The TwoFingersTouchZoomRotateHandler allows the user to zoom and rotate the map by pinching on a touchscreen.
TwoFingersTouchZoomRotateHandler
They can zoom with one finger by double tapping and dragging. On the second tap, hold the finger down and drag up or down to zoom in or out.
Disables the "pinch to rotate and zoom" interaction.
map.touchZoomRotate.disable(); Copy
map.touchZoomRotate.disable();
Disables the "pinch to rotate" interaction, leaving the "pinch to zoom" interaction enabled.
map.touchZoomRotate.disableRotation(); Copy
map.touchZoomRotate.disableRotation();
Enables the "pinch to rotate and zoom" interaction.
Optional
Options object.
map.touchZoomRotate.enable();map.touchZoomRotate.enable({ around: 'center' }); Copy
map.touchZoomRotate.enable();map.touchZoomRotate.enable({ around: 'center' });
Enables the "pinch to rotate" interaction.
map.touchZoomRotate.enable();map.touchZoomRotate.enableRotation(); Copy
map.touchZoomRotate.enable();map.touchZoomRotate.enableRotation();
Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.
true if the handler is active, false otherwise
true
false
Returns a Boolean indicating whether the "pinch to rotate and zoom" interaction is enabled.
true if the "pinch to rotate and zoom" interaction is enabled.
The
TwoFingersTouchZoomRotateHandler
allows the user to zoom and rotate the map by pinching on a touchscreen.They can zoom with one finger by double tapping and dragging. On the second tap, hold the finger down and drag up or down to zoom in or out.