As per #457822: Latitude and Longitude set to 180, 360, sometimes Location data needs additional latitude/longitude validation, beyond just checking that it is not empty. I added this validation to the Location module's location_has_coordinates() function, but that function is not currently being leveraged by gmap_plugin_style_gmap->render().
My current fix is to change the foreach() loop that renders the markers as follows:
if ((!empty($lat) && !empty($lon))
&& ($lat != 0 && $lon != 0)
&& ($lat != 180 && $lon != 360)) {
(That comes in around line 99 of gmap_plugin_style_gmap.inc.)
Once I have added this code, all the problems I previously experienced with GMap centering have disappearing. It would be great if someone can test this code to see whether it resolves issues for them.
Let me know if you need me to roll a proper patch. I'm swamped with work right now, but I may get around to it soon.
Comment | File | Size | Author |
---|---|---|---|
#4 | gmap-validation_for_adding_markers-457828-4.patch | 1 KB | Jerenus |
#2 | render_validation.patch | 600 bytes | EvanDonovan |
Comments
Comment #1
EvanDonovan CreditAttribution: EvanDonovan commentedClarifying title.
Comment #2
EvanDonovan CreditAttribution: EvanDonovan commentedAttached the patch against latest dev. (Needs to be applied from within gmap directory.)
Comment #3
podarokplease, provide patch against latest dev
Comment #4
Jerenus CreditAttribution: Jerenus commentedMay be you need.
Comment #5
podarokWe should bump needs review for testbot working )
Comment #7
podarokUndefined index: user_latitude Notice location.module line 692
from test
needs work
Comment #8
johnv#4: gmap-validation_for_adding_markers-457828-4.patch queued for re-testing.
Comment #9
podarok#4 commited pushed to 7.x-2.x
thanks!!!
Comment #11
brandy.brown CreditAttribution: brandy.brown commentedpatch did not fix anything for me.
^ doesn't matter; upgraded to latest version and everything works great yay!