modifyTerrain
The modifyTerrain object enables creation of modify terrain objects and provides access to created objects. Modify terrain objects modify the elevation values in an area of the terrain based on a polygon. The surface of the terrain is raised or lowered according to the elevation values of the polygon's points and the options set. The following member and method are available:
§ items
§ create()
static items : Array<TerraExplorerObject>
Returns an array of TerraExplorerObject containing all modify terrain objects in the project.
create(description, polygon, altitude, options) → {promise}
Creates a modify terrain object.
Parameters
Name |
Type |
Description |
||||||
description |
String |
The name of the modify terrain object as it appears in the Layers and Objects section of the Analysis tab on the sidebar. |
||||||
polygon |
Array of |
Array which represents the modify terrain polygon. |
||||||
altitude |
Number |
The altitude by which to raise or lower the surface of the terrain in the area of the modify terrain polygon. |
||||||
options |
Object |
|
Returns
Promise - A promise that resolves to the newly created modify terrain TerraExplorerObject object.
Example
The following example creates a modifyTerrain object:
var pos1 = Cesium.Cartesian3.fromDegrees(-122.50984, 37.82545);
var pos2 = Cesium.Cartesian3.fromDegrees(-122.50458, 37.82845);
var pos3 = Cesium.Cartesian3.fromDegrees(-122.50182, 37.82574);
var pos4 = Cesium.Cartesian3.fromDegrees(-122.50678, 37.82262);
var cart = [pos1, pos2, pos3, pos4];
Cesium.when(TerraExplorer.objects.modifyTerrain.create("modifyTerrain", cart, 200), function(teObject){teObject.flyTo();});