Interface InteractionOptions

All Superinterfaces:
Serializable
All Known Subinterfaces:
MapOptions
All Known Implementing Classes:
DefaultMapOptions

public interface InteractionOptions extends Serializable
Leaflet map interaction options
Since:
2020-03-14
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns how much the map's zoom level changes after a zoomIn(), zoomOut(), pressing + or - on the keyboard, or using the zoom controls.
    double
    Returns the value the map's zoom level is forced to be a multiple of.
    boolean
    Returns whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.
    boolean
    Returns whether popups are closed when the user clicks the map.
    boolean
    Returns whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.
    boolean
    Returns whether the map is draggable with mouse/touch.
    boolean
    Returns whether the map automatically handles browser window resize to update itself.
    void
    setBoxZoom(boolean boxZoom)
    Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.
    void
    setClosePopupOnClick(boolean closePopupOnClick)
    Set it to false if you don't want popups to close when user clicks the map.
    void
    setDoubleClickZoom(boolean doubleClickZoom)
    Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.
    void
    setDragging(boolean dragging)
    Whether the map be draggable with mouse/touch or not.
    void
    setTrackResize(boolean trackResize)
    Whether the map automatically handles browser window resize to update itself.
    void
    setZoomDelta(double zoomDelta)
    Controls how much the map's zoom level will change after a zoomIn(), zoomOut(), pressing + or - on the keyboard, or using the zoom controls.
    void
    setZoomSnap(double zoomSnap)
    Forces the map's zoom level to always be a multiple of this, particularly right after a fitBounds() or a pinch-zoom.
  • Method Details

    • isClosePopupOnClick

      boolean isClosePopupOnClick()
      Returns whether popups are closed when the user clicks the map.
      Returns:
      true if popups close when the user clicks the map
    • setClosePopupOnClick

      void setClosePopupOnClick(boolean closePopupOnClick)
      Set it to false if you don't want popups to close when user clicks the map.
      Parameters:
      closePopupOnClick - set to false if you don't want popups to close when user clicks the map
    • getZoomSnap

      double getZoomSnap()
      Returns the value the map's zoom level is forced to be a multiple of.
      Returns:
      the zoom snap value
    • setZoomSnap

      void setZoomSnap(double zoomSnap)
      Forces the map's zoom level to always be a multiple of this, particularly right after a fitBounds() or a pinch-zoom. By default, the zoom level snaps to the nearest integer; lower values (e.g. 0.5 or 0.1) allow for greater granularity. A value of 0 means the zoom level will not be snapped after fitBounds or a pinch-zoom.
      Parameters:
      zoomSnap - the value of zoom snap
    • getZoomDelta

      double getZoomDelta()
      Returns how much the map's zoom level changes after a zoomIn(), zoomOut(), pressing + or - on the keyboard, or using the zoom controls.
      Returns:
      the zoom delta value
    • setZoomDelta

      void setZoomDelta(double zoomDelta)
      Controls how much the map's zoom level will change after a zoomIn(), zoomOut(), pressing + or - on the keyboard, or using the zoom controls. Values smaller than 1 (e.g. 0.5) allow for greater granularity.
      Parameters:
      zoomDelta - the value how much the map's zoom level will change after a zoomIn(), zoomOut()
    • isTrackResize

      boolean isTrackResize()
      Returns whether the map automatically handles browser window resize to update itself.
      Returns:
      true if the map automatically handles browser window resize
    • setTrackResize

      void setTrackResize(boolean trackResize)
      Whether the map automatically handles browser window resize to update itself.
      Parameters:
      trackResize - if true automatically handles browser window resize
    • isBoxZoom

      boolean isBoxZoom()
      Returns whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.
      Returns:
      true if box (shift-drag) zoom is enabled
    • setBoxZoom

      void setBoxZoom(boolean boxZoom)
      Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.
      Parameters:
      boxZoom - if true the map can be zoomed to a rectangular area specified by dragging
    • isDoubleClickZoom

      boolean isDoubleClickZoom()
      Returns whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.
      Returns:
      true if double-click zoom is enabled
    • setDoubleClickZoom

      void setDoubleClickZoom(boolean doubleClickZoom)
      Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift. If passed 'center', double-click zoom will zoom to the center of the view regardless of where the mouse was.
      Parameters:
      doubleClickZoom - if true the map can be zoomed in by double clicking
    • isDragging

      boolean isDragging()
      Returns whether the map is draggable with mouse/touch.
      Returns:
      true if the map is draggable
    • setDragging

      void setDragging(boolean dragging)
      Whether the map be draggable with mouse/touch or not.
      Parameters:
      dragging - if true the map will be draggable