Learn R Programming

mapboxapi (version 0.6.3)

mapboxGeocoderInput: Use Mapbox's Geocoder widget in a Shiny application

Description

Use Mapbox's Geocoder widget in a Shiny application

Usage

mapboxGeocoderInput(
  inputId,
  access_token = NULL,
  placeholder = "Search",
  search_within = NULL,
  proximity = NULL,
  limit = 5,
  min_length = 2,
  language = NULL,
  types = NULL,
  country = NULL,
  worldview = NULL,
  width = "100%"
)

Value

A Mapbox geocoder widget as a Shiny input

Arguments

inputId

The Shiny input ID

access_token

The Mapbox access token (required); can be set with mb_access_token()

placeholder

The placeholder to be used in the search box; defaults to 'Search'

search_within

An sf object, or vector representing a bounding box of format c(min_longitude, min_latitude, max_longitude, max_latitude) used to limit search results. Defaults to NULL.

proximity

A length-2 vector of longitude and latitude coordinates used to prioritize results near to that location. Defaults to NULL.

limit

The maximum number of results to show. Defaults to 5.

min_length

The minimum number of characters the user must enter before results are shown. Defaults to 2.

language

The language to use for the geocoder. Per the Mapbox documentation, "Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script."

types

A vector of feature types to limit to which the search should be limited. Available options include 'country', 'region', 'postcode', 'district', 'place', 'locality', 'neighborhood', 'address', 'street', 'block', 'address'. and 'secondary_address'. If left blank, all types will be searched.

country

A character string or vector of ISO 3166 alpha-2 country codes within which you would like to limit your search.

worldview

Returns features intended for different regional or cultural groups. The US ('us') world view is returned by default.

width

The width of the input field. Can be specified as a number (pixels) or a valid CSS width value (e.g., "300px", "100%"). Defaults to 100%.