java.lang.Object
com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
com.vaadin.flow.component.map.configuration.layer.Layer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ImageLayer, TileLayer, VectorLayer

public abstract class Layer extends AbstractConfigurationObject
Abstract base class for all map layers
See Also:
  • Constructor Details

    • Layer

      public Layer()
  • Method Details

    • getOpacity

      public double getOpacity()
      Returns:
      opacity of the layer
    • setOpacity

      public void setOpacity(double opacity)
      Sets the opacity of the layer. The value must lie between 0 and 1. Default value is 1.
      Parameters:
      opacity - new opacity of the layer
    • isVisible

      public boolean isVisible()
      Returns:
      whether the layer is visible or not
    • setVisible

      public void setVisible(boolean visible)
      Sets the visibility of the layer. Default value is true.
      Parameters:
      visible - new visibility of the layer
    • getzIndex

      public Integer getzIndex()
      Returns:
      the z-index of the layer, or null if not defined
    • setzIndex

      public void setzIndex(Integer zIndex)
      Sets the z-index of the layer. This allows to control in which order layers are rendered. Layers with higher z-indexes are rendered above layers with lower z-indexes. This value is null by default, which means the order of the layers in the map determines the rendering order.
      Parameters:
      zIndex - the new z-index, or null to remove the z-index
    • getMinZoom

      public Double getMinZoom()
      Returns:
      the minimum zoom level at which this layer will be visible, or null if not defined
    • setMinZoom

      public void setMinZoom(Double minZoom)
      Sets the minimum zoom level at which this layer will be visible.
      Parameters:
      minZoom - the new minimum zoom level, or null to remove it
    • getMaxZoom

      public Double getMaxZoom()
      Returns:
      the maximum zoom level at which this layer will be visible, or null if not defined
    • setMaxZoom

      public void setMaxZoom(Double maxZoom)
      Sets the maximum zoom level at which this layer will be visible.
      Parameters:
      maxZoom - the new maximum zoom level, or null to remove it
    • getBackground

      public String getBackground()
      Returns:
      the background color of the layer as CSS color string, or null if not defined
    • setBackground

      public void setBackground(String background)
      Sets the background color of the layer as CSS color string. All valid CSS colors are supported, for example "black" or "rgb(0,0,0)".
      Parameters:
      background - the new background color of the layer, or null to remove it