Hi,
i am facing the problem in updating the direction path which is plotted by the call of direction api using setOrigin and SetDestination in mapbox.js, now the problem is that how can i update the direction path when the origin's lat and lan getting changed at a interval of 15 sec.
The below is the javascript code to implement the direction api,so know when the orgin lat and lng changes ,how can i updated the direction path in the below code.
Hi, i am facing the problem in updating the direction path which is plotted by the call of direction api using setOrigin and SetDestination in mapbox.js, now the problem is that how can i update the direction path when the origin's lat and lan getting changed at a interval of 15 sec.
The below is the javascript code to implement the direction api,so know when the orgin lat and lng changes ,how can i updated the direction path in the below code.
L.mapbox.accessToken = 'pk.eyJ1IjoiY2hhbmRydWRlbGlmb3JjZSIsImEiOiJjamMyMXkxdHYwYTlkMzNtd3MydWcwYXhlIn0.QVVhxj5S-dnI89ZXjaUJtA';
var map = L.mapbox.map('map', 'mapbox.streets', { center: [12.971599,77.594566], zoom: 13 });
var originFit = L.latLng(13.023008,77.726822), destinationFit = L.latLng(12.989100,77.726822), bounds = L.latLngBounds(destinationFit,originFit); map.fitBounds(bounds);
The below is the html code,
<link rel='stylesheet' href='https://api.mapbox.com/mapbox.js/plugins/mapbox-directions.js/v0.4.0/mapbox.directions.css' type='text/css'/>
Kindly provide me the solution ASAP ,thank u in advance.