Title explains it well.
I am using "Bing Maps AJAX Control, Version 7.0". I successfully disabled the mouse wheel from zooming in and out of the map. However, if I am hovering over a marker(pin) on the map, It still is zooming in and out.
Below is the code that I used to disabled the mouse wheel:
Microsoft.Maps.Events.addHandler(map, 'mousewheel', function(e) {
if(e.targetType == 'map') {
e.handled = true;
}
});
Title explains it well.
I am using "Bing Maps AJAX Control, Version 7.0". I successfully disabled the mouse wheel from zooming in and out of the map. However, if I am hovering over a marker(pin) on the map, It still is zooming in and out.
Below is the code that I used to disabled the mouse wheel:
Microsoft.Maps.Events.addHandler(map, 'mousewheel', function(e) {
if(e.targetType == 'map') {
e.handled = true;
}
});
Share
Improve this question
edited Dec 10, 2013 at 7:38
Kara
6,22616 gold badges53 silver badges58 bronze badges
asked Apr 26, 2012 at 21:16
Mike HenkenMike Henken
1801 silver badge8 bronze badges
2 Answers
Reset to default 5The following code worked fine for me:
Microsoft.Maps.Events.addHandler(map, 'mousewheel', function(e) {
e.handled = true;
return true;
});
For others that may e across this question that want to know how to pletely disable zooming (i.e. via the scroll wheel or otherwise) in Bing Maps AJAX API v7, here's how:
var options = { credentials: 'put-your-credentials-here', **disableZooming: true**
}
map = new Microsoft.Maps.Map(document.getElementById('myMap'), options);
The Bing Maps API provides other MapOptions, as documented here.
Regarding @Mike Henken's problem:
However, if I am hovering over a marker(pin) on the map, It still is zooming in and out.
That appears to be a bug in Bing Maps v7 API that has been fixed as of 8/5/2013. I can no longer reproduce that problem.