Leaflet Moving Marker
npm install --save leaflet-moving-marker
Provide an array of
destinations and marker will walk through each destination until array of destinations is drained.
Leaflet.movingMarkerlatLng: L.LatLng, options: MovingMarkerOptions;
Starts the marker movement.
Pause marker movement.
When marker starts moving.
When marker arrives to a new destination. Called with the destination object.
When all destinations are moved to and there is no more destination to go to.
When marker is paused this event is fired.
ar marker = L;marker;
Rotating the marker
Using provided events and Leaflet
DivIcon it's possible to rotate the marker on each destination..
First create a
DivIcon that has a
var RotatingIcon = LDivIcon;
Use your icon with Moving Marker:
var icon = ;var marker = L;
destination events to rotate your marker:
npm install and
npm start to watch for changes and see the results in browser.