禁用Ctrl + Scroll缩放谷歌地图 [英] Disable the Ctrl + Scroll to Zoom google maps
问题描述
有人知道如何禁用 CTRL + 滚动
?
当鼠标滚轮移动时,地图会放大/缩小。但现在它要求按 CTRL +鼠标滚轮滚动放大/缩小。
我们如何禁用此功能?我似乎无法在文档中找到任何内容:
您需要传递 gestureHandling:'greedy'
到您的地图选项。
文档: https://developers.google.com/maps/documentation/javascript/interaction#gestureHandling
例如:
const map = new google.maps.Map(mapElement,{
center:{0,0},
zoom:4,
gestureHandling:'贪婪'
} );
Does anybody know how to disable the CTRL + Scroll
?
First when the mouse wheel was moved the Map would Zoom in/out. But now it asks to press CTRL + Mouse Wheel Scroll to Zoom in/out.
How do we disable this feature? I can't seem to find anything in the documentation:
https://developers.google.com/maps/documentation/javascript/controls#ControlOptions
You need to pass gestureHandling: 'greedy'
to your map options.
Documentation: https://developers.google.com/maps/documentation/javascript/interaction#gestureHandling
For example:
const map = new google.maps.Map(mapElement, {
center: { 0, 0 },
zoom: 4,
gestureHandling: 'greedy'
});
这篇关于禁用Ctrl + Scroll缩放谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!