I am using Google Maps API (v3) to draw a few maps on a page. One thing I'd like to do is disable zooming when you scroll the mouse wheel over the map, but I'm unsure how.
I have disabled the scaleControl (i.e. removed the scaling UI element), but this doesn't prevent scroll wheel scaling.
Here is part of my function (it's a simple jQuery plugin):
$.fn.showMap = function(options, addr){
options = $.extend({
navigationControl: false,
mapTypeControl: false,
scaleControl: false,
draggable: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}, options);
var map = new google.maps.Map(document.getElementById($(this).attr('id')), options);
// Code cut from this example as not relevant
};
I created a more developed jQuery plugin that allows you to lock or unlock the map with a nice button.
This plugin disables the Google Maps iframe with a transparent overlay div and adds a button for unlockit. You must press for 650 milliseconds to unlock it.
You can change all the options for your convenience. Check it at https://github.com/diazemiliano/googlemaps-scrollprevent
Here's some example.
A simple solution:
Source: https://github.com/Corsidia/scrolloff