Class FitOptions

java.lang.Object
io.jmix.mapsflowui.component.model.FitOptions

public class FitOptions extends Object
Describes options for GeoMap.fit(FitOptions) method.

For more details see: View#fit() docs

  • Field Details

    • extent

      protected Extent extent
    • geometry

      protected org.locationtech.jts.geom.Geometry geometry
    • size

      protected Size size
    • padding

      protected Padding padding
    • duration

      protected Integer duration
    • maxZoom

      protected Double maxZoom
    • easing

      protected Easing easing
  • Constructor Details

    • FitOptions

      public FitOptions(Extent target)
      Creates an instance with extent as target object to zoom to.
      Parameters:
      target - extent
    • FitOptions

      public FitOptions(Feature target)
      Optional constructor. Creates an instance with geometry as target object to zoom to from provided feature.
      Parameters:
      target - feature from which is taken geometry
    • FitOptions

      public FitOptions(org.locationtech.jts.geom.Geometry target)
      Creates an instance with geometry as target object to zoom to.
      Parameters:
      target - geometry
  • Method Details

    • getSize

      public Size getSize()
      Returns:
      size of the box to fit the extent or geometry into or null if not set
    • withSize

      public FitOptions withSize(Size size)
      Sets the size in pixels of the box to fit the extent or geometry into. The map size is used by default.
      Parameters:
      size - the size in pixels
      Returns:
      current instance
    • getPadding

      public Padding getPadding()
      Returns:
      padding or null if not set
    • withPadding

      public FitOptions withPadding(Padding padding)
      Sets the padding to be cleared inside the view.
      Parameters:
      padding - padding to set
      Returns:
      current instance
    • getDuration

      public Integer getDuration()
      Returns:
      the duration or null if not set
    • withDuration

      public FitOptions withDuration(Integer duration)
      Sets the duration of the animation in milliseconds.

      Note, there is no animation to the target extent or geometry by default

      Parameters:
      duration - duration in milliseconds
      Returns:
      current instance
    • getMaxZoom

      public Double getMaxZoom()
      Returns:
      maximum zoom level or null if not set
    • withMaxZoom

      public FitOptions withMaxZoom(Double maxZoom)
      Sets the maximum zoom level that zoom to.
      Parameters:
      maxZoom - maximum zoom level
      Returns:
      current instance
    • getEasing

      public Easing getEasing()
      Returns:
      easing function or null if not set
    • withEasing

      public FitOptions withEasing(Easing easing)
      Sets the easing function used during the animation. The default is Easing.IN_AND_OUT).
      Parameters:
      easing - animation type
      Returns:
      current instance
    • getExtent

      public Extent getExtent()
      Returns:
      extent if options created using by FitOptions(Extent) constructor otherwise returns null
    • getGeometry

      public org.locationtech.jts.geom.Geometry getGeometry()
      Returns:
      geometry if options created using by FitOptions(Geometry) or FitOptions(Feature) constructor otherwise returns null