Skip to content Skip to sidebar Skip to footer

Google Maps API V3 Won't Disable Scroll Wheel After Map Loads

I'm implementing google maps on a website and everything is working great, except that I can't seem to be able to disable the scrollwheel after the maps has loaded. If I set the o

Solution 1:

Editing undocumented properties on Maps API objects is not supported and can lead to unpredictable results. You shouldn't directly modify properties on a map object. Instead, modify the properties using one of the documented options:

Object specific defined getters/setters:

map.setOptions({'scrollwheel': false});

MVCObject generic getters/setters:

map.set('scrollwheel', false);
var isScrollWheelEnabled = map.get('scrollwheel');

Both of these options successfully disabled scrollwheel zooming of the map after it had already been initialized.


Post a Comment for "Google Maps API V3 Won't Disable Scroll Wheel After Map Loads"