Interface MousewheelOptions
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
MapOptions
- All Known Implementing Classes:
DefaultMapOptions
Leaflet map mouse wheel options
- Since:
- 2020-03-14
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the rate at which a mouse wheel can fire, in milliseconds.doubleReturns how many scroll pixels mean a change of one full zoom level.booleanReturns whether the map can be zoomed by using the mouse wheel.voidsetScrollWheelZoom(boolean scrollWheelZoom) Whether the map can be zoomed by using the mouse wheel.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.
-
Method Details
-
isScrollWheelZoom
boolean isScrollWheelZoom()Returns whether the map can be zoomed by using the mouse wheel.- Returns:
trueif mouse wheel zoom is enabled
-
setScrollWheelZoom
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.- Parameters:
scrollWheelZoom- whether the map can be zoomed by using the mouse wheel
-
getWheelDebounceTime
double getWheelDebounceTime()Returns the rate at which a mouse wheel can fire, in milliseconds.- Returns:
- the wheel debounce time in milliseconds
-
setWheelDebounceTime
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.- Parameters:
wheelDebounceTime- he bounce time in milliseconds
-
getWheelPxPerZoomLevel
double getWheelPxPerZoomLevel()Returns how many scroll pixels mean a change of one full zoom level.- Returns:
- the number of scroll pixels per zoom level
-
setWheelPxPerZoomLevel
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).- Parameters:
wheelPxPerZoomLevel- pixel per zoom level
-