Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CView

基于Cesium Viewer的视图

export
implements

{IMap}

Hierarchy

  • Viewer
    • CView

Implements

Index

Constructors

  • 构建CView

    memberof

    CView

    Parameters

    • container: string | Element

      容器对象

    • Optional options: ICViewOptions

    Returns CView

Properties

allowDataSourcesToSuspendAnimation: boolean

Gets or sets whether or not data sources can temporarily pause animation in order to avoid showing an incomplete picture to the user. For example, if asynchronous primitives are being processed in the background, the clock will not advance until the geometry is ready.

animation: Animation

Gets the Animation widget.

baseLayerPicker: BaseLayerPicker

Gets the BaseLayerPicker.

baseMapLayers: PrimitiveCollection

背景图层容器

memberof

CView

bottomContainer: Element

Gets the DOM element for the area at the bottom of the window containing the {@link CreditDisplay} and potentially other things.

camera: Camera

Gets the camera.

cameraHeightChanged: Event

摄像机高度发生显著变化(超过10000米)的事件

memberof

CView

canvas: HTMLCanvasElement

Gets the canvas.

cesiumWidget: CesiumWidget

Gets the CesiumWidget.

clock: Clock

Gets the clock.

clockTrackedDataSource: DataSource

Gets or sets the data source to track with the viewer's clock.

clockViewModel: ClockViewModel

Gets the clock view model.

container: Element

Gets the parent container.

contourLayers: PrimitiveCollection

等值线图层容器

memberof

CView

dataSourceDisplay: DataSourceDisplay

Gets the display used for {@link DataSource} visualization.

dataSources: DataSourceCollection

Gets the set of {@link DataSource} instances to be visualized.

entities: EntityCollection

Gets the collection of entities not tied to a particular data source. This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.

featureLayers: PrimitiveCollection

站点图层容器

memberof

CView

fullscreenButton: FullscreenButton

Gets the FullscreenButton.

geocoder: Geocoder

Gets the Geocoder.

gridLayers: PrimitiveCollection

栅格图层容器

memberof

CView

groundLayers: PrimitiveCollection

地表图层容器

memberof

CView

homeButton: HomeButton

Gets the HomeButton.

imageryLayers: ImageryLayerCollection

Gets the collection of image layers that will be rendered on the globe.

infoBox: InfoBox

Gets the info box.

markerLayers: PrimitiveCollection

标签图层容器

memberof

CView

navigationHelpButton: NavigationHelpButton

Gets the NavigationHelpButton.

postProcessStages: PostProcessStageCollection

Gets the post-process stages.

projectionPicker: ProjectionPicker

Gets the ProjectionPicker.

resolutionScale: number

Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve performance on less powerful devices while values greater than 1.0 will render at a higher resolution and then scale down, resulting in improved visual fidelity. For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 will cause the scene to be rendered at 320x240 and then scaled up while setting it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.

scene: Scene

Gets the scene.

sceneModePicker: SceneModePicker

Gets the SceneModePicker.

screenSpaceEventHandler: ScreenSpaceEventHandler

Gets the screen space event handler.

selectedEntity: Entity

Gets or sets the object instance for which to display a selection indicator.

If a user interactively picks a Cesium3DTilesFeature instance, then this property will contain a transient Entity instance with a property named "feature" that is the instance that was picked.

selectedEntityChanged: Event

Gets the event that is raised when the selected entity changes.

selectionIndicator: SelectionIndicator

Gets the selection indicator.

shadowMap: ShadowMap

Get the scene's shadow map

shadows: boolean

Determines if shadows are cast by light sources.

targetFrameRate: number

Gets or sets the target frame rate of the widget when useDefaultRenderLoop is true. If undefined, the browser's {@link requestAnimationFrame} implementation determines the frame rate. If defined, this value must be greater than 0. A value higher than the underlying requestAnimationFrame implementation will have no effect.

terrainProvider: TerrainProvider

The terrain provider providing surface geometry for the globe.

terrainShadows: ShadowMode

Determines if the terrain casts or shadows from light sources.

timeline: Timeline

Gets the Timeline widget.

toolService: MapToolService

地图上用于绘制的工具服务

topMapLayers: PrimitiveCollection

顶层地图容器

memberof

CView

topMostLayers: PrimitiveCollection

顶层图层容器

memberof

CView

trackedEntity: Entity

Gets or sets the Entity instance currently being tracked by the camera.

trackedEntityChanged: Event

Gets the event that is raised when the tracked entity changes.

useBrowserRecommendedResolution: boolean

Boolean flag indicating if the browser's recommended resolution is used. If true, the browser's device pixel ratio is ignored and 1.0 is used instead, effectively rendering based on CSS pixels instead of device pixels. This can improve performance on less powerful devices that have high pixel density. When false, rendering will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether this flag is true or false.

useDefaultRenderLoop: boolean

Gets or sets whether or not this widget should control the render loop. If set to true the widget will use {@link requestAnimationFrame} to perform rendering and resizing of the widget, as well as drive the simulation clock. If set to false, you must manually call the resize, render methods as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s renderError event will be raised and this property will be set to false. It must be set back to true to continue rendering after the error.

vrButton: VRButton

Gets the VRButton.

DefaultOptions: ICViewOptions = ...

默认参数

static
memberof

CView

Accessors

  • get cameraHeight(): number
  • Returns number

Methods

  • destroy(): void
  • Destroys the widget. Should be called if permanently removing the widget from layout.

    Returns void

  • extend(mixin: ViewerMixin, options?: any): void
  • Extends the base viewer functionality with the provided mixin. A mixin may add additional properties, functions, or other behavior to the provided viewer instance.

    Parameters

    • mixin: ViewerMixin

      The Viewer mixin to add to this instance.

    • Optional options: any

    Returns void

  • flyTo(target: EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: { duration?: number; maximumHeight?: number; offset?: HeadingPitchRange }): Promise<boolean>
  • Flies the camera to the provided entity, entities, or data source. If the data source is still in the process of loading or the visualization is otherwise still loading, this method waits for the data to be ready before performing the flight.

    The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. The heading and the pitch angles are defined in the local east-north-up reference frame. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is zero, a range will be computed such that the whole bounding sphere is visible.

    In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the target will be the range. The heading will be determined from the offset. If the heading cannot be determined from the offset, the heading will be north.

    Parameters

    • target: EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>

      The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.

    • Optional options: { duration?: number; maximumHeight?: number; offset?: HeadingPitchRange }
      • Optional duration?: number
      • Optional maximumHeight?: number
      • Optional offset?: HeadingPitchRange

    Returns Promise<boolean>

    A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions

  • forceResize(): void
  • This forces the widget to re-think its layout, including widget sizes and credit placement.

    Returns void

  • getCameraHeight(): number
  • Returns number

  • goto(lon: number, lat: number, height?: number, options?: { duration?: number; easing?: Callback; heading?: number; pitch?: number }): Promise<void>
  • async版本的camera.flyTo,简化了传值方式

    Parameters

    • lon: number

      经度

    • lat: number

      纬度

    • Optional height: number

      高度,单位是米

    • Optional options: { duration?: number; easing?: Callback; heading?: number; pitch?: number }
      • Optional duration?: number
      • Optional easing?: Callback
      • Optional heading?: number
      • Optional pitch?: number

    Returns Promise<void>

  • isDestroyed(): boolean
  • Returns boolean

    true if the object has been destroyed, false otherwise.

  • lookAt(lon: number, lat: number, height?: number, options?: { heading?: number; pitch?: number }): void
  • Parameters

    • lon: number
    • lat: number
    • Optional height: number
    • Optional options: { heading?: number; pitch?: number }
      • Optional heading?: number
      • Optional pitch?: number

    Returns void

  • render(): void
  • Renders the scene. This function is called automatically unless useDefaultRenderLoop is set to false;

    Returns void

  • resize(): void
  • Resizes the widget to match the container size. This function is called automatically as needed unless useDefaultRenderLoop is set to false.

    Returns void

  • zoomTo(target: EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>
  • Asynchronously sets the camera to view the provided entity, entities, or data source. If the data source is still in the process of loading or the visualization is otherwise still loading, this method waits for the data to be ready before performing the zoom.

    The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. The heading and the pitch angles are defined in the local east-north-up reference frame. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is zero, a range will be computed such that the whole bounding sphere is visible.

    In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the target will be the range. The heading will be determined from the offset. If the heading cannot be determined from the offset, the heading will be north.

    Parameters

    • target: EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<EntityCollection | Entity | DataSource | Entity[] | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>

      The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.

    • Optional offset: HeadingPitchRange

    Returns Promise<boolean>

    A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled.

Generated using TypeDoc