Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Class TwoFingersTouchZoomRotateHandler

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.

Index
  • Disables the "pinch to rotate and zoom" interaction.

    Returns void

    map.touchZoomRotate.disable();
    
  • Disables the "pinch to rotate" interaction, leaving the "pinch to zoom" interaction enabled.

    Returns void

    map.touchZoomRotate.disableRotation();
    
  • Enables the "pinch to rotate and zoom" interaction.

    Parameters

    Returns void

    map.touchZoomRotate.enable();
    map.touchZoomRotate.enable({ around: 'center' });
    
  • Enables the "pinch to rotate" interaction.

    Returns void

    map.touchZoomRotate.enable();
    map.touchZoomRotate.enableRotation();
    
  • Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.

    Returns boolean

    true if the handler is active, false otherwise

  • Returns a Boolean indicating whether the "pinch to rotate and zoom" interaction is enabled.

    Returns boolean

    true if the "pinch to rotate and zoom" interaction is enabled.

  • Sets the zoom rate of touch gestures.

    Parameters

    • OptionalzoomRate: number

      1 The rate used to scale touch movement to a zoom value. Set to undefined to restore the default.

    Returns void

    Slow down touch zoom

    map.touchZoomRotate.setZoomRate(0.5);
    
  • Sets the threshold before a pinch gesture starts zooming.

    Parameters

    • OptionalzoomThreshold: number

      0.1 The minimum zoom delta before the pinch gesture becomes active. Set to undefined to restore the default.

    Returns void

    Make pinch zoom less sensitive

    map.touchZoomRotate.setZoomThreshold(0.3);
    
Was this helpful?