1.0.1 • Published 10 months ago
leafletdiviconplugin v1.0.1
重要:本插件必须在引入了leaflet插件之后再引入
使用
// 引入插件
import 'leafletdiviconplugin';
// 需要leaflet marker图标的地方,调用 L.customDivIcon,
// 传入 svg(后端返的svg字符串)、想要渲染的颜色
// 得到leaflet 图标实例
let myIcon = L.customDivIcon(svg, showColor);
// 将图标传递给 marker 方法
L.marker(经纬度, {
icon: myIcon,
...
})