Class Layer
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
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
-
Method Summary
Modifier and TypeMethodDescriptiondouble
boolean
void
setBackground
(String background) Sets the background color of the layer as CSS color string.void
setMaxZoom
(Double maxZoom) Sets the maximum zoom level at which this layer will be visible.void
setMinZoom
(Double minZoom) Sets the minimum zoom level at which this layer will be visible.void
setOpacity
(double opacity) Sets the opacity of the layer.void
setVisible
(boolean visible) Sets the visibility of the layer.void
Sets the z-index of the layer.Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addNullableChild, addPropertyChangeListener, collectChanges, deepMarkAsDirty, getId, getType, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
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 between0
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 istrue
.- Parameters:
visible
- new visibility of the layer
-
getzIndex
- Returns:
- the z-index of the layer, or null if not defined
-
setzIndex
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 isnull
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
- Returns:
- the minimum zoom level at which this layer will be visible, or null if not defined
-
setMinZoom
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
- Returns:
- the maximum zoom level at which this layer will be visible, or null if not defined
-
setMaxZoom
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
- Returns:
- the background color of the layer as CSS color string, or null if not defined
-
setBackground
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
-