Map.setGestureHandling
Controls how gestures are handled on the map.
See https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.gestureHandling.
Usage | Returns |
---|
Map.setGestureHandling(option) | |
Argument | Type | Details |
---|
option | String | The option that controls how gestures are handled on the map. Allowed values:
- "cooperative": Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map. In this mode the map cooperates with the page.
- "greedy": All touch gestures and scroll events 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 in an iframe.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-02-20 UTC.
[null,null,["Last updated 2024-02-20 UTC."],[[["`gestureHandling` option controls how users interact with the map through gestures like scrolling and touch."],["Options include \"cooperative\", \"greedy\", \"none\", and the default \"auto\", each affecting how the map responds to user input."],["\"cooperative\" allows page scrolling with one finger and map interaction with two fingers, while \"greedy\" makes all gestures control the map."],["\"none\" disables map panning and zooming via gestures, whereas \"auto\" intelligently switches between \"cooperative\" and \"greedy\" based on context."],["Refer to the Google Maps documentation for detailed information and implementation instructions."]]],["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"]]