Class FitBoundsOptions

java.lang.Object
org.vaadin.addons.componentfactory.leaflet.options.FitBoundsOptions
All Implemented Interfaces:
Serializable

public class FitBoundsOptions extends Object implements 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 Details

    • FitBoundsOptions

      public FitBoundsOptions()
  • Method Details

    • getPaddingTopLeft

      public Point getPaddingTopLeft()
      Gets the padding reserved in the top left corner of the map container.
      Returns:
      the paddingTopLeft
    • setPaddingTopLeft

      public void setPaddingTopLeft(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. 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

      public Point getPaddingBottomRight()
      Gets the padding reserved in the bottom right corner of the map container.
      Returns:
      the paddingBottomRight
    • setPaddingBottomRight

      public void setPaddingBottomRight(Point paddingBottomRight)
      The same for the bottom right corner of the map.
      Parameters:
      paddingBottomRight - the paddingBottomRight to set
    • getPadding

      public Point getPadding()
      Gets the padding applied to both the top left and bottom right corners.
      Returns:
      the padding
    • setPadding

      public void setPadding(Point padding)
      Equivalent of setting both top left and bottom right padding to the same value.
      Parameters:
      padding - the padding to set
    • getMaxZoom

      public Integer getMaxZoom()
      Gets the maximum zoom level used when fitting the bounds.
      Returns:
      the maxZoom
    • setMaxZoom

      public void setMaxZoom(Integer maxZoom)
      The maximum possible zoom to use.
      Parameters:
      maxZoom - the maxZoom to set