The rendered globe in the scene, including terrain (
Globe#terrainProvider
)
and imagery layers (Globe#imageryLayers
)
Name | Type | Default | Description |
---|---|---|---|
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional Determine the size and shape of the Earth |
Members
-
baseColor : Color
-
Get the base color of the earth (when no imagery is available).
-
Sets the type of terrain clipping (excavation). The default is to excavate the interior area.
-
Default Value:
ClippingType.KeepOutside
-
Get or set the single-sided and double-sided rendering status of the ball skin (whether to remove the back side, the default is No, that is, single-sided rendering).
-
Billboards/polylines/labels etc. will not be occluded if depth detection is turned on for terrain surfaces.
-
Default Value:
true
-
ellipsoid : Ellipsoid
-
Gets a geometric ellipsoid object describing the Earth.
-
Enable lighting the globe with the sun as a light source.
-
Default Value:
false
-
It is used for terrain excavation texture setting and bottom surface texture path. If set to undefined or null, no texture is used.
-
Used for terrain excavation texture settings, side texture paths. If set to undefined or null, no texture is used. The resolution of the texture image must be 2 to the Nth power.
-
Gets or sets the transparency of the Earth's surface.
-
Layered coloring of the earth (used for inundation analysis, simulating contour lines, terrain trends, etc.).
See:
-
imageryLayers : ImageryLayerCollection
-
Get a collection of imagery layers.
-
Image switching fine layer must be greater than the number of blocks
-
Default Value:
16
-
The distance where lighting resumes. This only takes effect when
enableLighting
istrue
.-
Default Value:
9000000.0
-
The distance where everything becomes lit. This only takes effect when
enableLighting
istrue
.-
Default Value:
6500000.0
-
material : Material
-
Get or set the material of the earth's surface.
-
The maximum screen-space error used to drive level-of-detail refinement. Higher values will provide better performance but lower visual quality.
-
Default Value:
2
-
The normal map to use for rendering waves in the ocean. Setting this property will only have an effect if the configured terrain provider includes a water mask.
-
Default Value:
buildModuleUrl('Assets/Textures/waterNormalsSmall.jpg')
-
Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded. Setting this to true optimizes the zoom-out experience and provides more detail in newly-exposed areas when panning. The down side is that it requires loading more tiles.
-
Default Value:
true
-
Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded. Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even if they are culled. Setting this to true may provide a better panning experience at the cost of loading more tiles.
-
Default Value:
true
-
shadows : ShadowMode
-
Determines whether the globe casts or receives shadows from each light source. Setting the globe to cast shadows may impact performance since the terrain is rendered again from the light's perspective. Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
-
Default Value:
ShadowMode.RECEIVE_ONLY
-
Determines if the globe will be shown.
-
Default Value:
true
-
Whether to display the side of the excavated terrain, the default is true.
-
Default Value:
true
-
True if an animated wave effect should be shown in areas of the globe covered by water; otherwise, false. This property is ignored if the
terrainProvider
does not provide a water mask.-
Default Value:
true
-
Get or set the earth's slope aspect.
-
splitDirection : Cartesian2
-
Rolling shutter direction: Horizontal (1,0) shields the left side, (-1, 0) shields the right side; or vertical (0,1) shields the bottom, (0, -1) shields the top
-
Get or set whether to enable the rolling shutter function.
-
swipeRegion : BoundingRectangle
-
Get or set the quadrilateral area of the shutter.
-
terrainProvider : TerrainProvider
-
Gets or sets the Earth's terrain service provider.
-
readonlyterrainProviderChanged : Event
-
Get the terrain service provider change event, which is triggered when the earth's terrain service provider changes.
-
The size of the terrain tile cache, expressed as a number of tiles. Any additional tiles beyond this number will be freed, as long as they aren't needed for rendering this frame. A larger number will consume more memory but will show detail faster when, for example, zooming out and then back in.
-
Default Value:
100
-
The size of the MVT cache, expressed as a number of tiles. Any additional tiles beyond this number will be freed, as long as they aren't needed for rendering this frame. A larger number will consume more memory but will show detail faster when, for example, zooming out and then back in.
-
Default Value:
100
Methods
-
Add terrain excavation areas.
Name Type Description options
Object Terrain excavation parameters include the following attributes: Name Type Description position
Array Location information of the excavation area. name
String Excavation area name. height
String Excavation depth. transparent
Boolean Whether the surface is transparent. textureWrap
TextureWrap It is used to specify the mapping method of the excavation texture, and the default value is Cesium.TextureWrap.REPEAT. Returns:
bool Returns true on success and false on failure.Example:
var pts = [lon1,lat1,h1,lon2,lat2,h2,lon3,lat3,h3]; viewer.scene.globe.addExcavationRegion({ name : 'test' , position : pts, height : 100, transparent : false textureWrap :SuperMap3D.TextureWrap.REPEAT // repeat texture textureWrap :SuperMap3D.TextureWrap.CLAMP_TO_EDGE // Do not repeat textures (stretch to edge textures) });
-
Terrain excavation extraction display effect
Name Type Description options
Object Terrain excavation extraction parameters include the following attributes: Name Type Description name
String The name of the excavation area position
Array terrain excavation area height
Number Terrain Excavation Depth transparent
Boolean Whether the edge banding is transparent, default value: false extractHeight
Number Terrain excavation extraction height, default value: 100 granularity
Number Terrain excavation accuracy, the smaller the more accurate, default value: 1 Example:
viewer.scene.globe.addExtractRegion({ name:'ggg', position:positions, height:50, transparent:transparent, extractHeight:200 });
-
image cropping
Name Type Description options
Object Image cropping parameters contain the following properties: Name Type Description position
Array clipping area layers
Array Imagery layers involved in cropping name
String The name (key value) of the clipping area -
Add terrain modification area. (The 3D vector surface data is passed in, and the undulating terrain is processed into an effect consistent with the height of the 3D surface)
Name Type Description options
Object The modified area parameter object contains the following properties: Name Type Description position
Array Modify the area location information. name
String Modify the zone name. Returns:
Returns true on success and false on failure.Example:
var pts = [lon1,lat1,h1,lon2,lat2,h2,lon3,lat3,h3]; viewer.scene.globe.addModifyRegion({ name : 'test', position : pts, });
-
Clear custom clipping planes.
-
Calculate the surface area.
Name Type Description polygonGeometry
Object Objects in the polygonGeometry class, used to determine the range of area measurement ellipsoid
Ellipsoid ellipsoid. That is, the ellipsoid used when calculating the area attached to the ground, the default value is WGS84 ellipsoid slice
Number optional Split granularity. Supports user-defined granularity of polygon splitting, if not set, the granularity is set according to the range of the polygon Returns:
The area attached to the ground within the range of the PolygonGeometry objectExample:
var ellipsoid = SuperMap3D.Ellipsoid.WGS84; var area = scene.globe.computeSurfaceArea(polygonGeometry, ellipsoid, 10);
-
Calculate the distance to the ground.
Name Type Description polylineGeometry
Object Objects in the polylineGeometry class, used to determine the range of distance measurement ellipsoid
Ellipsoid ellipsoid. That is, the ellipsoid used when calculating the distance to the ground, the default value is WGS84 ellipsoid Returns:
The ground distance corresponding to the PolylineGeometry objectExample:
var ellipsoid = SuperMap3D.Ellipsoid.WGS84; var distance = scene.globe.computeSurfaceDistance(polylineGeometry,ellipsoid);
-
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyed
will result in aDeveloperError
exception. Therefore, assign the return value (undefined
) to the object as done in the example.Returns:
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
globe = globe && globe.destroy();
See:
-
-
Get the altitude corresponding to the latitude and longitude.
Name Type Description Cartographic
Number Latitude and longitude values. Returns:
height value. -
Get the slope direction of the terrain, pass in the radian coordinates, and return the result with true north as 0 degrees.
Returns:
Slope direction -
Get terrain slope value
Returns:
slope value -
Get visible slices.
Returns:
A list of objects, where the attributes of the object are x, y, level -
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyed
will result in aDeveloperError
exception.Returns:
True if this object was destroyed; otherwise, false.See:
-
pick(Ray, Scene, result) → Cartesian3|undefined
-
Get the intersection of the ray and the earth (the ray must be in 3D world coordinates).
Name Type Description Ray
Number ray, for camera testing. Scene
Object scene object. result
Cartesian3 optional Three-dimensional space coordinates, used to save the result. Returns:
If not, return the 3D space coordinates of the intersection point.Example:
// Find the intersection point with the Earth through a pixel in screen space and a ray from the camera. var ray = viewer.camera.getPickRay(windowCoordinates); var intersection = globe.pick(ray, scene);
-
Remove all excavation faces.
Example:
viewer.scene.globe.removeAllExcavationRegion();
-
Remove all excavated areas and extractions
Example:
viewer.scene.globe.removeAllExtractRegion();
-
Removes all terrain-modified areas.
Example:
viewer.scene.globe.removeAllModifyRegion();
-
Remove the current excavation area and extracted part of the terrain
Example:
viewer.scene.globe.removeExtractRegion();
-
remove cropped area
Name Type Description name
String The name (key value) of the clipping area layers
Array Imagery layers involved in cropping -
Used to remove PBR materials.
-
Add custom clipping planes.
Name Type Description options
Object The clipping plane parameter contains the following properties: Name Type Description dimensions
Cartesian3 The length, width and height of the clipping box. position
Cartesian3 The center position of the box clipping. heading
Number Clipping the heading angle of the box. pitch
Number The pitch angle of the clipping box. roll
Number The roll angle of the clipping box. clipLineColor
Color Clipping line color. Returns:
bool returns true on success and false on failure.Throws:
-
DeveloperError : options and options.dimensions and options.position are required.
-
-
Sets the terrain polygon offset scaling factor and offset constant.
Name Type Description polyOffsetFactor
Number Offset scaling factor, defaults to 0. polyOffsetUnits
Number Offset constant, defaults to 0.