百度地图 路线设置marker,marker放上和离开添加事件显示,行走的路线
发布日期:2021-05-27 02:32:08 浏览次数:4 分类:技术文章

本文共 1059 字,大约阅读时间需要 3 分钟。

addMarker (state, point,DateTime) {      let img = this.driverRobImg[state];      if (!state || !img || state == 6){          let commonMarker = new BMap.Marker(point)          let label = new BMap.Label(DateTime,{offset:new BMap.Size(20,-10)});          // 放上去显示,移走不显示          commonMarker.addEventListener('mouseover',function () {              label.setStyle({                  display:"block",                  border:"none",              });              commonMarker.setLabel(label);          }) // 6483925          commonMarker.addEventListener('mouseout',function () {              label.setStyle({                  display:"none",              });              commonMarker.setLabel(label);          })          // 一直都显示          // label.setStyle({          //     border:"none",          //     height:"30px",          //     width:"130px",          //     textAlign:"center",          //     lineHeight:"30px"          // });          // commonMarker.setLabel(label);          return this.map.addOverlay(commonMarker);      }

 

公路线实现

行走的路线 

效果图:

代码:

 

 

转载地址:https://blog.csdn.net/jjw_zyfx/article/details/103052438 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:iview的modal中的form验证出错,页面不关闭的方法
下一篇:js中的++的理解和使用

发表评论

最新留言

感谢大佬
[***.8.128.20]2023年11月10日 04时58分43秒