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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description Configuration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLayer(Layer layer)
Adds a layer to the map.void
addPropertyChangeListener(PropertyChangeListener listener)
For internal use only.void
collectChanges(Consumer<AbstractConfigurationObject> changeCollector)
For internal use only.void
deepMarkAsDirty()
For internal use only.List<Layer>
getLayers()
The list of layers managed by this map.String
getType()
The unique type name of this class.View
getView()
Gets the view of the map.void
prependLayer(Layer layer)
Adds a layer to the map by prepending it to the list of layers.void
removeLayer(Layer layer)
Remove a layer from the mapvoid
setView(View view)
Sets the view of the map.-
Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, getId, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
-
-
-
Method Detail
-
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 classAbstractConfigurationObject
-
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, useaddLayer(Layer)
andremoveLayer(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, useLayer.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 usingLayer.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 classAbstractConfigurationObject
-
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 classAbstractConfigurationObject
-
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 classAbstractConfigurationObject
-
-