加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – 如何启用ctr scrollwheel以放大Google Maps Api

发布时间:2020-12-17 17:57:17 所属栏目:安全 来源:网络整理
导读:嗨即时通讯使用谷歌地图API https://angular-maps.com/,我想只在按住Ctrl滚动滚轮时进行缩放.阅读文档我发现了这个: gestureHandling This setting controls how gestures on the map are handled. Allowed values: ‘cooperative’ (Two-finger touch gest
嗨即时通讯使用谷歌地图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”似乎现在有效.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读