|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wicketstuff.gmap.geocoder.Geocoder
public class Geocoder
Geocoder. See: https://developers.google.com/maps/documentation/geocoding/
| Field Summary | |
|---|---|
static String |
OUTPUT_JSON
|
static String |
OUTPUT_XML
|
| Constructor Summary | |
|---|---|
Geocoder()
Deprecated. since 22th June 2016 Google Maps requires an API-key, therefore you should use Geocoder(java.lang.String) instead of
this constructor |
|
Geocoder(com.fasterxml.jackson.databind.ObjectMapper mapper)
Deprecated. since 22th June 2016 Google Maps requires an API-key, therefore you should use Geocoder(com.fasterxml.jackson.databind.ObjectMapper, java.lang.String) instead of this constructor |
|
Geocoder(com.fasterxml.jackson.databind.ObjectMapper mapper,
String apiKey)
|
|
Geocoder(String apiKey)
|
|
| Method Summary | |
|---|---|
void |
centerAndFitZoomForAdress(GMap map,
String address)
Convenience method to center and fit the zoom for an address, on the given map. |
GLatLng |
decode(String response)
Decode an response of an geocoder request to POJOs. Following the successful mapping from JSON to POJO all hits are available in geocoderResult |
String |
encode(String address)
builds the google geo-coding url |
GLatLng |
geocode(String address)
Invoke a geocoder request to the GoogleMaps API. Only return the first element of geocoderResult to be backward compatible.After successful call of geocode(String) you can get all results from
geocoderResult |
GeocoderResult |
getGecoderResult()
Get the Result of the last geocoder Request |
protected InputStream |
invokeService(String address)
fetches the url content |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String OUTPUT_XML
public static final String OUTPUT_JSON
| Constructor Detail |
|---|
public Geocoder()
Geocoder(java.lang.String) instead of
this constructor
ObjectMapper.ObjectMapper ignore unknown properties when mapping from JSON
to POJO.Geocoder(ObjectMapper) to customize
public Geocoder(String apiKey)
public Geocoder(com.fasterxml.jackson.databind.ObjectMapper mapper)
Geocoder(com.fasterxml.jackson.databind.ObjectMapper, java.lang.String) instead of this constructor
ObjectMapper
Geocoder()
public Geocoder(com.fasterxml.jackson.databind.ObjectMapper mapper,
String apiKey)
| Method Detail |
|---|
public GLatLng decode(String response)
throws GeocoderException,
org.apache.wicket.ajax.json.JSONException
geocoderResult
response - - JSON response from Google Geocoder Service
geocoderResult
GeocoderException - - When GeocoderStatus unequal to GeocoderStatus.OK
org.apache.wicket.ajax.json.JSONException - - The JSONException is thrown by the JSON.org classes when things are amiss.public String encode(String address)
address -
public GLatLng geocode(String address)
throws IOException,
org.apache.wicket.ajax.json.JSONException
geocoderResult to be backward compatible.geocode(String) you can get all results from
geocoderResult
address - - Requested address
GLatLng - only first hit of the request
IOException
org.apache.wicket.ajax.json.JSONException
protected InputStream invokeService(String address)
throws IOException
address -
IOExceptionpublic GeocoderResult getGecoderResult()
public void centerAndFitZoomForAdress(GMap map,
String address)
throws Exception
Example:
GMap myMap = GMap("wicketId");
new Geocoder().centerAndFitZoomForAdress(myMap, "Frankfurt am Main");
Result:
map - - the map where the address should shownaddress - - address as string for the google geocoder
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||