Class DefaultMapOptions
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.layer.map.options.DefaultMapOptions
- All Implemented Interfaces:
Serializable,Identifiable,AnimationOptions,ControlOptions,InteractionOptions,KeyboardNavigationOptions,MapOptions,MapStateOptions,MousewheelOptions,PanningInteriaOptions,TouchInteractionOptions
Map options with leaflet default values
- Since:
- 2020-03-06
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new set of map options initialized with the Leaflet default values and a randomly generated unique identifier. -
Method Summary
Modifier and TypeMethodDescriptionReturns the geographical bounds visible in the current map viewReturns the initial geographic center of the map.doubleReturns the easing linearity applied to inertial panning animations.doubleReturns the rate with which the inertial movement slows down, in pixels/second².doubleReturns the maximum speed of the inertial movement, in pixels/second.doubleReturns the amount of pixels the map pans when pressing an arrow key.Returns the geographical bounds the map view is restricted to.doubleReturns how solid the max bounds are when dragging the map around.Returns the maximum zoom level of the map.Returns the minimum zoom level of the map.intReturns 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.doubleReturns the maximum size of a CSS translation transform.getUuid()Returns the unique identifier of this object.doubleReturns the rate at which a mouse wheel can fire, in milliseconds.doubleReturns how many scroll pixels mean a change of one full zoom level.getZoom()Returns the initial map zoom level.doubleReturns the zoom difference above which zoom will not be animated.doubleReturns 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 default attribution control is added to the map.booleanReturns whether the map bounces back when pinch-zooming beyond the min/max zoom limits.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 tile fade animation is enabled.booleanReturns whether panning of the map has an inertia effect.booleanReturns whether keyboard navigation of the map is enabled.booleanReturns whether markers animate their zoom with the zoom animation.booleanReturns whether Paths are rendered on a Canvas renderer instead of the default SVG renderer.booleanReturns whether the map can be zoomed by using the mouse wheel.booleanisTap()Returns whether the mobile tap hacks are enabled.booleanReturns whether the map automatically handles browser window resize to update itself.booleanReturns whether the map jumps back to the original "copy" of the world when panning across the antimeridian.booleanReturns whether the map zoom animation is enabled.booleanReturns whether the default zoom control is added to the map.voidsetAttributionControl(boolean attributionControl) Whether a attribution control is added to the map by default.voidsetBounceAtZoomLimits(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.voidsetBounds(LatLngBounds bounds) Sets a map view that contains the given geographical bounds with the maximum zoom level possible.voidsetBoxZoom(boolean boxZoom) Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.voidInitial geographic center of the mapvoidsetClosePopupOnClick(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.voidsetEaseLinearity(double easeLinearity) Sets the easing linearity applied to inertial panning animations.voidsetFadeAnimation(boolean fadeAnimation) Whether the tile fade animation is enabled.voidsetInertia(boolean interia) If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time.voidsetInertiaDeceleration(double inertiaDeceleration) The rate with which the inertial movement slows down, in pixels/second².voidsetInertiaMaxSpeed(double inertiaMaxSpeed) Max speed of the inertial movement, in pixels/second.voidsetKeyboard(boolean keyboard) Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys.voidsetKeyboardPanDelta(double keyboardPanDelta) Amount of pixels to pan when pressing an arrow key.voidsetMarkerZoomAnimation(boolean markerZoomAnimation) Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation.voidsetMaxBounds(LatLngBounds maxBounds) When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back if the user tries to pan outside the view.voidsetMaxBoundsViscosity(double maxBoundsViscosity) If maxBounds is set, this option will control how solid the bounds are when dragging the map around.voidsetMaxZoom(Integer maxZoom) Maximum zoom level of the map.voidsetMinZoom(Integer minZoom) Minimum zoom level of the map.voidsetPreferCanvas(boolean preferCanvas) Whether Paths should be rendered on a Canvas renderer.voidsetScrollWheelZoom(boolean scrollWheelZoom) Whether the map can be zoomed by using the mouse wheel.voidsetTap(boolean tap) Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).voidsetTaptolerance(int tapTolerance) The max number of pixels a user can shift his finger during touch for it to be considered a valid tap.voidsetTouchZoom(String touchZoom) Whether the map can be zoomed by touch-dragging with two fingers.voidsetTrackResize(boolean trackResize) Whether the map automatically handles browser window resize to update itself.voidsetTransform3DLimit(double transform3dLimit) Defines the maximum size of a CSS translation transform.voidsetWheelDebounceTime(double wheelDebounceTime) Limits the rate at which a wheel can fire (in milliseconds).voidsetWheelPxPerZoomLevel(double wheelPxPerZoomLevel) How many scroll pixels (as reported by L.DomEvent.getWheelDelta) mean a change of one full zoom level.voidsetWorldCopyJump(boolean worldCopyJump) With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.voidInitial map zoom levelvoidsetZoomAnimation(boolean zoomAnimation) Whether the map zoom animation is enabled.voidsetZoomAnimationThreshold(double zoomAnimationThreshold) Won't animate zoom if the zoom difference exceeds this value.voidsetZoomControl(boolean zoomControl) Whether a zoom control is added to the map by default.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.
-
Constructor Details
-
DefaultMapOptions
public DefaultMapOptions()Creates a new set of map options initialized with the Leaflet default values and a randomly generated unique identifier.
-
-
Method Details
-
getCenter
Returns the initial geographic center of the map.- Specified by:
getCenterin interfaceMapStateOptions- Returns:
- the geographic center of the map
-
setCenter
Initial geographic center of the map- Specified by:
setCenterin interfaceMapStateOptions- Parameters:
center- the intial center of the map
-
getZoom
Returns the initial map zoom level.- Specified by:
getZoomin interfaceMapStateOptions- Returns:
- the initial map zoom level
-
setZoom
Initial map zoom level- Specified by:
setZoomin interfaceMapStateOptions- Parameters:
zoom- the initial map zoom level
-
isZoomAnimation
public boolean isZoomAnimation()Returns whether the map zoom animation is enabled.- Specified by:
isZoomAnimationin interfaceAnimationOptions- Returns:
trueif the map zoom animation is enabled
-
setZoomAnimation
public void setZoomAnimation(boolean zoomAnimation) Whether the map zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.- Specified by:
setZoomAnimationin interfaceAnimationOptions- Parameters:
zoomAnimation- whether the map zoom animation is enabled
-
getBounds
Returns the geographical bounds visible in the current map view- Specified by:
getBoundsin interfaceMapStateOptions- Returns:
- the geographical bounds of the map
-
setBounds
Sets a map view that contains the given geographical bounds with the maximum zoom level possible.- Specified by:
setBoundsin interfaceMapStateOptions- Parameters:
bounds- the geographical bounds of the map
-
isPreferCanvas
public boolean isPreferCanvas()Returns whether Paths are rendered on a Canvas renderer instead of the default SVG renderer.- Specified by:
isPreferCanvasin interfaceMapOptions- Returns:
trueif Paths are rendered on a Canvas renderer
-
setPreferCanvas
public void setPreferCanvas(boolean preferCanvas) Whether Paths should be rendered on a Canvas renderer. By default, all Paths are rendered in a SVG renderer.- Specified by:
setPreferCanvasin interfaceMapOptions- Parameters:
preferCanvas- whether Paths should be rendered on a Canvas renderer
-
getMinZoom
Returns the minimum zoom level of the map.- Specified by:
getMinZoomin interfaceMapStateOptions- Returns:
- the minimum zoom level of the map
-
setMinZoom
Minimum zoom level of the map. If not specified and at least one GridLayer or TileLayer is in the map, the lowest of their minZoom options will be used instead.- Specified by:
setMinZoomin interfaceMapStateOptions- Parameters:
minZoom- the minimum zoom level of the map
-
getMaxZoom
Returns the maximum zoom level of the map.- Specified by:
getMaxZoomin interfaceMapStateOptions- Returns:
- the maximum zoom level of the map
-
setMaxZoom
Maximum zoom level of the map. If not specified and at least one GridLayer or TileLayer is in the map, the highest of their maxZoom options will be used instead.- Specified by:
setMaxZoomin interfaceMapStateOptions- Parameters:
maxZoom- the maximum zoom level of the map
-
isAttributionControl
public boolean isAttributionControl()Returns whether the default attribution control is added to the map.- Specified by:
isAttributionControlin interfaceControlOptions- Returns:
trueif the default attribution control is added to the map
-
setAttributionControl
public void setAttributionControl(boolean attributionControl) Whether a attribution control is added to the map by default.- Specified by:
setAttributionControlin interfaceControlOptions- Parameters:
attributionControl- set false if yuo want to hide the default attribution control
-
isZoomControl
public boolean isZoomControl()Returns whether the default zoom control is added to the map.- Specified by:
isZoomControlin interfaceControlOptions- Returns:
trueif the default zoom control is added to the map
-
setZoomControl
public void setZoomControl(boolean zoomControl) Whether a zoom control is added to the map by default.- Specified by:
setZoomControlin interfaceControlOptions- Parameters:
zoomControl- set false if yuo want to hide the default zoom control
-
getUuid
Returns the unique identifier of this object.- Specified by:
getUuidin interfaceIdentifiable- Returns:
- the UUID of this object
-
getMaxBounds
Returns the geographical bounds the map view is restricted to.- Specified by:
getMaxBoundsin interfaceMapStateOptions- Returns:
- the maximum geographical bounds of the map view
-
setMaxBounds
When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back if the user tries to pan outside the view. To set the restriction dynamically, use setMaxBounds method.- Specified by:
setMaxBoundsin interfaceMapStateOptions- Parameters:
maxBounds- restricts the view to the given bounds
-
isClosePopupOnClick
public boolean isClosePopupOnClick()Returns whether popups are closed when the user clicks the map.- Specified by:
isClosePopupOnClickin interfaceInteractionOptions- Returns:
trueif popups close when the user clicks the map
-
setClosePopupOnClick
public void setClosePopupOnClick(boolean closePopupOnClick) Set it to false if you don't want popups to close when user clicks the map.- Specified by:
setClosePopupOnClickin interfaceInteractionOptions- Parameters:
closePopupOnClick- set to false if you don't want popups to close when user clicks the map
-
getZoomSnap
public double getZoomSnap()Returns the value the map's zoom level is forced to be a multiple of.- Specified by:
getZoomSnapin interfaceInteractionOptions- Returns:
- the zoom snap value
-
setZoomSnap
public 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.- Specified by:
setZoomSnapin interfaceInteractionOptions- Parameters:
zoomSnap- the value of zoom snap
-
getZoomDelta
public 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.- Specified by:
getZoomDeltain interfaceInteractionOptions- Returns:
- the zoom delta value
-
setZoomDelta
public 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.- Specified by:
setZoomDeltain interfaceInteractionOptions- Parameters:
zoomDelta- the value how much the map's zoom level will change after a zoomIn(), zoomOut()
-
isTrackResize
public boolean isTrackResize()Returns whether the map automatically handles browser window resize to update itself.- Specified by:
isTrackResizein interfaceInteractionOptions- Returns:
trueif the map automatically handles browser window resize
-
setTrackResize
public void setTrackResize(boolean trackResize) Whether the map automatically handles browser window resize to update itself.- Specified by:
setTrackResizein interfaceInteractionOptions- Parameters:
trackResize- if true automatically handles browser window resize
-
isBoxZoom
public boolean isBoxZoom()Returns whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.- Specified by:
isBoxZoomin interfaceInteractionOptions- Returns:
trueif box (shift-drag) zoom is enabled
-
setBoxZoom
public void setBoxZoom(boolean boxZoom) Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing the shift key.- Specified by:
setBoxZoomin interfaceInteractionOptions- Parameters:
boxZoom- if true the map can be zoomed to a rectangular area specified by dragging
-
isDoubleClickZoom
public boolean isDoubleClickZoom()Returns whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.- Specified by:
isDoubleClickZoomin interfaceInteractionOptions- Returns:
trueif double-click zoom is enabled
-
setDoubleClickZoom
public 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.- Specified by:
setDoubleClickZoomin interfaceInteractionOptions- Parameters:
doubleClickZoom- if true the map can be zoomed in by double clicking
-
isDragging
public boolean isDragging()Returns whether the map is draggable with mouse/touch.- Specified by:
isDraggingin interfaceInteractionOptions- Returns:
trueif the map is draggable
-
setDragging
public void setDragging(boolean dragging) Whether the map be draggable with mouse/touch or not.- Specified by:
setDraggingin interfaceInteractionOptions- Parameters:
dragging- if true the map will be draggable
-
isKeyboard
public boolean isKeyboard()Returns whether keyboard navigation of the map is enabled.- Specified by:
isKeyboardin interfaceKeyboardNavigationOptions- Returns:
trueif keyboard navigation is enabled
-
setKeyboard
public void setKeyboard(boolean keyboard) Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys.- Specified by:
setKeyboardin interfaceKeyboardNavigationOptions- Parameters:
keyboard- set true to enable keyboard navigation
-
getKeyboardPanDelta
public double getKeyboardPanDelta()Returns the amount of pixels the map pans when pressing an arrow key.- Specified by:
getKeyboardPanDeltain interfaceKeyboardNavigationOptions- Returns:
- the amount of pixels to pan when pressing an arrow key
-
setKeyboardPanDelta
public void setKeyboardPanDelta(double keyboardPanDelta) Amount of pixels to pan when pressing an arrow key.- Specified by:
setKeyboardPanDeltain interfaceKeyboardNavigationOptions- Parameters:
keyboardPanDelta- amount of pixels
-
getZoomAnimationThreshold
public double getZoomAnimationThreshold()Returns the zoom difference above which zoom will not be animated.- Specified by:
getZoomAnimationThresholdin interfaceAnimationOptions- Returns:
- the maximum zoom difference that will still be animated
-
setZoomAnimationThreshold
public void setZoomAnimationThreshold(double zoomAnimationThreshold) Won't animate zoom if the zoom difference exceeds this value.- Specified by:
setZoomAnimationThresholdin interfaceAnimationOptions- Parameters:
zoomAnimationThreshold- the max zoom animation difference
-
isFadeAnimation
public boolean isFadeAnimation()Returns whether the tile fade animation is enabled.- Specified by:
isFadeAnimationin interfaceAnimationOptions- Returns:
trueif the tile fade animation is enabled
-
setFadeAnimation
public void setFadeAnimation(boolean fadeAnimation) Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.- Specified by:
setFadeAnimationin interfaceAnimationOptions- Parameters:
fadeAnimation- if true the tile fade animation will be enabled
-
isMarkerZoomAnimation
public boolean isMarkerZoomAnimation()Returns whether markers animate their zoom with the zoom animation.- Specified by:
isMarkerZoomAnimationin interfaceAnimationOptions- Returns:
trueif markers animate their zoom with the zoom animation
-
setMarkerZoomAnimation
public void setMarkerZoomAnimation(boolean markerZoomAnimation) Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.- Specified by:
setMarkerZoomAnimationin interfaceAnimationOptions- Parameters:
markerZoomAnimation- if true markers will animate their zoom with the zoom animation
-
getTransform3DLimit
public double getTransform3DLimit()Returns the maximum size of a CSS translation transform.- Specified by:
getTransform3DLimitin interfaceAnimationOptions- Returns:
- the maximum size of a CSS translation transform
-
setTransform3DLimit
public void setTransform3DLimit(double transform3dLimit) Defines the maximum size of a CSS translation transform. The default value should not be changed unless a web browser positions layers in the wrong place after doing a large panBy.- Specified by:
setTransform3DLimitin interfaceAnimationOptions- Parameters:
transform3dLimit- the maximum size of a CSS translation transform
-
isTap
public boolean isTap()Returns whether the mobile tap hacks are enabled.- Specified by:
isTapin interfaceTouchInteractionOptions- Returns:
trueif the tap hacks are enabled
-
setTap
public 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).- Specified by:
setTapin interfaceTouchInteractionOptions- Parameters:
tap- set to true if you want to enable the hack
-
getTapTolerance
public 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.- Specified by:
getTapTolerancein interfaceTouchInteractionOptions- Returns:
- the tap tolerance in pixels
-
setTaptolerance
public 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.- Specified by:
setTaptolerancein interfaceTouchInteractionOptions- Parameters:
tapTolerance- The max number of pixels a user can shift his finger during touch
-
getTouchZoom
Returns whether the map can be zoomed by touch-dragging with two fingers.- Specified by:
getTouchZoomin interfaceTouchInteractionOptions- Returns:
- the touch zoom setting, or
"center"to zoom to the center of the view
-
setTouchZoom
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.- Specified by:
setTouchZoomin interfaceTouchInteractionOptions- Parameters:
touchZoom- Whether the map can be zoomed by touch-dragging with two fingers
-
isBounceAtZoomLimits
public boolean isBounceAtZoomLimits()Returns whether the map bounces back when pinch-zooming beyond the min/max zoom limits.- Specified by:
isBounceAtZoomLimitsin interfaceTouchInteractionOptions- Returns:
trueif the map bounces at the zoom limits
-
setBounceAtZoomLimits
public 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.- Specified by:
setBounceAtZoomLimitsin interfaceTouchInteractionOptions- Parameters:
bounceAtZoomLimits- Set it to false if you don't want the map to zoom
-
isInertia
public boolean isInertia()Returns whether panning of the map has an inertia effect.- Specified by:
isInertiain interfacePanningInteriaOptions- Returns:
trueif panning inertia is enabled
-
setInertia
public void setInertia(boolean interia) If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices. Enabled by default unless running on old Android devices.- Specified by:
setInertiain interfacePanningInteriaOptions- Parameters:
interia- If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging
-
getInertiaDeceleration
public double getInertiaDeceleration()Returns the rate with which the inertial movement slows down, in pixels/second².- Specified by:
getInertiaDecelerationin interfacePanningInteriaOptions- Returns:
- the inertia deceleration
-
setInertiaDeceleration
public void setInertiaDeceleration(double inertiaDeceleration) The rate with which the inertial movement slows down, in pixels/second².- Specified by:
setInertiaDecelerationin interfacePanningInteriaOptions- Parameters:
inertiaDeceleration- the value of interial deceleration
-
getInertiaMaxSpeed
public double getInertiaMaxSpeed()Returns the maximum speed of the inertial movement, in pixels/second.- Specified by:
getInertiaMaxSpeedin interfacePanningInteriaOptions- Returns:
- the maximum speed of the inertial movement
-
setInertiaMaxSpeed
public void setInertiaMaxSpeed(double inertiaMaxSpeed) Max speed of the inertial movement, in pixels/second.- Specified by:
setInertiaMaxSpeedin interfacePanningInteriaOptions- Parameters:
inertiaMaxSpeed- the max speed of interial movement
-
getEaseLinearity
public double getEaseLinearity()Returns the easing linearity applied to inertial panning animations.- Specified by:
getEaseLinearityin interfacePanningInteriaOptions- Returns:
- the ease linearity value
-
setEaseLinearity
public void setEaseLinearity(double easeLinearity) Sets the easing linearity applied to inertial panning animations.- Specified by:
setEaseLinearityin interfacePanningInteriaOptions- Parameters:
easeLinearity- the ease linearity value
-
isWorldCopyJump
public boolean isWorldCopyJump()Returns whether the map jumps back to the original "copy" of the world when panning across the antimeridian.- Specified by:
isWorldCopyJumpin interfacePanningInteriaOptions- Returns:
trueif world copy jump is enabled
-
setWorldCopyJump
public void setWorldCopyJump(boolean worldCopyJump) With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.- Specified by:
setWorldCopyJumpin interfacePanningInteriaOptions- Parameters:
worldCopyJump- if true the map tracks when you pan to another "copy" of the world
-
getMaxBoundsViscosity
public double getMaxBoundsViscosity()Returns how solid the max bounds are when dragging the map around.- Specified by:
getMaxBoundsViscosityin interfacePanningInteriaOptions- Returns:
- the maximum bounds viscosity
-
setMaxBoundsViscosity
public void setMaxBoundsViscosity(double maxBoundsViscosity) If maxBounds is set, this option will control how solid the bounds are when dragging the map around. The default value of 0.0 allows the user to drag outside the bounds at normal speed, higher values will slow down map dragging outside bounds, and 1.0 makes the bounds fully solid, preventing the user from dragging outside the bounds.- Specified by:
setMaxBoundsViscosityin interfacePanningInteriaOptions- Parameters:
maxBoundsViscosity- the value of maximum bounds when dragging the map
-
isScrollWheelZoom
public boolean isScrollWheelZoom()Returns whether the map can be zoomed by using the mouse wheel.- Specified by:
isScrollWheelZoomin interfaceMousewheelOptions- Returns:
trueif mouse wheel zoom is enabled
-
setScrollWheelZoom
public void setScrollWheelZoom(boolean scrollWheelZoom) Whether the map can be zoomed by using the mouse wheel. If passed 'center', it will zoom to the center of the view regardless of where the mouse was.- Specified by:
setScrollWheelZoomin interfaceMousewheelOptions- Parameters:
scrollWheelZoom- whether the map can be zoomed by using the mouse wheel
-
getWheelDebounceTime
public double getWheelDebounceTime()Returns the rate at which a mouse wheel can fire, in milliseconds.- Specified by:
getWheelDebounceTimein interfaceMousewheelOptions- Returns:
- the wheel debounce time in milliseconds
-
setWheelDebounceTime
public void setWheelDebounceTime(double wheelDebounceTime) Limits the rate at which a wheel can fire (in milliseconds). By default user can't zoom via wheel more often than once per 40 ms.- Specified by:
setWheelDebounceTimein interfaceMousewheelOptions- Parameters:
wheelDebounceTime- he bounce time in milliseconds
-
getWheelPxPerZoomLevel
public double getWheelPxPerZoomLevel()Returns how many scroll pixels mean a change of one full zoom level.- Specified by:
getWheelPxPerZoomLevelin interfaceMousewheelOptions- Returns:
- the number of scroll pixels per zoom level
-
setWheelPxPerZoomLevel
public void setWheelPxPerZoomLevel(double wheelPxPerZoomLevel) How many scroll pixels (as reported by L.DomEvent.getWheelDelta) mean a change of one full zoom level. Smaller values will make wheel-zooming faster (and vice versa).- Specified by:
setWheelPxPerZoomLevelin interfaceMousewheelOptions- Parameters:
wheelPxPerZoomLevel- pixel per zoom level
-