嗨即时通讯使用谷歌地图API
https://angular-maps.com/,我想只在按住Ctrl滚动滚轮时进行缩放.阅读文档我发现了这个:
gestureHandling This setting controls how gestures on the map are
handled. Allowed values:‘cooperative’ (Two-finger touch gestures pan and zoom the map.
One-finger touch gestures are not handled by the map.) ‘greedy’ (All
touch gestures pan or zoom the map.) ‘none’ (The map cannot be panned
or zoomed by user gestures.) ‘auto’ [default] (Gesture handling is
either cooperative or greedy,depending on whether the page is
scrollable or not. Type: |||Default value: auto
所以在我的代码中我补充说:
<agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom" [gestureHandling]="cooperative" [mapTypeControl]="true" [mapTypeControlOptions]="mapType" >
但是没有用,它没有要求我按ctrl来缩放.
解决方法
设置[scrollwheel] =“null”似乎现在有效.