Class FitBoundsOptions
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.options.FitBoundsOptions
- All Implemented Interfaces:
Serializable
Options controlling the behavior of Leaflet's
map.fitBounds() call.
They allow padding to be reserved around the map container so that overlays (such as sidebars or controls) do not obscure the fitted bounds, and let the maximum zoom level used when fitting be capped.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the maximum zoom level used when fitting the bounds.Gets the padding applied to both the top left and bottom right corners.Gets the padding reserved in the bottom right corner of the map container.Gets the padding reserved in the top left corner of the map container.voidsetMaxZoom(Integer maxZoom) The maximum possible zoom to use.voidsetPadding(Point padding) Equivalent of setting both top left and bottom right padding to the same value.voidsetPaddingBottomRight(Point paddingBottomRight) The same for the bottom right corner of the map.voidsetPaddingTopLeft(Point paddingTopLeft) Sets the amount of padding in the top left corner of a map container that shouldn't be accounted for when setting the view to fit bounds.
-
Constructor Details
-
FitBoundsOptions
public FitBoundsOptions()
-
-
Method Details
-
getPaddingTopLeft
Gets the padding reserved in the top left corner of the map container.- Returns:
- the paddingTopLeft
-
setPaddingTopLeft
Sets the amount of padding in the top left corner of a map container that shouldn't be accounted for when setting the view to fit bounds. Useful if you have some control overlays on the map like a sidebar and you don't want them to obscure objects you're zooming to.- Parameters:
paddingTopLeft- the paddingTopLeft to set
-
getPaddingBottomRight
Gets the padding reserved in the bottom right corner of the map container.- Returns:
- the paddingBottomRight
-
setPaddingBottomRight
The same for the bottom right corner of the map.- Parameters:
paddingBottomRight- the paddingBottomRight to set
-
getPadding
Gets the padding applied to both the top left and bottom right corners.- Returns:
- the padding
-
setPadding
Equivalent of setting both top left and bottom right padding to the same value.- Parameters:
padding- the padding to set
-
getMaxZoom
Gets the maximum zoom level used when fitting the bounds.- Returns:
- the maxZoom
-
setMaxZoom
The maximum possible zoom to use.- Parameters:
maxZoom- the maxZoom to set
-