ztcrdetail.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name=”SiteName” content=”重庆市南岸区人民政府”>
  7. <meta name="SiteDomain" content="http://www.cqna.gov.cn" />
  8. <meta name="SiteIDCode" content="5001080014">
  9. <meta name="ColumnName" content="载体服务">
  10. <meta name="ColumnDescription" content="载体服务" />
  11. <meta name="ColumnKeywords" content="载体服务" />
  12. <meta name="ColumnType" content="载体服务" />
  13. <title>载体服务-重庆市南岸区人民政府网</title>
  14. <link rel="stylesheet" href="css/mapcon.css">
  15. <link rel="stylesheet" href="swiper/swiper-bundle.css">
  16. <!-- 引入 Vue -->
  17. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/vue.min.js"></script>
  18. <!-- 引入样式 -->
  19. <link rel="stylesheet" href="https://www.cqna.gov.cn/syygapi/naxsb/css/index.css">
  20. <!-- 引入组件库 -->
  21. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/index.js"></script>
  22. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/jquery-3.5.1.min.js"></script>
  23. <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=7XivTux4H2e1ifKLjvEhxfuayDYxAluq">
  24. </script>
  25. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/jquery-3.5.1.min.js"></script>
  26. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/urljson.js"></script>
  27. <style>
  28. .contentleft {
  29. width: 50%;
  30. min-width: 841px;
  31. background-color: #EDF5FF;
  32. font-size: 20px;
  33. color: #333;
  34. padding: 15px 30px;
  35. box-sizing: border-box;
  36. font-family: Microsoft YaHei;
  37. height: auto;
  38. }
  39. .itemname .topicon {
  40. width: 134px;
  41. height: 37px;
  42. line-height: 37px;
  43. background: #D8E9FE;
  44. border-radius: 10px;
  45. font-size: 20px;
  46. color: #4B98F6;
  47. text-align: center;
  48. margin-left: 10px;
  49. margin-top: 10px;
  50. }
  51. .swiperimg {
  52. display: flex;
  53. justify-content: space-between;
  54. position: relative;
  55. }
  56. .swiper {
  57. width: 20%;
  58. min-width: 170px;
  59. height: 320px;
  60. margin: auto 0;
  61. }
  62. .swiper-slide {
  63. width: 100%;
  64. text-align: center;
  65. font-size: 18px;
  66. background: #fff;
  67. display: flex;
  68. justify-content: center;
  69. align-items: center;
  70. }
  71. .swiper-slide img {
  72. width: 100%;
  73. height: 104px;
  74. cursor: pointer;
  75. }
  76. .swiper-button-next,
  77. .swiper-button-prev {
  78. /* 移除所有样式 */
  79. all: unset;
  80. position: absolute;
  81. z-index: 20;
  82. color: #666;
  83. transform: translateY(-50%) rotate(270deg);
  84. width: 27px;
  85. height: 187px;
  86. right: 82px;
  87. background: #FFFFFF;
  88. display: flex;
  89. align-items: center;
  90. background-size: 100% 100%;
  91. background-position: center;
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. opacity: 1;
  96. padding-top: 5px;
  97. box-sizing: border-box;
  98. }
  99. .swiper-button-next {
  100. top: 10px;
  101. }
  102. .swiper-button-next img {
  103. transform: translateY(-50%) rotate(270deg);
  104. }
  105. .swiper-button-prev {
  106. top: 382px;
  107. }
  108. .swiper-button-prev img {
  109. transform: translateY(-50%) rotate(270deg);
  110. }
  111. .swiper-button-prev:after,
  112. .swiper-rtl .swiper-button-next:after {
  113. content: '';
  114. }
  115. .swiper-button-next:after,
  116. .swiper-rtl .swiper-button-prev:after {
  117. content: '';
  118. }
  119. .swiper-button-prev.swiper-button-disabled,
  120. .swiper-button-next.swiper-button-disabled {
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. /* opacity: 1; */
  125. padding-top: 5px;
  126. box-sizing: border-box;
  127. }
  128. .contentleft {
  129. height: 1000px;
  130. }
  131. .contentright {
  132. width: 50vw;
  133. height: 1000px;
  134. }
  135. #ztcr>.top {
  136. display: flex;
  137. justify-content: space-between;
  138. align-items: center;
  139. border-bottom: 1px solid #B7C7DC;
  140. background: #FFFFFF;
  141. }
  142. .iconzb {
  143. width: 100px;
  144. height: 37px;
  145. line-height: 37px;
  146. background: #E3F5E7;
  147. border-radius: 4px;
  148. border: 1px solid #4BB664;
  149. font-size: 20px;
  150. color: #4BB664;
  151. text-align: center;
  152. margin-right: 9px;
  153. cursor: pointer;
  154. margin-bottom: 5px;
  155. }
  156. .iconzbxq {
  157. width: 145px;
  158. height: 37px;
  159. line-height: 37px;
  160. background: transparent;
  161. border-radius: 4px;
  162. border: 1px solid #618ecf;
  163. font-size: 17px;
  164. color: #618ecf;
  165. text-align: center;
  166. margin-right: 9px;
  167. cursor: pointer;
  168. padding: 0 10px;
  169. overflow: hidden;
  170. word-break: break-all;
  171. white-space: nowrap;
  172. text-overflow: ellipsis;
  173. margin-top: 10px;
  174. }
  175. .zbptdiv {
  176. flex-wrap: wrap;
  177. max-height: 162px;
  178. overflow-y: scroll;
  179. }
  180. .zbptdiv::-webkit-scrollbar {
  181. display: none;
  182. /* Chrome, Safari 和 Opera */
  183. -ms-overflow-style: none;
  184. /* IE 和 Edge */
  185. scrollbar-width: none;
  186. /* Firefox */
  187. }
  188. @media screen and (min-width:1860px) and (max-width:1920px) {
  189. .swiper-button-next,
  190. .swiper-button-prev {
  191. height: 177px;
  192. right: 74px;
  193. }
  194. }
  195. @media screen and (min-width:1600px) and (max-width:1900px) {
  196. .swiper-button-next,
  197. .swiper-button-prev {
  198. height: 170px;
  199. right: 71px;
  200. }
  201. }
  202. @media screen and (max-width:1600px) {
  203. .swiper-button-next,
  204. .swiper-button-prev {
  205. height: 170px;
  206. right: 71px;
  207. }
  208. }
  209. .contentleft>.list {
  210. justify-content: flex-start;
  211. }
  212. .contentleft>.list .listitm {
  213. margin-right: 20px;
  214. }
  215. </style>
  216. </head>
  217. <body>
  218. <div style="width:100%;" class="header"></div>
  219. <div id="ztcr">
  220. <div class="top">
  221. <div class="toplogo">
  222. <img src="images/gyylogo.png" alt="">
  223. <span>载体服务</span>
  224. </div>
  225. <div class="backbutton" @click="window.history.go(-1)">
  226. <img src="images/back1.png" alt="">
  227. <span>返回</span>
  228. </div>
  229. </div>
  230. <div style="display: flex;">
  231. <div class="contentleft">
  232. <div class="itemname">
  233. <div>{{ztcrDetail.carrierName}}</div>
  234. <div style="display: flex;">
  235. <div class="topicon" v-for="(item,index) in (ztcrDetail.tag?ztcrDetail.tag.split(','):[])">
  236. {{item}}</div>
  237. </div>
  238. </div>
  239. <div class="swiperimg">
  240. <img :src="imgUrl" alt="" style="width: 75%;height: 394px;">
  241. <div class="swiper-button-prev"><img src="images/toparrow.png" alt=""></div>
  242. <div class="swiper mySwiper">
  243. <div class="swiper-wrapper">
  244. <div class="swiper-slide list" v-for="(item,index) in swiperList" @click="imgDetail(item)">
  245. <img :src="item" alt="">
  246. </div>
  247. </div>
  248. </div>
  249. <div class="swiper-button-next"><img src="images/bottomarrow.png" alt=""></div>
  250. </div>
  251. <div class="list">
  252. <div class="listitm" style="background-color: #4EB2AD;">
  253. <span>招商面积</span>
  254. <span>{{ztcrDetail.space?ztcrDetail.space:'-'}}㎡</span>
  255. </div>
  256. <!-- <div class="listitm" style="background-color: #4BB664;">
  257. <span>出售价格</span>
  258. <span>{{ztcrDetail.sellingPrice?ztcrDetail.sellingPrice:'-'}}</span>
  259. </div> -->
  260. <div class="listitm"
  261. style="background-color: #DFC483;width: auto;min-width: 23.5%;padding: 0 10px;">
  262. <span>载体类型</span>
  263. <span>{{ztcrDetail.application?ztcrDetail.application:'-'}}</span>
  264. </div>
  265. </div>
  266. <div class="text">
  267. <div style="" v-if="ztcrDetail.productModule">
  268. <span>主导产业:</span>
  269. <div class="icon"
  270. v-for="(item,index) in (ztcrDetail.productModule?ztcrDetail.productModule.split('、'):[])">
  271. {{item}}</div>
  272. </div>
  273. <div style="" v-if="ztcrDetail.typeName&&ztcrDetail.typeName.length">
  274. <span style="white-space: nowrap;">周边配套:</span>
  275. <div style="display: flex;flex-wrap: wrap;margin-top: 5px;">
  276. <div class="iconzb" v-for="(item,index) in ztcrDetail.typeName" @click="showZblist(item)">
  277. {{item}}</div>
  278. </div>
  279. </div>
  280. <div class="zbptdiv">
  281. <div class="iconzbxq" v-for="(item,index) in zbptlist"
  282. @click="showPoint(item.complementPoint.split(',')[0],item.complementPoint.split(',')[1],item.complementName)"
  283. v-if="item.complementPoint" :title="item.complementName">
  284. {{item.complementName}}</div>
  285. </div>
  286. <div v-if="ztcrDetail.addr"><span>详细地址:</span><span>{{ztcrDetail.addr?ztcrDetail.addr:'-'}}</span>
  287. </div>
  288. <div v-if="ztcrDetail.contactName">
  289. <span>联系方式:</span>
  290. <span v-show="ztcrDetail.contactNameList">
  291. <span
  292. v-for="(item,index) in ztcrDetail.contactNameList">{{item}}&nbsp;&nbsp;{{ztcrDetail.contactPhoneList[index]}}&nbsp;&nbsp;</span>
  293. </span>
  294. <span v-show="!ztcrDetail.contactNameList">
  295. <span>{{ztcrDetail.contactName?ztcrDetail.contactName:'-'}}&nbsp;&nbsp;{{ztcrDetail.contactPhone}}</span></span>
  296. </div>
  297. </div>
  298. </div>
  299. <div class="contentright" id="mapcontainer"></div>
  300. </div>
  301. </div>
  302. <div style="width:100%;" class="footer"></div>
  303. </body>
  304. <script>
  305. $(function () {
  306. /*公共部分
  307. * 导航栏
  308. * footer CopyRight
  309. */
  310. $(".header").load('https://www.cqna.gov.cn/syygapi/naxsb/top/top_style.html');
  311. $(".footer").load('https://www.cqna.gov.cn/syygapi/naxsb/footer/footer.html');
  312. });
  313. </script>
  314. <script src="https://www.cqna.gov.cn/syygapi/naxsb/swiper/swiper-bundle.js"></script>
  315. <script>
  316. </script>
  317. <script>
  318. new Vue({
  319. el: '#ztcr',
  320. data: function () {
  321. return {
  322. reqPtah: '',
  323. ztcrDetail: {},
  324. imgUrl: '',
  325. swiperList: [],
  326. backgroundImage: '',
  327. znptList: '学校,轻轨,公交车站',
  328. zbptlist: [
  329. ],
  330. map: {},
  331. complementDetailId: [],
  332. allZbList: []
  333. }
  334. },
  335. mounted() {
  336. const url = new URL(window.location.href);
  337. const id = url.searchParams.get('ztid');
  338. this.getBuildDetail(id);
  339. this.$nextTick(() => {
  340. var swiper = new Swiper(".mySwiper", {
  341. observer: true,
  342. observeParents: true,
  343. direction: "vertical",
  344. slidesPerView: 3,
  345. navigation: {
  346. nextEl: '.swiper-button-next',
  347. prevEl: '.swiper-button-prev',
  348. },
  349. spaceBetween: 10
  350. });
  351. })
  352. },
  353. methods: {
  354. backIndex() {
  355. window.history.go(-1)
  356. },
  357. imgDetail(imgurl) {
  358. if (imgurl == "https://www.cqna.gov.cn/syygapi/naxsb/images/tdcr0.png") {
  359. return
  360. }
  361. this.imgUrl = imgurl;
  362. },
  363. showallZblist() {
  364. var that = this;
  365. if (!that.allZbList.length) return
  366. that.allZbList.forEach(function (item) {
  367. if (item.complementPoint) {
  368. let arr = item.complementPoint.split(',');
  369. let p = new BMap.Point(arr[0], arr[1]);
  370. var myIcon = new BMap.Icon("images/addrzb.png", new BMap.Size(23, 25), {
  371. offset: new BMap.Size(10, 25), // 指定定位位置
  372. });
  373. let marker = new BMap.Marker(p, { icon: myIcon });
  374. marker.id = "zbId";
  375. that.map.addOverlay(marker);
  376. var opts = {
  377. position: new BMap.Point(arr[0], arr[1]), // 指定文本标签所在的地理位置
  378. offset: new BMap.Size(10, 10) // 设置文本偏移量
  379. };
  380. // 创建文本标签对象,并添加到地图
  381. var label = new BMap.Label(item.complementName, opts);
  382. // 自定义文本标签样式
  383. label.setStyle({
  384. color: "#186FF0",
  385. fontSize: "16px",
  386. height: "auto",
  387. lineHeight: "20px",
  388. fontFamily: "微软雅黑",
  389. fontWeight: 'bold',
  390. backgroundColor: 'transparent',
  391. border: 'none',
  392. // textShadow: '0 0 4px #4B97F5',
  393. // textStrokeColor: "#4B97F5", // 文本描边颜色
  394. // textStrokeWidth: "4px", // 文本描边宽度
  395. });
  396. marker.setLabel(label);
  397. label.setStyle({ display: "none" });
  398. marker.addEventListener("mouseover", function (e) {
  399. var label = this.getLabel()
  400. label.setStyle({ display: "block" });
  401. });
  402. marker.addEventListener("mouseout", function (e) {
  403. var label = this.getLabel()
  404. label.setStyle({ display: "none" });
  405. });
  406. }
  407. });
  408. },
  409. showZblist(name) {
  410. var complementDetailId = this.complementDetailId;
  411. var that = this;
  412. var formData = {
  413. "complementDetailId": complementDetailId,
  414. "typeName": name
  415. }
  416. var allOverlay = this.map.getOverlays();
  417. for (var i = 0; i < allOverlay.length; i++) {
  418. if (allOverlay[i].id == "zbId") {
  419. this.map.removeOverlay(allOverlay[i]);
  420. }
  421. }
  422. $.ajax({
  423. url: conpath + "/complement/findByBuild",
  424. type: 'POST',
  425. contentType: 'application/json; charset=utf-8',
  426. data: JSON.stringify(formData), // 传递表单数据
  427. dataType: 'json',
  428. success: function (data) {
  429. let mdata = data.data;
  430. that.zbptlist = mdata;
  431. that.zbptlist.forEach(function (item) {
  432. let arr = item.complementPoint.split(',');
  433. let p = new BMap.Point(arr[0], arr[1]);
  434. var myIcon = new BMap.Icon("images/addrzb.png", new BMap.Size(23, 25), {
  435. offset: new BMap.Size(10, 25), // 指定定位位置
  436. });
  437. let marker = new BMap.Marker(p, { icon: myIcon });
  438. marker.id = "zbId";
  439. that.map.addOverlay(marker);
  440. var opts = {
  441. position: new BMap.Point(arr[0], arr[1]), // 指定文本标签所在的地理位置
  442. offset: new BMap.Size(10, 10) // 设置文本偏移量
  443. };
  444. // 创建文本标签对象,并添加到地图
  445. var label = new BMap.Label(item.complementName, opts);
  446. // 自定义文本标签样式
  447. label.setStyle({
  448. color: "#186FF0",
  449. fontSize: "16px",
  450. height: "auto",
  451. lineHeight: "20px",
  452. fontFamily: "微软雅黑",
  453. fontWeight: 'bold',
  454. backgroundColor: 'transparent',
  455. border: 'none',
  456. // textShadow: '0 0 4px #4B97F5',
  457. // textStrokeColor: "#4B97F5", // 文本描边颜色
  458. // textStrokeWidth: "4px", // 文本描边宽度
  459. });
  460. marker.setLabel(label);
  461. label.setStyle({ display: "none" });
  462. marker.addEventListener("mouseover", function (e) {
  463. var label = this.getLabel()
  464. label.setStyle({ display: "block" });
  465. });
  466. marker.addEventListener("mouseout", function (e) {
  467. var label = this.getLabel()
  468. label.setStyle({ display: "none" });
  469. });
  470. });
  471. }
  472. });
  473. },
  474. showPoint(point1, point2, name) {
  475. var allOverlay = this.map.getOverlays();
  476. for (var i = 0; i < allOverlay.length; i++) {
  477. if (allOverlay[i].id == "zbId") {
  478. this.map.removeOverlay(allOverlay[i]);
  479. }
  480. }
  481. let p = new BMap.Point(point1, point2);
  482. var myIcon = new BMap.Icon("images/addrchose.png", new BMap.Size(23, 25), {
  483. offset: new BMap.Size(10, 25), // 指定定位位置
  484. });
  485. let marker = new BMap.Marker(p, { icon: myIcon });
  486. marker.id = "zbId";
  487. this.map.addOverlay(marker);
  488. var opts = {
  489. position: new BMap.Point(point1, point2), // 指定文本标签所在的地理位置
  490. offset: new BMap.Size(10, 10) // 设置文本偏移量
  491. };
  492. // 创建文本标签对象,并添加到地图
  493. var label = new BMap.Label(name, opts);
  494. // 自定义文本标签样式
  495. label.setStyle({
  496. color: "#186FF0",
  497. fontSize: "18px",
  498. height: "auto",
  499. lineHeight: "20px",
  500. fontFamily: "微软雅黑",
  501. fontWeight: 'bold',
  502. backgroundColor: 'transparent',
  503. border: 'none',
  504. textShadow: '0 0 4px #4B97F5',
  505. textStrokeColor: "#4B97F5", // 文本描边颜色
  506. textStrokeWidth: "4px", // 文本描边宽度
  507. });
  508. marker.setLabel(label);
  509. },
  510. getBuildDetail(id) {
  511. let that = this;
  512. $.ajax({
  513. url: conpath + "/sellBuild/" + id,
  514. type: "get",
  515. dataType: "json",
  516. success: function (data) {
  517. let mdata = data.data.sellBuild;
  518. mdata.typeName = data.data.typeName ? data.data.typeName : []
  519. that.complementDetailId = data.data.complement;
  520. that.ztcrDetail = mdata;
  521. that.allZbList = data.data.complementDetails;
  522. if (that.ztcrDetail.contactName && that.ztcrDetail.contactName.split(',').length > 1) {
  523. that.ztcrDetail.contactNameList = that.ztcrDetail.contactName.split(',')
  524. that.ztcrDetail.contactPhoneList = that.ztcrDetail.contactPhone.split(',')
  525. }
  526. var yqid = mdata.parkData.id;
  527. if (yqid == 4) {
  528. that.backgroundImage =
  529. 'https://www.cqna.gov.cn/syygapi/naxsb/image/npxq.webp';
  530. } else if (yqid == 6) {
  531. that.backgroundImage =
  532. 'https://www.cqna.gov.cn/syygapi/naxsb/image/dxkjy.webp';
  533. } else if (yqid == 5) {
  534. that.backgroundImage =
  535. 'https://www.cqna.gov.cn/syygapi/naxsb/image/ylcxg.png';
  536. } else if (yqid == 3) {
  537. that.backgroundImage =
  538. 'https://www.cqna.gov.cn/syygapi/naxsb/image/cjls.webp';
  539. } else if (yqid == 2) {
  540. that.backgroundImage =
  541. 'https://www.cqna.gov.cn/syygapi/naxsb/image/xjcy.webp';
  542. } else if (yqid == 1) {
  543. that.backgroundImage =
  544. 'https://www.cqna.gov.cn/syygapi/naxsb/image/cygyy.webp';
  545. } else {
  546. that.backgroundImage =
  547. 'https://www.cqna.gov.cn/syygapi/naxsb/image/cygyy.webp';
  548. }
  549. that.swiperList = mdata.imgUrl ? mdata.imgUrl.split(",") : [];
  550. if (!that.swiperList.length) {
  551. that.swiperList.push(that.backgroundImage)
  552. }
  553. that.imgUrl = that.swiperList[0];
  554. let points = mdata.parkData.addr;
  555. that.loadMap(points, mdata.point, mdata.namePoint, mdata.centerPoint);
  556. that.showallZblist();
  557. }
  558. });
  559. },
  560. loadMap(points, currPoints, namePoint, centerPoint) {
  561. let map = new BMap.Map("mapcontainer");
  562. this.map = map;
  563. map.enableScrollWheelZoom(); // 启用滚轮缩放
  564. map.enableDragging(); // 启用拖拽功能
  565. //设定中心点和地图级别
  566. if (!currPoints) {
  567. map.centerAndZoom(new BMap.Point(106.6438551, 29.480752), 17);
  568. } else {
  569. let pList = currPoints.split('@');
  570. pList.forEach(function (point) {
  571. let arr = point.split(',');
  572. map.centerAndZoom(new BMap.Point(arr[0], arr[1]), 17);
  573. });
  574. }
  575. var that = this;
  576. fetch('https://www.cqna.gov.cn/syygapi/naxsb/js/najson.json')
  577. .then(response => response.json())
  578. .then(data => {
  579. var pointList = data.features[0].geometry.coordinates[0][0];
  580. let result = [];
  581. pointList.forEach(function (point) {
  582. result.push(new BMap.Point(point[0], point[1]));
  583. });
  584. // 创建多边形
  585. let polygon = new BMap.Polygon(result, {
  586. strokeColor: "#226cfb",
  587. strokeWeight: 1.5,
  588. strokeOpacity: 1,
  589. strokeStyle: "solid",
  590. fillColor: "#4B98F6",
  591. fillOpacity: 0.2
  592. });
  593. // 将多边形添加到地图中
  594. that.map.addOverlay(polygon);
  595. })
  596. .catch(error => console.error('Error fetching JSON:', error));
  597. map.setMapType(BMAP_NORMAL_MAP);
  598. // var startPoint = new BMap.Point(106.656815, 29.512621);
  599. // var endPoint = new BMap.Point(106.659483, 29.48807);
  600. // var driving = new BMap.DrivingRoute(map, {
  601. // renderOptions: { map: map, autoViewport: true }
  602. // });
  603. // driving.search(startPoint, endPoint);
  604. // var transit = new BMap.TransitRoute(map, {
  605. // renderOptions: { map: map, autoViewport: true }
  606. // });
  607. // transit.search(startPoint, endPoint);
  608. // driving.addEventListener('onPolylinesSet', function (e) {
  609. // var polyline = e.getPolyline();
  610. // polyline.setStrokeColor("#38CA69"); // 设置路线颜色
  611. // polyline.setStrokeWeight(5); // 设置路线宽度
  612. // polyline.setStrokeOpacity(1); // 设置路线透明度
  613. // });
  614. // 添加选择地址
  615. if (!currPoints) return;
  616. let pList = currPoints.split('@');
  617. pList.forEach(function (point) {
  618. let arr = point.split(',');
  619. let p = new BMap.Point(arr[0], arr[1]);
  620. var myIcon = new BMap.Icon("images/addrzt.png", new BMap.Size(40, 40), {
  621. offset: new BMap.Size(10, 25), // 指定定位位置
  622. });
  623. let marker = new BMap.Marker(p, { icon: myIcon });
  624. map.addOverlay(marker);
  625. var opts = {
  626. position: new BMap.Point(arr[0], arr[1]), // 指定文本标签所在的地理位置
  627. offset: new BMap.Size(10, 10) // 设置文本偏移量
  628. };
  629. // 创建文本标签对象,并添加到地图
  630. var label = new BMap.Label(that.ztcrDetail.carrierName, opts);
  631. // 自定义文本标签样式
  632. label.setStyle({
  633. color: "#186FF0",
  634. fontSize: "18px",
  635. height: "auto",
  636. lineHeight: "20px",
  637. fontFamily: "微软雅黑",
  638. fontWeight: 'bold',
  639. backgroundColor: 'transparent',
  640. border: 'none',
  641. textShadow: '0 0 4px #4B97F5',
  642. textStrokeColor: "#4B97F5", // 文本描边颜色
  643. textStrokeWidth: "4px", // 文本描边宽度
  644. });
  645. map.addOverlay(label);
  646. });
  647. },
  648. }
  649. })
  650. </script>
  651. </html>