1
我试图用自定义标记覆盖现有的默认标记图标。 我已用可变定义的参数:Angular Leaflet自定义标记图标
var ratIcon = L.icon({
iconUrl: 'http://andywoodruff.com/maptime-leaflet/rat.png',
iconSize: [60,50]
});
和图标通过pointToLayer选项,它指定一个功能应用到:
pointToLayer: function(feature,latlng){
return L.marker(latlng,{icon: leafIcon});
}
但仍有默认标记图标 - >Plunker 我做错了什么?
In the last example是我想要展示的。
请参考这里的类似的答案: https://stackoverflow.com/a/26831200/4292656 –
谢谢@KyrosKoh,这是类似的答案,但不幸的是它仍然不起作用:([plunker](http://plnkr.co/edit/fKb0YuQZeqen3peDBbaI?p=preview) – corry
您正在定义' ratIcon',但使用'leafIcon' – Marc