point

The point object enables creation of point objects and provides access to created objects. The following member and method are available:

§  items

§  create()

items 

static items : Array<TerraExplorerObject>

Returns an array of TerraExplorerObject containing all point objects in the project.

create

create(description, point, options) → {promise}

Creates a point object. The method can be used to create a point or image/text label (see the examples below).

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.

point

Cesium.Cartesian3

Cesium.Cartesian3 that represents the point object.

options

Object

All Cesium PointGraphics options.

Returns

Promise - A promise that resolves to the newly created TerraExplorerObject point object.

 

Example

The following example creates a point:

var pos = new Cesium.Cartesian3(-2310134.6712067625, -5075997.653401327, 3084761.678725282);

var options = {backgroundColor:Cesium.Color.BLACK, color: Cesium.Color.RED, outlineColor:Cesium.Color.ORANGE, outlineWidth:5, pixelSize:6, height:30, heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND };

Cesium.when(TerraExplorer.objects.point.create("pointExample", pos, options), function(teObject){ teObject.flyTo()});

 

The following example creates a text label:

var pos = new Cesium.Cartesian3(-2310134.6712067625, -5075997.653401327, 3084761.678725282);

var options = {text: "Text", showBackground:true, backgroundColor:Cesium.Color.BLACK, color: Cesium.Color.RED, outlineColor:Cesium.Color.ORANGE, outlineWidth:5, pixelSize:6, height:30, heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND};

Cesium.when(TerraExplorer.objects.point.create("textLabel", pos, options), function(teObject){ teObject.flyTo()});

 

The following example creates an image label:

var pos = new Cesium.Cartesian3(-2310234.6712067625, -5075897.653401327, 3084861.678725282);

var options = {image:"./img/query.png", color: Cesium.Color.RED, pixelSize:6, height:30, heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND };

Cesium.when(TerraExplorer.objects.point.create("imageLabel", pos, options), function(teObject){ teObject.flyTo();});