Class LineStringFeature
java.lang.Object
com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
com.vaadin.flow.component.map.configuration.Feature
com.vaadin.flow.component.map.configuration.feature.LineStringFeature
- All Implemented Interfaces:
Serializable
A convenience class for displaying a line string with one or more segments on
the map.
Technically this is a Feature that uses a LineString geometry
for representation.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport -
Constructor Summary
ConstructorsConstructorDescriptionLineStringFeature(Coordinate... coordinates) Creates a new line string feature with the default style using the provided coordinates.LineStringFeature(List<Coordinate> coordinates) Creates a new line string feature with the default style using the provided coordinates. -
Method Summary
Modifier and TypeMethodDescriptionThe coordinates that define the line string, as an array.TheLineStringgeometry representing this feature.voidsetCoordinates(Coordinate... coordinates) Sets the coordinates that define the line string.voidsetCoordinates(List<Coordinate> coordinates) Sets the coordinates that define the line string.voidsetGeometry(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, setTextStyleMethods 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
-
LineStringFeature
Creates a new line string feature with the default style using the provided coordinates. The provided coordinates define the vertices of the line string. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line string, for example to represent a path or route.Coordinates must be specified in the map's user projection, which by default is
EPSG:4326, also referred to as GPS coordinates.- Parameters:
coordinates- the list of coordinates that define the vertices of the line string- Throws:
IllegalArgumentException- if the provided coordinate list is null or has fewer than 2 coordinates
-
LineStringFeature
Creates a new line string feature with the default style using the provided coordinates. The provided coordinates define the vertices of the line string. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line string, for example to represent a path or route.Coordinates must be specified in the map's user projection, which by default is
EPSG:4326, also referred to as GPS coordinates.- Parameters:
coordinates- the coordinates that define the vertices of the line string- Throws:
IllegalArgumentException- if the provided coordinate array is null or has fewer than 2 coordinates
-
-
Method Details
-
getCoordinates
The coordinates that define the line string, as an array. Each coordinate represents a vertex in the line string.- Returns:
- the current coordinates
-
setCoordinates
Sets the coordinates that define the line string. The provided coordinates define the vertices of the line string. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line string, for example to represent a path or route.Coordinates must be specified in the map's user projection, which by default is
EPSG:4326, also referred to as GPS coordinates.- Parameters:
coordinates- the new coordinates- Throws:
IllegalArgumentException- if the provided coordinate list is null or has fewer than 2 coordinates
-
setCoordinates
Sets the coordinates that define the line string. The provided coordinates define the vertices of the line string. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line string, for example to represent a path or route.Coordinates must be specified in the map's user projection, which by default is
EPSG:4326, also referred to as GPS coordinates.- Parameters:
coordinates- the new coordinates- Throws:
IllegalArgumentException- if the provided coordinate array is null or has fewer than 2 coordinates
-
getGeometry
TheLineStringgeometry representing this feature.- Overrides:
getGeometryin classFeature- Returns:
- the current line string geometry
-
setGeometry
Sets the geometry representing this feature. This must be aLineStringgeometry.- Overrides:
setGeometryin classFeature- Parameters:
geometry- the new geometry, not null- Throws:
IllegalArgumentException- if the geometry is not an instance ofLineString
-