I spend hours banging my head against this, so I'm simply posting this in case anybody else comes across it.
The problem I was having is that when I clicked on any marker, the map re-centered to a random location, mostly in the Indian Ocean.
The solution, was to change the google api version in gmap.module from this:
define('GMAP_API_V', '2');
to this the more specific:
define('GMAP_API_V', '2.69');
It would appear that google pushed a new minor version of the 2.x api that broke some things; as specifying a very specific minor version fixed the problem for me.
Comments
Comment #1
pshadow commentedSweet, thanks. A couple other issues posted today on this problem. I'll try your fix.
update: applied and works, thanks again.
Comment #2
michelleThanks! Here I thought gmap didn't work in panels and it turns out it was this. Fixed it right up for me.
Michelle
Comment #3
medenfield commentedThank you for solving this!
Comment #4
mediafrenzy commentedThanks!!
Presumably the next time they make a minor change to their API this will happen again?
Do you think its possible to specify in the gmap.module a 2.xx wildcard of some sort, eg so it continues to work with any future minor 2.xx additions?
Comment #5
ahkiam commentedI had this problem too (my Gmap liked Eastern Europe). Thanks for the fix!
Comment #6
akahn commentedInteresting that there is a comment in there saying 2.69 is a 'minimum' version.
Comment #7
jcuello commentedthe fix solve the problem for my site too!! http://elespectador.com/mapadenoticias
Thank you so much!!
Comment #8
pcoughlin commentedThanks ... big help ... this makes everything work.
Comment #9
ichien commentedThanks!!
I use this method to solve my problem.
Comment #10
mellenger commentedI needed terrain view so I chose 2.94 and everything worked. Here's a link to the list of API changes: http://groups.google.com/group/Google-Maps-API/web/api-version-changes
Comment #11
martinmartin commentedThanks for the fix! Work for me.
Comment #12
pcoughlin commentedBased on the Google link in #10 above (thanks for that, repeated here for reference) ... setting the code to one of the following also works and using the abbreviations instead of the actual numbers would keep the site updated with the "proper" api from Google.
http://groups.google.com/group/Google-Maps-API/web/api-version-changes
Based on this from the above page (on this date):
Current (v=2): 2.97
Latest (v=2.x): 2.101
Stable (v=2.s): 2.73
For the "most stable and recent" (which is a good choice for most sites not needing the newest items), in the gmap.module:
I have tried all three and only the "2.s" seems to work and still fixes the "indian ocean focus problem" (I had that problem also).
Hope this helps ... Paul
Comment #13
jhedstromWith the further investigation that has gone into this, I'm re-opening and submitting a patch that will change the default API to the most recent stable version (2.s), so that users in the future don't run into this issue.
Comment #14
niklp commentedPatched this manually, but can confirm this works with a version of gmap from way back, and sorted my problem out (thanks Michelle!! :)
Nik
Comment #15
bdragon commentedCommitted to DRUPAL-5.
(I really need to get around to rolling another alpha release, *sigh*)
Comment #16
dgtlmoon commentedI see this is fixed in current devel release, works great for me!
Comment #17
Bevan commented2.94 worked for the hub map. 2.s and anything older didn't. Grumble stable grumble release grumble cycle grumble. (not live yet) http://witness.lcl/map#full-screen
Comment #18
JohnColeman commentedThanks a lot. The answer always seems to be out there, often on the drupal pages.
Comment #19
pcoughlin commentedThe code works for me and it has been patched.
Thanks for creating the patch, jhedstrom, and thanks for committing it, bdragon.
I have marked this one fixed.
Comment #20
Erics commentedFantastic, fixed the problem, thanks so much.
[My map liked the Antarctic before it was fixed]
Comment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #22
Memeshift commentedConfirmed. Thank you!
Comment #23
hrmes commentedFixed it for me too, thank u very much!
Comment #24
twooten commentedYou rule! Great job.
Comment #25
bdragon commentedReopening as I finally tracked down the problem causing this.
Due to a bug in the marker compressor, I had been encoding ini file numbers like infoX and infoY as strings accidentally.
This was not a problem until map panning for infoWindows was implemented in 2.100. (see http://code.google.com/p/gmaps-api-issues/issues/detail?id=3) Bounds calculations have problems when dealing with strings, so the numbers MUST be represented as integer.
I have just committed a fix (http://drupal.org/cvs?commit=117981) for the compressor bug. This means we should be free now to use more recent api versions.
Comment #26
Bevan commentedThanks Bdragon, I look forward to testing with GMap2 API "2.x"! :)
Bevan/
Comment #27
chitwa commentedWow
Thankyou so so much jhedstrom and thanks to mellenger too for the API versions page (http://groups.google.com/group/Google-Maps-API/web/api-version-changes) . With the updates on google Maps you can visit this page and try out various API versions and find the one that works for your site, especially if you are doing some advance stuff.
Comment #28
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #29
jcamfield commentedTotally odd, but this still worked - my maps were working (unpatched) until midday today, when they started jumping to eastern europe; but specifying 2.69 worked like a charm!
Comment #30
petrknoth commentedThe proposed solution worked for me untill yesterday when the problem magicaly reappeared again. Does somebody have any suggestion how to fix it?