com.vaadin.flow.component.map.configuration.layer.

All Implemented Interfaces:

Serializable

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 a VectorSource by default.

See Also:

  • Constructor Details

    • FeatureLayer

      public FeatureLayer()
  • Method Details

    • getSource

      public VectorSource getSource()

      The source for this layer. For the feature layer this must always be a VectorSource

      Overrides:

      getSource in class VectorLayer

      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) and removeFeature(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

    • removeAllFeatures

      public void removeAllFeatures()

      Removes all features from the layer