我的谷歌地图选项是这样的
{
center: userLatLng,
zoom: 13,
mapTypeId: 'roadmap',
scrollwheel: false,
navigationControl: false,
mapTypeControl: false,
scaleControl: false,
draggable: true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
disableDoubleClickZoom: false,
zoomControl: false,
styles: styles['hide'],
componentRestrictions: {country: "in"},
}
在移动设备上,显示此消息:
Use two fingers to move the map
如果我用两根手指,我可以移动 map 并缩放它。
如何实现单指移动 map ,但不能缩放 map ?
最佳答案
将 gestureHandling: "greedy"
添加到您的 map 选项。
这里是关于这个选项的文档:gestureHandling
关于javascript - 如何使用 JavaScript API 在移动设备的 map 中禁用两指缩放选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41831023/