Class/Object

cesium

Viewer

Related Docs: object Viewer | package cesium

Permalink

class Viewer extends Object

A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package. The widget can always be extended by using mixins, which add functionality useful for a variety of applications.

alias Viewer

- {Element|String} container The DOM element or ID that will contain the widget. - The options object takes the following properties - {Boolean} [options.animation=true] If set to false, the Animation widget will not be created. - {Boolean} [options.baseLayerPicker=true] If set to false, the BaseLayerPicker widget will not be created. - {Boolean} [options.fullscreenButton=true] If set to false, the FullscreenButton widget will not be created. - {Boolean} [options.vrButton=false] If set to true, the VRButton widget will be created. - {Boolean} [options.geocoder=true] If set to false, the Geocoder widget will not be created. - {Boolean} [options.homeButton=true] If set to false, the HomeButton widget will not be created. - {Boolean} [options.infoBox=true] If set to false, the InfoBox widget will not be created. - {Boolean} [options.sceneModePicker=true] If set to false, the SceneModePicker widget will not be created. - {Boolean} [options.selectionIndicator=true] If set to false, the SelectionIndicator widget will not be created. - {Boolean} [options.timeline=true] If set to false, the Timeline widget will not be created. - {Boolean} [options.navigationHelpButton=true] If set to false, the navigation help button will not be created. - {Boolean} [options.navigationInstructionsInitiallyVisible=true] True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button. - {Boolean} [options.scene3DOnly=false] When true, each geometry instance will only be rendered in 3D to save GPU memory. - {Clock} [options.clock=new Clock()] The clock to use to control current time. - {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if options.baseLayerPicker is set to true. - {ProviderViewModel[]} [options.imageryProviderViewModels=createDefaultImageryProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if options.baseLayerPicker is set to true. - {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if options.baseLayerPicker is set to true. - {ProviderViewModel[]} [options.terrainProviderViewModels=createDefaultTerrainProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if options.baseLayerPicker is set to true. - {ImageryProvider} [options.imageryProvider=new BingMapsImageryProvider()] The imagery provider to use. This value is only valid if options.baseLayerPicker is set to false. - {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider()] The terrain provider to use - {SkyBox} [options.skyBox] The skybox used to render the stars. When undefined, the default stars are used. - {SkyAtmosphere} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false to turn it off. - {Element|String} [options.fullscreenElement=document.body] The element or id to be placed into fullscreen mode when the full screen button is pressed. - {Boolean} [options.useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise. - {Number} [options.targetFrameRate] The target frame rate when using the default render loop. - {Boolean} [options.showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. - {Boolean} [options.automaticallyTrackDataSourceClocks=true] If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently. - {Object} [options.contextOptions] Context and WebGL creation properties corresponding to options passed to Scene - {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode. - {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. - {Globe} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to false, no globe will be added. - {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. - {Element|String} [options.creditContainer] The DOM element or ID that will contain the CreditDisplay If not specified, the credits are added to the bottom of the widget itself. - {DataSourceCollection} [options.dataSources=new DataSourceCollection()] The collection of data sources visualized by the widget. If this parameter is provided, the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed. - {Number} [options.terrainExaggeration=1.0] A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.

exception {DeveloperError} Element with id "container" does not exist in the document. exception {DeveloperError} options.imageryProvider is not available when using the BaseLayerPicker widget, specify options.selectedImageryProviderViewModel instead. exception {DeveloperError} options.terrainProvider is not available when using the BaseLayerPicker widget, specify options.selectedTerrainProviderViewModel instead. exception {DeveloperError} options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.imageryProvider instead. exception {DeveloperError} options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.terrainProvider instead.

Annotations
@RawJSType() @native() @JSName( "Cesium.Viewer" )
Example:
  1. //Initialize the viewer widget with several custom options and mixins. var viewer = new Cesium.Viewer('cesiumContainer', { //Start in Columbus Viewer sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, //Use standard Cesium terrain terrainProvider : new Cesium.CesiumTerrainProvider({ url : 'https://assets.agi.com/stk-terrain/world' }), //Hide the base layer picker baseLayerPicker : false, //Use OpenStreetMaps imageryProvider : Cesium.createOpenStreetMapImageryProvider({ url : 'https://a.tile.openstreetmap.org/' }), // Use high-res stars downloaded from https://github.com/AnalyticalGraphicsInc/cesium-assets skyBox : new Cesium.SkyBox({ sources : { positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' } }), // Show Columbus View map with Web Mercator projection mapProjection : new Cesium.WebMercatorProjection() }); //Add basic drag and drop functionality viewer.extend(Cesium.viewerDragDropMixin); //Show a pop-up alert if we encounter an error when processing a dropped file viewer.dropError.addEventListener(function(dropHandler, name, error) { console.log(error); window.alert(error); });

See also

viewerDragDropMixin demo Sandcastle Hello World Demo

Timeline

SceneModePicker

HomeButton

FullscreenButton

CesiumWidget

BaseLayerPicker

Animation

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Viewer
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Viewer(container: |[Element, String], options: ViewerOptions = ???)

    Permalink
  2. new Viewer()

    Permalink
    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. var allowDataSourcesToSuspendAnimation: Boolean

    Permalink
  5. var animation: Animation

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. var baseLayerPicker: BaseLayerPicker

    Permalink
  8. var bottomContainer: Element

    Permalink
  9. var camera: Camera

    Permalink
  10. var canvas: HTMLCanvasElement

    Permalink
  11. var cesiumLogo: Element

    Permalink
  12. var cesiumWidget: CesiumWidget

    Permalink
  13. var clock: Clock

    Permalink
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. var container: Element

    Permalink
  16. var dataSourceDisplay: DataSourceDisplay

    Permalink
  17. var dataSources: DataSourceCollection

    Permalink
  18. def destroy(): Dynamic

    Permalink
  19. var entities: EntityCollection

    Permalink
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def extend(mixin: ViewerMixin, options: Any = ???): Dynamic

    Permalink
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def flyTo(target: |[|[|[|[|[Entity, Array[Entity]], EntityCollection], DataSource], ImageryLayer], Promise[|[|[|[|[Entity, Array[Entity]], EntityCollection], DataSource], ImageryLayer]]], options: ViewerFlyToOptions = ???): Promise[Boolean]

    Permalink
  25. def forceResize(): Dynamic

    Permalink
  26. var fullscreenButton: FullscreenButton

    Permalink
  27. var geocoder: Geocoder

    Permalink
  28. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  29. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. var homeButton: HomeButton

    Permalink
  32. var imageryLayers: ImageryLayerCollection

    Permalink
  33. var infoBox: InfoBox

    Permalink
  34. def isDestroyed(): Boolean

    Permalink
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  37. var navigationHelpButton: NavigationHelpButton

    Permalink
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  42. def render(): Dynamic

    Permalink
  43. def resize(): Dynamic

    Permalink
  44. var resolutionScale: Double

    Permalink
  45. var rotatable2D: Boolean

    Permalink
  46. var scene: Scene

    Permalink
  47. var sceneModePicker: SceneModePicker

    Permalink
  48. var screenSpaceEventHandler: ScreenSpaceEventHandler

    Permalink
  49. var selectedEntity: Entity

    Permalink
  50. var selectionIndicator: SelectionIndicator

    Permalink
  51. var shadowMap: ShadowMap

    Permalink
  52. var shadows: Boolean

    Permalink
  53. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  54. var targetFrameRate: Double

    Permalink
  55. var terrainProvider: TerrainProvider

    Permalink
  56. var terrainShadows: Int

    Permalink
  57. var timeline: Timeline

    Permalink
  58. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  59. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  60. var trackedEntity: Entity

    Permalink
  61. var useDefaultRenderLoop: Boolean

    Permalink
  62. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  63. var vrButton: VRButton

    Permalink
  64. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. def zoomTo(target: |[|[|[|[|[Entity, Array[Entity]], EntityCollection], DataSource], ImageryLayer], Promise[|[|[|[|[Entity, Array[Entity]], EntityCollection], DataSource], ImageryLayer]]], offset: HeadingPitchRange = ???): Promise[Boolean]

    Permalink

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped