@@ -119,16 +120,33 @@ Queries the geocoder with a location, and returns its result, if any.
...
@@ -119,16 +120,33 @@ Queries the geocoder with a location, and returns its result, if any.
| Options | Value | Description |
| Options | Value | Description |
| ---- | ---- | ---- |
| ---- | ---- | ---- |
| location (_required_) | object | A query, expressed as an object:<ul><li>`[lon, lat] // an array of lon, lat`</li><li>`{ lat: 0, lon: 0 } // a lon, lat object`</li><li>`{ lat: 0, lng: 0 } // a lng, lat object`</li></ul> The first argument can also be an array of objects in that form to geocode more than one item. |
| location (_required_) | object | A query, expressed as an object:<ul><li>`[lon, lat] // an array of lon, lat`</li><li>`{ lat: 0, lon: 0 } // a lon, lat object`</li><li>`{ lat: 0, lng: 0 } // a lng, lat object`</li></ul> The first argument can also be an array of objects in that form to geocode more than one item. |
| callback (_required_) | function | The callback is called with arguments <ul><li>An error, if any</li><li>The result. This is an object of the raw result from Mapbox.</li></ul>
| callback (_required_) | function | The callback is called with arguments - An error, if any - The result. This is an object of the raw result from Mapbox. |
_Returns_: the geocoder object. The return value of this function is not useful - you must use a callback to get results.
_Returns_: the geocoder object. The return value of this function is not useful - you must use a callback to get results.
Lists administrative boundaries in 3 different levels: Province, City, Locality (neighborhood).
| Options | Value | Description |
| ---- | ---- | ---- |
| type (_required_) | string | Type of an administrative boundary. Possible values: `province`, `city`, `locality`. |
| query (_optional_) | string | The query to limit the `type` above. For example: list all cities of "Tehran" province: `query('city', 'تهران', function(){})`. This option is not neccessary for type: `province`. |
| callback (_required_) | function | The callback is called with arguments - An error, if any - The result. |
_Returns_: the administrativeBoundaries object. The return value of this function is not useful - you must use a callback to get results.