// 使用polyline画出一个轨迹
let polyline = L.polyline(this.latlngs, {color: ‘green’}).addTo(this.map)
// 清除polyline线
clearPolylineGroup (polyline_group)
{
this.latlngs = [];
if(polyline_group){
this.map.removeLayer(polyline_group);
}
},
// 使用marker标注
this.robotMarker = L.marker(this.latlngs[this.latlngs.length-1],{icon:myIcon}).addTo(this.map);
// 清除marker
this.map.removeLayer(this.robotMarker)
leaflet移除画的线以及移除marker
最新推荐文章于 2023-08-02 15:42:28 发布