Interface MapGetStateFunctions
- All Superinterfaces:
ExecutableFunctions,Identifiable
- All Known Implementing Classes:
LeafletMap
Methods for Getting Map State
- Since:
- 2020-03-15
- Version:
- 1.1
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<LatLngBounds> Returns the geographical bounds visible in the current map viewdefault CompletableFuture<Double> getBoundsZoom(LatLngBounds bounds, boolean inside, Point padding) Returns the maximum zoom level on which the given bounds fit to the map view in its entirety.default CompletableFuture<LatLng> Returns the geographical center of the map viewdefault CompletableFuture<Double> Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).default CompletableFuture<Double> Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.default CompletableFuture<Bounds> Returns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations).default CompletableFuture<Point> Returns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations).default CompletableFuture<Bounds> getPixelWorldBounds(Double zoom) Returns the world's bounds in pixel coordinates for zoom level zoom.default CompletableFuture<Point> getSize()Returns the current size of the map container (in pixels).default CompletableFuture<Integer> getZoom()Returns the current zoom level of the map viewMethods 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
-
getCenter
Returns the geographical center of the map view- Returns:
- the geographical center of the map view
-
getZoom
Returns the current zoom level of the map view- Returns:
- the current zoom level of the map view
-
getBounds
Returns the geographical bounds visible in the current map view- Returns:
- the geographical bounds visible in the current map view
-
getMinZoom
Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.- Returns:
- the minimum zoom level of the map
-
getMaxZoom
Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).- Returns:
- the maximum zoom level of the map
-
getBoundsZoom
Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety.- Parameters:
bounds- the boundsinside- the insidepadding- the padding- Returns:
- the maximum zoom level on which the given bounds fit to the map view in its entirety
-
getSize
Returns the current size of the map container (in pixels).- Returns:
- the current size of the map container
-
getPixelBounds
Returns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations).- Returns:
- the bounds of the current map view
-
getPixelOrigin
Returns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations).- Returns:
- the projected pixel coordinates of the top left point of the map
-
getPixelWorldBounds
Returns the world's bounds in pixel coordinates for zoom level zoom. If zoom is omitted, the map's current zoom level is used.- Parameters:
zoom- the value of zoom level- Returns:
- the world's bounds in pixel coordinates for zoom level zoom
-