public class Geocoder
extends java.lang.Object
The Geocoder service encapsulates reverse geocoding queries to cercalia API. The Geocoder works with an APIKEY. Use the following call to configure it:
Cercalia.getInstance().setCercaliaApiKey(API_KEY)
Resolution of the queries is done asyncronously, so a callback must be defined as in this example overriding the method:
Geocoder.getInstance().getFromLocation(point, new Geocoder.ReverseGeocodingCallback() {
@Override
public void suggestresponse(NonNull List <Address > result, @Nullable String nativeResponse, boolean error) {
...
}
});
Copyright (c) 2017 Nexusgeographics All rights reserved.
Cercalia| Modifier and Type | Class and Description |
|---|---|
static interface |
Geocoder.ReverseGeocodingCallback
The interface Reverse geocoding callback.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel the current query
|
void |
getFromLocation(LatLng latLng,
Geocoder.ReverseGeocodingCallback callback)
Main method to resolve reverse geocoding with Cercalia.
|
static Geocoder |
getInstance()
Gets instance.
|
public static Geocoder getInstance()
@NonNull
public void getFromLocation(@NonNull
LatLng latLng,
@NonNull
Geocoder.ReverseGeocodingCallback callback)
latLng - coordinates of the locationcallback - the callback to treat the responsepublic void cancel()