mb_geocode | R Documentation |
See the Mapbox Geocoding API documentation for more information.
mb_geocode(
search_text,
endpoint = "mapbox.places",
limit = 1,
types = NULL,
search_within = NULL,
language = NULL,
output = "coordinates",
access_token = NULL
)
mb_reverse_geocode(
coordinates,
endpoint = "mapbox.places",
limit = 1,
language = NULL,
types = NULL,
output = "text",
access_token = NULL
)
search_text |
The text to search, formatted as a character string. Can be an address, a location, or a description of a point of interest. |
endpoint |
One of |
limit |
How many results to return; defaults to 1 (maximum 10). |
types |
A vector of feature types to limit to which the search should be
limited. Available options include |
search_within |
An |
language |
The user's language, which can help with interpretation of queries. Available languages are found at https://docs.mapbox.com/api/search/#language-coverage. |
output |
one of |
access_token |
The Mapbox access token (required); can be set with
|
coordinates |
The coordinates of a location in format |
A character vector, list, or sf
object representing the query
results.
## Not run:
whitehouse <- mb_geocode("1600 Pennsylvania Ave, Washington DC")
## End(Not run)
## Not run:
mb_reverse_geocode(c(77.5958768, 12.9667046), limit = 5, types = "poi")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.