admin管理员组文章数量:1426626
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.
本文标签: javascriptHow to disable mouse scroll over markers in Bing Maps v7Stack Overflow
版权声明:本文标题:javascript - How to disable mouse scroll over markers in Bing Maps v7 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745480380a2660146.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论