添加自定义svg图标
addMarker (latlon,liquidIcon=false,flowIcon=false,qualityIcon=false,JgIcon=false) {
let iconType;
if(liquidIcon){
iconType = 'liquid'
}else if(flowIcon){
iconType = 'flow'
}else if(qualityIcon){
iconType = 'huanbao'
}else if(JgIcon){
iconType = 'Jg'
}else{
iconType = 'redMarker'
}
// console.log(iconType)
const divIcon = L.divIcon({
html:
`<div>
<svg class="icon-svg map-svg icon-svg_${iconType}"aria-hidden="true">
<use xlink:href="#icon-${iconType}"></use>
</svg>
</div>`,
iconSize: [30, 30],
iconAnchor: [15, 30]
})
this.marker = L.marker(latlon, { icon: divIcon }).addTo(this.map)
},