cancel
Showing results for 
Search instead for 
Did you mean: 

GoogleApiKey not used in GoogleMapTools

Former Member
0 Kudos

Hi

We realised that when using the DefaultStoreFinderService the underlying Google Geocode Api Call made by the de.hybris.platform.storelocator.impl.GoogleMapTools.class doesn't use the configured "googleApiKey" and we therefore often receive the following Response for the REST Call in GoogleMapTools.geocodeAddress(addressData)

 <?xml version="1.0" encoding="UTF-8"?>
 <GeocodeResponse>
  <status>OVER_QUERY_LIMIT</status>
  <error_message>You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/</error_message>;
 </GeocodeResponse>

How can we make sure that the configured googleApiKey (set in project.properties as described here https://wiki.hybris.com/display/accdoc/Store+Locator+Configuration#StoreLocatorConfiguration-Storefr...) is used in that case?

We're running hybris 5.2

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Better late than never! You should configure spring bean in {yourExtension}-spring.xml:

 <alias name="customGoogleMapTools" alias="googleMapTools"/>
 <bean id="customGoogleMapTools" parent="defaultGoogleMapTools"
       class="de.hybris.platform.storelocator.impl.GoogleMapTools" scope="prototype">
     <property name="googleKey" value="${googleApiKey:#{null}}"/>
 </bean>

Also change the spring bean:

 <alias alias="geoServiceWrapper" name="googleMapsGeoServiceWrapper"/>

Answers (0)