当前位置: 首页 > news >正文

横沥镇网站仿做佛山市

横沥镇网站仿做,佛山市,做网站好还是小程序好,软件和网站开发// loadBMap.js ak 百度key export default function loadBMap(ak) {return new Promise((resolve, reject) {//聚合API依赖基础库,因此先加载基础库再加载聚合APIasyncLoadBaiduJs(ak).then(() {// 调用加载第三方组件js公共方法加载其他资源库// 加载聚合API// Ma…// loadBMap.js ak 百度key export default function loadBMap(ak) {return new Promise((resolve, reject) {//聚合API依赖基础库,因此先加载基础库再加载聚合APIasyncLoadBaiduJs(ak).then(() {// 调用加载第三方组件js公共方法加载其他资源库// 加载聚合API// MarkerClusterer_min.js依赖TextIconOverlay.js。因此先加载TextIconOverlay.jsasyncLoadJs(http://api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay.js).then(() {asyncLoadJs(http://api.map.baidu.com/library/MarkerClusterer/1.2/src/MarkerClusterer_min.js).then(() {asyncLoadJs(http://api.map.baidu.com/library/InfoBox/1.2/src/InfoBox_min.js).then(() {resolve()return true}).catch(err {reject(err)})}).catch(err {reject(err)})}).catch(err {reject(err)})}).catch(err {reject(err)})}) } // 加载百度地图基础组件js export function asyncLoadBaiduJs(ak) {return new Promise((resolve, reject) {if (typeof BMap ! undefined) {resolve(BMap)return true}window.onBMapCallback function() {resolve(BMap)}let script document.createElement(script)script.type text/javascriptscript.src http://api.map.baidu.com/api?v3.0ak ak s1callbackonBMapCallbackscript.onerror rejectdocument.head.appendChild(script)}) } // 加载第三方组件js公共方法 export function asyncLoadJs(url) {return new Promise((resolve, reject) {let script document.createElement(script)script.type text/javascriptscript.src urldocument.head.appendChild(script)script.onload () {resolve()}script.onerror reject}) }// import loadBMap from /utils/loadBMap.js initMapc() {let that thisloadBMap(百度key).then(() {map new BMap.Map(mapContainer)const centerPoint new BMap.Point(that.longitude, that.latitude)map.centerAndZoom(centerPoint, that.zoom)// 添加缩放控件map.addControl(new BMap.NavigationControl());markerArr [];that.parkList.forEach(item {let point new BMap.Point(item.longitude, item.latitude);let marker new BMap.Marker(point);marker.id item.id;marker.title item.name;marker.address item.address// 添加标签const opts {position: point, // 指定文本标注所在的地理位置offset: new BMap.Size(8, -30) // 设置文本偏移量};// 创建文本标注对象let c div stylebackground: #fff;padding: 6px 8px;border-radius: 4px div styledisplay: flex;align-items: center; span stylecolor: #333;font-size:14px item.name /span /div div stylefont-size: 12px;color: rgb(153, 153, 153);margin-top:2px; item.address /div /divconst label new BMap.Label(c, opts);// 自定义文本标注样式label.setStyle({color: #000,fontSize: 12px,fontFamily: 微软雅黑,border: 0,padding: 0,// ointerEvents: none // 设置文本标签不接受鼠标事件});// 将标签添加到地图中// map.addOverlay(label);// 添加信息窗口marker.addEventListener(click, function() {// alert(Marker ID: ${marker.id}, Title: ${marker.title});that.navigateTo(/pages/shop/packageList?id marker.id name marker.title)});label.addEventListener(click, function(e) {// alert(您点击了文本标签);// console.log(e)// console.log(marker.id)that.navigateTo(/pages/shop/packageList?id marker.id name marker.title)});label.setZIndex(999); // 设置zIndex属性marker.setLabel(label);markerArr.push(marker);map.addOverlay(marker);})var markerClusterer new BMapLib.MarkerClusterer(map, {markers: markerArr})// 监听地图移动、放大缩小事件map.addEventListener(movestart, function(){markerClusterer.getMarkers().forEach(marker {// console.log(marker.id)let c div stylebackground: #fff;padding: 6px 8px;border-radius: 4px div styledisplay: flex;align-items: center; span stylecolor: #333;font-size:14px marker.title /span /div div stylefont-size: 12px;color: rgb(153, 153, 153);margin-top:2px; marker.address /div /divconst label new BMap.Label(c, {position: marker.getPosition(),offset: new BMap.Size(20, -10)});label.setStyle({color: #000,fontSize: 12px,fontFamily: 微软雅黑,border: 0,padding: 0,});marker.setLabel(label);map.addOverlay(marker);label.addEventListener(click, function(e) {// alert(您点击了文本标签);// console.log(e)// console.log(marker.id)that.navigateTo(/pages/shop/packageList?id marker.id name marker.title)});})});map.addEventListener(moveend, function(){markerClusterer.getMarkers().forEach(marker {// console.log(marker.id)let c div stylebackground: #fff;padding: 6px 8px;border-radius: 4px div styledisplay: flex;align-items: center; span stylecolor: #333;font-size:14px marker.title /span /div div stylefont-size: 12px;color: rgb(153, 153, 153);margin-top:2px; marker.address /div /div// // 添加文本标签到每个 marker 上// const label new BMap.Label(c, {// position: marker.getPosition(),// offset: new BMap.Size(20, -10)// });const label new BMap.Label(c, {position: marker.getPosition(),offset: new BMap.Size(20, -10)});label.setStyle({color: #000,fontSize: 12px,fontFamily: 微软雅黑,border: 0,padding: 0,});marker.setLabel(label);map.addOverlay(marker);label.addEventListener(click, function(e) {// alert(您点击了文本标签);// console.log(e)// console.log(marker.id)that.navigateTo(/pages/shop/packageList?id marker.id name marker.title)});})});map.addEventListener(zoomstart, function(){markerClusterer.getMarkers().forEach(marker {// console.log(marker.id)let c div stylebackground: #fff;padding: 6px 8px;border-radius: 4px div styledisplay: flex;align-items: center; span stylecolor: #333;font-size:14px marker.title /span /div div stylefont-size: 12px;color: rgb(153, 153, 153);margin-top:2px; marker.address /div /div// // 添加文本标签到每个 marker 上// const label new BMap.Label(c, {// position: marker.getPosition(),// offset: new BMap.Size(20, -10)// });const label new BMap.Label(c, {position: marker.getPosition(),offset: new BMap.Size(20, -10)});label.setStyle({color: #000,fontSize: 12px,fontFamily: 微软雅黑,border: 0,padding: 0,});marker.setLabel(label);map.addOverlay(marker);label.addEventListener(click, function(e) {// alert(您点击了文本标签);// console.log(e)// console.log(marker.id)that.navigateTo(/pages/shop/packageList?id marker.id name marker.title)});})});map.addEventListener(zoomend, function(){markerClusterer.getMarkers().forEach(marker {// console.log(marker.id)let c div stylebackground: #fff;padding: 6px 8px;border-radius: 4px div styledisplay: flex;align-items: center; span stylecolor: #333;font-size:14px marker.title /span /div div stylefont-size: 12px;color: rgb(153, 153, 153);margin-top:2px; marker.address /div /div// // 添加文本标签到每个 marker 上// const label new BMap.Label(c, {// position: marker.getPosition(),// offset: new BMap.Size(20, -10)// });const label new BMap.Label(c, {position: marker.getPosition(),offset: new BMap.Size(20, -10)});label.setStyle({color: #000,fontSize: 12px,fontFamily: 微软雅黑,border: 0,padding: 0,});marker.setLabel(label);map.addOverlay(marker);label.addEventListener(click, function(e) {// alert(您点击了文本标签);// console.log(e)// console.log(marker.id)that.navigateTo(/pages/shop/packageList?id marker.id name marker.title)});})});})},
http://www.hkea.cn/news/14525971/

相关文章:

  • 海口小学网站建设抖音代运营保证金
  • 香奈儿网站设计分析wordpress自定义简单注册
  • 云南省建设培训网站有哪些网站可以用
  • 做娱乐网站少10个页面东莞网站建设 胶粘包装材料
  • 域名解析 网站建设驻马店seo
  • 国外搜索网站建设眉山建设局网站
  • 长沙企业网站建设报价企业vi设计是啥
  • 做网站跟app张家港做网站的
  • 安徽专业做网站的大公司网站建设速成班培训
  • 网站开发前期准备工作重庆求建网站
  • 网站建设费能算作无形资产吗郑州app开发定制多少钱
  • 商水县住房城乡建设网站网站排名优化化
  • 南昌网站开发公司哪家公司好建筑设计方案大全
  • 东莞企业网站费用商城网站开发多少钱
  • 网站怎么免费做推广南宁企业网站seo
  • 漳州公司建设网站windows 2003做网站
  • wordpress discussion settings站长之家seo查找
  • 网站定制开发建设wordpress 函数教程视频
  • html中文网站模板谷歌seo关键词排名优化
  • 网站定制公司排行榜秦皇岛城乡建设局
  • 域名注册网站建设方案xampp 如何将建好的wordpress发送到网络空间中
  • 天河区网站公司智能化网站建设
  • 网站后台更新无法在网页显示产品设计工具
  • 华邦网站公司主页网址
  • 广州市建设网站廊坊市网站建设
  • 广元 网站建设wordpress编辑器经典
  • 网站建设和维护pdf新类型网站
  • 赤壁网站建设做班级网站的详细计划书
  • 佛山市南海区建设局网站美食门户网站源码
  • 网络设计课程培训seo搜索引擎优化推广专员