I'm working on a site using location 6.x-3.1 to provide location services for events. I've got location_node enabled and configured for my event nodes. I'm using a views proximity search (cool stuff!) so all my locations need to have coordinates.

Currently, I'm just using the {zipcodes} table to geocode my locations based on zipcode (since I don't have a google geocoding key and all that stuff configured). So, my addresses only have approximate (zip-based) geo coordinates. That's fine for the proximity search, and it makes it easier to enter locations (since I just hide all the coordinate UI via form_alter()).

However, by default, if a location contains coordinates, those are automatically stuffed into the URL for the google map when viewing a location-aware node. Even though google gives you an accurate map just based on the address, once you include the coordinates (which are basically the center of the zipcode), the google map marker is way off.

For now, I just hacked my copy of location_map_link_us_google() to ignore the coordinates, since I know the address alone is always going to give me more accurate map markers than the zip-based coordinates.

However, it'd be nice to fix this upstream, perhaps via a simple site-wide setting on if you want to use coordinates in your gmap links or not. I'm happy to roll a patch for this if so desired.

I searched the queue and didn't see an issue open about this, apologies in advance if this is actually duplicate...

Thanks!
-Derek

Comments

linl’s picture

Hi,

Sounds like a great idea.

Just this morning I similarly hacked location_map_link_uk_google() to ignore the coordinates and so fix the google map marker. The other thing I found was a UK street address and postcode alone don't pinpoint a particular building accurately enough, so I also added the "name" and "additional" fields when building the $query_params array in location_map_link_uk_google() to ensure a more accurate position for the google map marker. Maybe that is something else that could be included?

Happy to test any patches.

legolasbo’s picture

Status: Active » Closed (outdated)

Closing old D6 issues as D6 is end of life