Leaflet GeoSearch
Edit page
IntroductionUsageLeaflet Control
Providers

MapBox Provider

note: MapBox services require an API key. Obtain here. For more options and configurations, see the MapBox developer docs on the Search API.

import { MapBoxProvider } from 'leaflet-geosearch';
const provider = new MapBoxProvider({
params: {
access_token: '__YOUR_MAPBOX_KEY__',
},
});
// add to leaflet
import { GeoSearchControl } from 'leaflet-geosearch';
map.addControl(
new GeoSearchControl({
provider,
style: 'bar',
}),
);