Leaflet 中 删除 一组 标记(Marker)

Posted yingyigongzi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Leaflet 中 删除 一组 标记(Marker)相关的知识,希望对你有一定的参考价值。

 动态显示一个标签:

L.marker([obj.Y,obj.X]).addTo(map).bindPopup(obj.name).openPopup();

 

 

let layers=[];
let myGroup=L.layerGroup(layers);
let that = this;
this.bus.$on("selectedTree",function(obj){
        //清除点位(清除一组点位)
        layers.splice(0,layers.length);
        myGroup.clearLayers();
//具体操作
//...
});

 

以上是关于Leaflet 中 删除 一组 标记(Marker)的主要内容,如果未能解决你的问题,请参考以下文章