com.vaadin.flow.component.map.configuration.layer.
Class FeatureLayer
- java.lang.Object
-
- com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
-
- com.vaadin.flow.component.map.configuration.layer.Layer
-
- com.vaadin.flow.component.map.configuration.layer.VectorLayer
-
- com.vaadin.flow.component.map.configuration.layer.FeatureLayer
-
All Implemented Interfaces:
public class FeatureLayer extends VectorLayer
Layer that allows to conveniently display a number of geographic features. A
Feature
can be anything that should be displayed on top of a map, such as points of interest, vehicles or people.The layer is a high-level abstraction built on top of
VectorLayer
, and uses aVectorSource
by default.See Also:
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description FeatureLayer()
-
Method Summary
All Methods Modifier and Type Method Description void
addFeature(Feature feature)
Adds a feature to the layer
List<Feature>
getFeatures()
The features managed by this layer.
VectorSource
getSource()
The source for this layer.
void
removeFeature(Feature feature)
Removes a feature from the layer
-
Methods inherited from class com.vaadin.flow.component.map.configuration.layer.VectorLayer
getType, setSource
-
Methods inherited from class com.vaadin.flow.component.map.configuration.layer.Layer
getBackground, getMaxZoom, getMinZoom, getOpacity, getzIndex, isVisible, setBackground, setMaxZoom, setMinZoom, setOpacity, setVisible, setzIndex
-
Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addPropertyChangeListener, collectChanges, deepMarkAsDirty, getId, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
-
-
-
Method Detail
-
getSource
public VectorSource getSource()
The source for this layer. For the feature layer this must always be a
VectorSource
Overrides:
getSource
in classVectorLayer
Returns:
the source of the layer
-
getFeatures
public List<Feature> getFeatures()
The features managed by this layer. This returns an immutable collection, which means it can not be modified. Use
addFeature(Feature)
andremoveFeature(Feature)
instead.Returns:
the features managed by the layer, immutable
-
addFeature
public void addFeature(Feature feature)
Adds a feature to the layer
Parameters:
feature
- the feature to be added
-
removeFeature
public void removeFeature(Feature feature)
Removes a feature from the layer
Parameters:
feature
- the feature to be removed
-
-