Class GoogleMapTools

java.lang.Object
de.hybris.platform.storelocator.impl.GoogleMapTools

public class GoogleMapTools extends Object
Spring Bean performing the geo-location HTTP requests towards Google Maps Service.
  • Constructor Details

    • GoogleMapTools

      public GoogleMapTools()
  • Method Details

    • getGoogleQuery

      public String getGoogleQuery(AddressData addressData)
    • geocodeAddress

      public GPS geocodeAddress(Location address)
      geo-codes the given location.
      Parameters:
      address - the address to geocode
      Returns:
      the GPS of the given address
      Throws:
      GeoServiceWrapperException
    • getDistanceAndRoute

      public RouteData getDistanceAndRoute(Location start, Location destination)
      creates Distance and Route for the given start/destination locations
      Parameters:
      start - the start location
      destination - the destination location
      Returns:
      the calculated RouteData for the given locations
      Throws:
      GeoServiceWrapperException
    • getDistanceAndRoute

      public RouteData getDistanceAndRoute(GPS start, GPS destination)
      creates Distance and Route for the given start/destination GPS
      Parameters:
      start - the start GPS
      destination - the destination GPS
      Returns:
      the calculated RouteData for the given GPS'
      Throws:
      GeoServiceWrapperException
    • getRouteData

      protected RouteData getRouteData(String urlAddress)
    • geocodeAddress

      public GPS geocodeAddress(AddressData addressData)
      geo-codes the given address data
      Parameters:
      addressData - the address to geocode
      Returns:
      the calculated GPS
      Throws:
      GeoServiceWrapperException
    • appendBusinessParams

      protected String appendBusinessParams(String urlAddress)
      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

      protected URI singAndEncodeURL(String urlAddress)
      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

      protected org.springframework.web.client.ResponseExtractor<RouteData> getRouteDataParser()
    • setBaseUrl

      public void setBaseUrl(String baseUrl)
    • getBaseUrl

      protected String getBaseUrl()
    • setGoogleKey

      public void setGoogleKey(String googleKey)
    • getGoogleKey

      protected String getGoogleKey()
    • setDirectionsUrlBuilder

      public void setDirectionsUrlBuilder(GeolocationDirectionsUrlBuilder directionsUrlBuilder)
    • getDirectionsUrlBuilder

      protected GeolocationDirectionsUrlBuilder getDirectionsUrlBuilder()
    • setCliendId

      public void setCliendId(String cliendId)
    • getCliendId

      protected String getCliendId()
    • setCryptoKey

      public void setCryptoKey(String signature)
    • getCryptoKey

      protected String getCryptoKey()