4

In my case, happen something strange, with the GOOGLE MAPS API V3 I create a contextmenu when the user makes rightclick over the map, but, if i try to open the map in fIREFOX, when i make rightclick to show the ContextMenu, its works! but makes a ZOOM OUT too, at the same time, i detect that this happen ONLY in FIREFOX...What happen here? Im making something wrong?

2 Answers 2

12

I had this exact same issue with Firefox, right click, zoom out. Major problem when you are trying to add right click functionality. It would appear the disableDoubleClickZoom resolves this issue but this is a good feature to have and I didn't want to lose it.

What I did is create two event listeners one for right click and one for normal click. In the right click event disable double click zoom:

google.maps.event.addListener(map, 'rightclick', function(e) {
    map.set('disableDoubleClickZoom', true);
});

Then on a normal click re-enable the double click zoom functionality:

google.maps.event.addListener(map, 'click', function(e) {
    map.set('disableDoubleClickZoom', false);       
});
-1

I don't think this is a bug in Firefox, at least not in my browser. Rather, try configuring your map like this:

var mapOptions = {
  disableDefaultUI: true,
  draggable: false,
  scrollwheel: false,
  disableDoubleClickZoom: true,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(element, mapOptions);

All map options here.

1
  • this only seems to happen in firefox, not sure if its a bug, but as the question states, most people don't want to disable double click zoom entirely, just to deal with this-
    – chrismarx
    Commented Apr 30, 2013 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.