This class will help you add or use search bar for geocoding with a MapLibre GL JS map.
const jawgPlaces = new JawgPlaces.MapLibre({
accessToken: 'Access-Token',
})
map.addControl(jawgPlaces)
Optional
options: JawgPlacesMaplibreOptionsSearch a random text, lat/lon or GID using Jawg Places.
All features are points with properties, more details on our documentation.
See JawgPlacesOptions.reverse for lat/lon search and JawgPlacesOptions.place for GID search.
The text to search using Jawg Places
A promise with the feature collection received from Jawg Places
Open the result list with elements from the FeatureCollection. We use the properties.label
field of each features.
This will trigger JawgPlacesOptions.onFeatures callback.
Use it if you want to display specific results or add new elements.
Feature Collection of geocoded points.
This class will help you add or use search bar for geocoding with a MapLibre GL JS map.