Class: Polyline

og.Polyline

new og.Polyline(options)

Polyline object.
Name Type Description
options Object optional Polyline options:
Name Type Description
thickness number optional Thickness in screen pixels 1.5 is default.
color og.math.Vector4 optional RGBA color.
visibility Boolean optional Polyline visibility. True default.
isClosed Boolean optional Closed geometry type identificator.
pathLonLat Array.<og.LonLat> optional Polyline geodetic coordinates array.
path Array.<Array.<number, number, number>> optional LinesString cartesian coordinates array. Like path:[[0,0,0], [1,1,1],...]

Members

protected_closedLineBoolean

Polyline geometry ring type identificator.

protected_extentog.Extent

Polyline geodetic extent.
Polyline RGBA color.

readonlyidnumber

Object unic identifier.

thicknessnumber

Polyline thickness in screen pixels.

visibilityboolean

Polyline visibility.

Methods

staticog.Polyline.appendLineData3v(path3v, isClosed, outVertices, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outTransformedPathMerc, outExtent)

Appends to the line arrays new data from cartesian coordinates.
Name Type Description
path3v Array.<Array.<number, number, number>> Line coordinates path array.
isClosed Boolean Identificator for the closed line data creation.
outVertices Array.<Number> Out vertices data array.
outOrders Array.<Number> Out vertices orders data array.
outIndexes Array.<Number> Out vertices indexes data array.
ellipsoid og.Ellipsoid optional Ellipsoid to coordinates transformation.
outTransformedPathLonLat Array.<Array.<og.LonLat>> optional Geodetic coordinates out array.
outTransformedPathMerc Array.<Array.<og.LonLat>> optional Mercator coordinates out array.
outExtent og.Extent Geodetic line extent.

staticog.Polyline.appendLineDataLonLat(pathLonLat, isClosed, outVertices, outOrders, outIndexes, ellipsoid, outTransformedPathCartesian, outTransformedPathMerc, outExtent)

Appends to the line arrays new data from geodetic coordinates.
Name Type Description
pathLonLat Array.<Array.<number, number, number>> Line geodetic coordinates path array.
isClosed Boolean Identificator for the closed line data creation.
outVertices Array.<Number> Out vertices data array.
outOrders Array.<Number> Out vertices orders data array.
outIndexes Array.<Number> Out indexes data array.
ellipsoid og.Ellipsoid Ellipsoid to coordinates transformation.
outTransformedPathCartesian Array.<Array.<Number, Number, Number>> Cartesian coordinates out array.
outTransformedPathMerc Array.<Array.<og.LonLat>> Mercator coordinates out array.
outExtent og.Extent Geodetic line extent.

protected_clearData()

protected_createData3v()

protected_createDataLonLat()

protected_createIndexBuffer()

Creates gl index and order buffer.

protected_createVerticesBuffer()

Creates gl main data buffer.

protected_deleteBuffers()

Clear GL buffers.

protected_refresh()

Refresh buffers.

protected_setEqualPath3v(path3v)

Sets polyline path with cartesian coordinates.
Name Type Description
path3v Array.<pg.math.Vector3> Cartesian coordinates.

protected_setEqualPathLonLat(pathLonLat)

Sets polyline with geodetic coordinates.
Name Type Description
pathLonLat Array.<og.LonLat> Geodetic polyline path coordinates.

protected_update()

Updates render buffers.

addPoint3v(point3v, multiLineIndex)

Adds a new cartesian point in the end of the path.
Name Type Default Description
point3v og.math.Vector3 New coordinate.
multiLineIndex number 0 optional Path part index, first by default.

addPointLonLat(lonlat, multiLineIndex)

Adds a new geodetic point in the end of the path.
Name Type Default Description
lonlat og.LonLat New coordinate.
multiLineIndex number 0 optional Path part index, first by default.
Clear Polyline object data.
Returns polyline geodetic extent.
Returns:
Type Description
og.Extent - Geodetic extent
Returns path cartesian coordinates.
Returns:
Type Description
Array.<og.math.Vector3> Polyline path.

getPathLonLat(){Array.<og.LonLat>}

Returns geodetic path coordinates.
Returns:
Type Description
Array.<og.LonLat> Polyline path.

getThickness(){number}

Returns thickness.
Returns:
Type Description
number Thickness in screen pixels.

getVisibility(){boolean}

Gets Polyline visibility.
Returns:
Type Description
boolean Polyline visibility.
Removes from an entity.

setColor(r, g, b, a)

Sets Polyline RGBA color.
Name Type Description
r number Red color.
g number Green color.
b number Blue color.
a number optional Opacity.

setColor3v(color)

Sets Polyline RGB color.
Name Type Description
color og.math.Vector3 RGB color.

setColor4v(color)

Sets Polyline RGBA color.
Name Type Description
color og.math.Vector4 RGBA color.

setOpacity(opacity)

Sets Polyline opacity.
Name Type Description
opacity number Opacity.

setPath3v(path)

Sets Polyline cartesian coordinates.
Name Type Description
path Array.<Array.<number, number, number>> Polyline path cartesian coordinates.

setPathLonLat(path)

Sets geodetic coordinates.
Name Type Description
path Array.<Array.<number, number, number>> Polyline path cartesian coordinates.

setRenderNode()

Assign with render node.

setThickness(thickness)

Sets Polyline thickness in screen pixels.
Name Type Description
thickness number Thickness.

setVisibility(visibility)

Sets visibility.
Name Type Description
visibility boolean Polyline visibility.