Class FillOptions


  • public class FillOptions
    extends Options<Fill>
    Builder class from which a fill is created.
    • Constructor Summary

      Constructors 
      Constructor Description
      FillOptions()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gson.JsonElement getData()
      Get the arbitrary json data of the annotation.
      boolean getDraggable()
      Returns whether this fill is draggable, meaning it can be dragged across the screen when touched and moved.
      java.lang.String getFillColor()
      Get the current configured fill-color for the fill
      java.lang.Float getFillOpacity()
      Get the current configured fill-opacity for the fill
      java.lang.String getFillOutlineColor()
      Get the current configured fill-outline-color for the fill
      java.lang.String getFillPattern()
      Get the current configured fill-pattern for the fill
      org.maplibre.geojson.Polygon getGeometry()
      Get the geometry of the fill, which represents the location of the fill on the map
      java.util.List<java.util.List<org.maplibre.android.geometry.LatLng>> getLatLngs()
      Get a list of lists of LatLng for the fill, which represents the locations of the fill on the map
      FillOptions withData​(com.google.gson.JsonElement jsonElement)
      Set the arbitrary json data of the annotation.
      FillOptions withDraggable​(boolean draggable)
      Set whether this fill should be draggable, meaning it can be dragged across the screen when touched and moved.
      FillOptions withFillColor​(java.lang.String fillColor)
      Set fill-color to initialise the fill with.
      FillOptions withFillOpacity​(java.lang.Float fillOpacity)
      Set fill-opacity to initialise the fill with.
      FillOptions withFillOutlineColor​(java.lang.String fillOutlineColor)
      Set fill-outline-color to initialise the fill with.
      FillOptions withFillPattern​(java.lang.String fillPattern)
      Set fill-pattern to initialise the fill with.
      FillOptions withGeometry​(org.maplibre.geojson.Polygon geometry)
      Set the geometry of the fill, which represents the location of the fill on the map
      FillOptions withLatLngs​(java.util.List<java.util.List<org.maplibre.android.geometry.LatLng>> latLngs)
      Set a list of lists of LatLng for the fill, which represents the locations of the fill on the map
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FillOptions

        public FillOptions()
    • Method Detail

      • withFillOpacity

        public FillOptions withFillOpacity​(java.lang.Float fillOpacity)
        Set fill-opacity to initialise the fill with.

        The opacity of the entire fill layer. In contrast to the PropertyFactory.fillColor(int), this value will also affect the 1px stroke around the fill, if the stroke is used.

        Parameters:
        fillOpacity - the fill-opacity value
        Returns:
        this
      • getFillOpacity

        public java.lang.Float getFillOpacity()
        Get the current configured fill-opacity for the fill

        The opacity of the entire fill layer. In contrast to the PropertyFactory.fillColor(int), this value will also affect the 1px stroke around the fill, if the stroke is used.

        Returns:
        fillOpacity value
      • withFillColor

        public FillOptions withFillColor​(java.lang.String fillColor)
        Set fill-color to initialise the fill with.

        The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.

        Parameters:
        fillColor - the fill-color value
        Returns:
        this
      • getFillColor

        public java.lang.String getFillColor()
        Get the current configured fill-color for the fill

        The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.

        Returns:
        fillColor value
      • withFillOutlineColor

        public FillOptions withFillOutlineColor​(java.lang.String fillOutlineColor)
        Set fill-outline-color to initialise the fill with.

        The outline color of the fill. Matches the value of PropertyFactory.fillColor(int) if unspecified.

        Parameters:
        fillOutlineColor - the fill-outline-color value
        Returns:
        this
      • getFillOutlineColor

        public java.lang.String getFillOutlineColor()
        Get the current configured fill-outline-color for the fill

        The outline color of the fill. Matches the value of PropertyFactory.fillColor(int) if unspecified.

        Returns:
        fillOutlineColor value
      • withFillPattern

        public FillOptions withFillPattern​(java.lang.String fillPattern)
        Set fill-pattern to initialise the fill with.

        Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

        Parameters:
        fillPattern - the fill-pattern value
        Returns:
        this
      • getFillPattern

        public java.lang.String getFillPattern()
        Get the current configured fill-pattern for the fill

        Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

        Returns:
        fillPattern value
      • withLatLngs

        public FillOptions withLatLngs​(java.util.List<java.util.List<org.maplibre.android.geometry.LatLng>> latLngs)
        Set a list of lists of LatLng for the fill, which represents the locations of the fill on the map
        Parameters:
        latLngs - a list of a lists of the locations of the line in a longitude and latitude pairs
        Returns:
        this
      • getLatLngs

        public java.util.List<java.util.List<org.maplibre.android.geometry.LatLng>> getLatLngs()
        Get a list of lists of LatLng for the fill, which represents the locations of the fill on the map
        Returns:
        a list of a lists of the locations of the line in a longitude and latitude pairs
      • withGeometry

        public FillOptions withGeometry​(org.maplibre.geojson.Polygon geometry)
        Set the geometry of the fill, which represents the location of the fill on the map
        Parameters:
        geometry - the location of the fill
        Returns:
        this
      • getGeometry

        public org.maplibre.geojson.Polygon getGeometry()
        Get the geometry of the fill, which represents the location of the fill on the map
        Returns:
        the location of the fill
      • getDraggable

        public boolean getDraggable()
        Returns whether this fill is draggable, meaning it can be dragged across the screen when touched and moved.
        Returns:
        draggable when touched
      • withDraggable

        public FillOptions withDraggable​(boolean draggable)
        Set whether this fill should be draggable, meaning it can be dragged across the screen when touched and moved.
        Parameters:
        draggable - should be draggable
      • withData

        public FillOptions withData​(@Nullable
                                    com.google.gson.JsonElement jsonElement)
        Set the arbitrary json data of the annotation.
        Parameters:
        jsonElement - the arbitrary json element data
      • getData

        @Nullable
        public com.google.gson.JsonElement getData()
        Get the arbitrary json data of the annotation.
        Returns:
        the arbitrary json object data if set, else null