//移除除底图外的所有图层for(var i in map._layers){if(map._layers[i]._path != undefined){try{
map.removeLayer(map._layers[i]);}catch(e){
console.log("problem with "+ e + map._layers[i]);}}}
点
var blueIcon =L.icon({
iconUrl:"图标地址",
iconSize:[30,30],
iconAnchor:[20,10]});this.htmlmaker =[];this.axios.get("./static/json/point.json").then(
response =>{var latlng = response.data.features;for(let i =0; i < latlng.length; i++){var newArr =this.pointType;if(newArr.indexOf(latlng[i].properties.FolderPath)!=-1){var lat = latlng[i].geometry.coordinates[1];var lng = latlng[i].geometry.coordinates[0];var tempmarker=[lat,lng];var marker =L.marker([lat, lng],{
icon: blueIcon,
minzoom:8,
maxZoom:10,
riseOnHover:true});var html ="";
html +='<div class="l-popup">';
html +="</div>";
marker.bindPopup(html);this.htmlmaker.push(marker);
marker.on("click",()=>{this.tempPoint = latlng[i];});//添加this.markerGroup =L.layerGroup(this.htmlmaker);this.markerGroup.addTo(map);// 飞到这个点的位置
map.flyTo(tempmarker,12,{duration:1});}}//删除点this.markerGroup.clearLayers();