Sign in
Log inSign up

How to add moving markers on the routing path in Leaflet.JS

Vignesh Mohanraj's photo
Vignesh Mohanraj
·Dec 3, 2016

I am working on Map based projects for data visulization !! I need to move markers on the map using the direction which is from L.Routing.control( );

Here is my Code: var start = [12.9716, 77.5946]; var end = [19.0760, 72.8777];

var routeControl= L.Routing.control({

waypoints: [

  L.latLng(start),
  L.latLng(end)
],

createMarker: function() { return null; },

show: false

}).addTo(map);

 var myMovingMarker = L.Marker.movingMarker([start,end],
 [290000]).addTo(map);

myMovingMarker.start();

**Moving Marker is not moving towards the Routing path**