Interface MapModifyStateFunctions
- All Superinterfaces:
ExecutableFunctions,Identifiable
- All Known Implementing Classes:
LeafletMap
Methods for modifying map state
- Since:
- 2020-02-06
- Version:
- 1.1
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidfitBounds(LatLngBounds bounds) Sets a map view that contains the given geographical bounds with the maximum zoom level possible.default voidfitBounds(LatLngBounds bounds, FitBoundsOptions options) Sets a map view that contains the given geographical bounds with the maximum zoom level possible.default voidfitWorld()Sets a map view that mostly contains the whole world with the maximum zoom level possible.default voidfitWorld(FitBoundsOptions options) Sets a map view that mostly contains the whole world with the maximum zoom level possible.default voidSets the view of the map (geographical center and zoom)default voidSets the view of the map (geographical center and zoom)default voidflyTo(LatLng latlng, int zoom, PanOptions options) Sets the view of the map (geographical center and zoom) performing a smooth pan animation.default voidflyTo(LatLng latlng, int zoom, ZoomOptions options) Sets the view of the map (geographical center and zoom) performing a smooth zoom animation.default voidflyToBounds(LatLngBounds bounds) Sets the view of the map with a smooth animation like flyTo, but takes a bounds parameter like fitBounds.default voidflyToBounds(LatLngBounds bounds, FitBoundsOptions options) Sets the view of the map with a smooth animation like flyTo, but takes a bounds parameter like fitBounds.default voidChecks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default.default voidinvalidateSize(boolean animate) Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default.default voidinvalidateSize(PanOptions options) Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default.default voidinvalidateSize(ZoomOptions options) Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default.default voidPans the map by a given number of pixels (animated).default voidpanBy(Point offset, PanOptions options) Pans the map by a given number of pixels (animated).default voidPans the map the minimum amount to make the latlng visible.default voidpanInside(LatLng latlng, PanOptions options) Pans the map the minimum amount to make the latlng visible.default voidpanInsideBounds(LatLngBounds bounds) Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.default voidpanInsideBounds(LatLngBounds bounds, PanOptions options) Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.default voidPans the map to a given center.default voidpanTo(LatLng latlng, PanOptions options) Pans the map to a given center.default voidsetMaxBounds(LatLngBounds bounds) Restricts the map view to the given bounds (see the maxBounds option).default voidsetMaxZoom(int maxZoom) Sets the upper limit for the available zoom levels (see the maxZoom option).default voidsetMinZoom(int minZoom) Sets the lower limit for the available zoom levels (see the minZoom option).default voidSets the view of the map (geographical center and zoom)default voidsetView(LatLng center, int zoom, PanOptions options) Sets the view of the map (geographical center and zoom) with the given animation options.default voidsetView(LatLng center, int zoom, ZoomOptions options) Sets the view of the map (geographical center and zoom) with the given animation options.default voidsetZoom(int zoom) Sets the zoom of the map.default voidsetZoom(int zoom, PanOptions options) Sets the zoom of the map.default voidsetZoomAround(LatLng latlng, int zoom) Zooms the map while keeping a specified geographical point on the map stationary (e.g.default voidsetZoomAround(Point offset, int zoom, ZoomOptions options) Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.default voidstop()Stops the currently running panTo or flyTo animation, if any.default voidzoomIn(int delta) Increases the zoom of the map by delta (zoomDelta by default).default voidzoomIn(int delta, ZoomOptions options) Increases the zoom of the map by delta (zoomDelta by default).default voidzoomOut(int delta) Decreases the zoom of the map by delta (zoomDelta by default).default voidzoomOut(int delta, ZoomOptions options) Decreases the zoom of the map by delta (zoomDelta by default).Methods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.map.functions.ExecutableFunctions
call, call, executeJs, executeJsMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.Identifiable
getUuid
-
Method Details
-
flyTo
Sets the view of the map (geographical center and zoom)- Parameters:
latlng- the new center coordiantes
-
flyTo
Sets the view of the map (geographical center and zoom)- Parameters:
latlng- the new center coordianteszoom- the new zoom level
-
flyTo
Sets the view of the map (geographical center and zoom) performing a smooth pan animation.- Parameters:
latlng- the new center coordianteszoom- the new zoom leveloptions- the pan animation options
-
flyTo
Sets the view of the map (geographical center and zoom) performing a smooth zoom animation.- Parameters:
latlng- the new center coordianteszoom- the new zoom leveloptions- the zoom animation options
-
panTo
Pans the map to a given center.- Parameters:
latlng- pans the map to a given latlng.
-
panTo
Pans the map to a given center.- Parameters:
latlng- pans the map to a given latlng.options- the pan animation options
-
setView
Sets the view of the map (geographical center and zoom)- Parameters:
center- the new center coordianteszoom- the new zoom level
-
setView
Sets the view of the map (geographical center and zoom) with the given animation options.- Parameters:
center- the new center coordianteszoom- the new zoom leveloptions- the zoom animation options
-
setView
Sets the view of the map (geographical center and zoom) with the given animation options.- Parameters:
center- the new center coordianteszoom- the new zoom leveloptions- the pan animation options
-
setZoom
default void setZoom(int zoom) Sets the zoom of the map.- Parameters:
zoom- the new zoom level
-
setZoom
Sets the zoom of the map.- Parameters:
zoom- the new zoom leveloptions- the pan animation options
-
zoomIn
default void zoomIn(int delta) Increases the zoom of the map by delta (zoomDelta by default).- Parameters:
delta- increases the zoom of the map by delta
-
zoomIn
Increases the zoom of the map by delta (zoomDelta by default).- Parameters:
delta- increases the zoom of the map by deltaoptions- the zoom animation options
-
zoomOut
default void zoomOut(int delta) Decreases the zoom of the map by delta (zoomDelta by default).- Parameters:
delta- decreases the zoom of the map by delta
-
zoomOut
Decreases the zoom of the map by delta (zoomDelta by default).- Parameters:
delta- decreases the zoom of the map by deltaoptions- the pan animation options
-
setZoomAround
Zooms the map while keeping a specified geographical point on the map stationary (e.g. used internally for scroll zoom and double-click zoom).- Parameters:
latlng- the geographical pointzoom- the zoom level
-
setZoomAround
Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.- Parameters:
offset- the offset relative to the top-left cornerzoom- the zoom leveloptions- the zoom animation options
-
fitBounds
Sets a map view that contains the given geographical bounds with the maximum zoom level possible.- Parameters:
bounds- the bounds
-
fitBounds
Sets a map view that contains the given geographical bounds with the maximum zoom level possible.- Parameters:
bounds- the boundsoptions- the fit bounds options
-
fitWorld
default void fitWorld()Sets a map view that mostly contains the whole world with the maximum zoom level possible. -
fitWorld
Sets a map view that mostly contains the whole world with the maximum zoom level possible.- Parameters:
options- the fit bounds options
-
panBy
Pans the map by a given number of pixels (animated).- Parameters:
offset- number of pixels
-
panBy
Pans the map by a given number of pixels (animated).- Parameters:
offset- number of pixelsoptions- the pan options
-
flyToBounds
Sets the view of the map with a smooth animation like flyTo, but takes a bounds parameter like fitBounds.- Parameters:
bounds- the bounds
-
flyToBounds
Sets the view of the map with a smooth animation like flyTo, but takes a bounds parameter like fitBounds.- Parameters:
bounds- the boundsoptions- the fit bounds options
-
setMaxBounds
Restricts the map view to the given bounds (see the maxBounds option).- Parameters:
bounds- the bounds
-
setMinZoom
default void setMinZoom(int minZoom) Sets the lower limit for the available zoom levels (see the minZoom option).- Parameters:
minZoom- the lower limit for the available zoom levels
-
setMaxZoom
default void setMaxZoom(int maxZoom) Sets the upper limit for the available zoom levels (see the maxZoom option).- Parameters:
maxZoom- the upper limit for the available zoom levels
-
panInsideBounds
Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.- Parameters:
bounds- the bounds
-
panInsideBounds
Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.- Parameters:
bounds- the boundsoptions- the pan options
-
panInside
Pans the map the minimum amount to make the latlng visible. Use padding, paddingTopLeft and paddingTopRight options to fit the display to more restricted bounds, like fitBounds. If latlng is already within the (optionally padded) display bounds, the map will not be panned.- Parameters:
latlng- the latlng
-
panInside
Pans the map the minimum amount to make the latlng visible. Use padding, paddingTopLeft and paddingTopRight options to fit the display to more restricted bounds, like fitBounds. If latlng is already within the (optionally padded) display bounds, the map will not be panned.- Parameters:
latlng- the latlngoptions- the pan options
-
invalidateSize
default void invalidateSize()Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. If options.debounceMoveend is true, it will delay moveend event so that it doesn't happen often even if the method is called many times in a row. -
invalidateSize
Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. If options.debounceMoveend is true, it will delay moveend event so that it doesn't happen often even if the method is called many times in a row.- Parameters:
options- the pan options
-
invalidateSize
Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. If options.debounceMoveend is true, it will delay moveend event so that it doesn't happen often even if the method is called many times in a row.- Parameters:
options- the zoom options
-
invalidateSize
default void invalidateSize(boolean animate) Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default.- Parameters:
animate- set true to animating
-
stop
default void stop()Stops the currently running panTo or flyTo animation, if any.
-