Class GoogleMapTools
java.lang.Object
de.hybris.platform.storelocator.impl.GoogleMapTools
Spring Bean performing the geo-location HTTP requests towards Google Maps Service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringappendBusinessParams(String urlAddress) Appends business user parameters client and signature.geocodeAddress(AddressData addressData) geo-codes the given address datageocodeAddress(Location address) geo-codes the given location.protected org.springframework.web.client.ResponseExtractor<MapLocationData>protected Stringprotected Stringprotected Stringprotected GeolocationDirectionsUrlBuildergetDistanceAndRoute(GPS start, GPS destination) creates Distance and Route for the given start/destination GPSgetDistanceAndRoute(Location start, Location destination) creates Distance and Route for the given start/destination locationsprotected StringgetGoogleQuery(AddressData addressData) protected RouteDatagetRouteData(String urlAddress) protected org.springframework.web.client.ResponseExtractor<RouteData>protected booleanvoidsetAddressLocationParser(org.springframework.web.client.ResponseExtractor<MapLocationData> addressLocationParser) voidsetBaseUrl(String baseUrl) voidsetCliendId(String cliendId) voidsetCryptoKey(String signature) voidsetDirectionsUrlBuilder(GeolocationDirectionsUrlBuilder directionsUrlBuilder) voidsetGoogleKey(String googleKey) voidsetRouteDataParser(org.springframework.web.client.ResponseExtractor<RouteData> routeDataParser) protected URIsingAndEncodeURL(String urlAddress) Encodes URL query, generates signature and appends it to the query.
-
Constructor Details
-
GoogleMapTools
public GoogleMapTools()
-
-
Method Details
-
getGoogleQuery
-
geocodeAddress
geo-codes the given location.- Parameters:
address- the address to geocode- Returns:
- the GPS of the given address
- Throws:
GeoServiceWrapperException
-
getDistanceAndRoute
creates Distance and Route for the given start/destination locations- Parameters:
start- the start locationdestination- the destination location- Returns:
- the calculated RouteData for the given locations
- Throws:
GeoServiceWrapperException
-
getDistanceAndRoute
creates Distance and Route for the given start/destination GPS- Parameters:
start- the start GPSdestination- the destination GPS- Returns:
- the calculated RouteData for the given GPS'
- Throws:
GeoServiceWrapperException
-
getRouteData
-
geocodeAddress
geo-codes the given address data- Parameters:
addressData- the address to geocode- Returns:
- the calculated GPS
- Throws:
GeoServiceWrapperException
-
appendBusinessParams
Appends business user parameters client and signature. Example URL after appending http://maps.googleapis.com/maps/api/geocode/xml ?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA &client=gme-YOUR_CLIENT_ID &signature=YOUR_URL_SIGNATURE- Parameters:
urlAddress-- Returns:
- url with client id and signature
-
singAndEncodeURL
Encodes URL query, generates signature and appends it to the query. Return URI to avoid second encoding- Parameters:
urlAddress-- Returns:
- URI
-
isBusinessAPI
protected boolean isBusinessAPI() -
setAddressLocationParser
public void setAddressLocationParser(org.springframework.web.client.ResponseExtractor<MapLocationData> addressLocationParser) -
getAddressLocationParser
protected org.springframework.web.client.ResponseExtractor<MapLocationData> getAddressLocationParser() -
setRouteDataParser
public void setRouteDataParser(org.springframework.web.client.ResponseExtractor<RouteData> routeDataParser) -
getRouteDataParser
-
setBaseUrl
-
getBaseUrl
-
setGoogleKey
-
getGoogleKey
-
setDirectionsUrlBuilder
-
getDirectionsUrlBuilder
-
setCliendId
-
getCliendId
-
setCryptoKey
-
getCryptoKey
-