Interface PanningInteriaOptions
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
MapOptions
- All Known Implementing Classes:
DefaultMapOptions
Leaflet map panning interria options
- Since:
- 2020-03-14
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns 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 how solid the max bounds are when dragging the map around.booleanReturns whether panning of the map has an inertia effect.booleanReturns whether the map jumps back to the original "copy" of the world when panning across the antimeridian.voidsetEaseLinearity(double easeLinearity) Sets the easing linearity applied to inertial panning animations.voidsetInertia(boolean inertia) 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.voidsetMaxBoundsViscosity(double maxBoundsViscosity) If maxBounds is set, this option will control how solid the bounds are when dragging the map around.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.
-
Method Details
-
isInertia
boolean isInertia()Returns whether panning of the map has an inertia effect.- Returns:
trueif panning inertia is enabled
-
setInertia
void setInertia(boolean inertia) 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.- Parameters:
inertia- If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging
-
getInertiaDeceleration
double getInertiaDeceleration()Returns the rate with which the inertial movement slows down, in pixels/second².- Returns:
- the inertia deceleration
-
setInertiaDeceleration
void setInertiaDeceleration(double inertiaDeceleration) The rate with which the inertial movement slows down, in pixels/second².- Parameters:
inertiaDeceleration- the value of interial deceleration
-
getInertiaMaxSpeed
double getInertiaMaxSpeed()Returns the maximum speed of the inertial movement, in pixels/second.- Returns:
- the maximum speed of the inertial movement
-
setInertiaMaxSpeed
void setInertiaMaxSpeed(double inertiaMaxSpeed) Max speed of the inertial movement, in pixels/second.- Parameters:
inertiaMaxSpeed- the max speed of interial movement
-
getEaseLinearity
double getEaseLinearity()Returns the easing linearity applied to inertial panning animations.- Returns:
- the ease linearity value
-
setEaseLinearity
void setEaseLinearity(double easeLinearity) Sets the easing linearity applied to inertial panning animations.- Parameters:
easeLinearity- the ease linearity value
-
isWorldCopyJump
boolean isWorldCopyJump()Returns whether the map jumps back to the original "copy" of the world when panning across the antimeridian.- Returns:
trueif world copy jump is enabled
-
setWorldCopyJump
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.- Parameters:
worldCopyJump- if true the map tracks when you pan to another "copy" of the world
-
getMaxBoundsViscosity
double getMaxBoundsViscosity()Returns how solid the max bounds are when dragging the map around.- Returns:
- the maximum bounds viscosity
-
setMaxBoundsViscosity
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.- Parameters:
maxBoundsViscosity- the value of maximum bounds when dragging the map
-