Globe

new SuperMap3D.Globe(ellipsoid)

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).

clippingType : Number

Sets the type of terrain clipping (excavation). The default is to excavate the interior area.
Default Value: ClippingType.KeepOutside

cullEnabled : Boolean

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).

depthTestAgainstTerrain : Boolean

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.

enableLighting : Boolean

Enable lighting the globe with the sun as a light source.
Default Value: false

excavationBottomTextureUrl : String

It is used for terrain excavation texture setting and bottom surface texture path. If set to undefined or null, no texture is used.

excavationSideTextureUrl : String

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.

globeAlpha : Number

Gets or sets the transparency of the Earth's surface.

HypsometricSetting : Object

Layered coloring of the earth (used for inundation analysis, simulating contour lines, terrain trends, etc.).
See:

imageryLayers : ImageryLayerCollection

Get a collection of imagery layers.

imageryLodTolerance : Number

Image switching fine layer must be greater than the number of blocks
Default Value: 16

lightingFadeInDistance : Number

The distance where lighting resumes. This only takes effect when enableLighting is true.
Default Value: 9000000.0

lightingFadeOutDistance : Number

The distance where everything becomes lit. This only takes effect when enableLighting is true.
Default Value: 6500000.0

material : Material

Get or set the material of the earth's surface.

maximumScreenSpaceError : Number

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

oceanNormalMapUrl : String

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')

preloadAncestors : Boolean

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

preloadSiblings : Boolean

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

show : Boolean

Determines if the globe will be shown.
Default Value: true

showExcavationSide : boolean

Whether to display the side of the excavated terrain, the default is true.
Default Value: true

showWaterEffect : Boolean

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

SlopeSetting : Object

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

swipeEnabled : Boolean

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.

tileCacheSize : Number

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

tileCacheSizeForMVT : Number

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

addExcavationRegion(options)Boolean

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)
            });

addExtractRegion(options)

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
 });

addImageryClipRegions(options)

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

addModifyRegion(options)Boolean

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,
			});

clearCustomClipBox()

Clear custom clipping planes.

computeSurfaceArea(polygonGeometry, ellipsoid, slice)number

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 object
Example:
var ellipsoid = SuperMap3D.Ellipsoid.WGS84;
var area = scene.globe.computeSurfaceArea(polygonGeometry, ellipsoid, 10);

computeSurfaceDistance(polylineGeometry, ellipsoid)number

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 object
Example:
var ellipsoid = SuperMap3D.Ellipsoid.WGS84;
var distance = scene.globe.computeSurfaceDistance(polylineGeometry,ellipsoid);

destroy()undefined

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 than isDestroyed will result in a DeveloperError 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:

getHeight(Cartographic)Number|undefined

Get the altitude corresponding to the latitude and longitude.
Name Type Description
Cartographic Number Latitude and longitude values.
Returns:
height value.

getSlopeDirectionValue()slopeDirection

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

getSlopeValue()slopeValue

Get terrain slope value
Returns:
slope value

getVisibleTiles()Array

Get visible slices.
Returns:
A list of objects, where the attributes of the object are x, y, level

isDestroyed()Boolean

Returns true if this object was destroyed; otherwise, false.

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError 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);

removeAllExcavationRegion()

Remove all excavation faces.
Example:
viewer.scene.globe.removeAllExcavationRegion();

removeAllExtractRegion()

Remove all excavated areas and extractions
Example:
viewer.scene.globe.removeAllExtractRegion();

removeAllModifyRegion()

Removes all terrain-modified areas.
Example:
viewer.scene.globe.removeAllModifyRegion();

removeExtractRegion()

Remove the current excavation area and extracted part of the terrain
Example:
viewer.scene.globe.removeExtractRegion();

removeImageryClipRegion(name, layers)

remove cropped area
Name Type Description
name String The name (key value) of the clipping area
layers Array Imagery layers involved in cropping

removePBRMaterial()

Used to remove PBR materials.

setCustomClipBox(options)Boolean

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.

setPolygonOffset(polyOffsetFactor, polyOffsetUnits)

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.