Distance based search with Google Maps integration 

This feature gives you the possibility to search for hits in a certain radius around a given zip or city. The hits may optionally be presented on a map (using Google Maps), additionally the distance is shown in the result list. If you want to avoid loading third-party content in the browser you can only use the distance search without the map.

Distance based search with Google Maps integration

System requirements 

  • "curl" has to be installed.
  • Activate distance search (see chapter "How to activate the distance search")
  • This feature does not work together with the boost keywords feature.
  • Since distance calculation is done within MySQL, it is not possible to use "Sphinx" at the same time.

Configuration 

The distance search configuration can be adjusted using this TypoScript (see Configuration/TypoScript/Distancesearch/setup.typoscript):

plugin.tx_kesearchpremium {
    distancesearch {
        templatepath = EXT:ke_search_premium/Resources/Private/Templates/DistanceSearch/
        radiusoptions = 10,20,50,100,200
        radiuslabel = km
    }
}
page.includeCSS.keSearchPremiumGoogleMapsCss = EXT:ke_search_premium/Resources/Public/Css/google-maps.css
Copied!

Geocode own content 

In order to geocode your own content you will have to create a hook in your own extension and do the geocoding.

Please have a look at the hook modifyAddressIndexEntry (ke_search_premium/Classes/DistanceSearch/DistanceSearch.php) delivered with ke_search_premium.

Troubleshooting 

If geocoding or distance search does not work, please check the following:

  • Check if the Geocoding API key (googleapikeyserver) is correct.
  • Check if the browser key (googleapikeybrowser) is correct.
  • Check if a valid Google Map ID (googlemapsmapid) is configured when the map is enabled.
  • Check if the country is set in the extension configuration.
  • Check the ke_search log file for errors. If Google Maps returns an error, this will be logged.
Show addtional fields