com.vaadin.flow.component.map.configuration.layer.
Class Layer
- java.lang.Object
-
- com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
-
- com.vaadin.flow.component.map.configuration.layer.Layer
-
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class Layer extends AbstractConfigurationObject
Abstract base class for all map layers
See Also:
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description Layer()
-
Method Summary
All Methods Modifier and Type Method Description String
getBackground()
Float
getMaxZoom()
Float
getMinZoom()
float
getOpacity()
Integer
getzIndex()
boolean
isVisible()
void
setBackground(String background)
Sets the background color of the layer as CSS color string.
void
setMaxZoom(Float maxZoom)
Sets the maximum zoom level at which this layer will be visible.
void
setMinZoom(Float minZoom)
Sets the minimum zoom level at which this layer will be visible.
void
setOpacity(float opacity)
Sets the opacity of the layer.
void
setVisible(boolean visible)
Sets the visibility of the layer.
void
setzIndex(Integer zIndex)
Sets the z-index of the layer.
-
Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addPropertyChangeListener, collectChanges, deepMarkAsDirty, getId, getType, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
-
-
-
Method Detail
-
getOpacity
public float getOpacity()
Returns:
opacity of the layer
-
setOpacity
public void setOpacity(float opacity)
Sets the opacity of the layer. The value must lie between
0
and1
. Default value is1
.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 Float getMinZoom()
Returns:
the minimum zoom level at which this layer will be visible, or null if not defined
-
setMinZoom
public void setMinZoom(Float 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 Float getMaxZoom()
Returns:
the maximum zoom level at which this layer will be visible, or null if not defined
-
setMaxZoom
public void setMaxZoom(Float 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
-
-