Download & Extend

Marker click on api v 2.100 and later

Project:GMap Module
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:bdragon
Status:closed (fixed)

Issue Summary

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

#1

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

update: applied and works, thanks again.

#2

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

Michelle

#3

Thank you for solving this!

#4

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?

#5

Category:support request» bug report
Priority:normal» minor
Status:active» fixed

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

#6

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

#7

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

#8

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

#9

Thanks!!

I use this method to solve my problem.

#10

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

#11

Thanks for the fix! Work for me.

#12

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

#13

Priority:minor» normal
Status:fixed» needs review

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.

AttachmentSize
gmap.module.patch 588 bytes

#14

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

Nik

#15

Status:needs review» active

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

#16

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

#17

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

#18

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

#19

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.

#20

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

#21

Status:fixed» closed (fixed)

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

#22

Confirmed. Thank you!

#23

Fixed it for me too, thank u very much!

#24

You rule! Great job.

#25

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
Priority:normal» critical
Assigned to:Anonymous» bdragon
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.

#26

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

Bevan/

#27

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.

#28

Status:fixed» closed (fixed)

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

#29

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!

#30

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

nobody click here