Animation widget
The view model for the Animation widget.
The view model for the Animation widget. alias AnimationViewModel
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
true
, the geometry is expected to appear translucent so Appearance#renderState has alpha blending enabled.true
, the geometry is expected to be closed so Appearance#renderState has backface culling enabled.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
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
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
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.
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
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
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
A Visualizer which maps Entity#billboard to a Billboard alias BillboardVisualizer
A Visualizer which maps Entity#billboard to a Billboard alias BillboardVisualizer
Provides tiled imagery using the Bing Maps Imagery REST API.
Provides tiled imagery using the Bing Maps Imagery REST API.
alias BingMapsImageryProvider
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
BoundingSphere
A bounding sphere with a center and a radius.
A bounding sphere with a center and a radius. alias BoundingSphere
Packable
BoundingRectangle
AxisAlignedBoundingBox
Describes a cube centered at the origin.
Describes a cube centered at the origin.
alias BoxGeometry
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
Describes a box.
Describes a box. The center position and orientation are determined by the containing Entity
alias BoxGraphics
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
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
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
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
ScreenSpaceEventHandler
A 2D Cartesian point.
A 2D Cartesian point. alias Cartesian2
Packable
Cartesian4
Cartesian3
A 3D Cartesian point.
A 3D Cartesian point. alias Cartesian3
Packable
Cartesian4
Cartesian2
A 4D Cartesian point.
A 4D Cartesian point. alias Cartesian4
Packable
Cartesian3
Cartesian2
A position defined by longitude, latitude, and height.
A position defined by longitude, latitude, and height. alias Cartographic
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
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
exception {DeveloperError} container is required. exception {DeveloperError} scene is required.
The view model for CesiumInspector alias CesiumInspectorViewModel
The view model for CesiumInspector alias CesiumInspectorViewModel
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
// 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
false
, no imagery provider will be added.undefined
, the default stars are used. If set to false
, no skyBox, Sun, or Moon will be added.false
to turn it off.true
, each geometry instance will only be rendered in 3D to save GPU memory.false
, no globe will be added.options
passed to Sceneexception {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
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
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
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
tick
are frame dependent or system clock dependent.startTime
or stopTime
is reached.canAnimate
and shouldAnimate
are true.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
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).
alias Color
Packable
Value and type information for per-instance geometry color.
Value and type information for per-instance geometry color.
alias ColorGeometryInstanceAttribute
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.
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
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
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
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
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
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
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
Entity demo Sandcastle Corridor Demo
A description of a corridor outline.
A description of a corridor outline.
alias CorridorOutlineGeometry
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.
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.
alias CreditDisplay
var creditDisplay = new Cesium.CreditDisplay(creditContainer);
The culling volume defined by planes.
The culling volume defined by planes.
alias CullingVolume
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
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
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
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
A description of the outline of a cylinder.
A description of the outline of a cylinder.
alias CylinderOutlineGeometry
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
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
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
float
, vec2
, vec3
, and vec4
.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 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
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
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
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
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
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
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
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
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
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
A description of an ellipsoid centered at the origin.
A description of an ellipsoid centered at the origin.
alias EllipsoidGeometry
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
Describe an ellipsoid or sphere.
Describe an ellipsoid or sphere. The center position and orientation are determined by the containing Entity
alias EllipsoidGraphics
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
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
true
, flat shading is used in the fragment shader, which means lighting is not taking into account.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 WallGeometrytrue
, the geometry is expected to appear translucent so EllipsoidSurfaceAppearance#renderState has alpha blending enabled.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.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
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
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
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
A utility object for tracking an entity with the camera.
A utility object for tracking an entity with the camera. alias EntityView
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
A single button widget for toggling fullscreen mode.
A single button widget for toggling fullscreen mode.
alias FullscreenButton
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
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
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 view model for the Geocoder widget.
The view model for the Geocoder widget. alias GeocoderViewModel
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
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
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
// 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
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.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
// 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
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.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
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
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
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
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
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
A MaterialProperty that maps to grid Material uniforms.
A MaterialProperty that maps to grid Material uniforms. alias GridMaterialProperty
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
true
, geometry vertices are optimized for the pre and post-vertex-shader caches.true
, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.true
, the geometry vertices are compressed, which will save memory.true
, the primitive does not keep a reference to the input geometryInstances
to save memory.true
, each geometry instance will only be pickable with Scene#pick When false
, GPU memory is saved.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
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
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.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
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
The view model for HomeButton alias HomeButtonViewModel
The view model for HomeButton alias HomeButtonViewModel
A MaterialProperty that maps to image Material uniforms.
A MaterialProperty that maps to image Material uniforms. alias ImageMaterialProperty
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
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.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.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.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.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.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.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
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
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
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
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
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
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
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
A spline that uses piecewise linear interpolation to create a curve.
A spline that uses piecewise linear interpolation to create a curve.
alias LinearSpline
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
// 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
true
or a function that returns true
, the geometry
with this material is expected to appear translucent.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
true
, flat shading is used in the fragment shader, which means lighting is not taking into account.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 WallGeometrytrue
, the geometry is expected to appear translucent so MaterialAppearance#renderState has alpha blending enabled.true
, the geometry is expected to be closed so MaterialAppearance#renderState has backface culling enabled.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
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
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
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
true
, each glTF mesh and primitive is pickable with Scene#pickexception {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
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
Draws the Moon in 3D.
Draws the Moon in 3D. alias Moon
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
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
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
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
// 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
// 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
A Visualizer which maps Entity#path to a Polyline alias PathVisualizer
A Visualizer which maps Entity#path to a Polyline alias PathVisualizer
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
true
, flat shading is used in the fragment shader, which means lighting is not taking into account.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 WallGeometrytrue
, the geometry is expected to appear translucent so PerInstanceColorAppearance#renderState has alpha blending enabled.true
, the geometry is expected to be closed so PerInstanceColorAppearance#renderState has backface culling enabled.// 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 view model for PerformanceWatchdog
The view model for PerformanceWatchdog
alias PerformanceWatchdogViewModel
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
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
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
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
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
// 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
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
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
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
// 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
true
if this polyline will be shown; otherwise, false
.PolylineCollection
A MaterialProperty that maps to PolylineArrow Material uniforms.
A MaterialProperty that maps to PolylineArrow Material uniforms.
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
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
true
, the geometry is expected to appear translucent so PolylineColorAppearance#renderState has alpha blending enabled.// 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
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
A MaterialProperty that maps to polyline glow Material uniforms.
A MaterialProperty that maps to polyline glow Material uniforms. alias PolylineGlowMaterialProperty
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
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
true
, the geometry is expected to appear translucent so PolylineMaterialAppearance#renderState has alpha blending enabled.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
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
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
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
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
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
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
true
, geometry vertices are optimized for the pre and post-vertex-shader caches.true
, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.true
, the geometry vertices are compressed, which will save memory.true
, the primitive does not keep a reference to the input geometryInstances
to save memory.true
, each geometry instance will only be pickable with Scene#pick When false
, GPU memory is saved.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.// 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
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
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
A view model that represents each item in the BaseLayerPicker
A view model that represents each item in the BaseLayerPicker
alias ProviderViewModel
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
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
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
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
A two dimensional region specified as longitude and latitude coordinates.
A two dimensional region specified as longitude and latitude coordinates.
alias Rectangle
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
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
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
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
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
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
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
DeveloperError
A SampledProperty which is also a PositionProperty
A SampledProperty which is also a PositionProperty
alias SampledPositionProperty
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
//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
// 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
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
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
Handles user input events.
Handles user input events. Custom functions can be added to be executed on when the user enters input.
alias ScreenSpaceEventHandler
A widget for displaying an indicator on a selected object.
A widget for displaying an indicator on a selected object.
alias SelectionIndicator
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
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
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
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
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
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
Image
object for each of the six cube map faces. See the example below.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
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
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
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
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
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
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
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
true
if options.start
is included in the interval, false
otherwise.true
if options.stop
is included in the interval, false
otherwise.// 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
A TimeIntervalCollectionProperty which is also a PositionProperty
A TimeIntervalCollectionProperty which is also a PositionProperty
alias TimeIntervalCollectionPositionProperty
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
A view model which exposes the properties of a toggle button.
A view model which exposes the properties of a toggle button. alias ToggleButtonViewModel
An affine transformation defined by a translation, rotation, and scale.
An affine transformation defined by a translation, rotation, and scale. alias TranslationRotationScale
Provides imagery by requesting tiles using a specified URL template.
Provides imagery by requesting tiles using a specified URL template.
alias UrlTemplateImageryProvider
{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.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{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.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
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
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
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
//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
//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.
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
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
true
, each geometry instance will only be rendered in 3D to save GPU memory.undefined
, the default stars are used.false
to turn it off.options
passed to Scenefalse
, no globe will be added.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
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
positions
that give the maximum height of the
wall at positions
. If undefined, the height of each position in used.positions
that give the minimum height of the
wall at positions
. If undefined, the height at each position is 0.0.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
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
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
positions
that give the maximum height of the
wall at positions
. If undefined, the height of each position in used.positions
that give the minimum height of the
wall at positions
. If undefined, the height at each position is 0.0.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
{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
{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
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
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.
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
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