public static class MapboxGeocoding.Builder<T extends MapboxGeocoding.Builder> extends MapboxBuilder
baseUrl, clientAppName
Constructor and Description |
---|
Builder()
Constructor
|
Modifier and Type | Method and Description |
---|---|
MapboxGeocoding |
build()
Build method
|
String |
getAccessToken() |
Boolean |
getAutocomplete() |
String |
getBbox() |
String |
getCountry() |
String |
getGeocodingTypes()
If you filtered your results by one or more types you can get what those filters are by
using this method.
|
String |
getLanguage() |
String |
getLimit() |
String |
getMode() |
String |
getProximity()
Location around which you biased the results.
|
String |
getQuery() |
T |
setAccessToken(String accessToken)
Required to call when building
MapboxGeocoding.Builder |
T |
setAutocomplete(boolean autocomplete)
Whether or not to return autocomplete results.
|
T |
setBaseUrl(String baseUrl)
Set the base url of the API.
|
T |
setBbox(double minX,
double minY,
double maxX,
double maxY)
Bounding box within which to limit results.
|
T |
setBbox(com.mapbox.services.commons.models.Position northeast,
com.mapbox.services.commons.models.Position southwest)
Bounding box within which to limit results.
|
T |
setClientAppName(String appName)
Set the App Name to identify
|
T |
setCoordinates(com.mapbox.services.commons.models.Position position) |
T |
setCountries(String[] countries)
Countries which you want the results to show up in.
|
T |
setCountry(String country)
Country which you want the results to show up in.
|
T |
setGeocodingType(String geocodingType)
Filter results by one or more type.
|
T |
setGeocodingTypes(String[] geocodingType)
Filter results by one or more type.
|
T |
setLanguage(String language)
The locale in which results should be returned.
|
T |
setLimit(int limit)
Limit the number of results returned.
|
T |
setLocation(String location)
The location equals the query.
|
T |
setMode(String mode)
mapbox.places or mapbox.places-permanent for enterprise/batch geocoding.
|
T |
setProximity(com.mapbox.services.commons.models.Position position)
Location around which to bias results.
|
getBaseUrl, getClientAppName, validateAccessToken
public T setAccessToken(String accessToken)
MapboxGeocoding.Builder
setAccessToken
in class MapboxBuilder
accessToken
- Mapbox access token, you must have a Mapbox account in order to use
this library.public T setLocation(String location)
location
- querypublic T setCoordinates(com.mapbox.services.commons.models.Position position)
position
- Position
public T setMode(String mode)
mode
- mapbox.places or mapbox.places-permanent for enterprise/batch geocoding.public T setCountry(String country)
country
- ISO 3166 alpha 2 country codepublic T setCountries(String[] countries)
countries
- ISO 3166 alpha 2 country codes, separated by commas.public T setProximity(com.mapbox.services.commons.models.Position position)
position
- A Position
.public T setGeocodingType(String geocodingType)
geocodingType
- String filtering the geocoder result types.public T setGeocodingTypes(String[] geocodingType)
geocodingType
- String array filtering the geocoder result types.public T setAutocomplete(boolean autocomplete)
autocomplete
- true, if you want autocomplete results, else false. (Defaults true)public T setBbox(com.mapbox.services.commons.models.Position northeast, com.mapbox.services.commons.models.Position southwest) throws ServicesException
northeast
- The northeast corner of the bounding box as Position
.southwest
- The southwest corner of the bounding box as Position
.ServicesException
- Generic Exception for all things geocoding.public T setBbox(double minX, double minY, double maxX, double maxY) throws ServicesException
minX
- The minX of bounding box when maps facing north.minY
- The minY of bounding box when maps facing north.maxX
- The maxX of bounding box when maps facing north.maxY
- The maxY of bounding box when maps facing north.ServicesException
- Generic Exception for all things geocoding.public T setLimit(int limit)
limit
- the integer value representing the amount of results desired.public String getAccessToken()
getAccessToken
in class MapboxBuilder
public String getQuery()
public String getMode()
public String getCountry()
public String getProximity()
public String getGeocodingTypes()
public Boolean getAutocomplete()
public String getBbox()
public String getLimit()
public String getLanguage()
public T setLanguage(String language)
This property affects the language of returned results; generally speaking, it does not determine which results are found. If the Geocoding API does not recognize the language code, it may fall back to another language or the default language. Components other than the language code, such as the country and script codes, are ignored.
By default, this property is set to `null`, causing results to be in the default language.
This option is experimental.
language
- The locale in which results should be returned.public T setClientAppName(String appName)
MapboxBuilder
setClientAppName
in class MapboxBuilder
appName
- base package name or other simple string identifierpublic T setBaseUrl(String baseUrl)
setBaseUrl
in class MapboxBuilder
baseUrl
- base url used as end pointpublic MapboxGeocoding build() throws ServicesException
build
in class MapboxBuilder
ServicesException
- Generic Exception for all things geocoding.© 2015–2016 Mapbox. All rights reserved.