Open abnagpal opened 5 years ago
You should be able to use the geocoder
and serviceUrl
options together. Please post the code that does not work if you think this is actually a bug in LRM.
I want to use Bing for routing(getting co-ordinates and itinerary).
let routingControl = new L.Routing.control({
waypoints: [
startMarker.getLatLng(),
destMarker.getLatLng()
],
show: false,
allowUTurns: false,
geocoder: new L.Control.Geocoder.bing(BING_MAP_KEY)
});
routingControl.addTo(map);
When I use the above code, it defaults to OSRM instead of calling BING APIs. Can you help out in where I am going wrong here?
Ok, there is no built-in support for Bing's route service in LRM, so that will not work.
You can achieve this by writing a custom IRouter
implementation that works with Bing, this had been done for numerous other routing providers before (see the GraphHopper, TomTom, Valhalla och ESRI plugins), but this is to my knowledge not something anyone has done for Bing already.
I am trying to get route between two waypoints using leaflet routing machine with Bing Geocoder.
I was able to hit my local OSRM server when using the serviceUrl option. While using the Bing Geocoder option, the routing is being defaulted to OSRM.
I am following the example mentioned here -
Can you help out in where I am going wrong here?
Also, I want to fetch the selected route and display the directions in a different view. Is it possible to fetch directions directly from the routing control object than going the listeners route?