gpt4 book ai didi

javascript - 如何在Bing Maps v7中禁用鼠标滚动标记

转载 作者:行者123 更新时间:2023-12-02 07:41:49 25 4
gpt4 key购买 nike

标题说明得很好。

我正在使用“Bing Maps AJAX控件,版本7.0”。我成功禁用了鼠标滚轮无法放大和缩小 map 。但是,如果我将鼠标悬停在 map 上的标记(大头针)上,它仍然会放大和缩小。

下面是我用来禁用鼠标滚轮的代码:

Microsoft.Maps.Events.addHandler(map, 'mousewheel', function(e) {
if(e.targetType == 'map') {
e.handled = true;
}
});

最佳答案

以下代码对我来说效果很好:

Microsoft.Maps.Events.addHandler(map, 'mousewheel', function(e) {
e.handled = true;
return true;
});

关于javascript - 如何在Bing Maps v7中禁用鼠标滚动标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10341548/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com