Interface InteractionOptions
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
MapOptions
- All Known Implementing Classes:
DefaultMapOptions
Leaflet map interaction options
- Since:
- 2020-03-14
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns how much the map's zoom level changes after a zoomIn(), zoomOut(), pressing + or - on the keyboard, or using the zoom controls.doubleReturns the value the map's zoom level is forced to be a multiple of.booleanReturns whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.booleanReturns whether popups are closed when the user clicks the map.booleanReturns whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.booleanReturns whether the map is draggable with mouse/touch.booleanReturns whether the map automatically handles browser window resize to update itself.voidsetBoxZoom(boolean boxZoom) Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.voidsetClosePopupOnClick(boolean closePopupOnClick) Set it to false if you don't want popups to close when user clicks the map.voidsetDoubleClickZoom(boolean doubleClickZoom) Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.voidsetDragging(boolean dragging) Whether the map be draggable with mouse/touch or not.voidsetTrackResize(boolean trackResize) Whether the map automatically handles browser window resize to update itself.voidsetZoomDelta(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.voidsetZoomSnap(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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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
-