Skip to main content

Geocoding

Public beta for Mapbox Search JS

Mapbox Search JS is in public beta. During the public beta phase, frameworks may be subject to potential changes as they stabilize.

The Geocoding Web library offers a UI search component, which allows you to forward and reverse geocode search and control a map.

MapboxGeocoder

MapboxGeocoder, also available as the element <mapbox-geocoder>, is an element that lets you search for addresses and places using the Mapbox Geocoding API.

It can control a Mapbox GL JS map to zoom to the selected result.

Additionally, MapboxGeocoder implements the IControl interface.

To use this element, you must have a Mapbox access token.

new MapboxGeocoder()

Example

const search = new MapboxGeocoder();
search.accessToken = '<your access token here>';
map.addControl(search);
<mapbox-geocoder
access-token="<your access token here>"
proximity="0,0"
>
</mapbox-geocoder>

Instance Members

Map settings

Methods

Map binding

Events

Was this section on MapboxGeocoder helpful?
Was this page helpful?