The globe rendered in the scene, including its terrain (
Globe#terrainProvider)
and imagery layers (Globe#imageryLayers). Access the globe using Scene#globe.
| Name | Type | Default | Description |
|---|---|---|---|
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional Determines the size and shape of the globe. |
Members
-
baseColor : Color
-
获取地球的基础颜色(当没有影像可用时)。
-
Gets or sets the single-sided rendering state of the ball.
-
True if primitives such as billboards, polylines, labels, etc. should be depth-tested against the terrain surface, or false if such primitives should always be drawn on top of terrain unless they're on the opposite side of the globe. The disadvantage of depth testing primitives against terrain is that slight numerical noise or terrain level-of-detail switched can sometimes make a primitive that should be on the surface disappear underneath it.
-
Default Value:
false -
ellipsoid : Ellipsoid
-
Get a geometric ellipsoid object that describes the Earth.
-
Enable lighting the globe with the sun as a light source.
-
Default Value:
false -
Gets or sets the transparency of the Earth's surface.
-
Earth layering and coloring (for submerged analysis, simulation contours, topography, etc.).
See:
-
imageryLayers : ImageryLayerCollection
-
Get a collection of image layers.
-
The distance where lighting resumes. This only takes effect when
enableLightingistrue.-
Default Value:
9000000.0 -
The distance where everything becomes lit. This only takes effect when
enableLightingistrue.-
Default Value:
6500000.0 -
material : Material
-
Gets or sets the material of the earth's surface. Fabric.
-
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') -
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 -
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
terrainProviderdoes not provide a water mask.-
Default Value:
true -
Gets or sets the slope of the earth.
-
splitDirection : Cartesian2
-
Set or obtain the direction of the roller blind: horizontal roller blind (1,0) or vertical roller blind (0,1)
-
terrainProvider : TerrainProvider
-
Get or set the terrain service provider for the Earth.
-
readonlyterrainProviderChanged : Event
-
Get the event changed by the terrain service provider and trigger the event 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
Methods
-
Add a terrain excavation area.
Name Type Description optionsObject The terrain excavation parameters contain the following properties: Name Type Description positionArray Excavation area location information. nameString Excavation area name. heightString Excavate the underground depth. transparentBoolean Whether the surface is transparent. Returns:
Bool returns true if successful, and false returns if it fails.Example:
var pts = [lon1,lat1,h1,lon2,lat2,h2,lon3,lat3,h3]; viewer.scene.globe.addExcavationRegion({ name : 'test' , position : pts, height : 100, transparent : false }); -
Add a terrain modification area.
Name Type Description optionsObject The Modify Region Parameter object contains the following properties: Name Type Description positionArray Modify the location information. nameString Modify the zone name. Returns:
Returns true if successful, false returns false.Example:
var pts = [lon1,lat1,h1,lon2,lat2,h2,lon3,lat3,h3]; viewer.scene.globe.addModifyRegion({ name : 'test', position : pts, }); -
Clear the custom crop faces.
-
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 thanisDestroyedwill result in aDeveloperErrorexception. 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 height corresponding to the latitude and longitude.
Name Type Description CartographicNumber Latitude and longitude values. Returns:
Height value. -
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyedwill result in aDeveloperErrorexception.Returns:
True if this object was destroyed; otherwise, false.See:
-
pick(Ray, Scene, result) → Cartesian3|undefined
-
Obtain the intersection of the ray and the Earth (the ray must be a three-dimensional world coordinate).
Name Type Description RayNumber Ray, used for camera testing. SceneObject Scene object. resultCartesian3 optional 3D space coordinates for saving results. Returns:
If they do not intersect, return the three-dimensional coordinates of the intersection.Example:
// Find the intersection of the Earth and the Earth through a pixel of the screen space and 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 terrain modified areas.
Example:
viewer.scene.globe.removeAllModifyRegion(); -
Add a custom clipping face.
Name Type Description optionsObject The crop face parameters contain the following properties: Name Type Description dimensionsCartesian3 Cut the length and width of the box. positionCartesian3 The box cuts the center position. headingNumber Crop the heading angle of the box. pitchNumber Crop the pitch angle of the box. rollNumber Crop the roll angle of the box. clipLineColorColor Crop line color. clipModeString Crop mode, including cropping plane, cropping plane, and only retaining lines. Returns:
Bool returns true if successful, and false returns if it fails.Throws:
-
DeveloperError : options and options.dimensions and options.position are required.
-
-
Set the terrain polygon offset scale factor and offset constant.
Name Type Description polyOffsetFactorNumber Offset scaling factor, default is 0. polyOffsetUnitsNumber Offset constant, default is 0.
