Class LineString
java.lang.Object
com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
com.vaadin.flow.component.map.configuration.geometry.SimpleGeometry
com.vaadin.flow.component.map.configuration.geometry.LineString
- All Implemented Interfaces:
Serializable
Geometry that represents a line string, which is a series of connected line
segments.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.component.map.configuration.AbstractConfigurationObject
propertyChangeSupport -
Constructor Summary
ConstructorsConstructorDescriptionLineString(Coordinate... coordinates) Constructs a newLineStringgeometry based on the provided coordinates.LineString(List<Coordinate> coordinates) Constructs a newLineStringgeometry based on the provided coordinates. -
Method Summary
Modifier and TypeMethodDescriptionThe coordinates that define the line string, as an array.getType()The unique type name of this class.voidsetCoordinates(Coordinate... coordinates) Sets the coordinates that define the line string.voidsetCoordinates(List<Coordinate> coordinates) Sets the coordinates that define the line string.voidtranslate(double deltaX, double deltaY) Translate the geometry by the specified deltaMethods 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
-
LineString
Constructs a newLineStringgeometry based on the provided coordinates. The provided coordinates define the vertices of the line. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line, 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 line string- Throws:
IllegalArgumentException- if the provided coordinate list is null or has fewer than 2 coordinates
-
LineString
Constructs a newLineStringgeometry based on the provided coordinates. The provided coordinates define the vertices of the line. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line, 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 line string- Throws:
IllegalArgumentException- if the provided coordinate array is null or has fewer than 2 coordinates
-
-
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
-
setCoordinates
Sets the coordinates that define the line string. The provided coordinates define the vertices of the line. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line, 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. A line string must have at least two coordinates. Using more than two coordinates creates a multi-segment line, 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
-
getCoordinates
The coordinates that define the line string, as an array.- Returns:
- the current coordinates
-
translate
public void translate(double deltaX, double deltaY) Description copied from class:SimpleGeometryTranslate the geometry by the specified delta- Specified by:
translatein classSimpleGeometry- Parameters:
deltaX- amount to move on x-axisdeltaY- amount to move on y-axis
-