Class Configuration
java.lang.Object
com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
com.vaadin.flow.component.map.configuration.Configuration
- All Implemented Interfaces:
Serializable
Contains the configuration for the map, such as layers, sources, features.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddControl(Control control) Adds a control to the map.voidAdds a layer to the map.voidFor internal use only.voidcollectChanges(Consumer<AbstractConfigurationObject> changeCollector) For internal use only.voidFor internal use only.The list of controls added to the map.The list of layers managed by this map.getType()The unique type name of this class.getView()Gets the view of the map.The list of visible controls added to the map.voidprependLayer(Layer layer) Adds a layer to the map by prepending it to the list of layers.voidremoveControl(Control control) Removes a control from the map.voidremoveLayer(Layer layer) Remove a layer from the mapvoidSets the view of the map.Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addNullableChild, getId, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
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
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
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
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
Remove a layer from the map- Parameters:
layer- the layer to be removed
-
getControls
The list of controls added to the map. This returns an immutable list.- Returns:
- the list of controls added to the map
-
getVisibleControls
The list of visible controls added to the map. This returns an immutable list.- Returns:
- the list of visible controls added to the map
-
addControl
Adds a control to the map. Only one control instance of each type is allowed. Adding a control of a type that already exists will throw anIllegalArgumentException.- Parameters:
control- the control to be added- Throws:
IllegalArgumentException- if a control of the same type already exists
-
removeControl
Removes a control from the map.- Parameters:
control- the control to be removed
-
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
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
For internal use only.Exposes the method to allow the map component to listen for changes to the configuration.
- Overrides:
addPropertyChangeListenerin classAbstractConfigurationObject
-
collectChanges
For internal use only.Exposes the method to allow the map component to collect changes from the configuration.
- Overrides:
collectChangesin classAbstractConfigurationObject
-