Class: Linestring

OSDPaperjsAnnotation.Linestring(geoJSON)

Represents a linestring annotation item.

Constructor

new Linestring(geoJSON)

The `Linestring` class represents a linestring annotation item. It inherits from the `AnnotationItem` class and provides methods to work with linestring annotations.
Parameters:
Name Type Description
geoJSON Object The GeoJSON object containing annotation data.
Properties:
Name Type Description
_paperItem paper.Group The associated paper item representing the linestring.
Source:
Throws:
Throws an error if the GeoJSON type is invalid.
Type
string

Extends

  • AnnotationItem

Methods

getCoordinates() → {Array}

This method returns an array of arrays representing the coordinates of each point in the linestring.
Source:
Returns:
An array of arrays containing x and y coordinates of each point.
Type
Array

getGeoJSONType() → {Object}

Get the type of this object.
Source:
Returns:
with fields `type === 'Linestring'`
Type
Object

getProperties() → {Object}

This method returns the style properties of the linestring in JSON format.
Source:
Returns:
The style properties in JSON format.
Type
Object

setStyle(properties)

This method sets the style properties of the linestring using the provided properties object.
Parameters:
Name Type Description
properties Object The style properties to set.
Source:

(static) supportsGeoJSONType(type, subtypeopt) → {Boolean}

Retrieves the supported types by the Linestring annotation item.
Parameters:
Name Type Attributes Default Description
type String
subtype String <optional>
null
Source:
Returns:
Whether this constructor supports the requested type/subtype
Type
Boolean