wicket.contrib.gmap.util
Class Geocoder

java.lang.Object
  extended by wicket.contrib.gmap.util.Geocoder
All Implemented Interfaces:
Serializable

public class Geocoder
extends Object
implements Serializable

Geocoder. See: http://www.google.com/apis/maps/documentation/services.html#Geocoding_Direct

Author:
Thijs Vonk
See Also:
Serialized Form

Field Summary
static String OUTPUT_CSV
           
static String OUTPUT_JSON
           
static String OUTPUT_KML
           
static String OUTPUT_XML
           
 
Constructor Summary
Geocoder(String gMapKey)
           
 
Method Summary
 GLatLng decode(String response)
           
 String encode(String address)
          builds the google geo-coding url
 GLatLng geocode(String address)
           
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

OUTPUT_CSV

public static final String OUTPUT_CSV
See Also:
Constant Field Values

OUTPUT_XML

public static final String OUTPUT_XML
See Also:
Constant Field Values

OUTPUT_KML

public static final String OUTPUT_KML
See Also:
Constant Field Values

OUTPUT_JSON

public static final String OUTPUT_JSON
See Also:
Constant Field Values
Constructor Detail

Geocoder

public Geocoder(String gMapKey)
Parameters:
gMapKey - Gmap API key
Throws:
IllegalArgumentException - If the API key is null
Method Detail

decode

public GLatLng decode(String response)
               throws GeocoderException
Throws:
GeocoderException

encode

public String encode(String address)
builds the google geo-coding url

Parameters:
address -
Returns:

geocode

public GLatLng geocode(String address)
                throws IOException
Parameters:
address -
Returns:
Throws:
IOException

invokeService

protected InputStream invokeService(String address)
                             throws IOException
fetches the url content

Parameters:
address -
Returns:
Throws:
IOException


Copyright © 2012. All Rights Reserved.