Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to be able to add region biasing when users are searching for addresses in views. This is a similar issue to: #1909706: Support Google's "bounds" parameter, where region biasing has been added when a field is geocoded.
The same functionality would be nice when a field is being search upon.
Comments
Comment #1
Sam152 CreditAttribution: Sam152 commentedSince geofield calls geocoder (when they are both installed), rolling in patch #1909706 makes it easier to add thins functionality. Once that patch is rolled in "getSourceValue" in "geofield/views/proximity_plugins/geofieldProximityGeocoder.inc" can be updated to include the region like so
$geocoded_data_raw = geocoder($geocoder_engine, $location, array('biasing' => array('region' => SELECTED_REGION)));
But for this to work, a field has to be added to the handler which collects this information.
Is there any more experienced with this module willing to work to get these two bits of functionality working togehter.
Comment #2
Sam152 CreditAttribution: Sam152 commentedComment #3
fonant CreditAttribution: fonant at Fonant Ltd commentedThere is a pretty quick workaround that works for all Google geocoding, including proximity filters, using hook_url_outbound_alter() in a custom module: #1909706-22: Support Google's "bounds" parameter
You need to clear the cache_geocoder table before the locations will be re-geocoded with the region biasing included.