Open CodeDome opened 7 years ago
use Leaflet-SVGIcon
Markers With Custom Icons - Leaflet - a JavaScript library for interactive maps
demo
var greenIcon = L.icon({
iconUrl: "leaf-green.png",
shadowUrl: "leaf-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 location
shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
});
var myMovingMarker = L.Marker.movingMarker(
[[48.8567, 2.3508], [50.45, 30.523333]],
[20000],
{ icon: icon }
).addTo(map);
myMovingMarker.start();
How do I replace the marker points with other images