Interface MapStateOptions
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
MapOptions
- All Known Implementing Classes:
DefaultMapOptions
Leaflet map state options
- Since:
- 2020-03-06
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptionReturns the geographical bounds visible in the current map viewReturns the initial geographic center of the map.Returns the geographical bounds the map view is restricted to.Returns the maximum zoom level of the map.Returns the minimum zoom level of the map.getZoom()Returns the initial map zoom level.voidsetBounds(LatLngBounds bounds) Sets a map view that contains the given geographical bounds with the maximum zoom level possible.voidInitial geographic center of the mapvoidsetMaxBounds(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.voidsetMaxZoom(Integer maxZoom) Maximum zoom level of the map.voidsetMinZoom(Integer minZoom) Minimum zoom level of the map.voidInitial map zoom level
-
Method Details
-
getCenter
LatLng getCenter()Returns the initial geographic center of the map.- Returns:
- the geographic center of the map
-
setCenter
Initial geographic center of the map- Parameters:
center- the intial center of the map
-
getZoom
Integer getZoom()Returns the initial map zoom level.- Returns:
- the initial map zoom level
-
setZoom
Initial map zoom level- Parameters:
zoom- the initial map zoom level
-
setBounds
Sets a map view that contains the given geographical bounds with the maximum zoom level possible.- Parameters:
bounds- the geographical bounds of the map
-
getBounds
LatLngBounds getBounds()Returns the geographical bounds visible in the current map view- Returns:
- the geographical bounds of the map
-
getMinZoom
Integer getMinZoom()Returns the minimum zoom level of the map.- 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.- Parameters:
minZoom- the minimum zoom level of the map
-
getMaxZoom
Integer getMaxZoom()Returns the maximum zoom level of the map.- 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.- Parameters:
maxZoom- the maximum zoom level of the map
-
getMaxBounds
LatLngBounds getMaxBounds()Returns the geographical bounds the map view is restricted to.- 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.- Parameters:
maxBounds- restricts the view to the given bounds
-