公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
Map.setGestureHandling
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
控制地图上手势的处理方式。
请参阅 https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.gestureHandling。
用法 | 返回 |
---|
Map.setGestureHandling(option) | |
参数 | 类型 | 详细信息 |
---|
option | 字符串 | 用于控制如何在地图上处理手势的选项。允许的值:
- “cooperative”:滚动事件和单指触控手势会滚动网页,而不会缩放或平移地图。双指触摸手势可平移和缩放地图。按住 Ctrl 键或 ⌘ 键滚动鼠标滚轮可缩放地图。在此模式下,地图会与网页协同工作。
- “greedy”:所有触摸手势和滚动事件都会平移或缩放地图。
- “none”:用户无法通过手势平移或缩放地图。
- “auto”(默认):手势处理是协作式还是贪婪式,取决于网页是否可滚动或是否位于 iframe 中。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],["The `Map.setGestureHandling(option)` method controls map gesture behavior. The `option` argument, a string, determines how the map interacts with user gestures. \"cooperative\" mode allows page scrolling with single-finger or scroll events while reserving two-finger gestures for map manipulation. \"greedy\" mode assigns all touch and scroll actions to the map. \"none\" disables map panning/zooming via gestures. \"auto\" (default) switches between cooperative and greedy modes.\n"],null,[]]