feature

The feature object enables you to load feature layers into the project and provides access to all loaded layers. The following members and method are available:

§  featurePoint

§  featureLine

§  featurePolygon

§  items

§  create()

 

featurePoint

The featurePoint object provides access to all point feature layers. The following member is available:

§  items

items

static items : Array<TerraExplorerObject>

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

featureLine

The featureLine object provides access to all polyline feature layers. The following member is available:

§  items

items

static items : Array<TerraExplorerObject>

Returns an array of TerraExplorerObject containing all the polyline feature layers in the project.

 

featurePolygon

The featurePolygon object provides access to all polygon feature layers. The following member is available:

§  items

items

static items : Array<TerraExplorerObject>

Returns an array of TerraExplorerObject containing all the polygon feature layers in the project.

 

items

static items : Array<TerraExplorerObject>

Returns an array of TerraExplorerObject containing all the feature layers in the project.

create

create(description, url, layer, featureType, style, showInMyLayersMenu) → {promise}

Loads a feature layer into the project.

Parameters

Name

Type

Description

description

String

The name of the layer as it appears in the Layers tab of the TE4W sidebar.

url

String

The URL of the SkylineGlobe Server (SGS) from which the layer is loaded, e.g., http://www.SkylineGlobe.com/SG.

layer

String

The ID or alias of the layer in the SkylineGlobe Server. You can obtain the layer ID by looking it up in the SGS Manager.

featureType

String

The feature layer type. The possible values are: "FeaturePolygon", "FeaturePolyline", and "FeaturePoint".

style

String

JSON style as returned by the getPropertiesString method.

showInMyLayersMenu

Boolean

Determines whether the created layer is listed in TE4W's sidebar (with a star by the layer entry to indicate that it was loaded into the project from SkylineGlobe Server). If showInMyLayersMenu is set to false, the layer is not listed.

Returns

Promise - A promise that resolves to the newly created feature layer TerraExplorerObject object when loaded or an error string if the URL failed to load.

 

Example

The following example creates a polyline feature layer:

var style = '{"lineColor":{"red":1,"green":0.4980392156862745,"blue":0.2,"alpha":1},"width":"5","extendToGround":false}';

               Cesium.when(TerraExplorer.layers.feature.create("World Highways L1","https://www.skylineglobe.com/SG","OSM_Highways_L1", "FeatureLine",  JSON.parse(style) , true), function(teObject){         

               Cesium.when(TerraExplorer.navigate.position.create({

               cartesian: new Cesium.Cartesian3(1333722.1708799102, -4728247.169076019,

               4153012.56762784),

               headingPitchRange: new Cesium.HeadingPitchRange(0.008348351558549183, -1.092241312096343, 1000),

               altitudeType: TerraExplorer.AltitudeMethod.RELATIVE_TO_MODEL}),function(pos){

               TerraExplorer.navigate.flyToPosition(pos);

               });

});