Class Configuration

java.lang.Object
com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
com.vaadin.flow.component.map.configuration.Configuration
All Implemented Interfaces:
Serializable

public class Configuration extends AbstractConfigurationObject
Contains the configuration for the map, such as layers, sources, features.
See Also:
  • Constructor Details

    • Configuration

      public Configuration()
  • Method Details

    • getType

      public String getType()
      Description copied from class: AbstractConfigurationObject
      The unique type name of this class. Used by the client-side synchronization mechanism to determine which OpenLayers class to synchronize into.
      Specified by:
      getType in class AbstractConfigurationObject
    • getLayers

      public List<Layer> getLayers()
      The list of layers managed by this map. This returns an immutable list, meaning the list can not be modified. Instead, use addLayer(Layer) and removeLayer(Layer) to manage the layers of the list.
      Returns:
      the list of layers managed by this map
    • addLayer

      public void addLayer(Layer layer)
      Adds a layer to the map. The layer will be appended to the list of layers, meaning that it will be rendered last / on top of previously added layers by default. For more fine-grained control of the layer rendering order, use Layer.setzIndex(Integer).
      Parameters:
      layer - the layer to be added
    • prependLayer

      public void prependLayer(Layer layer)
      Adds a layer to the map by prepending it to the list of layers. That means that it will be rendered first / behind all other layers by default. Consider using Layer.setzIndex(Integer) for more fine-grained control of the layer rendering order.
      Parameters:
      layer - the layer to be added
    • removeLayer

      public void removeLayer(Layer layer)
      Remove a layer from the map
      Parameters:
      layer - the layer to be removed
    • getView

      public View getView()
      Gets the view of the map. The view gives access to properties like center and zoom level of the viewport.
      Returns:
      the map's view
    • setView

      public void setView(View view)
      Sets the view of the map. This is only necessary when dealing with map services that use custom coordinate projection, in which case a view with a matching projection needs to be created and used.
      Parameters:
      view - the new view
    • deepMarkAsDirty

      public void deepMarkAsDirty()
      For internal use only.

      Exposes the method to allow the map component to mark the full configuration hierarchy as changed.

      Overrides:
      deepMarkAsDirty in class AbstractConfigurationObject
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      For internal use only.

      Exposes the method to allow the map component to listen for changes to the configuration.

      Overrides:
      addPropertyChangeListener in class AbstractConfigurationObject
    • collectChanges

      public void collectChanges(Consumer<AbstractConfigurationObject> changeCollector)
      For internal use only.

      Exposes the method to allow the map component to collect changes from the configuration.

      Overrides:
      collectChanges in class AbstractConfigurationObject