English中文

Globe

new Cesium.Globe(ellipsoid)

场景中渲染的地球,包括其地形( 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.default 可选 optional 确定地球的大小和形状。 Determines the size and shape of the globe.

成员 Members

atmosphereBrightnessShift : number

适用于大气的亮度变化。默认为 0.0(无移位)。 -1.0 的亮度偏移表示完全黑暗,这将使空间显现出来。 The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). A brightness shift of -1.0 is complete darkness, which will let space show through.
默认值: Default Value: 0.0

atmosphereHueShift : number

适用于气氛的色调变化。默认为 0.0(无移位)。色调偏移 1.0 表示可用色调的完整旋转。 The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). A hue shift of 1.0 indicates a complete rotation of the hues available.
默认值: Default Value: 0.0

atmosphereLightIntensity : number

用于计算地面大气颜色的光强度。 The intensity of the light that is used for computing the ground atmosphere color.
默认值: Default Value: 10.0

atmosphereMieAnisotropy : number

米氏散射要考虑的介质的各向异性。 The anisotropy of the medium to consider for Mie scattering.

有效值介于 -1.0 和 1.0 之间。 Valid values are between -1.0 and 1.0.

默认值: Default Value: 0.9

atmosphereMieCoefficient : Cartesian3

地面大气的大气散射方程中使用的米氏散射系数。 The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
默认值: Default Value: Cartesian3(21e-6, 21e-6, 21e-6)

atmosphereMieScaleHeight : number

地面大气的大气散射方程中使用的米氏标度高度,以米为单位。 The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
默认值: Default Value: 3200.0

atmosphereRayleighCoefficient : Cartesian3

地面大气的大气散射方程中使用的瑞利散射系数。 The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
默认值: Default Value: Cartesian3(5.5e-6, 13.0e-6, 28.4e-6)

atmosphereRayleighScaleHeight : number

地面大气的大气散射方程中使用的瑞利标度高度,以米为单位。 The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
默认值: Default Value: 10000.0

atmosphereSaturationShift : number

适用于大气的饱和度偏移。默认为 0.0(无移位)。 -1.0 的饱和度偏移是单色的。 The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). A saturation shift of -1.0 is monochrome.
默认值: Default Value: 0.0

backFaceCulling : boolean

是否剔除背面地形。当相机位于地下或启用半透明时,背面不会被剔除。 Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
默认值: Default Value: true
获取或设置没有图像可用时地球仪的颜色。 Gets or sets the color of the globe when no imagery is available.

cartographicLimitRectangle : Rectangle

指定一个属性 A property specifying a Rectangle 用于将地球仪渲染限制在制图区域。默认为制图坐标的最大范围。 used to limit globe rendering to a cartographic area. Defaults to the maximum extent of cartographic coordinates.
默认值: Default Value: Rectangle.MAX_VALUE
指定一个属性 A property specifying a ClippingPlaneCollection 用于有选择地禁用每个平面外部的渲染。 used to selectively disable rendering on the outside of each plane.
指定一个属性 A property specifying a ClippingPolygonCollection 用于有选择地禁用多边形列表内部或外部的渲染。 used to selectively disable rendering inside or outside a list of polygons.

depthTestAgainstTerrain : boolean

如果广告牌、折线、标签等图元应针对地形表面进行深度测试,则为 true;如果此类图元应始终绘制在地形顶部,除非它们位于地球的另一侧,则为 false。针对地形进行深度测试图元的缺点是,轻微的数值噪声或地形细节级别切换有时会使应该位于表面上的图元消失在其下方。 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

dynamicAtmosphereLighting : boolean

对大气和雾启用动态光照效果。这仅在以下情况下生效 Enable dynamic lighting effects on atmosphere and fog. This only takes effect when enableLighting is true.
默认值: Default Value: true

dynamicAtmosphereLightingFromSun : boolean

动态氛围照明是否使用太阳方向而不是场景的光线方向。这仅在以下情况下生效 Whether dynamic atmosphere lighting uses the sun direction instead of the scene's light direction. This only takes effect when enableLighting and dynamicAtmosphereLighting are true.
默认值: Default Value: false
获取描述地球形状的椭球体。 Gets an ellipsoid describing the shape of this globe.

enableLighting : boolean

启用使用场景光源照亮地球。 Enable lighting the globe with the scene's light source.
默认值: Default Value: false
用于突出显示地形填充图块的颜色。如果未定义,则填充图块根本不会突出显示。 Alpha 值用于与图块的实际颜色进行 Alpha 混合。由于地形填充图块不代表实际的地形表面,因此在某些应用程序中以视觉方式指示它们不可信可能很有用。 The color to use to highlight terrain fill tiles. If undefined, fill tiles are not highlighted at all. The alpha value is used to alpha blend with the tile's actual color. Because terrain fill tiles do not represent the actual terrain surface, it may be useful in some applications to indicate visually that they are not to be trusted.
默认值: Default Value: undefined
获取将在此地球上渲染的图像图层的集合。 Gets the collection of image layers that will be rendered on this globe.

readonly imageryLayersUpdatedEvent : Event

获取在添加、显示、隐藏、移动或删除图像图层时引发的事件。 Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.

lambertDiffuseMultiplier : number

用于调整地形朗伯光照的乘数。该数字乘以以下结果 A multiplier to adjust terrain lambert lighting. This number is multiplied by the result of czm_getLambertDiffuse 在 GlobeFS.glsl 中。这仅在以下情况下生效 in GlobeFS.glsl. This only takes effect when enableLighting is true.
默认值: Default Value: 0.9

lightingFadeInDistance : number

照明恢复的距离。这仅在以下情况下生效 The distance where lighting resumes. This only takes effect when enableLighting or showGroundAtmosphere is true.
默认值: Default Value: pi * ellipsoid.minimumRadius

lightingFadeOutDistance : number

一切都被照亮的距离。这仅在以下情况下生效 The distance where everything becomes lit. This only takes effect when enableLighting or showGroundAtmosphere is true.
默认值: Default Value: 1/2 * pi * ellipsoid.minimumRadius

loadingDescendantLimit : number

获取或设置被视为“太多”的加载后代图块的数量。如果某个图块有太多加载后代,则该图块将在其任何后代加载和渲染之前加载和渲染。这意味着向用户提供更多关于正在发生某事的反馈,但代价是更长的总体加载时间。将其设置为 0 将导致连续加载每个图块级别,从而显着增加加载时间。将其设置为较大的数字(例如 1000)将最大限度地减少加载的图块数量,但往往会使细节在长时间等待后立即显示出来。 Gets or sets the number of loading descendant tiles that is considered "too many". If a tile has too many loading descendants, that tile will be loaded and rendered before any of its descendants are loaded and rendered. This means more feedback for the user that something is happening at the cost of a longer overall load time. Setting this to 0 will cause each tile level to be loaded successively, significantly increasing load time. Setting it to a large number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make detail appear all at once after a long wait.
默认值: Default Value: 20
获取或设置地球仪的材质外观。这可以是几个内置的之一 Gets or sets the material appearance of the Globe. This can be one of several built-in Material 对象或自定义材质,编写脚本 objects or a custom material, scripted with Fabric.

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

nightFadeInDistance : number

夜晚的黑暗从地面大气逐渐消失到未照亮的地面大气的距离。这仅在以下情况下生效 The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere. This only takes effect when showGroundAtmosphere, enableLighting, 和 , and dynamicAtmosphereLighting are true.
默认值: Default Value: 5/2 * pi * ellipsoid.minimumRadius

nightFadeOutDistance : number

夜晚的黑暗从地面大气逐渐消失到明亮的地面大气的距离。这仅在以下情况下生效 The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere. This only takes effect when showGroundAtmosphere, enableLighting, 和 , and dynamicAtmosphereLighting are true.
默认值: Default Value: 1/2 * pi * ellipsoid.minimumRadius

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

获取或设置一个值,该值指示是否应预加载渲染图块的祖先。将其设置为 true 可优化缩小体验,并在平移时在新暴露的区域中提供更多细节。缺点是它需要加载更多瓷砖。 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

获取或设置一个值,该值指示是否应预加载渲染图块的同级图块。将其设置为 true 会导致加载与渲染图块具有相同父级的图块,即使它们被剔除也是如此。将其设置为 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: false
确定地球是否投射或接收来自光源的阴影。将地球仪设置为投射阴影可能会影响性能,因为地形是从灯光的角度再次渲染的。目前,只有视野中的地形才会投射阴影。默认情况下,地球仪不投射阴影。 Determines whether the globe casts or receives shadows from light sources. 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

showGroundAtmosphere : boolean

启用地面大气,当从远处观察时,它会绘制在地球上 Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between lightingFadeInDistance and lightingFadeOutDistance.
默认值: Default Value: true when using the WGS84 ellipsoid, false otherwise

showSkirts : boolean

是否显示地形裙边。地形裙边是从瓷砖边缘向下延伸的几何形状,用于隐藏相邻瓷砖之间的接缝。当相机位于地下或启用半透明时,裙子总是隐藏的。 Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles. Skirts are always hidden when the camera is underground or translucency is enabled.
默认值: Default Value: true

showWaterEffect : boolean

如果应在地球被水覆盖的区域显示动画波浪效果,则为 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
地形提供者为这个地球提供表面几何形状。 The terrain provider providing surface geometry for this globe.

readonly terrainProviderChanged : Event

获取地形提供者更改时引发的事件 Gets an event that's raised when the terrain provider is changed

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

tileLoadProgressEvent : Event

获取当切片加载队列的长度自上一个渲染帧以来发生更改时引发的事件。当加载队列为空时,当前视图的所有地形和图像均已加载。该事件传递图块加载队列的新长度。 Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty, all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.

readonly tilesLoaded : boolean

Returns true 当瓦片加载队列为空时, when the tile load queue is empty, false 否则。当加载队列为空时,当前视图的所有地形和图像均已加载。 otherwise. When the load queue is empty, all terrain and imagery for the current view have been loaded.
用于控制球体半透明度的属性。 Properties for controlling globe translucency.
当相机位于地下或地球仪为半透明时渲染地球仪背面的颜色,根据相机的距离与地球仪颜色混合。 The color to render the back side of the globe when the camera is underground or the globe is translucent, blended with the globe color based on the camera's distance.

要禁用地下着色,请设置 To disable underground coloring, set undergroundColor to undefined.
默认值: Default Value: Color.BLACK
另见: See:

undergroundColorAlphaByDistance : NearFarScalar

获取或设置混合的近距和远距 Gets or sets the near and far distance for blending Globe#undergroundColor 与地球仪颜色。 Alpha 将在 with the globe color. The alpha will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue 当相机距离落在指定的下限和上限内时 while the camera distance falls within the lower and upper bounds of the specified NearFarScalar#near and NearFarScalar#far。在这些范围之外,alpha 仍被限制在最近的范围内。如果未定义,地下颜色将不会与地球颜色混合。 . Outside of these ranges the alpha remains clamped to the nearest bound. If undefined, the underground color will not be blended with the globe color.

当相机位于椭球体上方时,距离是从椭球体上最近的点而不是相机的位置计算的。 When the camera is above the ellipsoid the distance is computed from the nearest point on the ellipsoid instead of the camera's position.
另见: See:

vertexShadowDarkness : number

确定顶点阴影的暗度。这仅在以下情况下生效 Determines the darkness of the vertex shadow. This only takes effect when enableLighting is true.
默认值: Default Value: 0.3

方法 Methods

销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 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.
抛出: Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
示例: Example:
globe = globe && globe.destroy();
另见: See:

getHeight(cartographic)number|undefined

获取给定地图上的表面高度。 Get the height of the surface at a given cartographic.
名称 Name 类型 Type 说明 Description
cartographic Cartographic 要查找高度的地图。 The cartographic for which to find the height.
返回: Returns:
制图的高度或未定义(如果无法找到)。 The height of the cartographic or undefined if it could not be found.

isDestroyed()boolean

如果该对象被销毁则返回 true;否则为假。 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;否则为假。 True if this object was destroyed; otherwise, false.
另见: See:

pick(ray, scene, result)Cartesian3|undefined

查找光线与渲染的地球表面之间的交点。光线必须以世界坐标给出。 Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
名称 Name 类型 Type 说明 Description
ray Ray 用于测试相交的光线。 The ray to test for intersection.
scene Scene 现场。 The scene.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
交叉路口或 The intersection or undefined 如果没有找到。 if none was found.
示例: Example:
// find intersection of ray through a pixel and the globe
const ray = viewer.camera.getPickRay(windowCoordinates);
const intersection = globe.pick(ray, scene);
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.