--- layout: api title: "v1.6.0 API: L.mapbox.geocoder(id|url)" categories: api version: v1.6.0 permalink: /api/v1.6.0/l-mapbox-geocoder --- {% raw %}
A low-level interface to geocoding, useful for more complex uses and reverse-geocoding.
Options | Value | Description |
---|---|---|
id or url | string | Value must be
|
Returns a L.mapbox.geocoder
object.
Queries the geocoder with a query string, and returns its result, if any.
Options | Value | Description |
---|---|---|
queryString (required) | string | a query, expressed as a string, like 'Arkansas' |
callback (required) | function | a callback |
The callback is called with arguments
The result. This is an object with the following members:
{
results: // raw results
latlng: // a map-friendly latlng array
bounds: // geojson-style bounds of the first result
lbounds: // leaflet-style bounds of the first result
}
Returns: the geocoder object. The return value of this function is not useful - you must use a callback to get results.
Queries the geocoder with a location, and returns its result, if any.
Options | Value | Description |
---|---|---|
location (required) | object | A query, expressed as an object:
|
callback (required) | function | The callback is called with arguments
|
Returns: the geocoder object. The return value of this function is not useful - you must use a callback to get results.
{% endraw %}