GMap Double Click Event Fired When Double Clicking on Markers in Firefox

According to the Google Map’s documentation, a doubleclick event should not be triggered on the GMap object when it occurs on a marker : “This event is fired when a double click is done on the map. Notice that this event will not be fired if the double click was on a marker or other clickable overlay. ” But I am finding in Firefox 3.0.5 on both Windows and Linux, the event is triggered when clicking on a marker, which results in centering the map. This does not occur in IE7 on Windows. It’s not a huge deal, but I have attached event listeners to markers so I could delete them when a user double clicks. They do in fact get deleted in Firefox, but the maps also centers on where the user clicked, which isn’t what I want.

I am using custom icons and thought that might be the problem, so I went with the standard icon but the problem persists. I searched GMaps issues and sure enough, if your marker is set to be draggable, the event will pass through to GMap and center in Firefox.I tried to mess around with the code and see if I could find a hack to fix it, but nothing worked. Might be able to “un-center” the map by keeping trac of the events fired, as the marker doubleclick always came first in when I was debugging. But it’s probably not worth it…

Leave a Reply