Ionic 3 Leaflet change图标标记

时间:2018-06-19 19:48:58

标签: ionic-framework leaflet

我想更改ionic 3中的图标标记,

var dot= L.icon({
iconUrl: 'dot.png',
shadowUrl: 'dot-shadow.png',
iconSize: [38, 95], // size of the icon
shadowSize: [50, 64], // size of the shadow
iconAnchor: [22, 94], // point of the icon which will correspond to marker's 
shadowAnchor: [4, 62],  // the same for the shadow
popupAnchor: [-3, -76] // point from which the popup should open relative..
});
...
...
L.marker([this.lat, this.lng], { icon: dot}).addTo(this.map);

https://leafletjs.com/reference-1.3.0.html#icon

它不起作用!只是不显示ther标记,所以不显示任何错误。 dot.png必须在哪里?

0 个答案:

没有答案