Polyline

Polyline object.

Constructor

new Polyline(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsObject<optional>

Polyline options:

Properties
NameTypeAttributesDescription
thicknessnumber<optional>

Thickness in screen pixels 1.5 is default.

altitudeNumber<optional>

Relative to ground layers altitude value.

colorVec4<optional>

RGBA color.

opacityBoolean<optional>

Line opacity.

visibilityBoolean<optional>

Polyline visibility. True default.

isClosedBoolean<optional>

Closed geometry type identification.

pathLonLatArray.<SegmentPathLonLatExt><optional>

Polyline geodetic coordinates array. [[[0,0,0], [1,1,1],...]]

path3vArray.<SegmentPath3vExt><optional>

LinesString cartesian coordinates array. [[[0,0,0], [1,1,1],...]]

pathColorsArray.<SegmentPathColor><optional>

Coordinates color. [[[1,0,0,1], [0,1,0,1],...]] for right and green colors.

Methods

__appendLineData3v()

Appends to the line array new cartesian coordinates line data.

__appendLineDataLonLat()

Appends to the line array new geodetic coordinates line data.

__appendPoint3v()

Appends to the line new cartesian coordinates point data.

(protected) _createIndexBuffer()

Creates gl index and order buffer.

(protected) _createVerticesBuffer()

Creates vertices buffers.

_deleteBuffers()

Clear GL buffers.

(protected) _refresh()

Refresh buffers.

(protected) _setEqualPath3v(path3v)

Sets polyline path with cartesian coordinates.

Parameters:
NameTypeDescription
path3vArray.<SegmentPath3vExt>

Cartesian coordinates.

(protected) _setEqualPathLonLat(pathLonLat)

Sets polyline with geodetic coordinates.

Parameters:
NameTypeDescription
pathLonLatArray.<SegmentPathLonLat>

Geodetic polyline path coordinates.

(protected) _update()

Updates render buffers.

addPoint3v(point3v, multiLineIndexopt)

Append new point in the end of the path.

Parameters:
NameTypeAttributesDefaultDescription
point3vVec3

New point coordinates.

multiLineIndexnumber<optional>
0

Path segment index, first by default.

addPointLonLat(lonLat, multiLineIndexopt)

Append new geodetic point in the end of the path.

Parameters:
NameTypeAttributesDefaultDescription
lonLatLonLat

New coordinate.

multiLineIndexnumber<optional>
0

Path segment index, first by default.

appendPoint3v(point3v, coloropt, skipEllipsoidopt)

Adds a new cartesian point in the end of the path in a last line segment.

Parameters:
NameTypeAttributesDescription
point3vVec3

New coordinates.

colorNumberArray4<optional>
skipEllipsoidboolean<optional>

clear()

Clear polyline data.

getExtent() → {Extent}

Returns polyline geodetic extent.

Returns:
  • Geodetic extent
Type: 
Extent

getOpacity(opacity)

Gets polyline opacity.

Parameters:
NameTypeDescription
opacitynumber

Opacity.

getPath3v() → {Array.<SegmentPath3vExt>}

Returns path cartesian coordinates.

Returns:

Polyline path.

Type: 
Array.<SegmentPath3vExt>

getPathLonLat() → {Array.<SegmentPathLonLatExt>}

Returns geodetic path coordinates.

Returns:

Polyline path.

Type: 
Array.<SegmentPathLonLatExt>

getThickness() → {number}

Returns thickness.

Returns:

Thickness in screen pixels.

Type: 
number

getVisibility() → {boolean}

Gets Polyline visibility.

Returns:

Polyline visibility.

Type: 
boolean

insertPoint3v(point3v, indexopt, coloropt, multilineIndexopt)

Insert point coordinates in a path segment

Parameters:
NameTypeAttributesDefaultDescription
point3vVec3

Point coordinates

indexnumber<optional>
0

Index in the path

colorNumberArray4<optional>

Point color

multilineIndexnumber<optional>
0

Path segment index

remove()

Removes from an entity.

removePoint(index, multiLineIndexopt)

Remove point from the path

Parameters:
NameTypeAttributesDefaultDescription
indexnumber

Point index in a path segment

multiLineIndexnumber<optional>
0

Segment path index

removeSegment(index)

Remove path segment

Parameters:
NameTypeDescription
indexnumber

Path segment index

setAltitude(thickness)

Sets Polyline thickness in screen pixels.

Parameters:
NameTypeDescription
thicknessnumber

Thickness.

setColorHTML(htmlColor-)

Sets polyline color

Parameters:
NameTypeDescription
htmlColor-string

HTML color

setOpacity(opacity)

Sets polyline opacity.

Parameters:
NameTypeDescription
opacitynumber

Opacity.

setPath3v(path3v, pathColorsopt, forceEqualopt)

Sets Polyline cartesian coordinates.

Parameters:
NameTypeAttributesDefaultDescription
path3vArray.<SegmentPath3vExt>

Polyline path cartesian coordinates. (exactly 3 entries)

pathColorsArray.<SegmentPathColor><optional>

Polyline path cartesian coordinates. (exactly 3 entries)

forceEqualBoolean<optional>
false

Makes assigning faster for size equal coordinates array.

setPathColors(pathColors)

Sets polyline colors.

Parameters:
NameTypeDescription
pathColorsArray.<Array.<NumberArray4>>
To Do
  • - Test the function.

setPathLonLat(pathLonLat, forceEqualopt)

Sets polyline geodetic coordinates.

Parameters:
NameTypeAttributesDefaultDescription
pathLonLatArray.<SegmentPathLonLat>

Polyline path cartesian coordinates.

forceEqualBoolean<optional>
false

OPTIMIZATION FLAG: Makes assigning faster for size equal coordinates array.

setPoint3v(coordinates, indexopt, segmentIndexopt, skipLonLatopt)

Changes cartesian point coordinates of the path

Parameters:
NameTypeAttributesDefaultDescription
coordinatesVec3

New coordinates

indexnumber<optional>
0

Path segment index

segmentIndexnumber<optional>
0

Index of the point in the path segment

skipLonLatboolean<optional>
false

Do not update geodetic coordinates

setPointColor(color, indexopt, segmentIndexopt)

Change path point color

Parameters:
NameTypeAttributesDefaultDescription
colorNumberArray4

New color

indexnumber<optional>
0

Point index

segmentIndexnumber<optional>
0

Path segment index

setRenderNode(renderNode)

Assign with render node.

Parameters:
NameTypeDescription
renderNodeRenderNode

setThickness(thickness)

Sets Polyline thickness in screen pixels.

Parameters:
NameTypeDescription
thicknessnumber

Thickness.

setVisibility(visibility)

Sets visibility.

Parameters:
NameTypeDescription
visibilityboolean

Polyline visibility.