polyline
The polyline object enables creation of polyline objects and provides access to created objects. The following member and method are available:
§ items
§ create()
static items : Array<TerraExplorerObject>
Returns an array of TerraExplorerObject containing all polyline objects in the project.
create(description, verticesArr, options) → {promise}
Creates a polyline object.
Parameters
Name |
Type |
Description |
description |
String |
The name of the object as it appears in the Layers and Objects section of the Analysis tab on the sidebar. |
verticesArr |
Array of |
Array which represents the position of each of the vertices in the polyline object. |
options |
Object |
Object that contains all the Cesium PolylineGraphics options, e.g., material, width, shadows. |
Returns
Promise - A promise that resolves to the newly created TerraExplorerObject polyline object.
Example
The following example creates a polyline object:
var pos1 = new Cesium.Cartesian3(-2310134.6712067625, -5075997.653401327, 3084761.678725282);
var pos2 = new Cesium.Cartesian3(-2310131.4953844063, -5076000.808094176, 3084758.837050934);
var pos3 = new Cesium.Cartesian3(-2310137.366409833, -5076002.783754897, 3084749.9968079026);
var cart = [pos1, pos2, pos3];
var options = {material: Cesium.Color.RED, outline: true, outlineColor:Cesium.Color.ORANGE, outlineWidth:5, heightReference:Cesium.HeightReference.RELATIVE_TO_GROUND, height:0, ignoreDepth:true};
Cesium.when(TerraExplorer.objects.polyline.create("polylineExample", cart, options), function(polylineExample){polylineExample.flyTo();});