Interface TouchInteractionOptions

All Known Subinterfaces:
MapOptions
All Known Implementing Classes:
DefaultMapOptions

public interface TouchInteractionOptions
Leaflet map touch interaction options
Since:
2020-03-06
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the max number of pixels a user can shift a finger during touch for it to still be considered a valid tap.
    Returns whether the map can be zoomed by touch-dragging with two fingers.
    boolean
    Returns whether the map bounces back when pinch-zooming beyond the min/max zoom limits.
    boolean
    Returns whether the mobile tap hacks are enabled.
    void
    setBounceAtZoomLimits(boolean bounceAtZoomLimits)
    Set it to false if you don't want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming.
    void
    setTap(boolean tap)
    Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).
    void
    setTaptolerance(int tapTolerance)
    The max number of pixels a user can shift his finger during touch for it to be considered a valid tap.
    void
    setTouchZoom(String touchZoom)
    Whether the map can be zoomed by touch-dragging with two fingers.
  • Method Details

    • isTap

      boolean isTap()
      Returns whether the mobile tap hacks are enabled.
      Returns:
      true if the tap hacks are enabled
    • setTap

      void setTap(boolean tap)
      Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).
      Parameters:
      tap - set to true if you want to enable the hack
    • getTapTolerance

      int getTapTolerance()
      Returns the max number of pixels a user can shift a finger during touch for it to still be considered a valid tap.
      Returns:
      the tap tolerance in pixels
    • setTaptolerance

      void setTaptolerance(int tapTolerance)
      The max number of pixels a user can shift his finger during touch for it to be considered a valid tap.
      Parameters:
      tapTolerance - The max number of pixels a user can shift his finger during touch
    • getTouchZoom

      String getTouchZoom()
      Returns whether the map can be zoomed by touch-dragging with two fingers.
      Returns:
      the touch zoom setting, or "center" to zoom to the center of the view
    • setTouchZoom

      void setTouchZoom(String touchZoom)
      Whether the map can be zoomed by touch-dragging with two fingers. If passed 'center', it will zoom to the center of the view regardless of where the touch events (fingers) were. Enabled for touch-capable web browsers except for old Androids.
      Parameters:
      touchZoom - Whether the map can be zoomed by touch-dragging with two fingers
    • isBounceAtZoomLimits

      boolean isBounceAtZoomLimits()
      Returns whether the map bounces back when pinch-zooming beyond the min/max zoom limits.
      Returns:
      true if the map bounces at the zoom limits
    • setBounceAtZoomLimits

      void setBounceAtZoomLimits(boolean bounceAtZoomLimits)
      Set it to false if you don't want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming.
      Parameters:
      bounceAtZoomLimits - Set it to false if you don't want the map to zoom