The feature object enables you to load feature layers into the project and provides access to all loaded layers. The following members and methods are available:
§ items
§ create()
The featureLine object provides access to all polyline feature layers. The following member and method are available:
§ items
static items :Array.< TerraExplorerObject >
Returns an array of TerraExplorerObject containing all the polyline feature layers in the project.
The featurePoint object provides access to all point feature layers. The following member is available:
§ items
static items :Array.< TerraExplorerObject >
Returns an array of TerraExplorerObject containing all the point feature layers in the project.
The featurePolygon object provides access to all polygon feature layers. The following member is available:
§ items
static items :Array.< TerraExplorerObject >
Returns an array of TerraExplorerObject containing all the polygon feature layers in the project.
static items :Array.< TerraExplorerObject >
Returns an array of TerraExplorerObject containing all the feature layers in the project.
create(description, url, layer, featureType, style, showInMyLayersMenu) → {Cesium.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 |
The style as defined in the KML published from TerraExplorer. |
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
Cesium.promise - A promise (Cesium.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 red polygon layer that is relative to terrain:
var style = "<Style id='Countries'>\
<sx:Line_Color>255</sx:Line_Color>\
<sx:Altitude_Method>0</sx:Altitude_Method>\
</Style>";
var promise = TerraExplorer.layers.feature.create ("Countries",
"http://www.YourDomain.com/SG”,
"442784",
"FeaturePolygon",
style,
true);
promise.then(function(teObject) {
alert(teObject.description);
teObject.show = false;
}).otherwise(function (err) {
alert(err);
});