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.

colorstring | Array.<string><optional>

Default line color or per-segment HTML colors.

opacityBoolean<optional>

Line opacity.

visibilityBoolean<optional>

Polyline visibility. True default.

isClosedArray.<Boolean><optional>

Closed geometry type identification, per-segment.

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.

texParamsTexParam<optional>

Texture params for all segments: texOffset, strokeSize and texOffsetSpeed.

Members

isClosed

Set closed/open state for one path segment.

Methods

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, coloropt)

Append new geodetic point in the end of the path.

Parameters:
NameTypeAttributesDefaultDescription
lonLatLonLat

New coordinate.

segmentIndexnumber<optional>
0

Path segment index, first by default.

colorNumberArray4<optional>

Point color.

clear()

Clear polyline data.

getOpacity()

Gets polyline opacity.

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.

setColor(htmlColor)

Sets polyline segment color.

Parameters:
NameTypeDescription
htmlColorstring

HTML color.

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.

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

setSrc()

Sets stroke source per segment (null = color-only).

setThickness(thickness)

Sets Polyline thickness in screen pixels.

Parameters:
NameTypeDescription
thicknessnumber

Thickness.

setVisibility(visibility)

Sets visibility.

Parameters:
NameTypeDescription
visibilityboolean

Polyline visibility.