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 voidaddLayer(Layer layer)Adds a layer to the map.voidaddPropertyChangeListener(PropertyChangeListener listener)For internal use only.voidcollectChanges(Consumer<AbstractConfigurationObject> changeCollector)For internal use only.voiddeepMarkAsDirty()For internal use only.List<Layer>getLayers()The list of layers managed by this map.StringgetType()The unique type name of this class.ViewgetView()Gets the view of the map.voidprependLayer(Layer layer)Adds a layer to the map by prepending it to the list of layers.voidremoveLayer(Layer layer)Remove a layer from the mapvoidsetView(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:AbstractConfigurationObjectThe unique type name of this class. Used by the client-side synchronization mechanism to determine which OpenLayers class to synchronize into.- Specified by:
getTypein 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:
deepMarkAsDirtyin 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:
addPropertyChangeListenerin 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:
collectChangesin classAbstractConfigurationObject
-
-