Class PointBasedFeature
java.lang.Object
com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
com.vaadin.flow.component.map.configuration.Feature
com.vaadin.flow.component.map.configuration.feature.PointBasedFeature
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MarkerFeature
Abstract base class for features that are represented by a single point and a
single coordinate.
Technically this is a Feature
that uses a Point
geometry for
representation.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe coordinates that define where the feature is located on the map.ThePoint
geometry representing this feature.void
setCoordinates
(Coordinate coordinates) Sets the coordinates that define where the feature is located on the map.void
setGeometry
(SimpleGeometry geometry) Sets the geometry representing this feature.Methods inherited from class com.vaadin.flow.component.map.configuration.Feature
getStyle, getText, getTextStyle, getType, isDraggable, setDraggable, setStyle, setText, setTextStyle
Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addNullableChild, addPropertyChangeListener, collectChanges, deepMarkAsDirty, getId, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
Constructor Details
-
PointBasedFeature
protected PointBasedFeature() -
PointBasedFeature
-
-
Method Details
-
getCoordinates
The coordinates that define where the feature is located on the map. Coordinates are returned in the map's user projection, which by default isEPSG:4326
, also referred to as GPS coordinates. If the user projection has been changed usingMap.setUserProjection(String)
, then coordinates must be specified in that projection instead.- Returns:
- the current coordinates
-
setCoordinates
Sets the coordinates that define where the feature is located on the map. Coordinates must be specified in the map's user projection, which by default isEPSG:4326
, also referred to as GPS coordinates. If the user projection has been changed usingMap.setUserProjection(String)
, then coordinates must be specified in that projection instead.- Parameters:
coordinates
- the new coordinates
-
getGeometry
ThePoint
geometry representing this feature.- Overrides:
getGeometry
in classFeature
- Returns:
- the current point geometry
-
setGeometry
Sets the geometry representing this feature. This must be aPoint
geometry.- Overrides:
setGeometry
in classFeature
- Parameters:
geometry
- the new geometry, not null- Throws:
IllegalArgumentException
- if the geometry is not an instance ofPoint
-