perliedman/leaflet-routing-machine

How to integrate leaflet routing machine with mapbox / google map

aliceevra opened this issue · 1 comments

I'm using leaflet routing machine with geocoder photon , I want to change search with geocoder google map or mapbox . How I can do this, any idea please . Thank you in advance

This is my example : https://jsfiddle.net/Aminali/kLs34ef8/7/

LRM itself relies on the awesome Leaflet Control Geocoder plugin to offer geocoding. This plugin has a wide variety of available geocoders that you could use. If you want to use mapbox instead of Photon, all you have to do is change

L.Control.Geocoder.photon()

to

L.Control.Geocoder.mapbox({
	apiKey: 'your api key here'
})