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.

(protected) _createIndexBuffer()

Creates gl index and order buffer.

(protected) _createVerticesBuffer()

Creates vertices buffers.

_deleteBuffers()

Clear GL buffers.

_getAtlasTexCoordsForSegment()

Get atlas tex coords for segment (null = color-only)

(protected) _refresh()

Refresh buffers.

(protected) _setSegmentEqualPath3v(path3v, segmentIndex)

Sets one polyline segment with cartesian coordinates.

Parameters:
NameTypeDescription
path3vSegmentPath3vExt

Cartesian coordinates for one segment.

segmentIndexnumber

Segment index to update.

(protected) _update()

Updates render buffers.

addPoint3v(point3v, segmentIndexopt, coloropt)

Append new point in the end of the path.

Parameters:
NameTypeAttributesDefaultDescription
point3vVec3

New point coordinates.

segmentIndexnumber<optional>
0

Path segment index, first by default.

colorNumberArray4<optional>

Point color

addPointLonLat(lonLat, segmentIndexopt)

Append new geodetic point in the end of the path.

Parameters:
NameTypeAttributesDefaultDescription
lonLatLonLat

New coordinate.

segmentIndexnumber<optional>
0

Path segment index, first by default.

clear()

Clear polyline data.

getExtent() → {Extent}

Returns polyline geodetic extent.

Returns:
  • Geodetic extent
Type: 
Extent

getOpacity()

Gets polyline 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>

getVisibility() → {boolean}

Gets Polyline visibility.

Returns:

Polyline visibility.

Type: 
boolean

insertPoint3v(point3v, indexopt, coloropt, segmentIndexopt)

Insert point coordinates in a path segment

Parameters:
NameTypeAttributesDefaultDescription
point3vVec3

Point coordinates

indexnumber<optional>
0

Index in the path

colorNumberArray4<optional>

Point color

segmentIndexnumber<optional>
0

Path segment index

remove()

Removes from an entity.

removePath(index)

Remove multiline path segment

Parameters:
NameTypeDescription
indexnumber

Segment index in multiline

removePoint(index, segmentIndexopt)

Remove point from the path

Parameters:
NameTypeAttributesDefaultDescription
indexnumber

Point index in a path segment

segmentIndexnumber<optional>
0

Segment path index

setAltitude(altitude)

Sets Polyline thickness in screen pixels.

Parameters:
NameTypeDescription
altitudenumber

ALtitude value.

setColorHTML(htmlColor)

Sets polyline color

Parameters:
NameTypeDescription
htmlColorstring

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.

setPathLonLat(pathLonLat, pathColors, forceEqualopt)

Sets polyline geodetic coordinates.

Parameters:
NameTypeAttributesDefaultDescription
pathLonLatArray.<SegmentPathLonLat>

Polyline path cartesian coordinates.

pathColorsArray.<SegmentPathColor>

Polyline path points colors.

forceEqualBoolean<optional>
false

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

setPathSrc()

Set stroke image source for a segment index.

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

setSrc()

Sets image template url source. string = all segments, array = per-segment (null/undefined = color-only).

setThickness(thickness, segmentIndexopt)

Sets Polyline thickness in screen pixels.

Parameters:
NameTypeAttributesDescription
thicknessnumber

Thickness.

segmentIndexnumber<optional>

setVisibility(visibility)

Sets visibility.

Parameters:
NameTypeDescription
visibilityboolean

Polyline visibility.

(static) setPathTexCoords()

[1, -1, 2, -2] - orders for triangle strip line segment t2 t3 (2)-------(-2) | | | | | | | | (1)-------(-1) t0 t1