Leaflet.MovingMarker icon indicating copy to clipboard operation
Leaflet.MovingMarker copied to clipboard

How do I replace the marker points with other images

Open CodeDome opened this issue 7 years ago • 2 comments

How do I replace the marker points with other images

CodeDome avatar Jun 06 '17 06:06 CodeDome

use Leaflet-SVGIcon

EmiyaGm avatar Sep 13 '17 07:09 EmiyaGm

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();

zjffun avatar Jul 05 '19 03:07 zjffun