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.

CommentFileSizeAuthor
#13 gmap.module.patch588 bytesjhedstrom

Comments

pshadow’s picture

Sweet, thanks. A couple other issues posted today on this problem. I'll try your fix.

update: applied and works, thanks again.

michelle’s picture

Thanks! Here I thought gmap didn't work in panels and it turns out it was this. Fixed it right up for me.

Michelle

medenfield’s picture

Thank you for solving this!

mediafrenzy’s picture

Thanks!!

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?

ahkiam’s picture

Category: support » bug
Priority: Normal » Minor
Status: Active » Fixed

I had this problem too (my Gmap liked Eastern Europe). Thanks for the fix!

akahn’s picture

Interesting that there is a comment in there saying 2.69 is a 'minimum' version.

jcuello’s picture

the fix solve the problem for my site too!! http://elespectador.com/mapadenoticias
Thank you so much!!

pcoughlin’s picture

Thanks ... big help ... this makes everything work.

ichien’s picture

Thanks!!

I use this method to solve my problem.

mellenger’s picture

I 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

martinmartin’s picture

Thanks for the fix! Work for me.

pcoughlin’s picture

Version: 5.x-1.x-dev » 5.x-1.0-alpha1

Based 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:

define('GMAP_API_V', '2.s');

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

jhedstrom’s picture

Priority: Minor » Normal
Status: Fixed » Needs review
StatusFileSize
new588 bytes

With 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.

niklp’s picture

Patched this manually, but can confirm this works with a version of gmap from way back, and sorted my problem out (thanks Michelle!! :)

Nik

bdragon’s picture

Status: Needs review » Active

Committed to DRUPAL-5.
(I really need to get around to rolling another alpha release, *sigh*)

dgtlmoon’s picture

I see this is fixed in current devel release, works great for me!

Bevan’s picture

2.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

JohnColeman’s picture

Thanks a lot. The answer always seems to be out there, often on the drupal pages.

pcoughlin’s picture

Status: Active » Fixed

The 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.

Erics’s picture

Fantastic, fixed the problem, thanks so much.
[My map liked the Antarctic before it was fixed]

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Memeshift’s picture

Confirmed. Thank you!

hrmes’s picture

Fixed it for me too, thank u very much!

twooten’s picture

You rule! Great job.

bdragon’s picture

Title: FYI: New Google API version breaks markers » Marker click on api v 2.100 and later
Version: 5.x-1.0-alpha1 » 5.x-1.x-dev
Assigned: Unassigned » bdragon
Priority: Normal » Critical
Status: Closed (fixed) » Fixed

Reopening 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.

Bevan’s picture

Thanks Bdragon, I look forward to testing with GMap2 API "2.x"! :)

Bevan/

chitwa’s picture

Wow
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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

jcamfield’s picture

Totally 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!

petrknoth’s picture

The proposed solution worked for me untill yesterday when the problem magicaly reappeared again. Does somebody have any suggestion how to fix it?