java.lang.Object | ||
↳ | com.carto.geocoding.GeocodingService | |
↳ | com.carto.geocoding.MapBoxOnlineGeocodingService |
An online geocoding service that uses MapBox geocoder.
As the class connects to an external (non-CARTO) service, this class is provided "as-is",
future changes from the service provider may not be compatible with the implementation.
Geocoding and reverse geocoding perform network requests and must be executed in non-UI background thread.
Be sure to read the Terms and Conditions of the MapBox service to see if the
service is available for your application.
Note: this class is experimental and may change or even be removed in future SDK versions.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MapBoxOnlineGeocodingService(String accessToken)
Constructs a new instance of the MapBoxOnlineGeocodingService given API key.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeocodingResultVector |
calculateAddresses(GeocodingRequest request)
Calculates matching addresses from the specified geocoding request.
| ||||||||||
synchronized void | delete() | ||||||||||
String |
getCustomServiceURL()
Returns the custom backend service URL.
| ||||||||||
String |
getLanguage()
Returns the language of the expected results.
| ||||||||||
int |
getMaxResults()
Returns the maximum number of results the geocoding service returns.
| ||||||||||
boolean |
isAutocomplete()
Returns the autocomplete flag of the service.
| ||||||||||
void |
setAutocomplete(boolean autocomplete)
Sets the autocomplete flag of the service.
| ||||||||||
void |
setCustomServiceURL(String serviceURL)
Sets the custom backend service URL.
| ||||||||||
void |
setLanguage(String lang)
Sets the language of the expected results.
| ||||||||||
void |
setMaxResults(int maxResults)
Sets the maximum number of results the geocoding service returns.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a new instance of the MapBoxOnlineGeocodingService given API key.
accessToken | The access token to use (registered with MapBox). |
---|
Calculates matching addresses from the specified geocoding request.
request | The geocoding request to use. |
---|
IOException |
---|
Returns the custom backend service URL.
Returns the language of the expected results.
Returns the maximum number of results the geocoding service returns.
Returns the autocomplete flag of the service.
Sets the autocomplete flag of the service.
By default this flag is off.
autocomplete | The new value for autocomplete flag. |
---|
Sets the custom backend service URL.
The custom URL should contain tags "{query}" and "{access_token}" that will be substituted by the SDK.
serviceURL | The custom backend service URL to use. If this is empty, then the default service is used. |
---|
Sets the language of the expected results.
lang | The language to use as ISO 639-1 code. Empty string can be used for default language. |
---|
Sets the maximum number of results the geocoding service returns.
The default number of results is service dependant (normally 10).
maxResults | The new maximum number of results the geocoding service returns. |
---|