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
public abstract class PointBasedFeature extends Feature
Abstract base class for features that are represented by a single point and a single coordinate.Technically this is a
Feature
that uses aPoint
geometry for representation.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PointBasedFeature()
protected
PointBasedFeature(Coordinate coordinates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Coordinate
getCoordinates()
The coordinates that define where the feature is located on the map.Point
getGeometry()
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, getType, setStyle
-
Methods inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
addChild, addPropertyChangeListener, collectChanges, deepMarkAsDirty, getId, markAsDirty, notifyChange, notifyChange, removeChild, removePropertyChangeListener, setId, update
-
-
-
-
Constructor Detail
-
PointBasedFeature
protected PointBasedFeature()
-
PointBasedFeature
protected PointBasedFeature(Coordinate coordinates)
-
-
Method Detail
-
getCoordinates
public Coordinate getCoordinates()
The coordinates that define where the feature is located on the map. The coordinates must be in the same projection as theView.getProjection()
andSource.getProjection()
.- Returns:
- the current coordinates
-
setCoordinates
public void setCoordinates(Coordinate coordinates)
Sets the coordinates that define where the feature is located on the map. The coordinates must be in the same projection as theView.getProjection()
andSource.getProjection()
.- Parameters:
coordinates
- the new coordinates
-
getGeometry
public Point getGeometry()
ThePoint
geometry representing this feature.- Overrides:
getGeometry
in classFeature
- Returns:
- the current point geometry
-
setGeometry
public void setGeometry(SimpleGeometry geometry)
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
-
-