Animation widget
The view model for the Animation widget.
The view model for the Animation widget. alias AnimationViewModel
- {ClockViewModel} clockViewModel The ClockViewModel instance to use.
Animation
An appearance defines the full GLSL vertex and fragment shaders and the
render state used to draw a Primitive All appearances implement
this base Appearance
interface.
An appearance defines the full GLSL vertex and fragment shaders and the
render state used to draw a Primitive All appearances implement
this base Appearance
interface.
alias Appearance
- The options object takes the following properties
- {Boolean} [options.translucent=true] When true
, the geometry is expected to appear translucent so Appearance#renderState has alpha blending enabled.
- {Boolean} [options.closed=false] When true
, the geometry is expected to be closed so Appearance#renderState has backface culling enabled.
- {Material} [options.material=Material.ColorType] The material used to determine the fragment color.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
PolylineMaterialAppearance demo and Appearances Demo
PolylineColorAppearance
DebugAppearance
PerInstanceColorAppearance
EllipsoidSurfaceAppearance
MaterialAppearance
A TerrainProvider that produces terrain geometry by tessellating height maps retrieved from an ArcGIS ImageServer.
A TerrainProvider that produces terrain geometry by tessellating height maps retrieved from an ArcGIS ImageServer.
alias ArcGisImageServerTerrainProvider
- The options object takes the following properties - {String} options.url The URL of the ArcGIS ImageServer service. - {String} [options.token] The authorization token to use to connect to the service. - {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed. - {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the terrain is broken into tiles. If this parameter is not provided, a GeographicTilingScheme is used. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used. - {Credit|String} [options.credit] The credit, which will is displayed on the canvas.
var terrainProvider = new Cesium.ArcGisImageServerTerrainProvider({ url : 'https://elevation.arcgisonline.com/ArcGIS/rest/services/WorldElevation/DTMEllipsoidal/ImageServer', token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..', proxy : new Cesium.DefaultProxy('/terrain/') }); viewer.terrainProvider = terrainProvider;
TerrainProvider
Provides tiled imagery hosted by an ArcGIS MapServer.
Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are used, if available.
alias ArcGisMapServerImageryProvider
- The options object takes the following properties - {String} options.url The URL of the ArcGIS MapServer service. - {String} [options.token] The ArcGIS token used to authenticate with the ArcGIS MapServer service. - {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile is invalid and should be discarded. If this value is not specified, a default DiscardMissingTileImagePolicy is used for tiled map servers, and a NeverTileDiscardPolicy is used for non-tiled map servers. In the former case, we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200), (80,110), and (160, 130). If all of these pixels are transparent, the discard check is disabled and no tiles are discarded. If any of them have a non-transparent color, any tile that has the same values in these pixel locations is discarded. The end result of these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure that no tiles are discarded, construct and pass a NeverTileDiscardPolicy for this parameter. - {Proxy} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed. - {Boolean} [options.usePreCachedTilesIfAvailable=true] If true, the server's pre-cached tiles are used if they are available. If false, any pre-cached tiles are ignored and the 'export' service is used. - {String} [options.layers] A comma-separated list of the layers to show, or undefined if all layers should be shown. - {Boolean} [options.enablePickFeatures=true] If true, ArcGisMapServerImageryProvider#pickFeatures will invoke the Identify service on the MapServer and return the features included in the response. If false, ArcGisMapServerImageryProvider#pickFeatures will immediately return undefined (indicating no pickable features) without communicating with the server. Set this property to false if you don't want this provider's features to be pickable. Can be overridden by setting the ArcGisMapServerImageryProvider#enablePickFeatures property on the object. - {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. This parameter is ignored when accessing a tiled layer. - {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles. This parameter is ignored when accessing a tiled server. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified and used, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used. - {Number} [options.tileWidth=256] The width of each tile in pixels. This parameter is ignored when accessing a tiled server. - {Number} [options.tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server. - {Number} [options.maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing a tiled server.
var esri = new Cesium.ArcGisMapServerImageryProvider({ url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' });
UrlTemplateImageryProvider
WebMapTileServiceImageryProvider
WebMapServiceImageryProvider
createTileMapServiceImageryProvider
SingleTileImageryProvider
createOpenStreetMapImageryProvider
GoogleEarthImageryProvider
BingMapsImageryProvider
A collection of key-value pairs that is stored as a hash for easy lookup but also provides an array for fast iteration.
A collection of key-value pairs that is stored as a hash for easy lookup but also provides an array for fast iteration. alias AssociativeArray
Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes. alias AxisAlignedBoundingBox
- {Cartesian3} [minimum=Cartesian3.ZERO] The minimum point along the x, y, and z axes. - {Cartesian3} [maximum=Cartesian3.ZERO] The maximum point along the x, y, and z axes. - {Cartesian3} [center] The center of the box; automatically computed if not supplied.
BoundingRectangle
BoundingSphere
BaseLayerPicker with its drop-panel open.
BaseLayerPicker with its drop-panel open.
The BaseLayerPicker is a single button widget that displays a panel of available imagery and terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted as the base layer of the imagery collection; removing the existing base. When terrain is selected, it replaces the current terrain provider. Each item in the available providers list contains a name, a representative icon, and a tooltip to display more information when hovered. The list is initially empty, and must be configured before use, as illustrated in the below example.
alias BaseLayerPicker.
- {Element|String} container The parent HTML container node or ID for this widget. - The options object takes the following properties - {Globe} options.globe The Globe to use. - {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery. - {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used. - {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain. - {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
exception {DeveloperError} Element with id "container" does not exist in the document.
// In HTML head, include a link to the BaseLayerPicker.css stylesheet, // and in the body, include: //Create the list of available providers we would like the user to select from. //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image. var imageryViewModels = []; imageryViewModels.push(new Cesium.ProviderViewModel({ name : 'OpenStreetMap', iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'), tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \ map of the world.\nhttp://www.openstreetmap.org', creationFunction : function() { return Cesium.createOpenStreetMapImageryProvider({ url : 'https://a.tile.openstreetmap.org/' }); } })); imageryViewModels.push(new Cesium.ProviderViewModel({ name : 'Black Marble', iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'), tooltip : 'The lights of cities and villages trace the outlines of civilization \ in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.', creationFunction : function() { return Cesium.createTileMapServiceImageryProvider({ url : 'https://cesiumjs.org/blackmarble', credit : 'Black Marble imagery courtesy NASA Earth Observatory', flipXY : true }); } })); imageryViewModels.push(new Cesium.ProviderViewModel({ name : 'Natural Earth II', iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'), tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/', creationFunction : function() { return Cesium.createTileMapServiceImageryProvider({ url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') }); } })); //Create a CesiumWidget without imagery, if you haven't already done so. var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false }); //Finally, create the baseLayerPicker widget using our view models. var layers = cesiumWidget.imageryLayers; var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', { globe : cesiumWidget.scene.globe, imageryProviderViewModels : imageryViewModels });
ImageryLayerCollection
ImageryProvider
TerrainProvider
The view model for BaseLayerPicker alias BaseLayerPickerViewModel
The view model for BaseLayerPicker alias BaseLayerPickerViewModel
- The options object takes the following properties - {Globe} options.globe The Globe to use. - {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery. - {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used. - {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain. - {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
exception {DeveloperError} imageryProviderViewModels must be an array. exception {DeveloperError} terrainProviderViewModels must be an array.
A viewport-aligned image positioned in the 3D scene, that is created and rendered using a BillboardCollection A billboard is created and its initial properties are set by calling BillboardCollection#add
A viewport-aligned image positioned in the 3D scene, that is created and rendered using a BillboardCollection A billboard is created and its initial properties are set by calling BillboardCollection#add
Example billboards
alias Billboard
performance Reading a property, e.g., Billboard#show, is constant time. Assigning to a property is constant time but results in CPU to GPU traffic when BillboardCollection#update is called. The per-billboard traffic is the same regardless of how many properties were updated. If most billboards in a collection need to be updated, it may be more efficient to clear the collection with BillboardCollection#removeAll and add new billboards instead of modifying each one.
exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near exception {DeveloperError} pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near
Label demo Sandcastle Billboard Demo
BillboardCollection#add
BillboardCollection
A renderable collection of billboards.
A renderable collection of billboards. Billboards are viewport-aligned images positioned in the 3D scene.
Example billboards
Billboards are added and removed from the collection using BillboardCollection#add and BillboardCollection#remove Billboards in a collection automatically share textures for images with the same identifier.
alias BillboardCollection
- The options object takes the following properties - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each billboard from model to world coordinates. - {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. - {Scene} [options.scene] Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
performance For best performance, prefer a few collections, each with many billboards, to many collections with only a few billboards each. Organize collections so that billboards with the same update frequency are in the same collection, i.e., billboards that do not change should be in one collection; billboards that change every frame should be in another collection; and so on.
// Create a billboard collection with two billboards var billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ position : new Cesium.Cartesian3(1.0, 2.0, 3.0), image : 'url/to/image' }); billboards.add({ position : new Cesium.Cartesian3(4.0, 5.0, 6.0), image : 'url/to/another/image' });
LabelCollection demo Sandcastle Billboard Demo
Billboard
BillboardCollection#remove
BillboardCollection#add
Describes a two dimensional icon located at the position of the containing Entity.
Describes a two dimensional icon located at the position of the containing Entity.
Example billboards
alias BillboardGraphics
- The options object takes the following properties - {Property} [options.image] A Property specifying the Image, URI, or Canvas to use for the billboard. - {Property} [options.show=true] A boolean Property specifying the visibility of the billboard. - {Property} [options.scale=1.0] A numeric Property specifying the scale to apply to the image size. - {Property} [options.horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the HorizontalOrigin. - {Property} [options.verticalOrigin=VerticalOrigin.CENTER] A Property specifying the VerticalOrigin. - {Property} [options.eyeOffset=Cartesian3.ZERO] A Cartesian3 Property specifying the eye offset. - {Property} [options.pixelOffset=Cartesian2.ZERO] A Cartesian2 Property specifying the pixel offset. - {Property} [options.rotation=0] A numeric Property specifying the rotation about the alignedAxis. - {Property} [options.alignedAxis=Cartesian3.ZERO] A Cartesian3 Property specifying the axis of rotation. - {Property} [options.width] A numeric Property specifying the width of the billboard in pixels, overriding the native size. - {Property} [options.height] A numeric Property specifying the height of the billboard in pixels, overriding the native size. - {Property} [options.color=Color.WHITE] A Property specifying the tint Color of the image. - {Property} [options.scaleByDistance] A NearFarScalar Property used to scale the point based on distance from the camera. - {Property} [options.translucencyByDistance] A NearFarScalar Property used to set translucency based on distance from the camera. - {Property} [options.pixelOffsetScaleByDistance] A NearFarScalar Property used to set pixelOffset based on distance from the camera. - {Property} [options.imageSubRegion] A Property specifying a BoundingRectangle that defines a sub-region of the image to use for the billboard, rather than the entire image. - {Property} [options.sizeInMeters] A boolean Property specifying whether this billboard's size should be measured in meters.
A Visualizer which maps Entity#billboard to a Billboard alias BillboardVisualizer
A Visualizer which maps Entity#billboard to a Billboard alias BillboardVisualizer
- {Scene} scene The scene the primitives will be rendered in. - {EntityCollection} entityCollection The entityCollection to visualize.
Provides tiled imagery using the Bing Maps Imagery REST API.
Provides tiled imagery using the Bing Maps Imagery REST API.
alias BingMapsImageryProvider
- The options object takes the following properties - {String} options.url The url of the Bing Maps server hosting the imagery. - {String} [options.key] The Bing Maps key for your application, which can be created at https://www.bingmapsportal.com/ If this parameter is not provided, BingMapsApi.defaultKey is used. If BingMapsApi.defaultKey is undefined as well, a message is written to the console reminding you that you must create and supply a Bing Maps key as soon as possible. Please do not deploy an application that uses Bing Maps imagery without creating a separate key for your application. - {String} [options.tileProtocol] The protocol to use when loading tiles, e.g. 'http:' or 'https:'. By default, tiles are loaded using the same protocol as the page. - {String} [options.mapStyle=BingMapsStyle.AERIAL] The type of Bing Maps imagery to load. - {String} [options.culture= ] The culture to use when requesting Bing Maps imagery. Not all cultures are supported. See for information on the supported cultures. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile is invalid and should be discarded. If this value is not specified, a default DiscardMissingTileImagePolicy is used which requests tile 0,0 at the maximum tile level and checks pixels (0,0), (120,140), (130,160), (200,50), and (200,200). If all of these pixels are transparent, the discard check is disabled and no tiles are discarded. If any of them have a non-transparent color, any tile that has the same values in these pixel locations is discarded. The end result of these defaults should be correct tile discarding for a standard Bing Maps server. To ensure that no tiles are discarded, construct and pass a NeverTileDiscardPolicy for this parameter. - {Proxy} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed.
var bing = new Cesium.BingMapsImageryProvider({ url : 'https://dev.virtualearth.net', key : 'get-yours-at-https://www.bingmapsportal.com/', mapStyle : Cesium.BingMapsStyle.AERIAL });
UrlTemplateImageryProvider
WebMapTileServiceImageryProvider
WebMapServiceImageryProvider
createTileMapServiceImageryProvider
SingleTileImageryProvider
createOpenStreetMapImageryProvider
GoogleEarthImageryProvider
ArcGisMapServerImageryProvider
A bounding rectangle given by a corner, width and height.
A bounding rectangle given by a corner, width and height. alias BoundingRectangle
- {Number} [x=0.0] The x coordinate of the rectangle. - {Number} [y=0.0] The y coordinate of the rectangle. - {Number} [width=0.0] The width of the rectangle. - {Number} [height=0.0] The height of the rectangle.
BoundingSphere
A bounding sphere with a center and a radius.
A bounding sphere with a center and a radius. alias BoundingSphere
- {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere. - {Number} [radius=0.0] The radius of the bounding sphere.
Packable
BoundingRectangle
AxisAlignedBoundingBox
Describes a cube centered at the origin.
Describes a cube centered at the origin.
alias BoxGeometry
- The options object takes the following properties - {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box. - {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
var box = new Cesium.BoxGeometry({ vertexFormat : Cesium.VertexFormat.POSITION_ONLY, maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) }); var geometry = Cesium.BoxGeometry.createGeometry(box);
Packable demo Sandcastle Box Demo
BoxGeometry.createGeometry
BoxGeometry.fromDimensions
A GeometryUpdater for boxes.
A GeometryUpdater for boxes. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias BoxGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes a box.
Describes a box. The center position and orientation are determined by the containing Entity
alias BoxGraphics
- The options object takes the following properties - {Property} [options.dimensions] A Cartesian3 Property specifying the length, width, and height of the box. - {Property} [options.show=true] A boolean Property specifying the visibility of the box. - {Property} [options.fill=true] A boolean Property specifying whether the box is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the box. - {Property} [options.outline=false] A boolean Property specifying whether the box is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline.
demo Sandcastle Box Demo
A description of the outline of a cube centered at the origin.
A description of the outline of a cube centered at the origin.
alias BoxOutlineGeometry
- The options object takes the following properties - {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box. - {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
var box = new Cesium.BoxOutlineGeometry({ maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) }); var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
Packable
BoxOutlineGeometry.createGeometry
BoxOutlineGeometry.fromDimensions
A Property whose value is lazily evaluated by a callback function.
A Property whose value is lazily evaluated by a callback function.
alias CallbackProperty
- {CallbackProperty~Callback]] callback The function to be called when the property is evaluated.
- {Boolean]] isConstant true
when the callback function returns the same value every time, false
if the value will change.
The camera is defined by a position, orientation, and view frustum.
The camera is defined by a position, orientation, and view frustum.
The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.
alias Camera
- {Scene} scene The scene.
demo Sandcastle Camera Demo
demo Example from the
// Create a camera looking down the negative z-axis, positioned at the origin,
// with a field of view of 60 degrees, and 1:1 aspect ratio.
var camera = new Cesium.Camera(scene);
camera.position = new Cesium.Cartesian3();
camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
camera.frustum.near = 1.0;
camera.frustum.far = 2.0;
Aggregates input events.
Aggregates input events. For example, suppose the following inputs are received between frames: left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into one event with a start and end position of the mouse.
alias CameraEventAggregator
- {Canvas} [element=document] The element to handle events for.
ScreenSpaceEventHandler
A 2D Cartesian point.
A 2D Cartesian point. alias Cartesian2
- {Number} [x=0.0] The X component. - {Number} [y=0.0] The Y component.
Packable
Cartesian4
Cartesian3
A 3D Cartesian point.
A 3D Cartesian point. alias Cartesian3
- {Number} [x=0.0] The X component. - {Number} [y=0.0] The Y component. - {Number} [z=0.0] The Z component.
Packable
Cartesian4
Cartesian2
A 4D Cartesian point.
A 4D Cartesian point. alias Cartesian4
- {Number} [x=0.0] The X component. - {Number} [y=0.0] The Y component. - {Number} [z=0.0] The Z component. - {Number} [w=0.0] The W component.
Packable
Cartesian3
Cartesian2
A position defined by longitude, latitude, and height.
A position defined by longitude, latitude, and height. alias Cartographic
- {Number} [longitude=0.0] The longitude, in radians. - {Number} [latitude=0.0] The latitude, in radians. - {Number} [height=0.0] The height, in meters, above the ellipsoid.
Ellipsoid
A Catmull-Rom spline is a cubic spline where the tangent at control points, except the first and last, are computed using the previous and next control points.
A Catmull-Rom spline is a cubic spline where the tangent at control points, except the first and last, are computed using the previous and next control points. Catmull-Rom splines are in the class C1.
alias CatmullRomSpline
- The options object takes the following properties - {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve. - {Cartesian3[]} options.points The array of Cartesian3 control points. - {Cartesian3} [options.firstTangent] The tangent of the curve at the first control point. If the tangent is not given, it will be estimated. - {Cartesian3} [options.lastTangent] The tangent of the curve at the last control point. If the tangent is not given, it will be estimated.
exception {DeveloperError} points.length must be greater than or equal to 2. exception {DeveloperError} times.length must be equal to points.length.
// spline above the earth from Philadelphia to Los Angeles var spline = new Cesium.CatmullRomSpline({ times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], points : [ new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) ] }); var p0 = spline.evaluate(times[i]); // equal to positions[i] var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
QuaternionSpline
LinearSpline
HermiteSpline
Inspector widget to aid in debugging
Inspector widget to aid in debugging
alias CesiumInspector
- {Element|String} container The DOM element or ID that will contain the widget. - {Scene} scene The Scene instance to use.
exception {DeveloperError} container is required. exception {DeveloperError} scene is required.
The view model for CesiumInspector alias CesiumInspectorViewModel
The view model for CesiumInspector alias CesiumInspectorViewModel
- {Scene} scene The scene instance to use.
exception {DeveloperError} scene is required.
A TerrainProvider that access terrain data in a Cesium terrain format.
A TerrainProvider that access terrain data in a Cesium terrain format. The format is described on the wiki.
alias CesiumTerrainProvider
- The options object takes the following properties - {String} options.url The URL of the Cesium terrain server. - {Proxy} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed. - {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available. - {Boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server, if available. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.
// Construct a terrain provider that uses per vertex normals for lighting // to add shading detail to an imagery provider. var terrainProvider = new Cesium.CesiumTerrainProvider({ url : 'https://assets.agi.com/stk-terrain/world', requestVertexNormals : true }); // Terrain geometry near the surface of the globe is difficult to view when using NaturalEarthII imagery, // unless the TerrainProvider provides additional lighting information to shade the terrain (as shown above). var imageryProvider = Cesium.createTileMapServiceImageryProvider({ url : 'http://localhost:8080/Source/Assets/Textures/NaturalEarthII', fileExtension : 'jpg' }); var viewer = new Cesium.Viewer('cesiumContainer', { imageryProvider : imageryProvider, baseLayerPicker : false, terrainProvider : terrainProvider }); // The globe must enable lighting to make use of the terrain's vertex normals viewer.scene.globe.enableLighting = true;
TerrainProvider
A widget containing a Cesium scene.
A widget containing a Cesium scene.
alias CesiumWidget
- {Element|String} container The DOM element or ID that will contain the widget.
- The options object takes the following properties
- {Clock} [options.clock=new Clock()] The clock to use to control current time.
- {ImageryProvider} [options.imageryProvider=new BingMapsImageryProvider()] The imagery provider to serve as the base layer. If set to false
, no imagery provider will be added.
- {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider] The terrain provider.
- {SkyBox} [options.skyBox] The skybox used to render the stars. When undefined
, the default stars are used. If set to false
, no skyBox, Sun, or Moon will be added.
- {SkyAtmosphere} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false
to turn it off.
- {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode.
- {Boolean} [options.scene3DOnly=false] When true
, each geometry instance will only be rendered in 3D to save GPU memory.
- {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.
- {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.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.
- {Object} [options.contextOptions] Context and WebGL creation properties corresponding to options
passed to Scene
- {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.
- {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.
// For each example, include a link to CesiumWidget.css stylesheet in HTML head, // and in the body, include: //Widget with no terrain and default Bing Maps imagery provider. var widget = new Cesium.CesiumWidget('cesiumContainer'); //Widget with OpenStreetMaps imagery provider and Cesium terrain provider hosted by AGI. var widget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider : Cesium.createOpenStreetMapImageryProvider(), terrainProvider : new Cesium.CesiumTerrainProvider({ url : 'https://assets.agi.com/stk-terrain/world' }), // 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 sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, mapProjection : new Cesium.WebMercatorProjection() });
A MaterialProperty that maps to checkerboard Material uniforms.
A MaterialProperty that maps to checkerboard Material uniforms. alias CheckerboardMaterialProperty
- The options object takes the following properties - {Property} [options.evenColor=Color.WHITE] A Property specifying the first Color - {Property} [options.oddColor=Color.BLACK] A Property specifying the second Color - {Property} [options.repeat=new Cartesian2(2.0, 2.0)] A Cartesian2 Property specifying how many times the tiles repeat in each direction.
A description of a circle on the ellipsoid.
A description of a circle on the ellipsoid. Circle geometry can be rendered with both Primitive and GroundPrimitive.
alias CircleGeometry
- The options object takes the following properties - {Cartesian3} options.center The circle's center point in the fixed frame. - {Number} options.radius The radius in meters. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on. - {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface. - {Number} [options.granularity=0.02] The angular distance between points on the circle in radians. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface. - {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
exception {DeveloperError} radius must be greater than zero. exception {DeveloperError} granularity must be greater than zero.
// Create a circle. var circle = new Cesium.CircleGeometry({ center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), radius : 100000.0 }); var geometry = Cesium.CircleGeometry.createGeometry(circle);
Packable
CircleGeometry.createGeometry
A description of the outline of a circle on the ellipsoid.
A description of the outline of a circle on the ellipsoid.
alias CircleOutlineGeometry
- The options object takes the following properties - {Cartesian3} options.center The circle's center point in the fixed frame. - {Number} options.radius The radius in meters. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on. - {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface. - {Number} [options.granularity=0.02] The angular distance between points on the circle in radians. - {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface. - {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.
exception {DeveloperError} radius must be greater than zero. exception {DeveloperError} granularity must be greater than zero.
// Create a circle. var circle = new Cesium.CircleOutlineGeometry({ center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), radius : 100000.0 }); var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
Packable
CircleOutlineGeometry.createGeometry
A simple clock for keeping track of simulated time.
A simple clock for keeping track of simulated time.
alias Clock
- The options object takes the following properties
- {JulianDate} [options.startTime] The start time of the clock.
- {JulianDate} [options.stopTime] The stop time of the clock.
- {JulianDate} [options.currentTime] The current time.
- {Number} [options.multiplier=1.0] Determines how much time advances when tick is called, negative values allow for advancing backwards.
- {ClockStep} [options.clockStep=ClockStep.SYSTEM_CLOCK_MULTIPLIER] Determines if calls to tick
are frame dependent or system clock dependent.
- {ClockRange} [options.clockRange=ClockRange.UNBOUNDED] Determines how the clock should behave when startTime
or stopTime
is reached.
- {Boolean} [options.canAnimate=true] Indicates whether tick can advance time. This could be false if data is being buffered, for example. The clock will only tick when both canAnimate
and shouldAnimate
are true.
- {Boolean} [options.shouldAnimate=true] Indicates whether tick should attempt to advance time. The clock will only tick when both canAnimate
and shouldAnimate
are true.
exception {DeveloperError} startTime must come before stopTime.
// Create a clock that loops on Christmas day 2013 and runs in real-time. var clock = new Cesium.Clock({ startTime : Cesium.JulianDate.fromIso8601("2013-12-25"), currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"), stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"), clockRange : Cesium.ClockRange.LOOP_STOP, clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER });
JulianDate
ClockRange
ClockStep
A view model which exposes a Clock for user interfaces.
A view model which exposes a Clock for user interfaces. alias ClockViewModel
- {Clock} [clock] The clock object wrapped by this view model, if undefined a new instance will be created.
Clock
A color, specified using red, green, blue, and alpha values,
which range from 0
(no intensity) to 1.0
(full intensity).
A color, specified using red, green, blue, and alpha values,
which range from 0
(no intensity) to 1.0
(full intensity).
- {Number} [red=1.0] The red component.
- {Number} [green=1.0] The green component.
- {Number} [blue=1.0] The blue component.
- {Number} [alpha=1.0] The alpha component.
alias Color
Packable
Value and type information for per-instance geometry color.
Value and type information for per-instance geometry color.
alias ColorGeometryInstanceAttribute
- {Number} [red=1.0] The red component. - {Number} [green=1.0] The green component. - {Number} [blue=1.0] The blue component. - {Number} [alpha=1.0] The alpha component.
var instance = new Cesium.GeometryInstance({ geometry : Cesium.BoxGeometry.fromDimensions({ dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) }), modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), id : 'box', attributes : { color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha) } });
GeometryInstanceAttribute
GeometryInstance
A MaterialProperty that maps to solid color Material uniforms.
A MaterialProperty that maps to solid color Material uniforms.
- {Property} [color=Color.WHITE] The Color Property to be used.
alias ColorMaterialProperty
A Command is a function with an extra canExecute
observable property to determine
whether the command can be executed.
A Command is a function with an extra canExecute
observable property to determine
whether the command can be executed. When executed, a Command function will check the
value of canExecute
and throw if false.
This type describes an interface and is not intended to be instantiated directly. See createCommand to create a command from a function.
alias Command
Non-destructively composites multiple EntityCollection instances into a single collection.
Non-destructively composites multiple EntityCollection instances into a single collection. If a Entity with the same ID exists in multiple collections, it is non-destructively merged into a single new entity instance. If an entity has the same property in multiple collections, the property of the Entity in the last collection of the list it belongs to is used. CompositeEntityCollection can be used almost anywhere that a EntityCollection is used.
alias CompositeEntityCollection
- {EntityCollection[]} [collections] The initial list of EntityCollection instances to merge. - {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.
A CompositeProperty which is also a MaterialProperty
A CompositeProperty which is also a MaterialProperty
alias CompositeMaterialProperty
A CompositeProperty which is also a PositionProperty
A CompositeProperty which is also a PositionProperty
alias CompositePositionProperty
- {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.
A Property which is defined by a TimeIntervalCollection, where the data property of each TimeInterval is another Property instance which is evaluated at the provided time.
A Property which is defined by a TimeIntervalCollection, where the data property of each TimeInterval is another Property instance which is evaluated at the provided time.
alias CompositeProperty
var constantProperty = ...; var sampledProperty = ...; //Create a composite property from two previously defined properties //where the property is valid on August 1st, 2012 and uses a constant //property for the first half of the day and a sampled property for the //remaining half. var composite = new Cesium.CompositeProperty(); composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z', data : constantProperty })); composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z', isStartIncluded : false, isStopIncluded : false, data : sampledProperty }));
CompositePositionProperty
CompositeMaterialProperty
A PositionProperty whose value does not change in respect to the ReferenceFrame in which is it defined.
A PositionProperty whose value does not change in respect to the ReferenceFrame in which is it defined.
alias ConstantPositionProperty
- {Cartesian3} [value] The property value. - {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.
A Property whose value does not change with respect to simulation time.
A Property whose value does not change with respect to simulation time.
alias ConstantProperty
- {Object} [value] The property value.
ConstantPositionProperty exception {DeveloperError} value.clone is a required function. exception {DeveloperError} value.equals is a required function.
A description of a corridor.
A description of a corridor. Corridor geometry can be rendered with both Primitive and GroundPrimitive.
alias CorridorGeometry
- The options object takes the following properties - {Cartesian3[]} options.positions An array of positions that define the center of the corridor. - {Number} options.width The distance between the edges of the corridor in meters. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {Number} [options.height=0] The distance in meters between the ellipsoid surface and the positions. - {Number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
var corridor = new Cesium.CorridorGeometry({ vertexFormat : Cesium.VertexFormat.POSITION_ONLY, positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), width : 100000 });
Packable demo Sandcastle Corridor Demo
CorridorGeometry.createGeometry
A GeometryUpdater for corridors.
A GeometryUpdater for corridors. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias CorridorGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes a corridor, which is a shape defined by a centerline and width that conforms to the curvature of the globe.
Describes a corridor, which is a shape defined by a centerline and width that conforms to the curvature of the globe. It can be placed on the surface or at altitude and can optionally be extruded into a volume.
alias CorridorGraphics
- The options object takes the following properties - {Property} [options.positions] A Property specifying the array of Cartesian3 positions that define the centerline of the corridor. - {Property} [options.width] A numeric Property specifying the distance between the edges of the corridor. - {Property} [options.cornerType=CornerType.ROUNDED] A CornerType Property specifying the style of the corners. - {Property} [options.height=0] A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface. - {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface. - {Property} [options.show=true] A boolean Property specifying the visibility of the corridor. - {Property} [options.fill=true] A boolean Property specifying whether the corridor is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the corridor. - {Property} [options.outline=false] A boolean Property specifying whether the corridor is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude.
Entity demo Sandcastle Corridor Demo
A description of a corridor outline.
A description of a corridor outline.
alias CorridorOutlineGeometry
- The options object takes the following properties - {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline. - {Number} options.width The distance between the edges of the corridor outline. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {Number} [options.height=0] The distance in meters between the positions and the ellipsoid surface. - {Number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface. - {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
var corridor = new Cesium.CorridorOutlineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), width : 100000 });
CorridorOutlineGeometry.createGeometry
A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
- {String} [text] The text to be displayed on the screen if no imageUrl is specified. - {String} [imageUrl] The source location for an image - {String} [link] A URL location for which the credit will be hyperlinked
alias Credit
//Create a credit with a tooltip, image and link var credit = new Cesium.Credit('Cesium', '/images/cesium_logo.png', 'http://cesiumjs.org/');
The credit display is responsible for displaying credits on screen.
The credit display is responsible for displaying credits on screen.
- {HTMLElement} container The HTML element where credits will be displayed - {String} [delimiter= ' • '] The string to separate text credits
alias CreditDisplay
var creditDisplay = new Cesium.CreditDisplay(creditContainer);
The culling volume defined by planes.
The culling volume defined by planes.
alias CullingVolume
- {Cartesian4[]} [planes] An array of clipping planes.
A DataSource implementation which can be used to manually manage a group of entities.
A DataSource implementation which can be used to manually manage a group of entities.
alias CustomDataSource
- {String} [name] A human-readable name for this instance.
var dataSource = new Cesium.CustomDataSource('myData'); var entity = dataSource.entities.add({ position : Cesium.Cartesian3.fromDegrees(1, 2, 0), billboard : { image : 'image.png' } }); viewer.dataSources.add(dataSource);
A description of a cylinder.
A description of a cylinder.
alias CylinderGeometry
- The options object takes the following properties - {Number} options.length The length of the cylinder. - {Number} options.topRadius The radius of the top of the cylinder. - {Number} options.bottomRadius The radius of the bottom of the cylinder. - {Number} [options.slices=128] The number of edges around perimeter of the cylinder. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
exception {DeveloperError} options.length must be greater than 0. exception {DeveloperError} options.topRadius must be greater than 0. exception {DeveloperError} options.bottomRadius must be greater than 0. exception {DeveloperError} bottomRadius and topRadius cannot both equal 0. exception {DeveloperError} options.slices must be greater that 3.
// create cylinder geometry var cylinder = new Cesium.CylinderGeometry({ length: 200000, topRadius: 80000, bottomRadius: 200000, }); var geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
CylinderGeometry.createGeometry
A GeometryUpdater for cylinders.
A GeometryUpdater for cylinders. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias CylinderGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.
Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius. The center position and orientation are determined by the containing Entity
alias CylinderGraphics
- The options object takes the following properties - {Property} [options.length] A numeric Property specifying the length of the cylinder. - {Property} [options.topRadius] A numeric Property specifying the radius of the top of the cylinder. - {Property} [options.bottomRadius] A numeric Property specifying the radius of the bottom of the cylinder. - {Property} [options.show=true] A boolean Property specifying the visibility of the cylinder. - {Property} [options.fill=true] A boolean Property specifying whether the cylinder is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the cylinder. - {Property} [options.outline=false] A boolean Property specifying whether the cylinder is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. - {Property} [options.slices=128] The number of edges around perimeter of the cylinder.
A description of the outline of a cylinder.
A description of the outline of a cylinder.
alias CylinderOutlineGeometry
- The options object takes the following properties - {Number} options.length The length of the cylinder. - {Number} options.topRadius The radius of the top of the cylinder. - {Number} options.bottomRadius The radius of the bottom of the cylinder. - {Number} [options.slices=128] The number of edges around perimeter of the cylinder. - {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.
exception {DeveloperError} options.length must be greater than 0. exception {DeveloperError} options.topRadius must be greater than 0. exception {DeveloperError} options.bottomRadius must be greater than 0. exception {DeveloperError} bottomRadius and topRadius cannot both equal 0. exception {DeveloperError} options.slices must be greater that 3.
// create cylinder geometry var cylinder = new Cesium.CylinderOutlineGeometry({ length: 200000, topRadius: 80000, bottomRadius: 200000, }); var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
CylinderOutlineGeometry.createGeometry
A DataSource which processes https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Guide|CZML alias CzmlDataSource
A DataSource which processes https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Guide|CZML alias CzmlDataSource
- {String} [name] An optional name for the data source. This value will be overwritten if a loaded document contains a name.
demo Sandcastle CZML Demo
Defines the interface for data sources, which turn arbitrary data into a EntityCollection for generic consumption.
Defines the interface for data sources, which turn arbitrary data into a EntityCollection for generic consumption. This object is an interface for documentation purposes and is not intended to be instantiated directly. alias DataSource
DataSourceDisplay
Entity
Represents CZML document-level clock settings.
Represents CZML document-level clock settings.
alias DataSourceClock
A collection of DataSource instances.
A collection of DataSource instances. alias DataSourceCollection
Visualizes a collection of DataSource instances.
Visualizes a collection of DataSource instances. alias DataSourceDisplay
- The options object takes the following properties - {Scene} options.scene The scene in which to display the data. - {DataSourceCollection} options.dataSourceCollection The data sources to display. - {DataSourceDisplay~VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] A function which creates an array of visualizers used for visualization. If undefined, all standard visualizers are used.
Visualizes a vertex attribute by displaying it as a color for debugging.
Visualizes a vertex attribute by displaying it as a color for debugging.
Components for well-known unit-length vectors, i.e., normal
,
binormal
, and tangent
, are scaled and biased
from [-1.0, 1.0] to (-1.0, 1.0).
alias DebugAppearance
- The options object takes the following properties
- {String} options.attributeName The name of the attribute to visualize.
- {String} [options.glslDatatype='vec3'] The GLSL datatype of the attribute. Supported datatypes are float
, vec2
, vec3
, and vec4
.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
exception {DeveloperError} options.glslDatatype must be float, vec2, vec3, or vec4.
var primitive = new Cesium.Primitive({ geometryInstances : // ... appearance : new Cesium.DebugAppearance({ attributeName : 'normal' }) });
Draws the outline of the camera's view frustum.
Draws the outline of the camera's view frustum.
Draws the axes of a reference frame defined by a matrix that transforms to world coordinates, i.e., Earth's WGS84 coordinates.
Draws the axes of a reference frame defined by a matrix that transforms to world
coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is
a primitives modelMatrix
.
The X axis is red; Y is green; and Z is blue.
This is for debugging only; it is not optimized for production use.
alias DebugModelMatrixPrimitive
- The options object takes the following properties - {Number} [options.length=10000000.0] The length of the axes in meters. - {Number} [options.width=2.0] The width of the axes in pixels. - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize. - {Boolean} [options.show=true] Determines if this primitive will be shown. - {Object} [options.id] A user-defined object to return when the instance is picked with Scene#pick
primitives.add(new Cesium.DebugModelMatrixPrimitive({ modelMatrix : primitive.modelMatrix, // primitive to debug length : 100000.0, width : 10.0 }));
A simple proxy that appends the desired resource as the sole query parameter to the given proxy URL.
A simple proxy that appends the desired resource as the sole query parameter to the given proxy URL.
alias DefaultProxy
- {String} proxy The proxy URL that will be used to requests all resources.
Constructs an exception object that is thrown due to a developer error, e.g., invalid argument, argument out of range, etc.
Constructs an exception object that is thrown due to a developer error, e.g., invalid argument, argument out of range, etc. This exception should only be thrown during development; it usually indicates a bug in the calling code. This exception should never be caught; instead the calling code should strive not to generate it.
On the other hand, a RuntimeError indicates an exception that may be thrown at runtime, e.g., out of memory, that the calling code should be prepared to catch.
alias DeveloperError
extends Error
- {String} [message] The error message for this exception.
RuntimeError
A policy for discarding tile images that match a known image containing a "missing" image.
A policy for discarding tile images that match a known image containing a "missing" image.
alias DiscardMissingTileImagePolicy
- The options object takes the following properties - {String} options.missingImageUrl The URL of the known missing image. - {Cartesian2[]} options.pixelsToCheck An array of Cartesian2 pixel positions to compare against the missing image. - {Boolean} [options.disableCheckIfAllPixelsAreTransparent=false] If true, the discard check will be disabled if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the discard check will proceed no matter the values of the pixelsToCheck.
Defines the interface for a dynamic geometry updater.
Defines the interface for a dynamic geometry updater. A DynamicGeometryUpdater is responsible for handling visualization of a specific type of geometry that needs to be recomputed based on simulation time. This object is never used directly by client code, but is instead created by GeometryUpdater implementations which contain dynamic geometry.
This type defines an interface and cannot be instantiated directly.
alias DynamicGeometryUpdater
Easing functions for use with TweenCollection.
Easing functions for use with TweenCollection. These function are from Tween.js and Robert Penner. See the Tween.js graphs for each function.
A description of an ellipse on an ellipsoid.
A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both Primitive and GroundPrimitive.
alias EllipseGeometry
- The options object takes the following properties - {Cartesian3} options.center The ellipse's center point in the fixed frame. - {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters. - {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on. - {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface. - {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface. - {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north. - {Number} [options.stRotation=0.0] The rotation of the texture coordinates counter-clockwise from north. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero. exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis. exception {DeveloperError} granularity must be greater than zero.
// Create an ellipse. var ellipse = new Cesium.EllipseGeometry({ center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), semiMajorAxis : 500000.0, semiMinorAxis : 300000.0, rotation : Cesium.Math.toRadians(60.0) }); var geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
EllipseGeometry.createGeometry
A GeometryUpdater for ellipses.
A GeometryUpdater for ellipses. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias EllipseGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes an ellipse defined by a center point and semi-major and semi-minor axes.
Describes an ellipse defined by a center point and semi-major and semi-minor axes. The ellipse conforms to the curvature of the globe and can be placed on the surface or at altitude and can optionally be extruded into a volume. The center point is determined by the containing Entity
alias EllipseGraphics
- The options object takes the following properties - {Property} [options.semiMajorAxis] The numeric Property specifying the semi-major axis. - {Property} [options.semiMinorAxis] The numeric Property specifying the semi-minor axis. - {Property} [options.height=0] A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface. - {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface. - {Property} [options.show=true] A boolean Property specifying the visibility of the ellipse. - {Property} [options.fill=true] A boolean Property specifying whether the ellipse is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the ellipse. - {Property} [options.outline=false] A boolean Property specifying whether the ellipse is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. - {Property} [options.rotation=0.0] A numeric property specifying the rotation of the ellipse counter-clockwise from north. - {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the ellipse texture counter-clockwise from north. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the ellipse.
demo and Ellipses.html|Cesium Sandcastle Circles and Ellipses Demo
A description of the outline of an ellipse on an ellipsoid.
A description of the outline of an ellipse on an ellipsoid.
alias EllipseOutlineGeometry
- The options object takes the following properties - {Cartesian3} options.center The ellipse's center point in the fixed frame. - {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters. - {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on. - {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface. - {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface. - {Number} [options.rotation=0.0] The angle from north (counter-clockwise) in radians. - {Number} [options.granularity=0.02] The angular distance between points on the ellipse in radians. - {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surface of an extruded ellipse.
exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero. exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis. exception {DeveloperError} granularity must be greater than zero.
var ellipse = new Cesium.EllipseOutlineGeometry({ center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), semiMajorAxis : 500000.0, semiMinorAxis : 300000.0, rotation : Cesium.Math.toRadians(60.0) }); var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
EllipseOutlineGeometry.createGeometry
A quadratic surface defined in Cartesian coordinates by the equation
(x / a)^2 + (y / b)^2 + (z / c) 2 = 1
.
A quadratic surface defined in Cartesian coordinates by the equation
(x / a)^2 + (y / b)^2 + (z / c) 2 = 1
. Primarily used
by Cesium to represent the shape of planetary bodies.
Rather than constructing this object directly, one of the provided constants is normally used. alias Ellipsoid
- {Number} [x=0] The radius in the x direction. - {Number} [y=0] The radius in the y direction. - {Number} [z=0] The radius in the z direction.
exception {DeveloperError} All radii components must be greater than or equal to zero.
Ellipsoid.UNIT_SPHERE
Ellipsoid.WGS84
Ellipsoid.fromCartesian3
Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
alias EllipsoidGeodesic
- {Cartographic} [start] The initial planetodetic point on the path. - {Cartographic} [end] The final planetodetic point on the path. - {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the geodesic lies.
A description of an ellipsoid centered at the origin.
A description of an ellipsoid centered at the origin.
alias EllipsoidGeometry
- The options object takes the following properties - {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions. - {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks. - {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
exception {DeveloperError} options.slicePartitions cannot be less than three. exception {DeveloperError} options.stackPartitions cannot be less than three.
var ellipsoid = new Cesium.EllipsoidGeometry({ vertexFormat : Cesium.VertexFormat.POSITION_ONLY, radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0) }); var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
EllipsoidGeometry#createGeometry
A GeometryUpdater for ellipsoids.
A GeometryUpdater for ellipsoids. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias EllipsoidGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describe an ellipsoid or sphere.
Describe an ellipsoid or sphere. The center position and orientation are determined by the containing Entity
alias EllipsoidGraphics
- The options object takes the following properties - {Property} [options.radii] A Cartesian3 Property specifying the radii of the ellipsoid. - {Property} [options.show=true] A boolean Property specifying the visibility of the ellipsoid. - {Property} [options.fill=true] A boolean Property specifying whether the ellipsoid is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the ellipsoid. - {Property} [options.outline=false] A boolean Property specifying whether the ellipsoid is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.subdivisions=128] A Property specifying the number of samples per outline ring, determining the granularity of the curvature. - {Property} [options.stackPartitions=64] A Property specifying the number of stacks. - {Property} [options.slicePartitions=64] A Property specifying the number of radial slices.
A description of the outline of an ellipsoid centered at the origin.
A description of the outline of an ellipsoid centered at the origin.
alias EllipsoidOutlineGeometry
- The options object takes the following properties - {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions. - {Number} [options.stackPartitions=10] The count of stacks for the ellipsoid (1 greater than the number of parallel lines). - {Number} [options.slicePartitions=8] The count of slices for the ellipsoid (Equal to the number of radial lines). - {Number} [options.subdivisions=128] The number of points per line, determining the granularity of the curvature .
exception {DeveloperError} options.stackPartitions must be greater than or equal to one. exception {DeveloperError} options.slicePartitions must be greater than or equal to zero. exception {DeveloperError} options.subdivisions must be greater than or equal to zero.
var ellipsoid = new Cesium.EllipsoidOutlineGeometry({ radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0), stackPartitions: 6, slicePartitions: 5 }); var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
An appearance for geometry on the surface of the ellipsoid like PolygonGeometry
and RectangleGeometry, which supports all materials like MaterialAppearance
with MaterialAppearance.MaterialSupport However, this appearance requires
fewer vertex attributes since the fragment shader can procedurally compute normal
,
binormal
, and tangent
.
An appearance for geometry on the surface of the ellipsoid like PolygonGeometry
and RectangleGeometry, which supports all materials like MaterialAppearance
with MaterialAppearance.MaterialSupport However, this appearance requires
fewer vertex attributes since the fragment shader can procedurally compute normal
,
binormal
, and tangent
.
alias EllipsoidSurfaceAppearance
- The options object takes the following properties
- {Boolean} [options.flat=false] When true
, flat shading is used in the fragment shader, which means lighting is not taking into account.
- {Boolean} [options.faceForward=options.aboveGround] When true
, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like WallGeometry
- {Boolean} [options.translucent=true] When true
, the geometry is expected to appear translucent so EllipsoidSurfaceAppearance#renderState has alpha blending enabled.
- {Boolean} [options.aboveGround=false] When true
, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so EllipsoidSurfaceAppearance#renderState has backface culling enabled.
- {Material} [options.material=Material.ColorType] The material used to determine the fragment color.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
var primitive = new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : new Cesium.PolygonGeometry({ vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, // ... }) }), appearance : new Cesium.EllipsoidSurfaceAppearance({ material : Cesium.Material.fromType('Stripe') }) });
https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric
A plane tangent to the provided ellipsoid at the provided origin.
A plane tangent to the provided ellipsoid at the provided origin. If origin is not on the surface of the ellipsoid, it's surface projection will be used. If origin is at the center of the ellipsoid, an exception will be thrown. alias EllipsoidTangentPlane
- {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches. - {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
exception {DeveloperError} origin must not be at the center of the ellipsoid.
A very simple TerrainProvider that produces geometry by tessellating an ellipsoidal surface.
A very simple TerrainProvider that produces geometry by tessellating an ellipsoidal surface.
alias EllipsoidTerrainProvider
- The options object takes the following properties - {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal surface is broken into tiles. If this parameter is not provided, a GeographicTilingScheme is used. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used.
TerrainProvider
Entity instances aggregate multiple forms of visualization into a single high-level object.
Entity instances aggregate multiple forms of visualization into a single high-level object. They can be created manually and added to Viewer#entities or be produced by data sources, such as CzmlDataSource and GeoJsonDataSource alias Entity
- The options object takes the following properties - {String} [options.id] A unique identifier for this object. If none is provided, a GUID is generated. - {String} [options.name] A human readable name to display to users. It does not have to be unique. - {TimeIntervalCollection} [options.availability] The availability, if any, associated with this object. - {Boolean} [options.show] A boolean value indicating if the entity and its children are displayed. - {Property} [options.description] A string Property specifying an HTML description for this entity. - {PositionProperty} [options.position] A Property specifying the entity position. - {Property} [options.orientation] A Property specifying the entity orientation. - {Property} [options.viewFrom] A suggested initial offset for viewing this object. - {Entity} [options.parent] A parent entity to associate with this entity. - {BillboardGraphics} [options.billboard] A billboard to associate with this entity. - {BoxGraphics} [options.box] A box to associate with this entity. - {CorridorGraphics} [options.corridor] A corridor to associate with this entity. - {CylinderGraphics} [options.cylinder] A cylinder to associate with this entity. - {EllipseGraphics} [options.ellipse] A ellipse to associate with this entity. - {EllipsoidGraphics} [options.ellipsoid] A ellipsoid to associate with this entity. - {LabelGraphics} [options.label] A options.label to associate with this entity. - {ModelGraphics} [options.model] A model to associate with this entity. - {PathGraphics} [options.path] A path to associate with this entity. - {PointGraphics} [options.point] A point to associate with this entity. - {PolygonGraphics} [options.polygon] A polygon to associate with this entity. - {PolylineGraphics} [options.polyline] A polyline to associate with this entity. - {PolylineVolumeGraphics} [options.polylineVolume] A polylineVolume to associate with this entity. - {RectangleGraphics} [options.rectangle] A rectangle to associate with this entity. - {WallGraphics} [options.wall] A wall to associate with this entity.
Defines how screen space objects (billboards, points, labels) are clustered.
Defines how screen space objects (billboards, points, labels) are clustered.
An observable collection of Entity instances where each entity has a unique id.
An observable collection of Entity instances where each entity has a unique id. alias EntityCollection
- {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.
A utility object for tracking an entity with the camera.
A utility object for tracking an entity with the camera. alias EntityView
- {Entity} entity The entity to track with the camera. - {Scene} scene The scene to use. - {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use for orienting the camera. - {BoundingSphere} [boundingSphere] An initial bounding sphere for setting the default view.
A generic utility class for managing subscribers for a particular event.
A generic utility class for managing subscribers for a particular event. This class is usually instantiated inside of a container class and exposed as a property for others to subscribe to.
alias Event
MyObject.prototype.myListener = function(arg1, arg2) { this.myArg1Copy = arg1; this.myArg2Copy = arg2; } var myObjectInstance = new MyObject(); var evt = new Cesium.Event(); evt.addEventListener(MyObject.prototype.myListener, myObjectInstance); evt.raiseEvent('1', '2'); evt.removeEventListener(MyObject.prototype.myListener);
A convenience object that simplifies the common pattern of attaching event listeners to several events, then removing all those listeners at once later, for example, in a destroy method.
A convenience object that simplifies the common pattern of attaching event listeners to several events, then removing all those listeners at once later, for example, in a destroy method.
alias EventHelper
var helper = new Cesium.EventHelper(); helper.add(someObject.event, listener1, this); helper.add(otherObject.event, listener2, this); // later... helper.removeAll();
Event
Blends the atmosphere to geometry far from the camera for horizon views.
Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional performance improvements by rendering less geometry and dispatching less terrain requests.
alias Fog
Monitors the frame rate (frames per second) in a Scene and raises an event if the frame rate is lower than a threshold.
Monitors the frame rate (frames per second) in a Scene and raises an event if the frame rate is lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised. To avoid creating multiple FrameRateMonitors for a single Scene, use FrameRateMonitor instead of constructing an instance explicitly.
alias FrameRateMonitor
- The options object takes the following properties - {Scene} options.scene The Scene instance for which to monitor performance. - {Number} [options.samplingWindow=5.0] The length of the sliding window over which to compute the average frame rate, in seconds. - {Number} [options.quietPeriod=2.0] The length of time to wait at startup and each time the page becomes visible (i.e. when the user switches back to the tab) before starting to measure performance, in seconds. - {Number} [options.warmupPeriod=5.0] The length of the warmup period, in seconds. During the warmup period, a separate (usually lower) frame rate is required. - {Number} [options.minimumFrameRateDuringWarmup=4] The minimum frames-per-second that are required for acceptable performance during the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. - {Number} [options.minimumFrameRateAfterWarmup=8] The minimum frames-per-second that are required for acceptable performance after the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
A single button widget for toggling fullscreen mode.
A single button widget for toggling fullscreen mode.
alias FullscreenButton
- {Element|String} container The DOM element or ID that will contain the widget. - {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode.
exception {DeveloperError} Element with id "container" does not exist in the document.
Fullscreen
The view model for FullscreenButton alias FullscreenButtonViewModel
The view model for FullscreenButton alias FullscreenButtonViewModel
- {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode.
A DataSource which processes both http://www.geojson.org/|GeoJSON and https://github.com/mbostock/topojson|TopoJSON data.
A DataSource which processes both http://www.geojson.org/|GeoJSON and https://github.com/mbostock/topojson|TopoJSON data. https://github.com/mapbox/simplestyle-spec|simplestyle-spec properties will also be used if they are present.
alias GeoJsonDataSource
- {String} [name] The name of this data source. If undefined, a name will be taken from the name of the GeoJSON file.
demo Sandcastle GeoJSON and TopoJSON Demo demo Sandcastle GeoJSON simplestyle Demo
var viewer = new Cesium.Viewer('cesiumContainer'); viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', { stroke: Cesium.Color.HOTPINK, fill: Cesium.Color.PINK, strokeWidth: 3, markerSymbol: '?' }));
A widget for finding addresses and landmarks, and flying the camera to them.
A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is performed using the Maps Locations API
alias Geocoder
- The options object takes the following properties - {Element|String} options.container The DOM element or ID that will contain the widget. - {Scene} options.scene The Scene instance to use. - {String} [options.url='https://dev.virtualearth.net'] The base URL of the Bing Maps API. - {String} [options.key] The Bing Maps key for your application, which can be created at https://www.bingmapsportal.com If this parameter is not provided, BingMapsApi.defaultKey is used. If BingMapsApi.defaultKey is undefined as well, a message is written to the console reminding you that you must create and supply a Bing Maps key as soon as possible. Please do not deploy an application that uses this widget without creating a separate key for your application. - {Number} [options.flightDuration=1.5] The duration of the camera flight to an entered location, in seconds.
The view model for the Geocoder widget.
The view model for the Geocoder widget. alias GeocoderViewModel
- The options object takes the following properties - {Scene} options.scene The Scene instance to use. - {String} [options.url='https://dev.virtualearth.net'] The base URL of the Bing Maps API. - {String} [options.key] The Bing Maps key for your application, which can be created at https://www.bingmapsportal.com If this parameter is not provided, BingMapsApi.defaultKey is used. If BingMapsApi.defaultKey is undefined as well, a message is written to the console reminding you that you must create and supply a Bing Maps key as soon as possible. Please do not deploy an application that uses this widget without creating a separate key for your application. - {Number} [options.flightDuration] The duration of the camera flight to an entered location, in seconds.
A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying them by the Ellipsoid#maximumRadius.
A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying them by the Ellipsoid#maximumRadius. This projection is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It is also known as EPSG:4326.
alias GeographicProjection
- {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
WebMercatorProjection
A tiling scheme for geometry referenced to a simple GeographicProjection where longitude and latitude are directly mapped to X and Y.
A tiling scheme for geometry referenced to a simple GeographicProjection where longitude and latitude are directly mapped to X and Y. This projection is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
alias GeographicTilingScheme
- The options object takes the following properties - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to the WGS84 ellipsoid. - {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme. - {Number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of the tile tree. - {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of the tile tree.
A geometry representation with attributes forming vertices and optional index data defining primitives.
A geometry representation with attributes forming vertices and optional index data
defining primitives. Geometries and an Appearance, which describes the shading,
can be assigned to a Primitive for visualization. A Primitive
can
be created from many heterogeneous - in many cases - geometries for performance.
Geometries can be transformed and optimized using functions in GeometryPipeline.
alias Geometry
- The options object takes the following properties - {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices. - {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry. - {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry. - {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.
// Create geometry with a position attribute and indexed lines. var positions = new Float64Array([ 0.0, 0.0, 0.0, 7500000.0, 0.0, 0.0, 0.0, 7500000.0, 0.0 ]); var geometry = new Cesium.Geometry({ attributes : { position : new Cesium.GeometryAttribute({ componentDatatype : Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute : 3, values : positions }) }, indices : new Uint16Array([0, 1, 1, 2, 2, 0]), primitiveType : Cesium.PrimitiveType.LINES, boundingSphere : Cesium.BoundingSphere.fromVertices(positions) });
EllipsoidGeometry demo and Appearances Demo
BoxGeometry
SimplePolylineGeometry
WallGeometry
CircleGeometry
EllipseGeometry
RectangleGeometry
PolygonGeometry
Values and type information for geometry attributes.
Values and type information for geometry attributes. A Geometry generally contains one or more attributes. All attributes together form the geometry's vertices.
alias GeometryAttribute
- The options object takes the following properties
- {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values.
- {Number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes.
- {Boolean} [options.normalize=false] When true
and componentDatatype
is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
- {TypedArray} [options.values] The values for the attributes stored in a typed array.
exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.
var geometry = new Cesium.Geometry({ attributes : { position : new Cesium.GeometryAttribute({ componentDatatype : Cesium.ComponentDatatype.FLOAT, componentsPerAttribute : 3, values : new Float32Array([ 0.0, 0.0, 0.0, 7500000.0, 0.0, 0.0, 0.0, 7500000.0, 0.0 ]) }) }, primitiveType : Cesium.PrimitiveType.LINE_LOOP });
Geometry
Attributes, which make up a geometry's vertices.
Attributes, which make up a geometry's vertices. Each property in this object corresponds to a GeometryAttribute containing the attribute's data.
Attributes are always stored non-interleaved in a Geometry.
alias GeometryAttributes
Geometry instancing allows one Geometry object to be positions in several different locations and colored uniquely.
Geometry instancing allows one Geometry object to be positions in several
different locations and colored uniquely. For example, one BoxGeometry can
be instanced several times, each with a different modelMatrix
to change
its position, rotation, and scale.
alias GeometryInstance
- The options object takes the following properties - {Geometry} options.geometry The geometry to instance. - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates. - {Object} [options.id] A user-defined object to return when the instance is picked with Scene#pick or get/set per-instance attributes with Primitive#getGeometryInstanceAttributes - {Object} [options.attributes] Per-instance attributes like a show or color attribute shown in the example below.
// Create geometry for a box, and two instances that refer to it. // One instance positions the box on the bottom and colored aqua. // The other instance positions the box on the top and color white. var geometry = Cesium.BoxGeometry.fromDimensions({ vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) }); var instanceBottom = new Cesium.GeometryInstance({ geometry : geometry, modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) }, id : 'bottom' }); var instanceTop = new Cesium.GeometryInstance({ geometry : geometry, modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()), attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) }, id : 'top' });
Geometry
Values and type information for per-instance geometry attributes.
Values and type information for per-instance geometry attributes.
alias GeometryInstanceAttribute
- The options object takes the following properties
- {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values.
- {Number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes.
- {Boolean} [options.normalize=false] When true
and componentDatatype
is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
- {Number[]} [options.value] The value for the attribute.
exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.
var instance = new Cesium.GeometryInstance({ geometry : Cesium.BoxGeometry.fromDimensions({ dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) }), modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), id : 'box', attributes : { color : new Cesium.GeometryInstanceAttribute({ componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute : 4, normalize : true, value : [255, 255, 0, 255] }) } });
ShowGeometryInstanceAttribute
ColorGeometryInstanceAttribute
Defines the interface for a geometry updater.
Defines the interface for a geometry updater. A GeometryUpdater maps geometry defined as part of a Entity into Geometry instances. These instances are then visualized by GeometryVisualizer
This type defines an interface and cannot be instantiated directly.
alias GeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
WallGeometryUpdater
RectangleGeometryUpdater
PolylineGeometryUpdater
PolygonGeometryUpdater
EllipsoidGeometryUpdater
EllipseGeometryUpdater
A general purpose visualizer for geometry represented by Primitive instances.
A general purpose visualizer for geometry represented by Primitive instances. alias GeometryVisualizer
- {GeometryUpdater} type The updater to be used for creating the geometry. - {Scene} scene The scene the primitives will be rendered in. - {EntityCollection} entityCollection The entityCollection to visualize.
Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
alias GetFeatureInfoFormat
- {String} type The type of response to expect from a GetFeatureInfo request. Valid values are 'json', 'xml', 'html', or 'text'. - {String} [format] The info format to request from the WMS server. This is usually a MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json' using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'. - {Function} [callback] A function to invoke with the GetFeatureInfo response from the WMS server in order to produce an array of picked ImageryLayerFeatureInfo instances. If this parameter is not specified, a default function for the type of response is used.
The globe rendered in the scene, including its terrain (Globe#terrainProvider) and imagery layers (Globe#imageryLayers).
The globe rendered in the scene, including its terrain (Globe#terrainProvider) and imagery layers (Globe#imageryLayers). Access the globe using Scene#globe
alias Globe
- {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] Determines the size and shape of the globe.
Provides tiled imagery using the Google Earth Imagery API.
Provides tiled imagery using the Google Earth Imagery API.
Notes: This imagery provider does not work with the public Google Earth servers. It works with the Google Earth Enterprise Server.
By default the Google Earth Enterprise server does not set the Resource Sharing headers. You can either use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf and add the 'Header set Access-Control-Allow-Origin "*"' option to the '<Directory />' and '<Directory "/opt/google/gehttpd/htdocs">' directives.
alias GoogleEarthImageryProvider
- The options object takes the following properties - {String} options.url The url of the Google Earth server hosting the imagery. - {Number} options.channel The channel (id) to be used when requesting data from the server. The channel number can be found by looking at the json file located at: earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may differ depending on your Google Earth Enterprise server configuration. Look for the "id" that is associated with a "ImageryMaps" requestType. There may be more than one id available. Example: { layers: [ { id: 1002, requestType: "ImageryMaps" }, { id: 1007, requestType: "VectorMapsRaster" } ] } - {String} [options.path="/default_map"] The path of the Google Earth server hosting the imagery. - {Number} [options.maximumLevel] The maximum level-of-detail supported by the Google Earth Enterprise server, or undefined if there is no limit. - {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass a NeverTileDiscardPolicy for this parameter. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - {Proxy} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed.
exception {RuntimeError} Could not find layer with channel (id) of options.channel
.
exception {RuntimeError} Could not find a version in channel (id) options.channel
.
exception {RuntimeError} Unsupported projection data.projection
.
var google = new Cesium.GoogleEarthImageryProvider({ url : 'https://earth.localdomain', channel : 1008 });
UrlTemplateImageryProvider
WebMapTileServiceImageryProvider
WebMapServiceImageryProvider
createTileMapServiceImageryProvider
SingleTileImageryProvider
createOpenStreetMapImageryProvider
BingMapsImageryProvider
ArcGisMapServerImageryProvider
Represents a Gregorian date in a more precise format than the JavaScript Date object.
Represents a Gregorian date in a more precise format than the JavaScript Date object. In addition to submillisecond precision, this object can also represent leap seconds. alias GregorianDate
JulianDate#toGregorianDate
An ImageryProvider that draws a wireframe grid on every tile with controllable background and glow.
An ImageryProvider that draws a wireframe grid on every tile with controllable background and glow. May be useful for custom rendering effects or debugging terrain.
alias GridImageryProvider
- The options object takes the following properties - {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used. - {Number} [options.cells=8] The number of grids cells. - {Color} [options.color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines. - {Color} [options.glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines. - {Number} [options.glowWidth=6] The width of lines used for rendering the line glow effect. - {Color} [backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color. - {Number} [options.tileWidth=256] The width of the tile for level-of-detail selection purposes. - {Number} [options.tileHeight=256] The height of the tile for level-of-detail selection purposes. - {Number} [options.canvasSize=256] The size of the canvas used for rendering.
A MaterialProperty that maps to grid Material uniforms.
A MaterialProperty that maps to grid Material uniforms. alias GridMaterialProperty
- The options object takes the following properties - {Property} [options.color=Color.WHITE] A Property specifying the grid Color - {Property} [options.cellAlpha=0.1] A numeric Property specifying cell alpha values. - {Property} [options.lineCount=new Cartesian2(8, 8)] A Cartesian2 Property specifying the number of grid lines along each axis. - {Property} [options.lineThickness=new Cartesian2(1.0, 1.0)] A Cartesian2 Property specifying the thickness of grid lines along each axis. - {Property} [options.lineOffset=new Cartesian2(0.0, 0.0)] A Cartesian2 Property specifying starting offset of grid lines along each axis.
A ground primitive represents geometry draped over the terrain in the Scene The geometry must be from a single GeometryInstance Batching multiple geometries is not yet supported.
A ground primitive represents geometry draped over the terrain in the Scene The geometry must be from a single GeometryInstance Batching multiple geometries is not yet supported.
A primitive combines the geometry instance with an Appearance that describes the full shading, including Material and RenderState Roughly, the geometry instance defines the structure and placement, and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix and match most of them and add a new geometry or appearance independently of each other. Only the PerInstanceColorAppearance is supported at this time.
Because of the cutting edge nature of this feature in WebGL, it requires the EXT_frag_depth extension, which is currently only supported in Chrome, Firefox, and Edge. Apple support is expected in iOS 9 and MacOS Safari 9. Android support varies by hardware and IE11 will most likely never support it. You can use webglreport.com to verify support for your hardware. Finally, this feature is currently only supported in Primitives and not yet available via the Entity API.
Valid geometries are CircleGeometry, CorridorGeometry, EllipseGeometry, PolygonGeometry, and RectangleGeometry
alias GroundPrimitive
- The options object takes the following properties
- {Array|GeometryInstance} [options.geometryInstances] The geometry instances to render.
- {Boolean} [options.show=true] Determines if this primitive will be shown.
- {Boolean} [options.vertexCacheOptimize=false] When true
, geometry vertices are optimized for the pre and post-vertex-shader caches.
- {Boolean} [options.interleave=false] When true
, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
- {Boolean} [options.compressVertices=true] When true
, the geometry vertices are compressed, which will save memory.
- {Boolean} [options.releaseGeometryInstances=true] When true
, the primitive does not keep a reference to the input geometryInstances
to save memory.
- {Boolean} [options.allowPicking=true] When true
, each geometry instance will only be pickable with Scene#pick When false
, GPU memory is saved.
- {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready.
- {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.
- {Boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true
on
creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false
.
// Example 1: Create primitive with a single instance var rectangleInstance = new Cesium.GeometryInstance({ geometry : new Cesium.RectangleGeometry({ rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) }), id : 'rectangle', attributes : { color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) } }); scene.primitives.add(new Cesium.GroundPrimitive({ geometryInstances : rectangleInstance })); // Example 2: Batch instances var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color. var rectangleInstance = new Cesium.GeometryInstance({ geometry : new Cesium.RectangleGeometry({ rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) }), id : 'rectangle', attributes : { color : color } }); var ellipseInstance = new Cesium.GeometryInstance({ geometry : new Cesium.EllipseGeometry({ center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0), semiMinorAxis : 300000.0, semiMajorAxis : 400000.0 }), id : 'ellipse', attributes : { color : color } }); scene.primitives.add(new Cesium.GroundPrimitive({ geometryInstances : [rectangleInstance, ellipseInstance] }));
Appearance
GeometryInstance
Primitive
Defines a heading angle, pitch angle, and range in a local frame.
Defines a heading angle, pitch angle, and range in a local frame. Heading is the rotation from the local north direction where a positive angle is increasing eastward. Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch angles are below the plane. Range is the distance from the center of the frame. alias HeadingPitchRange
- {Number} [heading=0.0] The heading angle in radians. - {Number} [pitch=0.0] The pitch angle in radians. - {Number} [range=0.0] The distance from the center in meters.
Terrain data for a single tile where the terrain data is represented as a heightmap.
Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap is a rectangular array of heights in row-major order from south to north and west to east.
alias HeightmapTerrainData
- The options object takes the following properties - {TypedArray} options.buffer The buffer containing height data. - {Number} options.width The width (longitude direction) of the heightmap, in samples. - {Number} options.height The height (latitude direction) of the heightmap, in samples. - {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist. If a child's bit is set, geometry will be requested for that tile as well when it is needed. If the bit is cleared, the child tile is not requested and geometry is instead upsampled from the parent. The bit values are as follows:
Bit Position | Bit Value | Child Tile |
---|---|---|
0 | 1 | Southwest |
1 | 2 | Southeast |
2 | 4 | Northwest |
3 | 8 | Northeast |
height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256
This is assuming that the isBigEndian property is false. If it is true, the order of the
elements is reversed.
- {Boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the
stride property is greater than 1. If this property is false, the first element is the
low-order element. If it is true, the first element is the high-order element.
- {Boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;
otherwise, false.
var buffer = ... var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth); var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0]; var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1); var terrainData = new Cesium.HeightmapTerrainData({ buffer : heightBuffer, width : 65, height : 65, childTileMask : childTileMask, waterMask : waterMask });
QuantizedMeshTerrainData
TerrainData
A Hermite spline is a cubic interpolating spline.
A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between points[i]
and
points[i + 1]
, the tangents at the points will be outTangents[i]
and inTangents[i]
,
respectively.
alias HermiteSpline
- The options object takes the following properties - {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve. - {Cartesian3[]} options.points The array of Cartesian3 control points. - {Cartesian3[]} options.inTangents The array of Cartesian3 incoming tangents at each control point. - {Cartesian3[]} options.outTangents The array of Cartesian3 outgoing tangents at each control point.
exception {DeveloperError} points.length must be greater than or equal to 2. exception {DeveloperError} times.length must be equal to points.length. exception {DeveloperError} inTangents and outTangents must have a length equal to points.length - 1.
// Create a G1 continuous Hermite spline var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; var spline = new Cesium.HermiteSpline({ times : times, points : [ new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) ], outTangents : [ new Cesium.Cartesian3(1125196, -161816, 270551), new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5), new Cesium.Cartesian3(-2096917, 48379.5, -292683.5), new Cesium.Cartesian3(-890902.5, 408999.5, -447115) ], inTangents : [ new Cesium.Cartesian3(-1993381, -731813, 368057), new Cesium.Cartesian3(-4193834, 96759, -585367), new Cesium.Cartesian3(-1781805, 817999, -894230), new Cesium.Cartesian3(1165345, 112641, 47281) ] }); var p0 = spline.evaluate(times[0]);
QuaternionSpline
LinearSpline
CatmullRomSpline
A single button widget for returning to the default camera view of the current scene.
A single button widget for returning to the default camera view of the current scene.
alias HomeButton
- {Element|String} container The DOM element or ID that will contain the widget. - {Scene} scene The Scene instance to use. - {Number} [duration] The time, in seconds, it takes to complete the camera flight home.
The view model for HomeButton alias HomeButtonViewModel
The view model for HomeButton alias HomeButtonViewModel
- {Scene} scene The scene instance to use. - {Number} [duration] The duration of the camera flight in seconds.
A MaterialProperty that maps to image Material uniforms.
A MaterialProperty that maps to image Material uniforms. alias ImageMaterialProperty
- The options object takes the following properties - {Property} [options.image] A Property specifying the Image, URL, Canvas, or Video. - {Property} [options.repeat=new Cartesian2(1.0, 1.0)] A Cartesian2 Property specifying the number of times the image repeats in each direction. - {Property} [options.color=Color.WHITE] The color applied to the image - {Property} [options.transparent=false] Set to true when the image has transparency (for example, when a png has transparent sections)
An imagery layer that displays tiled image data from a single imagery provider on a Globe
An imagery layer that displays tiled image data from a single imagery provider on a Globe
alias ImageryLayer
- {ImageryProvider} imageryProvider The imagery provider to use.
- The options object takes the following properties
- {Rectangle} [options.rectangle=imageryProvider.rectangle] The rectangle of the layer. This rectangle
can limit the visible portion of the imagery provider.
- {Number|Function} [options.alpha=1.0] The alpha blending value of this layer, from 0.0 to 1.0.
This can either be a simple number or a function with the signature
function(frameState, layer, x, y, level)
. The function is passed the
current frame state, this layer, and the x, y, and level coordinates of the
imagery tile for which the alpha is required, and it is expected to return
the alpha value to use for the tile.
- {Number|Function} [options.brightness=1.0] The brightness of this layer. 1.0 uses the unmodified imagery
color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
This can either be a simple number or a function with the signature
function(frameState, layer, x, y, level)
. The function is passed the
current frame state, this layer, and the x, y, and level coordinates of the
imagery tile for which the brightness is required, and it is expected to return
the brightness value to use for the tile. The function is executed for every
frame and for every tile, so it must be fast.
- {Number|Function} [options.contrast=1.0] The contrast of this layer. 1.0 uses the unmodified imagery color.
Less than 1.0 reduces the contrast while greater than 1.0 increases it.
This can either be a simple number or a function with the signature
function(frameState, layer, x, y, level)
. The function is passed the
current frame state, this layer, and the x, y, and level coordinates of the
imagery tile for which the contrast is required, and it is expected to return
the contrast value to use for the tile. The function is executed for every
frame and for every tile, so it must be fast.
- {Number|Function} [options.hue=0.0] The hue of this layer. 0.0 uses the unmodified imagery color.
This can either be a simple number or a function with the signature
function(frameState, layer, x, y, level)
. The function is passed the
current frame state, this layer, and the x, y, and level coordinates
of the imagery tile for which the hue is required, and it is expected to return
the contrast value to use for the tile. The function is executed for every
frame and for every tile, so it must be fast.
- {Number|Function} [options.saturation=1.0] The saturation of this layer. 1.0 uses the unmodified imagery color.
Less than 1.0 reduces the saturation while greater than 1.0 increases it.
This can either be a simple number or a function with the signature
function(frameState, layer, x, y, level)
. The function is passed the
current frame state, this layer, and the x, y, and level coordinates
of the imagery tile for which the saturation is required, and it is expected to return
the contrast value to use for the tile. The function is executed for every
frame and for every tile, so it must be fast.
- {Number|Function} [options.gamma=1.0] The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
This can either be a simple number or a function with the signature
function(frameState, layer, x, y, level)
. The function is passed the
current frame state, this layer, and the x, y, and level coordinates of the
imagery tile for which the gamma is required, and it is expected to return
the gamma value to use for the tile. The function is executed for every
frame and for every tile, so it must be fast.
- {Boolean} [options.show=true] True if the layer is shown; otherwise, false.
- {Number} [options.maximumAnisotropy=maximum supported] The maximum anisotropy level to use
for texture filtering. If this parameter is not specified, the maximum anisotropy supported
by the WebGL stack will be used. Larger values make the imagery look better in horizon
views.
- {Number} [options.minimumTerrainLevel] The minimum terrain level-of-detail at which to show this imagery layer,
or undefined to show it at all levels. Level zero is the least-detailed level.
- {Number} [options.maximumTerrainLevel] The maximum terrain level-of-detail at which to show this imagery layer,
or undefined to show it at all levels. Level zero is the least-detailed level.
An ordered collection of imagery layers.
An ordered collection of imagery layers.
alias ImageryLayerCollection
demo Sandcastle Imagery Adjustment Demo demo Sandcastle Imagery Manipulation Demo
Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
alias ImageryLayerFeatureInfo
Provides imagery to be displayed on the surface of an ellipsoid.
Provides imagery to be displayed on the surface of an ellipsoid. This type describes an interface and is not intended to be instantiated directly.
alias ImageryProvider
WebMapServiceImageryProvider demo Sandcastle Imagery Layers Demo demo Sandcastle Imagery Manipulation Demo
WebMapTileServiceImageryProvider
createOpenStreetMapImageryProvider
MapboxImageryProvider
GoogleEarthImageryProvider
BingMapsImageryProvider
SingleTileImageryProvider
ArcGisMapServerImageryProvider
A widget for displaying information or a description.
A widget for displaying information or a description.
alias InfoBox
- {Element|String} container The DOM element or ID that will contain the widget.
exception {DeveloperError} Element with id "container" does not exist in the document.
The view model for InfoBox alias InfoBoxViewModel
The view model for InfoBox alias InfoBoxViewModel
Represents the closed interval [start, stop].
Represents the closed interval [start, stop]. alias Interval
- {Number} [start=0.0] The beginning of the interval. - {Number} [stop=0.0] The end of the interval.
Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC). For increased precision, this class stores the whole number part of the date and the seconds part of the date in separate components. In order to be safe for arithmetic and represent leap seconds, the date is always stored in the International Atomic Time standard TimeStandard.TAI. alias JulianDate
- {Number} julianDayNumber The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly. - {Number} secondsOfDay The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly. - {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.
A DataSource which processes Keyhole Markup Language 2.2 (KML).
A DataSource which processes Keyhole Markup Language 2.2 (KML).
KML support in Cesium is incomplete, but a large amount of the standard,
as well as Google's gx
extension namespace, is supported. See Github issue
for a
detailed list of what is and isn't support. Cesium will also write information to the
console when it encounters most unsupported features.
Non visual feature data, such as atom:author
and ExtendedData
is exposed via an instance of KmlFeatureData, which is added to each Entity
under the kml
property.
alias KmlDataSource
- {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. - {Canvas} options.canvas The canvas that is used for sending viewer properties to network links. - {DefaultProxy} [options.proxy] A proxy to be used for loading external data.
var viewer = new Cesium.Viewer('cesiumContainer'); viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz'), { camera: viewer.scene.camera, canvas: viewer.scene.canvas });
Contains KML Feature data loaded into the Entity.kml
property by KmlDataSource
alias KmlFeatureData
Contains KML Feature data loaded into the Entity.kml
property by KmlDataSource
alias KmlFeatureData
A Label draws viewport-aligned text positioned in the 3D scene.
A Label draws viewport-aligned text positioned in the 3D scene. This constructor should not be used directly, instead create labels by calling LabelCollection#add
alias Label
exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near exception {DeveloperError} pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near
LabelCollection#add demo Sandcastle Labels Demo
LabelCollection
A renderable collection of labels.
A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene. Each label can have a different font, color, scale, etc.
Example labels
Labels are added and removed from the collection using LabelCollection#add and LabelCollection#remove
alias LabelCollection
- The options object takes the following properties - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each label from model to world coordinates. - {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. - {Scene} [options.scene] Must be passed in for labels that use the height reference property or will be depth tested against the globe.
performance For best performance, prefer a few collections, each with many labels, to many collections with only a few labels each. Avoid having collections where some labels change every frame and others do not; instead, create one or more collections for static labels, and one or more collections for dynamic labels.
// Create a label collection with two labels var labels = scene.primitives.add(new Cesium.LabelCollection()); labels.add({ position : new Cesium.Cartesian3(1.0, 2.0, 3.0), text : 'A label' }); labels.add({ position : new Cesium.Cartesian3(4.0, 5.0, 6.0), text : 'Another label' });
BillboardCollection demo Sandcastle Labels Demo
Label
LabelCollection#remove
LabelCollection#add
Describes a two dimensional label located at the position of the containing Entity
Describes a two dimensional label located at the position of the containing Entity
Example labels
alias LabelGraphics
- The options object takes the following properties - {Property} [options.text] A Property specifying the text. - {Property} [options.font='10px sans-serif'] A Property specifying the CSS font. - {Property} [options.style=LabelStyle.FILL] A Property specifying the LabelStyle - {Property} [options.fillColor=Color.WHITE] A Property specifying the fill Color - {Property} [options.outlineColor=Color.BLACK] A Property specifying the outline Color - {Property} [options.outlineWidth=1.0] A numeric Property specifying the outline width. - {Property} [options.show=true] A boolean Property specifying the visibility of the label. - {Property} [options.scale=1.0] A numeric Property specifying the scale to apply to the text. - {Property} [options.horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the HorizontalOrigin - {Property} [options.verticalOrigin=VerticalOrigin.CENTER] A Property specifying the VerticalOrigin - {Property} [options.eyeOffset=Cartesian3.ZERO] A Cartesian3 Property specifying the eye offset. - {Property} [options.pixelOffset=Cartesian2.ZERO] A Cartesian2 Property specifying the pixel offset. - {Property} [options.translucencyByDistance] A NearFarScalar Property used to set translucency based on distance from the camera. - {Property} [options.pixelOffsetScaleByDistance] A NearFarScalar Property used to set pixelOffset based on distance from the camera.
A Visualizer which maps the LabelGraphics instance in Entity#label to a Label alias LabelVisualizer
A Visualizer which maps the LabelGraphics instance in Entity#label to a Label alias LabelVisualizer
- {Scene} scene The scene the primitives will be rendered in. - {EntityCollection} entityCollection The entityCollection to visualize.
Describes a single leap second, which is constructed from a JulianDate and a numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
Describes a single leap second, which is constructed from a JulianDate and a numerical offset representing the number of seconds TAI is ahead of the UTC time standard. alias LeapSecond
- {JulianDate} [date] A Julian date representing the time of the leap second. - {Number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.
A spline that uses piecewise linear interpolation to create a curve.
A spline that uses piecewise linear interpolation to create a curve.
alias LinearSpline
- The options object takes the following properties - {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve. - {Cartesian3[]} options.points The array of Cartesian3 control points.
exception {DeveloperError} points.length must be greater than or equal to 2. exception {DeveloperError} times.length must be equal to points.length.
var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; var spline = new Cesium.LinearSpline({ times : times, points : [ new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) ] }); var p0 = spline.evaluate(times[0]);
QuaternionSpline
CatmullRomSpline
HermiteSpline
Defines how geodetic ellipsoid coordinates (Cartographic) project to a flat map like Cesium's 2D and Columbus View modes.
Defines how geodetic ellipsoid coordinates (Cartographic) project to a flat map like Cesium's 2D and Columbus View modes.
alias MapProjection
WebMercatorProjection
GeographicProjection
Provides tiled imagery hosted by Mapbox.
Provides tiled imagery hosted by Mapbox.
alias MapboxImageryProvider
- The options object takes the following properties - {String} [options.url='https://api.mapbox.com/v4/'] The Mapbox server url. - {String} options.mapId The Mapbox Map ID. - {String} [options.accessToken] The public access token for the imagery. - {String} [options.format='png'] The format of the image request. - {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely to result in rendering problems. - {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.
// Mapbox tile provider var mapbox = new Cesium.MapboxImageryProvider({ mapId: 'mapbox.streets', accessToken: 'thisIsMyAccessToken' });
A Material defines surface appearance through a combination of diffuse, specular, normal, emission, and alpha components.
A Material defines surface appearance through a combination of diffuse, specular, normal, emission, and alpha components. These values are specified using a JSON schema called Fabric which gets parsed and assembled into glsl shader code behind-the-scenes. Check out the page for more details on Fabric.
<style type="text/css"> #materialDescriptions code { font-weight: normal; font-family: Consolas, 'Lucida Console', Monaco, monospace; color: #A35A00; } #materialDescriptions ul, #materialDescriptions ul ul { list-style-type: none; } #materialDescriptions ul ul { margin-bottom: 10px; } #materialDescriptions ul ul li { font-weight: normal; color: #000000; text-indent: -2em; margin-left: 2em; } #materialDescriptions ul li { font-weight: bold; color: #0053CF; } </style>
Base material types and their uniforms:
color
: rgba color object.image
: path to image.repeat
: Object with x and y values specifying the number of times to repeat the image.image
: path to image.channels
: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.repeat
: Object with x and y values specifying the number of times to repeat the image.image
: path to image.channel
: One character string containing r, g, b, or a for selecting the desired image channel.repeat
: Object with x and y values specifying the number of times to repeat the image.image
: path to image.channel
: One character string containing r, g, b, or a for selecting the desired image channel.repeat
: Object with x and y values specifying the number of times to repeat the image.image
: path to image.channels
: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.repeat
: Object with x and y values specifying the number of times to repeat the image.image
: path to image.channel
: One character string containing r, g, b, or a for selecting the desired image channel.repeat
: Object with x and y values specifying the number of times to repeat the image.strength
: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.image
: path to image.channels
: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.repeat
: Object with x and y values specifying the number of times to repeat the image.strength
: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.color
: rgba color object for the whole material.cellAlpha
: Alpha value for the cells between grid lines. This will be combined with color.alpha.lineCount
: Object with x and y values specifying the number of columns and rows respectively.lineThickness
: Object with x and y values specifying the thickness of grid lines (in pixels where available).lineOffset
: Object with x and y values specifying the offset of grid lines (range is 0 to 1).horizontal
: Boolean that determines if the stripes are horizontal or vertical.evenColor
: rgba color object for the stripe's first color.oddColor
: rgba color object for the stripe's second color.offset
: Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.repeat
: Number that controls the total number of stripes, half light and half dark.lightColor
: rgba color object for the checkerboard's light alternating color.darkColor
: rgba color object for the checkerboard's dark alternating color.repeat
: Object with x and y values specifying the number of columns and rows respectively.lightColor
: rgba color object for the dot color.darkColor
: rgba color object for the background color.repeat
: Object with x and y values specifying the number of columns and rows of dots respectively.baseWaterColor
: rgba color object base color of the water.blendColor
: rgba color object used when blending from water to non-water areas.specularMap
: Single channel texture used to indicate areas of water.normalMap
: Normal map for water normal perturbation.frequency
: Number that controls the number of waves.normalMap
: Normal map for water normal perturbation.animationSpeed
: Number that controls the animations speed of the water.amplitude
: Number that controls the amplitude of water waves.specularIntensity
: Number that controls the intensity of specular reflections.color
: diffuse color and alpha.rimColor
: diffuse color and alpha of the rim.width
: Number that determines the rim's width.fadeInColor
: diffuse color and alpha at time
fadeOutColor
: diffuse color and alpha at maximumDistance
from time
maximumDistance
: Number between 0.0 and 1.0 where the fadeInColor
becomes the fadeOutColor
. A value of 0.0 gives the entire material a color of fadeOutColor
and a value of 1.0 gives the the entire material a color of fadeInColor
repeat
: true if the fade should wrap around the texture coodinates.fadeDirection
: Object with x and y values specifying if the fade should be in the x and y directions.time
: Object with x and y values between 0.0 and 1.0 of the fadeInColor
positioncolor
: diffuse color and alpha.color
: color and maximum alpha for the glow on the line.glowPower
: strength of the glow, as a percentage of the total line width (less than 1.0).color
: diffuse color and alpha for the interior of the line.outlineColor
: diffuse color and alpha for the outline.outlineWidth
: width of the outline in pixels.alias Material
- The options object takes the following properties
- {Boolean} [options.strict=false] Throws errors for issues that would normally be ignored, including unused uniforms or materials.
- {Boolean|Function} [options.translucent=true] When true
or a function that returns true
, the geometry
with this material is expected to appear translucent.
- {Object} options.fabric The fabric JSON used to generate the material.
exception {DeveloperError} fabric: uniform has invalid type. exception {DeveloperError} fabric: uniforms and materials cannot share the same property. exception {DeveloperError} fabric: cannot have source and components in the same section. exception {DeveloperError} fabric: property name is not valid. It should be 'type', 'materials', 'uniforms', 'components', or 'source'. exception {DeveloperError} fabric: property name is not valid. It should be 'diffuse', 'specular', 'shininess', 'normal', 'emission', or 'alpha'. exception {DeveloperError} strict: shader source does not use string. exception {DeveloperError} strict: shader source does not use uniform. exception {DeveloperError} strict: shader source does not use material.
// Create a color material with fromType: polygon.material = Cesium.Material.fromType('Color'); polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); // Create the default material: polygon.material = new Cesium.Material(); // Create a color material with full Fabric notation: polygon.material = new Cesium.Material({ fabric : { type : 'Color', uniforms : { color : new Cesium.Color(1.0, 1.0, 0.0, 1.0) } } });
wiki page for a more detailed options of Fabric. demo Sandcastle Materials Demo
An appearance for arbitrary geometry (as opposed to EllipsoidSurfaceAppearance, for example) that supports shading with materials.
An appearance for arbitrary geometry (as opposed to EllipsoidSurfaceAppearance, for example) that supports shading with materials.
alias MaterialAppearance
- The options object takes the following properties
- {Boolean} [options.flat=false] When true
, flat shading is used in the fragment shader, which means lighting is not taking into account.
- {Boolean} [options.faceForward=!options.closed] When true
, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like WallGeometry
- {Boolean} [options.translucent=true] When true
, the geometry is expected to appear translucent so MaterialAppearance#renderState has alpha blending enabled.
- {Boolean} [options.closed=false] When true
, the geometry is expected to be closed so MaterialAppearance#renderState has backface culling enabled.
- {MaterialAppearance.MaterialSupport} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported.
- {Material} [options.material=Material.ColorType] The material used to determine the fragment color.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
var primitive = new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : new Cesium.WallGeometry({ materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat, // ... }) }), appearance : new Cesium.MaterialAppearance({ material : Cesium.Material.fromType('Color'), faceForward : true }) });
https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric demo Sandcastle Material Appearance Demo
The interface for all Property objects that represent Material uniforms.
The interface for all Property objects that represent Material uniforms. This type defines an interface and cannot be instantiated directly.
alias MaterialProperty
StripeMaterialProperty
PolylineOutlineMaterialProperty
PolylineGlowMaterialProperty
ImageMaterialProperty
GridMaterialProperty
CompositeMaterialProperty
ColorMaterialProperty
A 2x2 matrix, indexable as a column-major order array.
A 2x2 matrix, indexable as a column-major order array. Constructor parameters are in row-major order for code readability. alias Matrix2
- {Number} [column0Row0=0.0] The value for column 0, row 0. - {Number} [column1Row0=0.0] The value for column 1, row 0. - {Number} [column0Row1=0.0] The value for column 0, row 1. - {Number} [column1Row1=0.0] The value for column 1, row 1.
Matrix4
Matrix3
Matrix2.fromUniformScale
Matrix2.fromScale
Matrix2.fromRowMajorArray
Matrix2.fromColumnMajorArray
A 3x3 matrix, indexable as a column-major order array.
A 3x3 matrix, indexable as a column-major order array. Constructor parameters are in row-major order for code readability. alias Matrix3
- {Number} [column0Row0=0.0] The value for column 0, row 0. - {Number} [column1Row0=0.0] The value for column 1, row 0. - {Number} [column2Row0=0.0] The value for column 2, row 0. - {Number} [column0Row1=0.0] The value for column 0, row 1. - {Number} [column1Row1=0.0] The value for column 1, row 1. - {Number} [column2Row1=0.0] The value for column 2, row 1. - {Number} [column0Row2=0.0] The value for column 0, row 2. - {Number} [column1Row2=0.0] The value for column 1, row 2. - {Number} [column2Row2=0.0] The value for column 2, row 2.
Matrix4
Matrix2
Matrix3.fromUniformScale
Matrix3.fromScale
Matrix3.fromQuaternion
Matrix3.fromRowMajorArray
Matrix3.fromColumnMajorArray
A 4x4 matrix, indexable as a column-major order array.
A 4x4 matrix, indexable as a column-major order array. Constructor parameters are in row-major order for code readability. alias Matrix4
- {Number} [column0Row0=0.0] The value for column 0, row 0. - {Number} [column1Row0=0.0] The value for column 1, row 0. - {Number} [column2Row0=0.0] The value for column 2, row 0. - {Number} [column3Row0=0.0] The value for column 3, row 0. - {Number} [column0Row1=0.0] The value for column 0, row 1. - {Number} [column1Row1=0.0] The value for column 1, row 1. - {Number} [column2Row1=0.0] The value for column 2, row 1. - {Number} [column3Row1=0.0] The value for column 3, row 1. - {Number} [column0Row2=0.0] The value for column 0, row 2. - {Number} [column1Row2=0.0] The value for column 1, row 2. - {Number} [column2Row2=0.0] The value for column 2, row 2. - {Number} [column3Row2=0.0] The value for column 3, row 2. - {Number} [column0Row3=0.0] The value for column 0, row 3. - {Number} [column1Row3=0.0] The value for column 1, row 3. - {Number} [column2Row3=0.0] The value for column 2, row 3. - {Number} [column3Row3=0.0] The value for column 3, row 3.
Packable
Matrix3
Matrix2
Matrix4.computeViewportTransformation
Matrix4.computeInfinitePerspectiveOffCenter
Matrix4.computePerspectiveOffCenter
Matrix4.computeOrthographicOffCenter
Matrix4.computePerspectiveFieldOfView
Matrix4.fromCamera
Matrix4.fromUniformScale
Matrix4.fromScale
Matrix4.fromTranslation
Matrix4.fromTranslationQuaternionRotationScale
Matrix4.fromTranslationRotationScale
Matrix4.fromRotationTranslation
Matrix4.fromRowMajorArray
Matrix4.fromColumnMajorArray
A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
Cesium includes support for geometry and materials, glTF animations, and glTF skinning. In addition, individual glTF nodes are pickable with Scene#pick and animatable with Model#getNode glTF cameras and lights are not currently supported.
An external glTF asset is created with Model glTF JSON can also be created at runtime and passed to this constructor function. In either case, the Model#readyPromise is resolved when the model is ready to render, i.e., when the external binary, image, and shader files are downloaded and the WebGL resources are created.
For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated relative to a local origin.
alias Model
- The options object takes the following properties
- {Object|ArrayBuffer|Uint8Array} [options.gltf] The object for the glTF JSON or an arraybuffer of Binary glTF defined by the KHR_binary_glTF extension.
- {String} [options.basePath= ] The base path that paths in the glTF JSON are relative to.
- {Boolean} [options.show=true] Determines if the model primitive will be shown.
- {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.
- {Number} [options.scale=1.0] A uniform scale applied to this model.
- {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
- {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
- {Object} [options.id] A user-defined object to return when the model is picked with Scene#pick
- {Boolean} [options.allowPicking=true] When true
, each glTF mesh and primitive is pickable with Scene#pick
- {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
- {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
- {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.
- {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
exception {DeveloperError} bgltf is not a valid Binary glTF file. exception {DeveloperError} Only glTF Binary version 1 is supported.
Model.fromGltf demo Sandcastle Models Demo
An active glTF animation.
An active glTF animation. A glTF asset can contain animations. An active animation is an animation that is currently playing or scheduled to be played because it was added to a model's ModelAnimationCollection An active animation is an instance of an animation; for example, there can be multiple active animations for the same glTF animation, each with a different start time.
Create this by calling ModelAnimationCollection#add
alias ModelAnimation
ModelAnimationCollection#add
A collection of active model animations.
A collection of active model animations. Access this using Model#activeAnimations
alias ModelAnimationCollection
Model#activeAnimations
A 3D model based on https://github.com/KhronosGroup/glTF|glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
A 3D model based on https://github.com/KhronosGroup/glTF|glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL. The position and orientation of the model is determined by the containing Entity
Cesium includes support for glTF geometry, materials, animations, and skinning. Cameras and lights are not currently supported.
alias ModelGraphics
- The options object takes the following properties - {Property} [options.uri] A string Property specifying the URI of the glTF asset. - {Property} [options.show=true] A boolean Property specifying the visibility of the model. - {Property} [options.scale=1.0] A numeric Property specifying a uniform linear scale. - {Property} [options.minimumPixelSize=0.0] A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom. - {Property} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize. - {Property} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded. - {Property} [options.runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started. - {Property} [options.nodeTransformations] An object, where keys are names of nodes, and values are TranslationRotationScale Properties describing the transformation to apply to that node.
A model's material with modifiable parameters.
A model's material with modifiable parameters. A glTF material contains parameters defined by the material's technique with values defined by the technique and potentially overridden by the material. This class allows changing these values at runtime.
Use Model#getMaterial to create an instance.
alias ModelMaterial
Model#getMaterial
A model's mesh and its materials.
Model#getMesh
A model node with a transform for user-defined animations.
A model node with a transform for user-defined animations. A glTF asset can contain animations that target a node's transform. This class allows changing a node's transform externally so animation can be driven by another source, not just an animation in the glTF asset.
Use Model#getNode to create an instance.
alias ModelNode
var node = model.getNode('LOD3sp'); node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
Model#getNode
A Visualizer which maps Entity#model to a Model alias ModelVisualizer
A Visualizer which maps Entity#model to a Model alias ModelVisualizer
- {Scene} scene The scene the primitives will be rendered in. - {EntityCollection} entityCollection The entityCollection to visualize.
Draws the Moon in 3D.
Draws the Moon in 3D. alias Moon
- The options object takes the following properties - {Boolean} [options.show=true] Determines whether the moon will be rendered. - {String} [options.textureUrl=buildModuleUrl('Assets/Textures/moonSmall.jpg')] The moon texture. - {Ellipsoid} [options.ellipsoid=Ellipsoid.MOON] The moon ellipsoid. - {Boolean} [options.onlySunLighting=true] Use the sun as the only light source.
scene.moon = new Cesium.Moon();
Scene#moon
The NavigationHelpButton is a single button widget for displaying instructions for navigating the globe with the mouse.
The NavigationHelpButton is a single button widget for displaying instructions for navigating the globe with the mouse.
alias NavigationHelpButton
- The options object takes the following properties - {Element|String} options.container The DOM element or ID that will contain the widget. - {Boolean} [options.instructionsInitiallyVisible=false] True if the navigation instructions should initially be visible; otherwise, false.
exception {DeveloperError} Element with id "container" does not exist in the document.
// In HTML head, include a link to the NavigationHelpButton.css stylesheet, // and in the body, include: var navigationHelpButton = new Cesium.NavigationHelpButton({ container : 'navigationHelpButtonContainer' });
The view model for NavigationHelpButton alias NavigationHelpButtonViewModel
The view model for NavigationHelpButton alias NavigationHelpButtonViewModel
Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
Represents a scalar value's lower and upper bound at a near distance and far distance in eye space. alias NearFarScalar
- {Number} [near=0.0] The lower bound of the camera range. - {Number} [nearValue=0.0] The value at the lower bound of the camera range. - {Number} [far=1.0] The upper bound of the camera range. - {Number} [farValue=0.0] The value at the upper bound of the camera range.
Packable
A TileDiscardPolicy specifying that tile images should never be discard.
A TileDiscardPolicy specifying that tile images should never be discard.
alias NeverTileDiscardPolicy
DiscardMissingTileImagePolicy
A Property that produces TranslationRotationScale data.
A Property that produces TranslationRotationScale data. alias NodeTransformationProperty
- The options object takes the following properties - {Property} [options.translation=Cartesian3.ZERO] A Cartesian3 Property specifying the (x, y, z) translation to apply to the node. - {Property} [options.rotation=Quaternion.IDENTITY] A Quaternion Property specifying the (x, y, z, w) rotation to apply to the node. - {Property} [options.scale=new Cartesian3(1.0, 1.0, 1.0)] A Cartesian3 Property specifying the (x, y, z) scaling to apply to the node.
Creates an Occluder derived from an object's position and radius, as well as the camera position.
Creates an Occluder derived from an object's position and radius, as well as the camera position. The occluder can be used to determine whether or not other objects are visible or hidden behind the visible horizon defined by the occluder and camera position.
alias Occluder
- {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder. - {Cartesian3} cameraPosition The coordinate of the viewer/camera.
// Construct an occluder one unit away from the origin with a radius of one. var cameraPosition = Cesium.Cartesian3.ZERO; var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1); var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
Creates an instance of an OrientedBoundingBox.
Creates an instance of an OrientedBoundingBox. An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than BoundingSphere or AxisAlignedBoundingBox in many cases. alias OrientedBoundingBox
- {Cartesian3} [center=Cartesian3.ZERO] The center of the box. - {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box. Equivalently, the transformation matrix, to rotate and scale a 2x2x2 cube centered at the origin.
// Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale. var center = new Cesium.Cartesian3(1.0, 0.0, 0.0); var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3()); var obb = new Cesium.OrientedBoundingBox(center, halfAxes);
BoundingRectangle
BoundingSphere
The viewing frustum is defined by 6 planes.
The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.
alias OrthographicFrustum
var maxRadii = ellipsoid.maximumRadius; var frustum = new Cesium.OrthographicFrustum(); frustum.right = maxRadii * Cesium.Math.PI; frustum.left = -c.frustum.right; frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth); frustum.bottom = -c.frustum.top; frustum.near = 0.01 * maxRadii; frustum.far = 50.0 * maxRadii;
Describes a polyline defined as the path made by an Entity as it moves over time.
Describes a polyline defined as the path made by an Entity as it moves over time.
alias PathGraphics
- The options object takes the following properties - {Property} [options.leadTime] A Property specifying the number of seconds behind the object to show. - {Property} [options.trailTime] A Property specifying the number of seconds in front of the object to show. - {Property} [options.show=true] A boolean Property specifying the visibility of the path. - {Property} [options.width=1.0] A numeric Property specifying the width in pixels. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to draw the path. - {Property} [options.resolution=60] A numeric Property specifying the width in pixels.
A Visualizer which maps Entity#path to a Polyline alias PathVisualizer
A Visualizer which maps Entity#path to a Polyline alias PathVisualizer
- {Scene} scene The scene the primitives will be rendered in. - {EntityCollection} entityCollection The entityCollection to visualize.
An appearance for GeometryInstance instances with color attributes.
An appearance for GeometryInstance instances with color attributes. This allows several geometry instances, each with a different color, to be drawn with the same Primitive as shown in the second example below.
alias PerInstanceColorAppearance
- The options object takes the following properties
- {Boolean} [options.flat=false] When true
, flat shading is used in the fragment shader, which means lighting is not taking into account.
- {Boolean} [options.faceForward=!options.closed] When true
, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like WallGeometry
- {Boolean} [options.translucent=true] When true
, the geometry is expected to appear translucent so PerInstanceColorAppearance#renderState has alpha blending enabled.
- {Boolean} [options.closed=false] When true
, the geometry is expected to be closed so PerInstanceColorAppearance#renderState has backface culling enabled.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
// A solid white line segment var primitive = new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : new Cesium.SimplePolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 5.0, 0.0 ]) }), attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) } }), appearance : new Cesium.PerInstanceColorAppearance({ flat : true, translucent : false }) }); // Two rectangles in a primitive, each with a different color var instance = new Cesium.GeometryInstance({ geometry : new Cesium.RectangleGeometry({ rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0) }), attributes : { color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) } }); var anotherInstance = new Cesium.GeometryInstance({ geometry : new Cesium.RectangleGeometry({ rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0) }), attributes : { color : new Cesium.Color(0.0, 0.0, 1.0, 0.5) } }); var rectanglePrimitive = new Cesium.Primitive({ geometryInstances : [instance, anotherInstance], appearance : new Cesium.PerInstanceColorAppearance() });
Monitors performance of the application and displays a message if poor performance is detected.
Monitors performance of the application and displays a message if poor performance is detected.
alias PerformanceWatchdog
- The options object takes the following properties - {Element|String} options.container The DOM element or ID that will contain the widget. - {Scene} options.scene The Scene for which to monitor performance. - {String} [options.lowFrameRateMessage='This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] The message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
The view model for PerformanceWatchdog
The view model for PerformanceWatchdog
alias PerformanceWatchdogViewModel
- The options object takes the following properties - {Scene} options.scene The Scene instance for which to monitor performance. - {String} [options.lowFrameRateMessage='This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] The message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
The viewing frustum is defined by 6 planes.
The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.
alias PerspectiveFrustum
var frustum = new Cesium.PerspectiveFrustum(); frustum.aspectRatio = canvas.clientWidth / canvas.clientHeight; frustum.fov = Cesium.Math.PI_OVER_THREE; frustum.near = 1.0; frustum.far = 2.0;
PerspectiveOffCenterFrustum
The viewing frustum is defined by 6 planes.
The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.
alias PerspectiveOffCenterFrustum
var frustum = new Cesium.PerspectiveOffCenterFrustum(); frustum.right = 1.0; frustum.left = -1.0; frustum.top = 1.0; frustum.bottom = -1.0; frustum.near = 1.0; frustum.far = 2.0;
PerspectiveFrustum
A utility class for generating custom map pins as canvas elements.
A utility class for generating custom map pins as canvas elements.
Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
alias PinBuilder
A plane in Hessian Normal Form defined by
ax + by + cz + d = 0where (a, b, c) is the plane's
normal
, d is the signed
distance
to the plane, and (x, y, z) is any point on
the plane.A plane in Hessian Normal Form defined by
ax + by + cz + d = 0where (a, b, c) is the plane's
normal
, d is the signed
distance
to the plane, and (x, y, z) is any point on
the plane.alias Plane
- {Cartesian3} normal The plane's normal (normalized).
- {Number} distance The shortest distance from the origin to the plane. The sign of
distance
determines which side of the plane the origin
is on. If distance
is positive, the origin is in the half-space
in the direction of the normal; if negative, the origin is in the half-space
opposite to the normal; if zero, the plane passes through the origin.
// The plane x=0 var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
Describes a graphical point located at the position of the containing Entity
Describes a graphical point located at the position of the containing Entity
alias PointGraphics
- The options object takes the following properties - {Property} [options.color=Color.WHITE] A Property specifying the Color of the point. - {Property} [options.pixelSize=1] A numeric Property specifying the size in pixels. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=0] A numeric Property specifying the the outline width in pixels. - {Property} [options.show=true] A boolean Property specifying the visibility of the point. - {Property} [options.scaleByDistance] A NearFarScalar Property used to scale the point based on distance. - {Property} [options.translucencyByDistance] A NearFarScalar Property used to set translucency based on distance from the camera.
A graphical point positioned in the 3D scene, that is created and rendered using a PointPrimitiveCollection A point is created and its initial properties are set by calling PointPrimitiveCollection#add
A graphical point positioned in the 3D scene, that is created and rendered using a PointPrimitiveCollection A point is created and its initial properties are set by calling PointPrimitiveCollection#add
alias PointPrimitive
performance Reading a property, e.g., PointPrimitive#show, is constant time. Assigning to a property is constant time but results in CPU to GPU traffic when PointPrimitiveCollection is called. The per-pointPrimitive traffic is the same regardless of how many properties were updated. If most pointPrimitives in a collection need to be updated, it may be more efficient to clear the collection with PointPrimitiveCollection#removeAll and add new pointPrimitives instead of modifying each one.
exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near
PointPrimitiveCollection#add demo Sandcastle Points Demo
PointPrimitiveCollection
A renderable collection of points.
A renderable collection of points.
Points are added and removed from the collection using PointPrimitiveCollection#add and PointPrimitiveCollection#remove
alias PointPrimitiveCollection
- The options object takes the following properties - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each point from model to world coordinates. - {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.
performance For best performance, prefer a few collections, each with many points, to many collections with only a few points each. Organize collections so that points with the same update frequency are in the same collection, i.e., points that do not change should be in one collection; points that change every frame should be in another collection; and so on.
// Create a pointPrimitive collection with two points var points = scene.primitives.add(new Cesium.PointPrimitiveCollection()); points.add({ position : new Cesium.Cartesian3(1.0, 2.0, 3.0), color : Cesium.Color.YELLOW }); points.add({ position : new Cesium.Cartesian3(4.0, 5.0, 6.0), color : Cesium.Color.CYAN });
PointPrimitive
PointPrimitiveCollection#remove
PointPrimitiveCollection#add
A Visualizer which maps Entity#point to a PointPrimitive alias PointVisualizer
A Visualizer which maps Entity#point to a PointPrimitive alias PointVisualizer
- {Scene} scene The scene the primitives will be rendered in. - {EntityCollection} entityCollection The entityCollection to visualize.
A description of a polygon on the ellipsoid.
A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both Primitive and GroundPrimitive.
alias PolygonGeometry
- The options object takes the following properties - {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes. - {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface. - {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height. - {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open. - {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
// 1. create a polygon from points var polygon = new Cesium.PolygonGeometry({ polygonHierarchy : new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0, -75.0, 30.0, -70.0, 30.0, -68.0, 40.0 ]) ) }); var geometry = Cesium.PolygonGeometry.createGeometry(polygon); // 2. create a nested polygon with holes var polygonWithHole = new Cesium.PolygonGeometry({ polygonHierarchy : new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -109.0, 30.0, -95.0, 30.0, -95.0, 40.0, -109.0, 40.0 ]), [new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -107.0, 31.0, -107.0, 39.0, -97.0, 39.0, -97.0, 31.0 ]), [new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -105.0, 33.0, -99.0, 33.0, -99.0, 37.0, -105.0, 37.0 ]), [new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -103.0, 34.0, -101.0, 34.0, -101.0, 36.0, -103.0, 36.0 ]) )] )] )] ) }); var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole); // 3. create extruded polygon var extrudedPolygon = new Cesium.PolygonGeometry({ polygonHierarchy : new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0, -75.0, 30.0, -70.0, 30.0, -68.0, 40.0 ]) ), extrudedHeight: 300000 }); var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
PolygonGeometry#fromPositions demo Sandcastle Polygon Demo
PolygonGeometry#createGeometry
A GeometryUpdater for polygons.
A GeometryUpdater for polygons. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias PolygonGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes. The polygon conforms to the curvature of the globe and can be placed on the surface or at altitude and can optionally be extruded into a volume.
alias PolygonGraphics
- The options object takes the following properties - {Property} [options.hierarchy] A Property specifying the PolygonHierarchy - {Property} [options.height=0] A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface. - {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface. - {Property} [options.show=true] A boolean Property specifying the visibility of the polygon. - {Property} [options.fill=true] A boolean Property specifying whether the polygon is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the polygon. - {Property} [options.outline=false] A boolean Property specifying whether the polygon is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the polygon texture counter-clockwise from north. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. - {Property} [options.perPositionHeight=false] A boolean specifying whether or not the the height of each position is used. - {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open. - {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
Entity demo Sandcastle Polygon Demo
An hierarchy of linear rings which define a polygon and its holes.
An hierarchy of linear rings which define a polygon and its holes. The holes themselves may also have holes which nest inner polygons. alias PolygonHierarchy
- {Cartesian3[]} [positions] A linear ring defining the outer boundary of the polygon or hole. - {PolygonHierarchy[]} [holes] An array of polygon hierarchies defining holes in the polygon.
A description of the outline of a polygon on the ellipsoid.
A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
alias PolygonOutlineGeometry
- The options object takes the following properties - {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes. - {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface. - {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
// 1. create a polygon outline from points var polygon = new Cesium.PolygonOutlineGeometry({ polygonHierarchy : new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0, -75.0, 30.0, -70.0, 30.0, -68.0, 40.0 ]) ) }); var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); // 2. create a nested polygon with holes outline var polygonWithHole = new Cesium.PolygonOutlineGeometry({ polygonHierarchy : new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -109.0, 30.0, -95.0, 30.0, -95.0, 40.0, -109.0, 40.0 ]), [new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -107.0, 31.0, -107.0, 39.0, -97.0, 39.0, -97.0, 31.0 ]), [new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -105.0, 33.0, -99.0, 33.0, -99.0, 37.0, -105.0, 37.0 ]), [new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -103.0, 34.0, -101.0, 34.0, -101.0, 36.0, -103.0, 36.0 ]) )] )] )] ) }); var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole); // 3. create extruded polygon outline var extrudedPolygon = new Cesium.PolygonOutlineGeometry({ polygonHierarchy : new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0, -75.0, 30.0, -70.0, 30.0, -68.0, 40.0 ]) ), extrudedHeight: 300000 }); var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
PolygonOutlineGeometry#fromPositions
PolygonOutlineGeometry#createGeometry
A renderable polyline.
A renderable polyline. Create this by calling PolylineCollection#add
alias Polyline
- The options object takes the following properties
- {Boolean} [options.show=true] true
if this polyline will be shown; otherwise, false
.
- {Number} [options.width=1.0] The width of the polyline in pixels.
- {Boolean} [options.loop=false] Whether a line segment will be added between the last and first line positions to make this line a loop.
- {Material} [options.material=Material.ColorType] The material.
- {Cartesian3[]} [options.positions] The positions.
- {Object} [options.id] The user-defined object to be returned when this polyline is picked.
PolylineCollection
A MaterialProperty that maps to PolylineArrow Material uniforms.
A MaterialProperty that maps to PolylineArrow Material uniforms.
- {Property} [color=Color.WHITE] The Color Property to be used.
alias PolylineArrowMaterialProperty
A renderable collection of polylines.
A renderable collection of polylines.
Example polylines
Polylines are added and removed from the collection using PolylineCollection#add and PolylineCollection#remove
alias PolylineCollection
- The options object takes the following properties - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each polyline from model to world coordinates. - {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.
performance For best performance, prefer a few collections, each with many polylines, to many collections with only a few polylines each. Organize collections so that polylines with the same update frequency are in the same collection, i.e., polylines that do not change should be in one collection; polylines that change every frame should be in another collection; and so on.
// Create a polyline collection with two polylines var polylines = new Cesium.PolylineCollection(); polylines.add({ positions : Cesium.Cartesian3.fromDegreesArray([ -75.10, 39.57, -77.02, 38.53, -80.50, 35.14, -80.12, 25.46]), width : 2 }); polylines.add({ positions : Cesium.Cartesian3.fromDegreesArray([ -73.10, 37.57, -75.02, 36.53, -78.50, 33.14, -78.12, 23.46]), width : 4 });
LabelCollection
Polyline
PolylineCollection#remove
PolylineCollection#add
An appearance for GeometryInstance instances with color attributes and PolylineGeometry This allows several geometry instances, each with a different color, to be drawn with the same Primitive
An appearance for GeometryInstance instances with color attributes and PolylineGeometry This allows several geometry instances, each with a different color, to be drawn with the same Primitive
alias PolylineColorAppearance
- The options object takes the following properties
- {Boolean} [options.translucent=true] When true
, the geometry is expected to appear translucent so PolylineColorAppearance#renderState has alpha blending enabled.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
// A solid white line segment var primitive = new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : new Cesium.PolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 5.0, 0.0 ]), width : 10.0, vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT }), attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) } }), appearance : new Cesium.PolylineColorAppearance({ translucent : false }) });
A description of a polyline modeled as a line strip; the first two positions define a line segment, and each additional position defines a line segment from the previous position.
A description of a polyline modeled as a line strip; the first two positions define a line segment, and each additional position defines a line segment from the previous position. The polyline is capable of displaying with a material.
alias PolylineGeometry
- The options object takes the following properties - {Cartesian3[]} options.positions An array of Cartesian3 defining the positions in the polyline as a line strip. - {Number} [options.width=1.0] The width in pixels. - {Color[]} [options.colors] An Array of Color defining the per vertex or per segment colors. - {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices. - {Boolean} [options.followSurface=true] A boolean that determines whether positions will be adjusted to the surface of the ellipsoid via a great arc. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.followSurface=true. Determines the number of positions in the buffer. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
exception {DeveloperError} At least two positions are required. exception {DeveloperError} width must be greater than or equal to one. exception {DeveloperError} colors has an invalid length.
// A polyline with two connected line segments var polyline = new Cesium.PolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 5.0, 0.0, 5.0, 5.0 ]), width : 10.0 }); var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
PolylineGeometry#createGeometry demo Sandcastle Polyline Demo
A GeometryUpdater for polylines.
A GeometryUpdater for polylines. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias PolylineGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
A MaterialProperty that maps to polyline glow Material uniforms.
A MaterialProperty that maps to polyline glow Material uniforms. alias PolylineGlowMaterialProperty
- The options object takes the following properties - {Property} [options.color=Color.WHITE] A Property specifying the Color of the line. - {Property} [options.glowPower=0.25] A numeric Property specifying the strength of the glow, as a percentage of the total line width.
Describes a polyline defined as a line strip.
Describes a polyline defined as a line strip. The first two positions define a line segment, and each additional position defines a line segment from the previous position. The segments can be linear connected points or great arcs.
alias PolylineGraphics
- The options object takes the following properties - {Property} [options.positions] A Property specifying the array of Cartesian3 positions that define the line strip. - {Property} [options.followSurface=true] A boolean Property specifying whether the line segments should be great arcs or linearly connected. - {Property} [options.width=1.0] A numeric Property specifying the width in pixels. - {Property} [options.show=true] A boolean Property specifying the visibility of the polyline. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to draw the polyline. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if followSurface is true.
Entity demo Sandcastle Polyline Demo
An appearance for PolylineGeometry that supports shading with materials.
An appearance for PolylineGeometry that supports shading with materials.
alias PolylineMaterialAppearance
- The options object takes the following properties
- {Boolean} [options.translucent=true] When true
, the geometry is expected to appear translucent so PolylineMaterialAppearance#renderState has alpha blending enabled.
- {Material} [options.material=Material.ColorType] The material used to determine the fragment color.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
var primitive = new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : new Cesium.PolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 5.0, 0.0 ]), width : 10.0, vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT }) }), appearance : new Cesium.PolylineMaterialAppearance({ material : Cesium.Material.fromType('Color') }) });
https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric
A MaterialProperty that maps to polyline outline Material uniforms.
A MaterialProperty that maps to polyline outline Material uniforms. alias PolylineOutlineMaterialProperty
- The options object takes the following properties - {Property} [options.color=Color.WHITE] A Property specifying the Color of the line. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline, in pixels.
A description of a polyline with a volume (a 2D shape extruded along a polyline).
A description of a polyline with a volume (a 2D shape extruded along a polyline).
alias PolylineVolumeGeometry
- The options object takes the following properties - {Cartesian3[]} options.polylinePositions An array of Cartesian3 positions that define the center of the polyline volume. - {Cartesian2[]} options.shapePositions An array of Cartesian2 positions that define the shape to be extruded along the polyline - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
function computeCircle(radius) { var positions = []; for (var i = 0; i < 360; i++) { var radians = Cesium.Math.toRadians(i); positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); } return positions; } var volume = new Cesium.PolylineVolumeGeometry({ vertexFormat : Cesium.VertexFormat.POSITION_ONLY, polylinePositions : Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0 ]), shapePositions : computeCircle(100000.0) });
PolylineVolumeGeometry#createGeometry demo Sandcastle Polyline Volume Demo
A GeometryUpdater for polyline volumes.
A GeometryUpdater for polyline volumes. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias PolylineVolumeGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.
Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it. The resulting volume conforms to the curvature of the globe.
alias PolylineVolumeGraphics
- The options object takes the following properties - {Property} [options.positions] A Property specifying the array of Cartesian3 positions which define the line strip. - {Property} [options.shape] A Property specifying the array of Cartesian2 positions which define the shape to be extruded. - {Property} [options.cornerType=CornerType.ROUNDED] A CornerType Property specifying the style of the corners. - {Property} [options.show=true] A boolean Property specifying the visibility of the volume. - {Property} [options.fill=true] A boolean Property specifying whether the volume is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the volume. - {Property} [options.outline=false] A boolean Property specifying whether the volume is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.
Entity demo Sandcastle Polyline Volume Demo
A description of a polyline with a volume (a 2D shape extruded along a polyline).
A description of a polyline with a volume (a 2D shape extruded along a polyline).
alias PolylineVolumeOutlineGeometry
- The options object takes the following properties - {Cartesian3[]} options.polylinePositions An array of positions that define the center of the polyline volume. - {Cartesian2[]} options.shapePositions An array of positions that define the shape to be extruded along the polyline - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
function computeCircle(radius) { var positions = []; for (var i = 0; i < 360; i++) { var radians = Cesium.Math.toRadians(i); positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); } return positions; } var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({ polylinePositions : Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0 ]), shapePositions : computeCircle(100000.0) });
PolylineVolumeOutlineGeometry#createGeometry
The interface for all Property objects that define a world location as a Cartesian3 with an associated ReferenceFrame This type defines an interface and cannot be instantiated directly.
The interface for all Property objects that define a world location as a Cartesian3 with an associated ReferenceFrame This type defines an interface and cannot be instantiated directly.
alias PositionProperty
TimeIntervalCollectionPositionProperty
SampledPositionProperty
ConstantPositionProperty
CompositePositionProperty
A PositionProperty whose value is an array whose items are the computed value of other PositionProperty instances.
A PositionProperty whose value is an array whose items are the computed value of other PositionProperty instances.
alias PositionPropertyArray
- {Property[]} [value] An array of Property instances. - {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.
A primitive represents geometry in the Scene The geometry can be from a single GeometryInstance as shown in example 1 below, or from an array of instances, even if the geometry is from different geometry types, e.g., an RectangleGeometry and an EllipsoidGeometry as shown in Code Example 2.
A primitive represents geometry in the Scene The geometry can be from a single GeometryInstance as shown in example 1 below, or from an array of instances, even if the geometry is from different geometry types, e.g., an RectangleGeometry and an EllipsoidGeometry as shown in Code Example 2.
A primitive combines geometry instances with an Appearance that describes the full shading, including Material and RenderState Roughly, the geometry instance defines the structure and placement, and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix and match most of them and add a new geometry or appearance independently of each other.
Combining multiple instances into one primitive is called batching, and significantly improves performance for static data. Instances can be individually picked; Scene#pick returns their GeometryInstance#id Using per-instance appearances like PerInstanceColorAppearance, each instance can also have a unique color.
Geometry can either be created and batched on a web worker or the main thread. The first two examples
show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
shows how to create the geometry on the main thread by explicitly calling the createGeometry
method.
alias Primitive
- The options object takes the following properties
- {GeometryInstance[]|GeometryInstance} [options.geometryInstances] The geometry instances - or a single geometry instance - to render.
- {Appearance} [options.appearance] The appearance used to render the primitive.
- {Boolean} [options.show=true] Determines if this primitive will be shown.
- {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
- {Boolean} [options.vertexCacheOptimize=false] When true
, geometry vertices are optimized for the pre and post-vertex-shader caches.
- {Boolean} [options.interleave=false] When true
, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
- {Boolean} [options.compressVertices=true] When true
, the geometry vertices are compressed, which will save memory.
- {Boolean} [options.releaseGeometryInstances=true] When true
, the primitive does not keep a reference to the input geometryInstances
to save memory.
- {Boolean} [options.allowPicking=true] When true
, each geometry instance will only be pickable with Scene#pick When false
, GPU memory is saved.
- {Boolean} [options.cull=true] When true
, the renderer frustum culls and horizon culls the primitive's commands based on their bounding volume. Set this to false
for a small performance gain if you are manually culling the primitive.
- {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready.
- {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.
// 3. Create the geometry on the main thread. scene.primitives.add(new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({ radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL })), modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), id : 'ellipsoid', attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) } }), appearance : new Cesium.PerInstanceColorAppearance() }));
// 2. Draw different instances each with a unique color var rectangleInstance = new Cesium.GeometryInstance({ geometry : new Cesium.RectangleGeometry({ rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0), vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT }), id : 'rectangle', attributes : { color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) } }); var ellipsoidInstance = new Cesium.GeometryInstance({ geometry : new Cesium.EllipsoidGeometry({ radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL }), modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), id : 'ellipsoid', attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) } }); scene.primitives.add(new Cesium.Primitive({ geometryInstances : [rectangleInstance, ellipsoidInstance], appearance : new Cesium.PerInstanceColorAppearance() }));
// 1. Draw a translucent ellipse on the surface with a checkerboard pattern var instance = new Cesium.GeometryInstance({ geometry : new Cesium.EllipseGeometry({ center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0), semiMinorAxis : 500000.0, semiMajorAxis : 1000000.0, rotation : Cesium.Math.PI_OVER_FOUR, vertexFormat : Cesium.VertexFormat.POSITION_AND_ST }), id : 'object returned when this instance is picked and to get/set per-instance attributes' }); scene.primitives.add(new Cesium.Primitive({ geometryInstances : instance, appearance : new Cesium.EllipsoidSurfaceAppearance({ material : Cesium.Material.fromType('Checkerboard') }) }));
Appearance
GeometryInstance
A collection of primitives.
A collection of primitives. This is most often used with Scene#primitives,
but PrimitiveCollection
is also a primitive itself so collections can
be added to collections forming a hierarchy.
alias PrimitiveCollection
- The options object takes the following properties - {Boolean} [options.show=true] Determines if the primitives in the collection will be shown. - {Boolean} [options.destroyPrimitives=true] Determines if primitives in the collection are destroyed when they are removed.
var billboards = new Cesium.BillboardCollection(); var labels = new Cesium.LabelCollection(); var collection = new Cesium.PrimitiveCollection(); collection.add(billboards); scene.primitives.add(collection); // Add collection scene.primitives.add(labels); // Add regular primitive
The interface for all properties, which represent a value that can optionally vary over time.
The interface for all properties, which represent a value that can optionally vary over time. This type defines an interface and cannot be instantiated directly.
alias Property
ReferenceProperty
PositionProperty
MaterialProperty
TimeIntervalCollectionProperty
SampledProperty
ConstantProperty
CompositeProperty
A Property whose value is an array whose items are the computed value of other property instances.
A Property whose value is an array whose items are the computed value of other property instances.
alias PropertyArray
- {Property[]} [value] An array of Property instances.
A Property whose value is a key-value mapping of property names to the computed value of other properties.
A Property whose value is a key-value mapping of property names to the computed value of other properties.
alias PropertyBag
- {Object} [value] An object, containing key-value mapping of property names to properties. - {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property.
A view model that represents each item in the BaseLayerPicker
A view model that represents each item in the BaseLayerPicker
alias ProviderViewModel
- {Object} options The object containing all parameters. - {String} options.name The name of the layer. - {String} options.tooltip The tooltip to show when the item is moused over. - {String} options.iconUrl An icon representing the layer. - {ProviderViewModel~CreationFunction|Command} options.creationFunction A function or Command that creates one or more providers which will be added to the globe when this item is selected.
TerrainProvider
ImageryProvider
BaseLayerPicker
Terrain data for a single tile where the terrain data is represented as a quantized mesh.
Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile and 32767 at the maximum height in the tile.
alias QuantizedMeshTerrainData
- The options object takes the following properties - {Uint16Array} options.quantizedVertices The buffer containing the quantized mesh. - {Uint16Array|Uint32Array} options.indices The indices specifying how the quantized vertices are linked together into triangles. Each three indices specifies one triangle. - {Number} options.minimumHeight The minimum terrain height within the tile, in meters above the ellipsoid. - {Number} options.maximumHeight The maximum terrain height within the tile, in meters above the ellipsoid. - {BoundingSphere} options.boundingSphere A sphere bounding all of the vertices in the mesh. - {OrientedBoundingBox} [options.orientedBoundingBox] An OrientedBoundingBox bounding all of the vertices in the mesh. - {Cartesian3} options.horizonOcclusionPoint The horizon occlusion point of the mesh. If this point is below the horizon, the entire tile is assumed to be below the horizon as well. The point is expressed in ellipsoid-scaled coordinates. - {Number[]} options.westIndices The indices of the vertices on the western edge of the tile. - {Number[]} options.southIndices The indices of the vertices on the southern edge of the tile. - {Number[]} options.eastIndices The indices of the vertices on the eastern edge of the tile. - {Number[]} options.northIndices The indices of the vertices on the northern edge of the tile. - {Number} options.westSkirtHeight The height of the skirt to add on the western edge of the tile. - {Number} options.southSkirtHeight The height of the skirt to add on the southern edge of the tile. - {Number} options.eastSkirtHeight The height of the skirt to add on the eastern edge of the tile. - {Number} options.northSkirtHeight The height of the skirt to add on the northern edge of the tile. - {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist. If a child's bit is set, geometry will be requested for that tile as well when it is needed. If the bit is cleared, the child tile is not requested and geometry is instead upsampled from the parent. The bit values are as follows:
Bit Position | Bit Value | Child Tile |
---|---|---|
0 | 1 | Southwest |
1 | 2 | Southeast |
2 | 4 | Northwest |
3 | 8 | Northeast |
var data = new Cesium.QuantizedMeshTerrainData({ minimumHeight : -100, maximumHeight : 2101, quantizedVertices : new Uint16Array([// order is SW NW SE NE // longitude 0, 0, 32767, 32767, // latitude 0, 32767, 0, 32767, // heights 16384, 0, 32767, 16384]), indices : new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000), orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())), horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0), westIndices : [0, 1], southIndices : [0, 1], eastIndices : [2, 3], northIndices : [1, 3], westSkirtHeight : 1.0, southSkirtHeight : 1.0, eastSkirtHeight : 1.0, northSkirtHeight : 1.0 });
HeightmapTerrainData
TerrainData
A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space. alias Quaternion
- {Number} [x=0.0] The X component. - {Number} [y=0.0] The Y component. - {Number} [z=0.0] The Z component. - {Number} [w=0.0] The W component.
PackableForInterpolation
A spline that uses spherical quadrangle (squad) interpolation to create a quaternion curve.
A spline that uses spherical quadrangle (squad) interpolation to create a quaternion curve. The generated curve is in the class C1.
alias QuaternionSpline
- The options object takes the following properties - {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve. - {Quaternion[]} options.points The array of Quaternion control points. - {Quaternion} [options.firstInnerQuadrangle] The inner quadrangle of the curve at the first control point. If the inner quadrangle is not given, it will be estimated. - {Quaternion} [options.lastInnerQuadrangle] The inner quadrangle of the curve at the last control point. If the inner quadrangle is not given, it will be estimated.
exception {DeveloperError} points.length must be greater than or equal to 2. exception {DeveloperError} times.length must be equal to points.length.
LinearSpline
CatmullRomSpline
HermiteSpline
A queue that can enqueue items at the end, and dequeue items from the front.
A queue that can enqueue items at the end, and dequeue items from the front.
alias Queue
Represents a ray that extends infinitely from the provided origin in the provided direction.
Represents a ray that extends infinitely from the provided origin in the provided direction. alias Ray
- {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray. - {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.
A two dimensional region specified as longitude and latitude coordinates.
A two dimensional region specified as longitude and latitude coordinates.
alias Rectangle
- {Number} [west=0.0] The westernmost longitude, in radians, in the range [-Pi, Pi]. - {Number} [south=0.0] The southernmost latitude, in radians, in the range [-Pi/2, Pi/2]. - {Number} [east=0.0] The easternmost longitude, in radians, in the range [-Pi, Pi]. - {Number} [north=0.0] The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
Packable
A description of a cartographic rectangle on an ellipsoid centered at the origin.
A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both Primitive and GroundPrimitive.
alias RectangleGeometry
- The options object takes the following properties - {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface. - {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise. - {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. - {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface. - {Boolean} [options.closeTop=true] Specifies whether the rectangle has a top cover when extruded. - {Boolean} [options.closeBottom=true] Specifies whether the rectangle has a bottom cover when extruded.
exception {DeveloperError} options.rectangle.north
must be in the interval [-Pi/2
, Pi/2
].
exception {DeveloperError} options.rectangle.south
must be in the interval [-Pi/2
, Pi/2
].
exception {DeveloperError} options.rectangle.east
must be in the interval [-Pi
, Pi
].
exception {DeveloperError} options.rectangle.west
must be in the interval [-Pi
, Pi
].
exception {DeveloperError} options.rectangle.north
must be greater than options.rectangle.south
.
// 1. create an rectangle var rectangle = new Cesium.RectangleGeometry({ ellipsoid : Cesium.Ellipsoid.WGS84, rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), height : 10000.0 }); var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); // 2. create an extruded rectangle without a top var rectangle = new Cesium.RectangleGeometry({ ellipsoid : Cesium.Ellipsoid.WGS84, rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), height : 10000.0, extrudedHeight: 300000, closeTop: false }); var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
RectangleGeometry#createGeometry demo Sandcastle Rectangle Demo
A GeometryUpdater for rectangles.
A GeometryUpdater for rectangles. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias RectangleGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes graphics for a Rectangle The rectangle conforms to the curvature of the globe and can be placed on the surface or at altitude and can optionally be extruded into a volume.
Describes graphics for a Rectangle The rectangle conforms to the curvature of the globe and can be placed on the surface or at altitude and can optionally be extruded into a volume.
alias RectangleGraphics
- The options object takes the following properties - {Property} [options.coordinates] The Property specifying the Rectangle - {Property} [options.height=0] A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface. - {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface. - {Property} [options.closeTop=true] A boolean Property specifying whether the rectangle has a top cover when extruded - {Property} [options.closeBottom=true] A boolean Property specifying whether the rectangle has a bottom cover when extruded. - {Property} [options.show=true] A boolean Property specifying the visibility of the rectangle. - {Property} [options.fill=true] A boolean Property specifying whether the rectangle is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the rectangle. - {Property} [options.outline=false] A boolean Property specifying whether the rectangle is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.rotation=0.0] A numeric property specifying the rotation of the rectangle clockwise from north. - {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the rectangle texture counter-clockwise from north. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the rectangle.
Entity demo Sandcastle Rectangle Demo
A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
alias RectangleOutlineGeometry
- The options object takes the following properties - {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface. - {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise. - {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.
exception {DeveloperError} options.rectangle.north
must be in the interval [-Pi/2
, Pi/2
].
exception {DeveloperError} options.rectangle.south
must be in the interval [-Pi/2
, Pi/2
].
exception {DeveloperError} options.rectangle.east
must be in the interval [-Pi
, Pi
].
exception {DeveloperError} options.rectangle.west
must be in the interval [-Pi
, Pi
].
exception {DeveloperError} options.rectangle.north
must be greater than rectangle.south
.
var rectangle = new Cesium.RectangleOutlineGeometry({ ellipsoid : Cesium.Ellipsoid.WGS84, rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), height : 10000.0 }); var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
RectangleOutlineGeometry#createGeometry
A Property which transparently links to another property on a provided object.
A Property which transparently links to another property on a provided object.
alias ReferenceProperty
- {EntityCollection} targetCollection The entity collection which will be used to resolve the reference. - {String} targetId The id of the entity which is being referenced. - {String[]} targetPropertyNames The names of the property on the target entity which we will use.
var collection = new Cesium.EntityCollection(); //Create a new entity and assign a billboard scale. var object1 = new Cesium.Entity({id:'object1'}); object1.billboard = new Cesium.BillboardGraphics(); object1.billboard.scale = new Cesium.ConstantProperty(2.0); collection.add(object1); //Create a second entity and reference the scale from the first one. var object2 = new Cesium.Entity({id:'object2'}); object2.model = new Cesium.ModelGraphics(); object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']); collection.add(object2); //Create a third object, but use the fromString helper function. var object3 = new Cesium.Entity({id:'object3'}); object3.billboard = new Cesium.BillboardGraphics(); object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale'); collection.add(object3); //You can refer to an entity with a # or . in id and property names by escaping them. var object4 = new Cesium.Entity({id:'#object.4'}); object4.billboard = new Cesium.BillboardGraphics(); object4.billboard.scale = new Cesium.ConstantProperty(2.0); collection.add(object4); var object5 = new Cesium.Entity({id:'object5'}); object5.billboard = new Cesium.BillboardGraphics(); object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale'); collection.add(object5);
An event that is raised when a request encounters an error.
An event that is raised when a request encounters an error.
alias RequestErrorEvent
- {Number} [statusCode] The HTTP error status code, such as 404. - {Object} [response] The response included along with the error. - {String|Object} [responseHeaders] The response headers, represented either as an object literal or as a string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
Constructs an exception object that is thrown due to an error that can occur at runtime, e.g., out of memory, could not compile shader, etc.
Constructs an exception object that is thrown due to an error that can occur at runtime, e.g., out of memory, could not compile shader, etc. If a function may throw this exception, the calling code should be prepared to catch it.
On the other hand, a DeveloperError indicates an exception due to a developer error, e.g., invalid argument, that usually indicates a bug in the calling code.
alias RuntimeError
extends Error
- {String} [message] The error message for this exception.
DeveloperError
A SampledProperty which is also a PositionProperty
A SampledProperty which is also a PositionProperty
alias SampledPositionProperty
- {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined. - {Number} [numberOfDerivatives=0] The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...
A Property whose value is interpolated for a given time from the provided set of samples and specified interpolation algorithm and degree.
A Property whose value is interpolated for a given time from the provided set of samples and specified interpolation algorithm and degree. alias SampledProperty
- {Number|Packable} type The type of property. - {Packable[]} [derivativeTypes] When supplied, indicates that samples will contain derivative information of the specified types.
//Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
var property = new Cesium.SampledProperty(Number);
property.setInterpolationOptions({
interpolationDegree : 3,
interpolationAlgorithm : Cesium.HermitePolynomialApproximation
});
//Populate it with data
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:00:00.00Z
), 1.0);
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:01:00.00Z
), 6.0);
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:02:00.00Z
), 12.0);
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:03:30.00Z
), 5.0);
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:06:30.00Z
), 2.0);
//Samples can be added in any order.
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:00:30.00Z
), 6.2);
//Retrieve an interpolated value
var result = property.getValue(Cesium.JulianDate.fromIso8601(2012-08-01T00:02:34.00Z
));
//Create a linearly interpolated Cartesian2
var property = new Cesium.SampledProperty(Cesium.Cartesian2);
//Populate it with data
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-01T00:00:00.00Z
), new Cesium.Cartesian2(0, 0));
property.addSample(Cesium.JulianDate.fromIso8601(2012-08-02T00:00:00.00Z
), new Cesium.Cartesian2(4, 7));
//Retrieve an interpolated value
var result = property.getValue(Cesium.JulianDate.fromIso8601(2012-08-01T12:00:00.00Z
));
SampledPositionProperty
The container for all 3D graphical objects and state in a Cesium virtual scene.
The container for all 3D graphical objects and state in a Cesium virtual scene. Generally, a scene is not created directly; instead, it is implicitly created by CesiumWidget
contextOptions
parameter details:
The default values are:
{
webgl : {
alpha : false,
depth : true,
stencil : false,
antialias : true,
premultipliedAlpha : true,
preserveDrawingBuffer : false,
failIfMajorPerformanceCaveat : false
},
allowTextureFilterAnisotropic : true
}
The webgl
property corresponds to the http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes
object used to create the WebGL context.
webgl.alpha
defaults to false, which can improve performance compared to the standard WebGL default
of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
webgl.alpha
to true.
The other webgl
properties match the WebGL defaults for http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes
allowTextureFilterAnisotropic
defaults to true, which enables anisotropic texture filtering when the
WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
alias Scene
- The options object takes the following properties - {Canvas} options.canvas The HTML canvas element to create the scene for. - {Object} [options.contextOptions] Context and WebGL creation properties. See details above. - {Element} [options.creditContainer] The HTML element in which the credits will be displayed. - {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. - {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. - {Boolean} [options.scene3DOnly=false] If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View. - {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.
// Create scene without anisotropic texture filtering var scene = new Cesium.Scene({ canvas : canvas, contextOptions : { allowTextureFilterAnisotropic : false } });
http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes exception {DeveloperError} options and options.canvas are required.
CesiumWidget
The SceneModePicker is a single button widget for switching between scene modes; shown to the left in its expanded state. Programatic switching of scene modes will be automatically reflected in the widget as long as the specified Scene is used to perform the change.
alias SceneModePicker
- {Element|String} container The DOM element or ID that will contain the widget. - {Scene} scene The Scene instance to use. - {Number} [duration=2.0] The time, in seconds, it takes for the scene to transition.
exception {DeveloperError} Element with id "container" does not exist in the document.
// In HTML head, include a link to the SceneModePicker.css stylesheet, // and in the body, include: // Note: This code assumes you already have a Scene instance. var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);
The view model for SceneModePicker alias SceneModePickerViewModel
The view model for SceneModePicker alias SceneModePickerViewModel
- {Scene} scene The Scene to morph - {Number} [duration=2.0] The duration of scene morph animations, in seconds
Modifies the camera position and orientation based on mouse input to a canvas.
Modifies the camera position and orientation based on mouse input to a canvas. alias ScreenSpaceCameraController
- {Scene} scene The scene.
Handles user input events.
Handles user input events. Custom functions can be added to be executed on when the user enters input.
alias ScreenSpaceEventHandler
- {Canvas} [element=document] The element to add events to.
A widget for displaying an indicator on a selected object.
A widget for displaying an indicator on a selected object.
alias SelectionIndicator
- {Element|String} container The DOM element or ID that will contain the widget. - {Scene} scene The Scene instance to use.
exception {DeveloperError} Element with id "container" does not exist in the document.
The view model for SelectionIndicator alias SelectionIndicatorViewModel
The view model for SelectionIndicator alias SelectionIndicatorViewModel
- {Scene} scene The scene instance to use for screen-space coordinate conversion. - {Element} selectionIndicatorElement The element containing all elements that make up the selection indicator. - {Element} container The DOM element that contains the widget.
Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
alias ShowGeometryInstanceAttribute
- {Boolean} [show=true] Determines if the geometry instance will be shown.
var instance = new Cesium.GeometryInstance({ geometry : new Cesium.BoxGeometry({ vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) }), modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), id : 'box', attributes : { show : new Cesium.ShowGeometryInstanceAttribute(false) } });
GeometryInstanceAttribute
GeometryInstance
A description of a polyline modeled as a line strip; the first two positions define a line segment, and each additional position defines a line segment from the previous position.
A description of a polyline modeled as a line strip; the first two positions define a line segment, and each additional position defines a line segment from the previous position.
alias SimplePolylineGeometry
- The options object takes the following properties - {Cartesian3[]} options.positions An array of Cartesian3 defining the positions in the polyline as a line strip. - {Color[]} [options.colors] An Array of Color defining the per vertex or per segment colors. - {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices. - {Boolean} [options.followSurface=true] A boolean that determines whether positions will be adjusted to the surface of the ellipsoid via a great arc. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.followSurface=true. Determines the number of positions in the buffer. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
exception {DeveloperError} At least two positions are required. exception {DeveloperError} colors has an invalid length.
// A polyline with two connected line segments var polyline = new Cesium.SimplePolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 5.0, 0.0, 5.0, 5.0 ]) }); var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
SimplePolylineGeometry#createGeometry
Provides a single, top-level imagery tile.
Provides a single, top-level imagery tile. The single image is assumed to use a GeographicTilingScheme
alias SingleTileImageryProvider
- The options object takes the following properties - {String} options.url The url for the tile. - {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed.
UrlTemplateImageryProvider
WebMapTileServiceImageryProvider
WebMapServiceImageryProvider
createTileMapServiceImageryProvider
createOpenStreetMapImageryProvider
GoogleEarthImageryProvider
BingMapsImageryProvider
ArcGisMapServerImageryProvider
An atmosphere drawn around the limb of the provided ellipsoid.
An atmosphere drawn around the limb of the provided ellipsoid. Based on Atmospheric Scattering in GPU Gems 2.
This is only supported in 3D. atmosphere is faded out when morphing to 2D or Columbus view.
alias SkyAtmosphere
- {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that the atmosphere is drawn around.
scene.skyAtmosphere = new Cesium.SkyAtmosphere();
Scene.skyAtmosphere
A sky box around the scene to draw stars.
A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of the sky box must not exceed Scene#maximumCubeMapSize
alias SkyBox
- The options object takes the following properties
- {Object} [options.sources] The source URL or Image
object for each of the six cube map faces. See the example below.
- {Boolean} [options.show=true] Determines if this primitive will be shown.
scene.skyBox = new Cesium.SkyBox({ sources : { positiveX : 'skybox_px.png', negativeX : 'skybox_nx.png', positiveY : 'skybox_py.png', negativeY : 'skybox_ny.png', positiveZ : 'skybox_pz.png', negativeZ : 'skybox_nz.png' } });
Transforms.computeTemeToPseudoFixedMatrix
Scene#skyBox
A description of a sphere centered at the origin.
A description of a sphere centered at the origin.
alias SphereGeometry
- The options object takes the following properties - {Number} [options.radius=1.0] The radius of the sphere. - {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks. - {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
exception {DeveloperError} options.slicePartitions cannot be less than three. exception {DeveloperError} options.stackPartitions cannot be less than three.
var sphere = new Cesium.SphereGeometry({ radius : 100.0, vertexFormat : Cesium.VertexFormat.POSITION_ONLY }); var geometry = Cesium.SphereGeometry.createGeometry(sphere);
SphereGeometry#createGeometry
A description of the outline of a sphere.
A description of the outline of a sphere.
alias SphereOutlineGeometry
- The options object takes the following properties - {Number} [options.radius=1.0] The radius of the sphere. - {Number} [options.stackPartitions=10] The count of stacks for the sphere (1 greater than the number of parallel lines). - {Number} [options.slicePartitions=8] The count of slices for the sphere (Equal to the number of radial lines). - {Number} [options.subdivisions=200] The number of points per line, determining the granularity of the curvature .
exception {DeveloperError} options.stackPartitions must be greater than or equal to one. exception {DeveloperError} options.slicePartitions must be greater than or equal to zero. exception {DeveloperError} options.subdivisions must be greater than or equal to zero.
var sphere = new Cesium.SphereOutlineGeometry({ radius : 100.0, stackPartitions : 6, slicePartitions: 5 }); var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
A set of curvilinear 3-dimensional coordinates.
A set of curvilinear 3-dimensional coordinates.
alias Spherical
- {Number} [clock=0.0] The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. - {Number} [cone=0.0] The angular coordinate measured from the positive z-axis and toward the negative z-axis. - {Number} [magnitude=1.0] The linear coordinate measured from the origin.
Creates a curve parameterized and evaluated by time.
Creates a curve parameterized and evaluated by time. This type describes an interface and is not intended to be instantiated directly.
alias Spline
QuaternionSpline
LinearSpline
HermiteSpline
CatmullRomSpline
A MaterialProperty that maps to stripe Material uniforms.
A MaterialProperty that maps to stripe Material uniforms. alias StripeMaterialProperty
- The options object takes the following properties - {Property} [options.evenColor=Color.WHITE] A Property specifying the first Color - {Property} [options.oddColor=Color.BLACK] A Property specifying the second Color - {Property} [options.repeat=1] A numeric Property specifying how many times the stripes repeat. - {Property} [options.offset=0] A numeric Property specifying how far into the pattern to start the material. - {Property} [options.orientation=StripeOrientation.HORIZONTAL] A Property specifying the StripeOrientation
Draws a sun billboard.
Draws a sun billboard.
This is only supported in 3D and Columbus view.
alias Sun
scene.sun = new Cesium.Sun();
Scene#sun
A wrapper around a web worker that allows scheduling tasks for a given worker, returning results asynchronously via a promise.
A wrapper around a web worker that allows scheduling tasks for a given worker, returning results asynchronously via a promise.
The Worker is not constructed until a task is scheduled.
alias TaskProcessor
- {String} workerName The name of the worker. This is expected to be a script in the Workers folder. - {Number} [maximumActiveTasks=5] The maximum number of active tasks. Once exceeded, scheduleTask will not queue any more tasks, allowing work to be rescheduled in future frames.
Terrain data for a single tile.
Terrain data for a single tile. This type describes an interface and is not intended to be instantiated directly.
alias TerrainData
QuantizedMeshTerrainData
HeightmapTerrainData
Provides terrain or other geometry for the surface of an ellipsoid.
Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is organized into a pyramid of tiles according to a TilingScheme. This type describes an interface and is not intended to be instantiated directly.
alias TerrainProvider
ArcGisImageServerTerrainProvider
CesiumTerrainProvider
EllipsoidTerrainProvider
An ImageryProvider that draws a box around every rendered tile in the tiling scheme, and draws a label inside it indicating the X, Y, Level coordinates of the tile.
An ImageryProvider that draws a box around every rendered tile in the tiling scheme, and draws a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for debugging terrain and imagery rendering problems.
alias TileCoordinatesImageryProvider
- The options object takes the following properties - {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. - {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used. - {Color} [options.color=Color.YELLOW] The color to draw the tile box and label. - {Number} [options.tileWidth=256] The width of the tile for level-of-detail selection purposes. - {Number} [options.tileHeight=256] The height of the tile for level-of-detail selection purposes.
A policy for discarding tile images according to some criteria.
A policy for discarding tile images according to some criteria. This type describes an interface and is not intended to be instantiated directly.
alias TileDiscardPolicy
NeverTileDiscardPolicy
DiscardMissingTileImagePolicy
Provides details about an error that occurred in an ImageryProvider or a TerrainProvider.
Provides details about an error that occurred in an ImageryProvider or a TerrainProvider.
alias TileProviderError
- {ImageryProvider|TerrainProvider} provider The imagery or terrain provider that experienced the error. - {String} message A message describing the error. - {Number} [x] The X coordinate of the tile that experienced the error, or undefined if the error is not specific to a particular tile. - {Number} [y] The Y coordinate of the tile that experienced the error, or undefined if the error is not specific to a particular tile. - {Number} [level] The level of the tile that experienced the error, or undefined if the error is not specific to a particular tile. - {Number} [timesRetried=0] The number of times this operation has been retried. - {Error} [error] The error or exception that occurred, if any.
A tiling scheme for geometry or imagery on the surface of an ellipsoid.
A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero, the coarsest, least-detailed level, the number of tiles is configurable. At level of detail one, each of the level zero tiles has four children, two in each direction. At level of detail two, each of the level one tiles has four children, two in each direction. This continues for as many levels as are present in the geometry or imagery source.
alias TilingScheme
GeographicTilingScheme
WebMercatorTilingScheme
An interval defined by a start and a stop time; optionally including those times as part of the interval.
An interval defined by a start and a stop time; optionally including those times as part of the interval. Arbitrary data can optionally be associated with each instance for used with TimeIntervalCollection.
alias TimeInterval
- The options object takes the following properties
- {JulianDate} [options.start=new JulianDate()] The start time of the interval.
- {JulianDate} [options.stop=new JulianDate()] The stop time of the interval.
- {Boolean} [options.isStartIncluded=true] true
if options.start
is included in the interval, false
otherwise.
- {Boolean} [options.isStopIncluded=true] true
if options.stop
is included in the interval, false
otherwise.
- {Object} [options.data] Arbitrary data associated with this interval.
// Check if an interval contains a specific time. var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z'); var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);
// Create two instances from ISO 8601 intervals with associated numeric data // then compute their intersection, summing the data they contain. var left = Cesium.TimeInterval.fromIso8601({ iso8601 : '2000/2010', data : 2 }); var right = Cesium.TimeInterval.fromIso8601({ iso8601 : '1995/2005', data : 3 }); //The result of the below intersection will be an interval equivalent to //var intersection = Cesium.TimeInterval.fromIso8601({ // iso8601 : '2000/2005', // data : 5 //}); var intersection = new Cesium.TimeInterval(); Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) { return leftData + rightData; });
// Create an instance that spans August 1st, 1980 and is associated // with a Cartesian position. var timeInterval = new Cesium.TimeInterval({ start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'), stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'), isStartIncluded : true, isStopIncluded : false, data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082) });
A non-overlapping collection of TimeInterval instances sorted by start time.
A non-overlapping collection of TimeInterval instances sorted by start time. alias TimeIntervalCollection
- {TimeInterval[]} [intervals] An array of intervals to add to the collection.
A TimeIntervalCollectionProperty which is also a PositionProperty
A TimeIntervalCollectionProperty which is also a PositionProperty
alias TimeIntervalCollectionPositionProperty
- {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.
A Property which is defined by a TimeIntervalCollection, where the data property of each TimeInterval represents the value at time.
A Property which is defined by a TimeIntervalCollection, where the data property of each TimeInterval represents the value at time.
alias TimeIntervalCollectionProperty
//Create a Cartesian2 interval property which contains data on August 1st, 2012 //and uses a different value every 6 hours. var composite = new Cesium.TimeIntervalCollectionProperty(); composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z', isStartIncluded : true, isStopIncluded : false, data : new Cesium.Cartesian2(2.0, 3.4) })); composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z', isStartIncluded : true, isStopIncluded : false, data : new Cesium.Cartesian2(12.0, 2.7) })); composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z', isStartIncluded : true, isStopIncluded : false, data : new Cesium.Cartesian2(5.0, 12.4) })); composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z', isStartIncluded : true, isStopIncluded : true, data : new Cesium.Cartesian2(85.0, 4.1) }));
The Timeline is a widget for displaying and controlling the current scene time.
The Timeline is a widget for displaying and controlling the current scene time. alias Timeline
- {Element} container The parent HTML container node for this widget. - {Clock} clock The clock to use.
A view model which exposes the properties of a toggle button.
A view model which exposes the properties of a toggle button. alias ToggleButtonViewModel
- {Command} command The command which will be executed when the button is toggled. - The options object takes the following properties - {Boolean} [options.toggled=false] A boolean indicating whether the button should be initially toggled. - {String} [options.tooltip= ] A string containing the button's tooltip.
An affine transformation defined by a translation, rotation, and scale.
An affine transformation defined by a translation, rotation, and scale. alias TranslationRotationScale
- {Cartesian3} [translation=Cartesian3.ZERO] A Cartesian3 specifying the (x, y, z) translation to apply to the node. - {Quaternion} [rotation=Quaternion.IDENTITY] A Quaternion specifying the (x, y, z, w) rotation to apply to the node. - {Cartesian3} [scale=new Cartesian3(1.0, 1.0, 1.0)] A Cartesian3 specifying the (x, y, z) scaling to apply to the node.
Provides imagery by requesting tiles using a specified URL template.
Provides imagery by requesting tiles using a specified URL template.
alias UrlTemplateImageryProvider
- {Promise.<Object>|Object} [options] Object with the following properties: - {String} options.url The URL template to use to request tiles. It has the following keywords:
{z}
: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.{x}
: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.{y}
: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.{s}
: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.{reverseX}
: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.{reverseY}
: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.{reverseZ}
: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.{westDegrees}
: The Western edge of the tile in geodetic degrees.{southDegrees}
: The Southern edge of the tile in geodetic degrees.{eastDegrees}
: The Eastern edge of the tile in geodetic degrees.{northDegrees}
: The Northern edge of the tile in geodetic degrees.{westProjected}
: The Western edge of the tile in projected coordinates of the tiling scheme.{southProjected}
: The Southern edge of the tile in projected coordinates of the tiling scheme.{eastProjected}
: The Eastern edge of the tile in projected coordinates of the tiling scheme.{northProjected}
: The Northern edge of the tile in projected coordinates of the tiling scheme.{width}
: The width of each tile in pixels.{height}
: The height of each tile in pixels.- {String} [options.pickFeaturesUrl] The URL template to use to pick features. If this property is not specified,
UrlTemplateImageryProvider#pickFeatures will immediately returned undefined, indicating no
features picked. The URL template supports all of the keywords supported by the url
parameter, plus the following:
{i}
: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.{j}
: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.{reverseI}
: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.{reverseJ}
: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.{longitudeDegrees}
: The longitude of the picked position in degrees.{latitudeDegrees}
: The latitude of the picked position in degrees.{longitudeProjected}
: The longitude of the picked position in the projected coordinates of the tiling scheme.{latitudeProjected}
: The latitude of the picked position in the projected coordinates of the tiling scheme.{format}
: The format in which to get feature information, as specified in the GetFeatureInfoFormat- {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s}
placeholder in the URL template.
If this parameter is a single string, each character in the string is a subdomain. If it is
an array, each element in the array is a subdomain.
- {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL.
- {Credit|String} [options.credit= ] A credit for the data source, which is displayed on the canvas.
- {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
to result in rendering problems.
- {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
- {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.
- {TilingScheme} [options.tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal
surface is broken into tiles. If this parameter is not provided, a WebMercatorTilingScheme
is used.
- {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified,
this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
parameter is specified, the WGS84 ellipsoid is used.
- {Number} [options.tileWidth=256] Pixel width of image tiles.
- {Number} [options.tileHeight=256] Pixel height of image tiles.
- {Boolean} [options.hasAlphaChannel=true] true if the images provided by this imagery provider
include an alpha channel; otherwise, false. If this property is false, an alpha channel, if
present, will be ignored. If this property is true, any images without an alpha channel will
be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage
and texture upload time are potentially reduced.
- {GetFeatureInfoFormat[]} [options.getFeatureInfoFormats] The formats in which to get feature information at a
specific location when UrlTemplateImageryProvider#pickFeatures is invoked. If this
parameter is not specified, feature picking is disabled.
- {Boolean} [options.enablePickFeatures=true] If true, UrlTemplateImageryProvider#pickFeatures will
request the options.pickFeaturesUrl
and attempt to interpret the features included in the response. If false,
UrlTemplateImageryProvider#pickFeatures will immediately return undefined (indicating no pickable
features) without communicating with the server. Set this property to false if you know your data
source does not support picking features or if you don't want this provider's features to be pickable. Note
that this can be dynamically overridden by modifying the UrlTemplateImageryProvider
property.
// Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project var tms = new Cesium.UrlTemplateImageryProvider({ url : 'https://cesiumjs.org/tilesets/imagery/naturalearthii/{z}/{x}/{reverse} jpg', credit : '© Analytical Graphics, Inc.', tilingScheme : new Cesium.GeographicTilingScheme(), maximumLevel : 5 }); // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme. var positron = new Cesium.UrlTemplateImageryProvider({ url : 'http://{s basemaps.cartocdn.com/light_all/{z}/{x}/{y png', credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.' }); // Access a Web Map Service (WMS) server. var wms = new Cesium.UrlTemplateImageryProvider({ url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' + 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' + 'styles=&service=WMS&version=1.1.1&request=GetMap&' + 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' + 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' + 'width=256&height=256', rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013) });
WebMapTileServiceImageryProvider
WebMapServiceImageryProvider
createTileMapServiceImageryProvider
SingleTileImageryProvider
createOpenStreetMapImageryProvider
GoogleEarthImageryProvider
BingMapsImageryProvider
ArcGisMapServerImageryProvider
A single button widget for toggling vr mode.
A single button widget for toggling vr mode.
alias VRButton
- {Element|String} container The DOM element or ID that will contain the widget. - {Scene} scene The scene. - {Element|String} [vrElement=document.body] The element or id to be placed into vr mode.
exception {DeveloperError} Element with id "container" does not exist in the document.
The view model for VRButton alias VRButtonViewModel
The view model for VRButton alias VRButtonViewModel
- {Scene} scene The scene. - {Element|String} [vrElement=document.body] The element or id to be placed into VR mode.
A TerrainProvider that produces terrain geometry by tessellating height maps retrieved from a MÄK VR-TheWorld server.
A TerrainProvider that produces terrain geometry by tessellating height maps retrieved from a MÄK VR-TheWorld server.
alias VRTheWorldTerrainProvider
- The options object takes the following properties - {String} options.url The URL of the VR-TheWorld TileMap. - {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid. If this parameter is not specified, the WGS84 ellipsoid is used. - {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.
var terrainProvider = new Cesium.VRTheWorldTerrainProvider({ url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/' }); viewer.terrainProvider = terrainProvider;
TerrainProvider
A Property which evaluates to a Quaternion rotation based on the velocity of the provided PositionProperty
A Property which evaluates to a Quaternion rotation based on the velocity of the provided PositionProperty
alias VelocityOrientationProperty
- {Property} [position] The position property used to compute the orientation. - {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine which way is up.
//Create an entity with position and orientation. var position = new Cesium.SampledProperty(); position.addSamples(...); var entity = viewer.entities.add({ position : position, orientation : new Cesium.VelocityOrientationProperty(position) }));
A Property which evaluates to a Cartesian3 vector based on the velocity of the provided PositionProperty
A Property which evaluates to a Cartesian3 vector based on the velocity of the provided PositionProperty
alias VelocityVectorProperty
- {Property} [position] The position property used to compute the velocity.
//Create an entity with a billboard rotated to match its velocity. var position = new Cesium.SampledProperty(); position.addSamples(...); var entity = viewer.entities.add({ position : position, billboard : { image : 'image.png', alignedAxis : new Cesium.VelocityVectorProperty(position) } }));
A vertex format defines what attributes make up a vertex.
A vertex format defines what attributes make up a vertex. A VertexFormat can be provided to a Geometry to request that certain properties be computed, e.g., just position, position and normal, etc.
- {Object} [options] An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
alias VertexFormat
// Create a vertex format with position and 2D texture coordinate attributes. var format = new Cesium.VertexFormat({ position : true, st : true });
Packable
Geometry#attributes
Synchronizes a video element with a simulation clock.
Synchronizes a video element with a simulation clock.
alias VideoSynchronizer
- The options object takes the following properties - {Clock} [options.clock] The clock instance used to drive the video. - {HTMLVideoElement} [options.element] The video element to be synchronized. - {JulianDate} [options.epoch=Iso8601.MINIMUM_VALUE] The simulation time that marks the start of the video. - {Number} [options.tolerance=1.0] The maximum amount of time, in seconds, that the clock and video can diverge.
demo Material Demo
A base widget for building applications.
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.
//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); });
viewerDragDropMixin demo Sandcastle Hello World Demo
Timeline
SceneModePicker
HomeButton
FullscreenButton
CesiumWidget
BaseLayerPicker
Animation
A viewport aligned quad.
A viewport aligned quad.
alias ViewportQuad
- {BoundingRectangle} [rectangle] The BoundingRectangle defining the quad's position within the viewport. - {Material} [material] The Material defining the surface appearance of the viewport quad.
var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40)); viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
Defines the interface for visualizers.
Defines the interface for visualizers. Visualizers are plug-ins to DataSourceDisplay that render data associated with DataSource instances. This object is an interface for documentation purposes and is not intended to be instantiated directly. alias Visualizer
GeometryVisualizer
PointVisualizer
PathVisualizer
ModelVisualizer
LabelVisualizer
BillboardVisualizer
A description of a wall, which is similar to a KML line string.
A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
alias WallGeometry
- The options object takes the following properties
- {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.
- {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
- {Number[]} [options.maximumHeights] An array parallel to positions
that give the maximum height of the
wall at positions
. If undefined, the height of each position in used.
- {Number[]} [options.minimumHeights] An array parallel to positions
that give the minimum height of the
wall at positions
. If undefined, the height at each position is 0.0.
- {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation
- {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
exception {DeveloperError} positions length must be greater than or equal to 2. exception {DeveloperError} positions and maximumHeights must have the same length. exception {DeveloperError} positions and minimumHeights must have the same length.
// create a wall that spans from ground level to 10000 meters var wall = new Cesium.WallGeometry({ positions : Cesium.Cartesian3.fromDegreesArrayHeights([ 19.0, 47.0, 10000.0, 19.0, 48.0, 10000.0, 20.0, 48.0, 10000.0, 20.0, 47.0, 10000.0, 19.0, 47.0, 10000.0 ]) }); var geometry = Cesium.WallGeometry.createGeometry(wall);
WallGeometry#fromConstantHeight demo Sandcastle Wall Demo
WallGeometry#createGeometry
A GeometryUpdater for walls.
A GeometryUpdater for walls. Clients do not normally create this class directly, but instead rely on DataSourceDisplay alias WallGeometryUpdater
- {Entity} entity The entity containing the geometry to be visualized. - {Scene} scene The scene where visualization is taking place.
Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.
Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights. The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.
alias WallGraphics
- The options object takes the following properties - {Property} [options.positions] A Property specifying the array of Cartesian3 positions which define the top of the wall. - {Property} [options.maximumHeights] A Property specifying an array of heights to be used for the top of the wall instead of the height of each position. - {Property} [options.minimumHeights] A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface. - {Property} [options.show=true] A boolean Property specifying the visibility of the wall. - {Property} [options.fill=true] A boolean Property specifying whether the wall is filled with the provided material. - {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the wall. - {Property} [options.outline=false] A boolean Property specifying whether the wall is outlined. - {Property} [options.outlineColor=Color.BLACK] A Property specifying the Color of the outline. - {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.
Entity demo Sandcastle Wall Demo
A description of a wall outline.
A description of a wall outline. A wall is defined by a series of points, which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
alias WallOutlineGeometry
- The options object takes the following properties
- {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.
- {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
- {Number[]} [options.maximumHeights] An array parallel to positions
that give the maximum height of the
wall at positions
. If undefined, the height of each position in used.
- {Number[]} [options.minimumHeights] An array parallel to positions
that give the minimum height of the
wall at positions
. If undefined, the height at each position is 0.0.
- {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation
exception {DeveloperError} positions length must be greater than or equal to 2. exception {DeveloperError} positions and maximumHeights must have the same length. exception {DeveloperError} positions and minimumHeights must have the same length.
// create a wall outline that spans from ground level to 10000 meters var wall = new Cesium.WallOutlineGeometry({ positions : Cesium.Cartesian3.fromDegreesArrayHeights([ 19.0, 47.0, 10000.0, 19.0, 48.0, 10000.0, 20.0, 48.0, 10000.0, 20.0, 47.0, 10000.0, 19.0, 47.0, 10000.0 ]) }); var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
WallGeometry#fromConstantHeight
WallGeometry#createGeometry
Provides tiled imagery hosted by a Web Map Service (WMS) server.
Provides tiled imagery hosted by a Web Map Service (WMS) server.
alias WebMapServiceImageryProvider
- The options object takes the following properties
- {String} options.url The URL of the WMS service. The URL supports the same keywords as the UrlTemplateImageryProvider
- {String} options.layers The layers to include, separated by commas.
- {Object} [options.parameters=WebMapServiceImageryProvider.DefaultParameters] Additional parameters
to pass to the WMS server in the GetMap URL.
- {Object} [options.getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional
parameters to pass to the WMS server in the GetFeatureInfo URL.
- {Boolean} [options.enablePickFeatures=true] If true, WebMapServiceImageryProvider#pickFeatures will invoke
the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,
WebMapServiceImageryProvider#pickFeatures will immediately return undefined (indicating no pickable features)
without communicating with the server. Set this property to false if you know your WMS server does not support
GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically
overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
- {GetFeatureInfoFormat[]} [options.getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats
in which to try WMS GetFeatureInfo requests.
- {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.
- {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.
- {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified,
this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
parameter is specified, the WGS84 ellipsoid is used.
- {Number} [options.tileWidth=256] The width of each tile in pixels.
- {Number} [options.tileHeight=256] The height of each tile in pixels.
- {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when
specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is
likely to result in rendering problems.
- {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
If not specified, there is no limit.
- {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.
- {Object} [options.proxy] A proxy to use for requests. This object is
expected to have a getURL function which returns the proxied URL, if needed.
- {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s}
placeholder in the URL template.
If this parameter is a single string, each character in the string is a subdomain. If it is
an array, each element in the array is a subdomain.
var provider = new Cesium.WebMapServiceImageryProvider({ url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer', layers : '0', proxy: new Cesium.DefaultProxy('/proxy/') }); viewer.imageryLayers.addImageryProvider(provider);
UrlTemplateImageryProvider
WebMapTileServiceImageryProvider
createTileMapServiceImageryProvider
SingleTileImageryProvider
createOpenStreetMapImageryProvider
GoogleEarthImageryProvider
BingMapsImageryProvider
ArcGisMapServerImageryProvider
Provides tiled imagery served by 1.0.0 compliant servers.
Provides tiled imagery served by 1.0.0 compliant servers. This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
alias WebMapTileServiceImageryProvider
- The options object takes the following properties
- {String} options.url The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains.
- {String} [options.format='image/jpeg'] The MIME type for images to retrieve from the server.
- {String} options.layer The layer name for WMTS requests.
- {String} options.style The style name for WMTS requests.
- {String} options.tileMatrixSetID The identifier of the TileMatrixSet to use for WMTS requests.
- {Array} [options.tileMatrixLabels] A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
- {Number} [options.tileWidth=256] The tile width in pixels.
- {Number} [options.tileHeight=256] The tile height in pixels.
- {TilingScheme} [options.tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
- {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL.
- {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer.
- {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider.
- {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
- {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
- {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.
- {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s}
placeholder in the URL template.
If this parameter is a single string, each character in the string is a subdomain. If it is
an array, each element in the array is a subdomain.
// Example 2. USGS shaded relief tiles (RESTful) var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({ url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol} jpg', layer : 'USGSShadedReliefOnly', style : 'default', format : 'image/jpeg', tileMatrixSetID : 'default028mm', maximumLevel: 19, credit : new Cesium.Credit('U. S. Geological Survey') }); viewer.imageryLayers.addImageryProvider(shadedRelief2);
// Example 1. USGS shaded relief tiles (KVP) var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({ url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS', layer : 'USGSShadedReliefOnly', style : 'default', format : 'image/jpeg', tileMatrixSetID : 'default028mm', // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...], maximumLevel: 19, credit : new Cesium.Credit('U. S. Geological Survey') }); viewer.imageryLayers.addImageryProvider(shadedRelief1);
UrlTemplateImageryProvider
WebMapServiceImageryProvider
createTileMapServiceImageryProvider
SingleTileImageryProvider
createOpenStreetMapImageryProvider
GoogleEarthImageryProvider
BingMapsImageryProvider
ArcGisMapServerImageryProvider
The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857.
The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using the spherical (rather than ellipsoidal) equations.
alias WebMercatorProjection
- {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
GeographicProjection
A tiling scheme for geometry referenced to a WebMercatorProjection, EPSG:3857.
A tiling scheme for geometry referenced to a WebMercatorProjection, EPSG:3857. This is the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
alias WebMercatorTilingScheme
- The options object takes the following properties - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to the WGS84 ellipsoid. - {Number} [options.numberOfLevelZeroTilesX=1] The number of tiles in the X direction at level zero of the tile tree. - {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of the tile tree. - {Cartesian2} [options.rectangleSouthwestInMeters] The southwest corner of the rectangle covered by the tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire globe is covered in the longitude direction and an equal distance is covered in the latitude direction, resulting in a square projection. - {Cartesian2} [options.rectangleNortheastInMeters] The northeast corner of the rectangle covered by the tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire globe is covered in the longitude direction and an equal distance is covered in the latitude direction, resulting in a square projection.
Finds an item in a sorted array.
Finds an item in a sorted array.
Object for setting and retrieving the default BingMaps API key
Object for setting and retrieving the default BingMaps API key
Cesium is an open-source JavaScript library for world-class 3D globes and maps
Cesium is an open-source JavaScript library for world-class 3D globes and maps
Creates an adapter function to allow a calculation function to operate as a Web Worker, paired with TaskProcessor, to receive tasks and return results.
Creates an adapter function to allow a calculation function to operate as a Web Worker, paired with TaskProcessor, to receive tasks and return results.
Content pipeline functions for geometries.
Content pipeline functions for geometries.
An InterpolationAlgorithm for performing linear interpolation.
An InterpolationAlgorithm for performing linear interpolation.
A stable merge sort.
A stable merge sort.
A browser-independent function to request a new animation frame.
A browser-independent function to request a new animation frame. This is used to create an application's draw loop as shown in the example below.
Because browsers throttle the number of parallel requests allowed to each server, this function tracks the number of active requests in progress to each server, and returns undefined immediately if the request would exceed the maximum, allowing the caller to retry later, instead of queueing indefinitely under the browser's control.
Because browsers throttle the number of parallel requests allowed to each server, this function tracks the number of active requests in progress to each server, and returns undefined immediately if the request would exceed the maximum, allowing the caller to retry later, instead of queueing indefinitely under the browser's control.
Enum containing WebGL Constant values by name.
Enum containing WebGL Constant values by name. for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context (For example, in [Safari 9]{https://github.com/AnalyticalGraphicsInc/cesium/issues/2989}).
These match the constants from the [WebGL 1.0]{https://www.khronos.org/registry/webgl/specs/latest/1.0/} and [WebGL 2.0]{https://www.khronos.org/registry/webgl/specs/latest/2.0/} specifications.
see: https://github.com/AnalyticalGraphicsInc/cesium/blob/8328880c6a50e4fb735f68f8b87338eb477efb1f/Source/Core/WebGLConstants.js
Animation widget
The Animation widget provides buttons for play, pause, and reverse, along with the current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
The "shuttle ring" concept is borrowed from video editing, where typically a "jog wheel" can be rotated to move past individual animation frames very slowly, and a surrounding shuttle ring can be twisted to control direction and speed of fast playback. Cesium typically treats time as continuous (not broken into pre-defined animation frames), so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and very slow playback. Click and drag the shuttle ring pointer itself (shown above in green), or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
The Animation widget also provides a "realtime" button (in the upper-left) that keeps animation time in sync with the end user's system clock, typically displaying "today" or "right now." This mode is not available in ClockRange.CLAMPED or ClockRange.LOOP_STOP mode if the current time is outside of createCommand Clock's startTime and endTime.
alias Animation
- {Element|String} container The DOM element or ID that will contain the widget. - {AnimationViewModel} viewModel The view model used by this widget.
exception {DeveloperError} Element with id "container" does not exist in the document.
// In HTML head, include a link to Animation.css stylesheet, // and in the body, include: var clock = new Cesium.Clock(); var clockViewModel = new Cesium.ClockViewModel(clock); var viewModel = new Cesium.AnimationViewModel(clockViewModel); var widget = new Cesium.Animation('animationContainer', viewModel); function tick() { clock.tick(); Cesium.requestAnimationFrame(tick); } Cesium.requestAnimationFrame(tick);
Clock
AnimationViewModel