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:
Serializable
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 a VectorSource by default.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeature(Feature feature) Adds a feature to the layerThe features managed by this layer.The source for this layer.voidRemoves all features from the layervoidremoveFeature(Feature feature) Removes a feature from the layerMethods inherited from class com.vaadin.flow.component.map.configuration.layer.VectorLayer
getType, setSourceMethods inherited from class com.vaadin.flow.component.map.configuration.layer.Layer
getBackground, getMaxZoom, getMinZoom, getOpacity, getzIndex, isVisible, setBackground, setMaxZoom, setMinZoom, setOpacity, setVisible, setzIndexMethods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addNullableChild, addPropertyChangeListener, collectChanges, deepMarkAsDirty, getId, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
Constructor Details
-
FeatureLayer
public FeatureLayer()
-
-
Method Details
-
getSource
The source for this layer. For the feature layer this must always be aVectorSource- Overrides:
getSourcein classVectorLayer- Returns:
- the source of the layer
-
getFeatures
The features managed by this layer. This returns an immutable collection, which means it can not be modified. UseaddFeature(Feature)andremoveFeature(Feature)instead.- Returns:
- the features managed by the layer, immutable
-
addFeature
Adds a feature to the layer- Parameters:
feature- the feature to be added
-
removeFeature
Removes a feature from the layer- Parameters:
feature- the feature to be removed
-
removeAllFeatures
public void removeAllFeatures()Removes all features from the layer
-