declare module "@cesium/engine" { import { ArcType, AssociativeArray, AxisAlignedBoundingBox, BoundingRectangle, BoundingSphere, BoxGeometry, BoxOutlineGeometry, Cartesian2, Cartesian3, Cartesian4, Cartographic, CatmullRomSpline, CircleGeometry, CircleOutlineGeometry, Clock, ClockRange, ClockStep, Color, ColorGeometryInstanceAttribute, ComponentDatatype, ConstantSpline, CoplanarPolygonGeometry, CoplanarPolygonOutlineGeometry, CornerType, CorridorGeometry, CorridorOutlineGeometry, CubicRealPolynomial, CullingVolume, CylinderGeometry, CylinderOutlineGeometry, DeveloperError, DistanceDisplayCondition, DistanceDisplayConditionGeometryInstanceAttribute, EllipseGeometry, EllipseOutlineGeometry, Ellipsoid, EllipsoidGeodesic, EllipsoidGeometry, EllipsoidOutlineGeometry, EllipsoidRhumbLine, EllipsoidTangentPlane, Event, EventHelper, ExtrapolationType, FixedFrameTransforms, Frozen, GeographicProjection, Geometry, GeometryAttribute, GeometryAttributes, GeometryFactory, GeometryInstance, GeometryInstanceAttribute, GeometryPipeline, GregorianDate, HeadingPitchRange, HeadingPitchRoll, HermitePolynomialApproximation, HermiteSpline, IndexDatatype, Intersect, IntersectionTests, Intersections2D, Interval, Iso8601, JulianDate, LagrangePolynomialApproximation, LeapSecond, LinearApproximation, LinearSpline, MapProjection, Matrix2, Matrix3, Viewport, Matrix4, MorphWeightSpline, NearFarScalar, Occluder, OrientedBoundingBox, OrthographicFrustum, OrthographicOffCenterFrustum, Packable, PackableForInterpolation, PerspectiveFrustum, PerspectiveOffCenterFrustum, PixelDatatype, PixelFormat, Plane, PlaneGeometry, PlaneOutlineGeometry, PolygonGeometry, PolygonHierarchy, PolygonOutlineGeometry, PolylineGeometry, PolylineVolumeGeometry, PolylineVolumeOutlineGeometry, PrimitiveType, QuadraticRealPolynomial, QuarticRealPolynomial, Quaternion, QuaternionSpline, Queue, Ray, Rectangle, RectangleGeometry, RectangleOutlineGeometry, ReferenceFrame, RuntimeError, ShowGeometryInstanceAttribute, SimplePolylineGeometry, SphereGeometry, SphereOutlineGeometry, Spherical, Spline, SteppedSpline, Stereographic, TimeInterval, TimeIntervalCollection, TimeStandard, TrackingReferenceFrame, TranslationRotationScale, TridiagonalSystemSolver, VertexFormat, VerticalExaggeration, Visibility, WallGeometry, WallOutlineGeometry, WebGLConstants, WebMercatorProjection, WindingOrder, barycentricCoordinates, binarySearch, clone, combine, createGuid, defined, destroyObject, formatError, getAbsoluteUri, getBaseUri, getExtensionFromUri, getFilenameFromUri, getTimestamp, isLeapYear, mergeSort, objectToQuery, pointInsideTriangle, queryToObject, srgbToLinear, subdivideArray, TypedArray, Math } from "@cesium/core"; import { ComponentReader } from "@cesium/gltf"; import { ArcType as _ArcType } from "@cesium/core"; /** * @deprecated ArcType has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ArcTypeShim: typeof _ArcType; export { _ArcTypeShim as ArcType }; import { AssociativeArray as _AssociativeArray } from "@cesium/core"; /** * @deprecated AssociativeArray has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _AssociativeArrayShim: typeof _AssociativeArray; export { _AssociativeArrayShim as AssociativeArray }; import { AxisAlignedBoundingBox as _AxisAlignedBoundingBox } from "@cesium/core"; /** * @deprecated AxisAlignedBoundingBox has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _AxisAlignedBoundingBoxShim: typeof _AxisAlignedBoundingBox; export { _AxisAlignedBoundingBoxShim as AxisAlignedBoundingBox }; import { BoundingRectangle as _BoundingRectangle } from "@cesium/core"; /** * @deprecated BoundingRectangle has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _BoundingRectangleShim: typeof _BoundingRectangle; export { _BoundingRectangleShim as BoundingRectangle }; import { BoundingSphere as _BoundingSphere } from "@cesium/core"; /** * @deprecated BoundingSphere has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _BoundingSphereShim: typeof _BoundingSphere; export { _BoundingSphereShim as BoundingSphere }; import { BoxGeometry as _BoxGeometry } from "@cesium/core"; /** * @deprecated BoxGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _BoxGeometryShim: typeof _BoxGeometry; export { _BoxGeometryShim as BoxGeometry }; import { BoxOutlineGeometry as _BoxOutlineGeometry } from "@cesium/core"; /** * @deprecated BoxOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _BoxOutlineGeometryShim: typeof _BoxOutlineGeometry; export { _BoxOutlineGeometryShim as BoxOutlineGeometry }; import { Cartesian2 as _Cartesian2 } from "@cesium/core"; /** * @deprecated Cartesian2 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Cartesian2Shim: typeof _Cartesian2; export { _Cartesian2Shim as Cartesian2 }; import { Cartesian3 as _Cartesian3 } from "@cesium/core"; /** * @deprecated Cartesian3 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Cartesian3Shim: typeof _Cartesian3; export { _Cartesian3Shim as Cartesian3 }; import { Cartesian4 as _Cartesian4 } from "@cesium/core"; /** * @deprecated Cartesian4 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Cartesian4Shim: typeof _Cartesian4; export { _Cartesian4Shim as Cartesian4 }; import { Cartographic as _Cartographic } from "@cesium/core"; /** * @deprecated Cartographic has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CartographicShim: typeof _Cartographic; export { _CartographicShim as Cartographic }; import { CatmullRomSpline as _CatmullRomSpline } from "@cesium/core"; /** * @deprecated CatmullRomSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CatmullRomSplineShim: typeof _CatmullRomSpline; export { _CatmullRomSplineShim as CatmullRomSpline }; import { Check as _Check } from "@cesium/core"; /** * @deprecated Check has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CheckShim: typeof _Check; export { _CheckShim as Check }; import { CircleGeometry as _CircleGeometry } from "@cesium/core"; /** * @deprecated CircleGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CircleGeometryShim: typeof _CircleGeometry; export { _CircleGeometryShim as CircleGeometry }; import { CircleOutlineGeometry as _CircleOutlineGeometry } from "@cesium/core"; /** * @deprecated CircleOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CircleOutlineGeometryShim: typeof _CircleOutlineGeometry; export { _CircleOutlineGeometryShim as CircleOutlineGeometry }; import { Clock as _Clock } from "@cesium/core"; /** * @deprecated Clock has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ClockShim: typeof _Clock; export { _ClockShim as Clock }; import { ClockRange as _ClockRange } from "@cesium/core"; /** * @deprecated ClockRange has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ClockRangeShim: typeof _ClockRange; export { _ClockRangeShim as ClockRange }; import { ClockStep as _ClockStep } from "@cesium/core"; /** * @deprecated ClockStep has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ClockStepShim: typeof _ClockStep; export { _ClockStepShim as ClockStep }; import { Color as _Color } from "@cesium/core"; /** * @deprecated Color has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ColorShim: typeof _Color; export { _ColorShim as Color }; import { ColorGeometryInstanceAttribute as _ColorGeometryInstanceAttribute } from "@cesium/core"; /** * @deprecated ColorGeometryInstanceAttribute has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ColorGeometryInstanceAttributeShim: typeof _ColorGeometryInstanceAttribute; export { _ColorGeometryInstanceAttributeShim as ColorGeometryInstanceAttribute }; import { ComponentDatatype as _ComponentDatatype } from "@cesium/core"; /** * @deprecated ComponentDatatype has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ComponentDatatypeShim: typeof _ComponentDatatype; export { _ComponentDatatypeShim as ComponentDatatype }; import { ConstantSpline as _ConstantSpline } from "@cesium/core"; /** * @deprecated ConstantSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ConstantSplineShim: typeof _ConstantSpline; export { _ConstantSplineShim as ConstantSpline }; import { CoplanarPolygonGeometry as _CoplanarPolygonGeometry } from "@cesium/core"; /** * @deprecated CoplanarPolygonGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CoplanarPolygonGeometryShim: typeof _CoplanarPolygonGeometry; export { _CoplanarPolygonGeometryShim as CoplanarPolygonGeometry }; import { CoplanarPolygonOutlineGeometry as _CoplanarPolygonOutlineGeometry } from "@cesium/core"; /** * @deprecated CoplanarPolygonOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CoplanarPolygonOutlineGeometryShim: typeof _CoplanarPolygonOutlineGeometry; export { _CoplanarPolygonOutlineGeometryShim as CoplanarPolygonOutlineGeometry }; import { CornerType as _CornerType } from "@cesium/core"; /** * @deprecated CornerType has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CornerTypeShim: typeof _CornerType; export { _CornerTypeShim as CornerType }; import { CorridorGeometry as _CorridorGeometry } from "@cesium/core"; /** * @deprecated CorridorGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CorridorGeometryShim: typeof _CorridorGeometry; export { _CorridorGeometryShim as CorridorGeometry }; import { CorridorOutlineGeometry as _CorridorOutlineGeometry } from "@cesium/core"; /** * @deprecated CorridorOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CorridorOutlineGeometryShim: typeof _CorridorOutlineGeometry; export { _CorridorOutlineGeometryShim as CorridorOutlineGeometry }; import { CubicRealPolynomial as _CubicRealPolynomial } from "@cesium/core"; /** * @deprecated CubicRealPolynomial has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CubicRealPolynomialShim: typeof _CubicRealPolynomial; export { _CubicRealPolynomialShim as CubicRealPolynomial }; import { CullingVolume as _CullingVolume } from "@cesium/core"; /** * @deprecated CullingVolume has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CullingVolumeShim: typeof _CullingVolume; export { _CullingVolumeShim as CullingVolume }; import { CylinderGeometry as _CylinderGeometry } from "@cesium/core"; /** * @deprecated CylinderGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CylinderGeometryShim: typeof _CylinderGeometry; export { _CylinderGeometryShim as CylinderGeometry }; import { CylinderOutlineGeometry as _CylinderOutlineGeometry } from "@cesium/core"; /** * @deprecated CylinderOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _CylinderOutlineGeometryShim: typeof _CylinderOutlineGeometry; export { _CylinderOutlineGeometryShim as CylinderOutlineGeometry }; import { DeveloperError as _DeveloperError } from "@cesium/core"; /** * @deprecated DeveloperError has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _DeveloperErrorShim: typeof _DeveloperError; export { _DeveloperErrorShim as DeveloperError }; import { DistanceDisplayCondition as _DistanceDisplayCondition } from "@cesium/core"; /** * @deprecated DistanceDisplayCondition has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _DistanceDisplayConditionShim: typeof _DistanceDisplayCondition; export { _DistanceDisplayConditionShim as DistanceDisplayCondition }; import { DistanceDisplayConditionGeometryInstanceAttribute as _DistanceDisplayConditionGeometryInstanceAttribute } from "@cesium/core"; /** * @deprecated DistanceDisplayConditionGeometryInstanceAttribute has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _DistanceDisplayConditionGeometryInstanceAttributeShim: typeof _DistanceDisplayConditionGeometryInstanceAttribute; export { _DistanceDisplayConditionGeometryInstanceAttributeShim as DistanceDisplayConditionGeometryInstanceAttribute }; import { EllipseGeometry as _EllipseGeometry } from "@cesium/core"; /** * @deprecated EllipseGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipseGeometryShim: typeof _EllipseGeometry; export { _EllipseGeometryShim as EllipseGeometry }; import { EllipseOutlineGeometry as _EllipseOutlineGeometry } from "@cesium/core"; /** * @deprecated EllipseOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipseOutlineGeometryShim: typeof _EllipseOutlineGeometry; export { _EllipseOutlineGeometryShim as EllipseOutlineGeometry }; import { Ellipsoid as _Ellipsoid } from "@cesium/core"; /** * @deprecated Ellipsoid has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipsoidShim: typeof _Ellipsoid; export { _EllipsoidShim as Ellipsoid }; import { EllipsoidGeodesic as _EllipsoidGeodesic } from "@cesium/core"; /** * @deprecated EllipsoidGeodesic has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipsoidGeodesicShim: typeof _EllipsoidGeodesic; export { _EllipsoidGeodesicShim as EllipsoidGeodesic }; import { EllipsoidGeometry as _EllipsoidGeometry } from "@cesium/core"; /** * @deprecated EllipsoidGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipsoidGeometryShim: typeof _EllipsoidGeometry; export { _EllipsoidGeometryShim as EllipsoidGeometry }; import { EllipsoidOutlineGeometry as _EllipsoidOutlineGeometry } from "@cesium/core"; /** * @deprecated EllipsoidOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipsoidOutlineGeometryShim: typeof _EllipsoidOutlineGeometry; export { _EllipsoidOutlineGeometryShim as EllipsoidOutlineGeometry }; import { EllipsoidRhumbLine as _EllipsoidRhumbLine } from "@cesium/core"; /** * @deprecated EllipsoidRhumbLine has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipsoidRhumbLineShim: typeof _EllipsoidRhumbLine; export { _EllipsoidRhumbLineShim as EllipsoidRhumbLine }; import { EllipsoidTangentPlane as _EllipsoidTangentPlane } from "@cesium/core"; /** * @deprecated EllipsoidTangentPlane has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EllipsoidTangentPlaneShim: typeof _EllipsoidTangentPlane; export { _EllipsoidTangentPlaneShim as EllipsoidTangentPlane }; import { Event as _Event } from "@cesium/core"; /** * @deprecated Event has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EventShim: typeof _Event; export { _EventShim as Event }; import { EventHelper as _EventHelper } from "@cesium/core"; /** * @deprecated EventHelper has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _EventHelperShim: typeof _EventHelper; export { _EventHelperShim as EventHelper }; import { ExtrapolationType as _ExtrapolationType } from "@cesium/core"; /** * @deprecated ExtrapolationType has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ExtrapolationTypeShim: typeof _ExtrapolationType; export { _ExtrapolationTypeShim as ExtrapolationType }; import { Frozen as _Frozen } from "@cesium/core"; /** * @deprecated Frozen has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _FrozenShim: typeof _Frozen; export { _FrozenShim as Frozen }; import { GeographicProjection as _GeographicProjection } from "@cesium/core"; /** * @deprecated GeographicProjection has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeographicProjectionShim: typeof _GeographicProjection; export { _GeographicProjectionShim as GeographicProjection }; import { Geometry as _Geometry } from "@cesium/core"; /** * @deprecated Geometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryShim: typeof _Geometry; export { _GeometryShim as Geometry }; import { GeometryAttribute as _GeometryAttribute } from "@cesium/core"; /** * @deprecated GeometryAttribute has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryAttributeShim: typeof _GeometryAttribute; export { _GeometryAttributeShim as GeometryAttribute }; import { GeometryAttributes as _GeometryAttributes } from "@cesium/core"; /** * @deprecated GeometryAttributes has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryAttributesShim: typeof _GeometryAttributes; export { _GeometryAttributesShim as GeometryAttributes }; import { GeometryFactory as _GeometryFactory } from "@cesium/core"; /** * @deprecated GeometryFactory has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryFactoryShim: typeof _GeometryFactory; export { _GeometryFactoryShim as GeometryFactory }; import { GeometryInstance as _GeometryInstance } from "@cesium/core"; /** * @deprecated GeometryInstance has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryInstanceShim: typeof _GeometryInstance; export { _GeometryInstanceShim as GeometryInstance }; import { GeometryInstanceAttribute as _GeometryInstanceAttribute } from "@cesium/core"; /** * @deprecated GeometryInstanceAttribute has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryInstanceAttributeShim: typeof _GeometryInstanceAttribute; export { _GeometryInstanceAttributeShim as GeometryInstanceAttribute }; import { GeometryPipeline as _GeometryPipeline } from "@cesium/core"; /** * @deprecated GeometryPipeline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GeometryPipelineShim: typeof _GeometryPipeline; export { _GeometryPipelineShim as GeometryPipeline }; import { GregorianDate as _GregorianDate } from "@cesium/core"; /** * @deprecated GregorianDate has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _GregorianDateShim: typeof _GregorianDate; export { _GregorianDateShim as GregorianDate }; import { HeadingPitchRange as _HeadingPitchRange } from "@cesium/core"; /** * @deprecated HeadingPitchRange has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _HeadingPitchRangeShim: typeof _HeadingPitchRange; export { _HeadingPitchRangeShim as HeadingPitchRange }; import { HeadingPitchRoll as _HeadingPitchRoll } from "@cesium/core"; /** * @deprecated HeadingPitchRoll has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _HeadingPitchRollShim: typeof _HeadingPitchRoll; export { _HeadingPitchRollShim as HeadingPitchRoll }; import { HermitePolynomialApproximation as _HermitePolynomialApproximation } from "@cesium/core"; /** * @deprecated HermitePolynomialApproximation has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _HermitePolynomialApproximationShim: typeof _HermitePolynomialApproximation; export { _HermitePolynomialApproximationShim as HermitePolynomialApproximation }; import { HermiteSpline as _HermiteSpline } from "@cesium/core"; /** * @deprecated HermiteSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _HermiteSplineShim: typeof _HermiteSpline; export { _HermiteSplineShim as HermiteSpline }; import { IndexDatatype as _IndexDatatype } from "@cesium/core"; /** * @deprecated IndexDatatype has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _IndexDatatypeShim: typeof _IndexDatatype; export { _IndexDatatypeShim as IndexDatatype }; import { Intersect as _Intersect } from "@cesium/core"; /** * @deprecated Intersect has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _IntersectShim: typeof _Intersect; export { _IntersectShim as Intersect }; import { IntersectionTests as _IntersectionTests } from "@cesium/core"; /** * @deprecated IntersectionTests has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _IntersectionTestsShim: typeof _IntersectionTests; export { _IntersectionTestsShim as IntersectionTests }; import { Intersections2D as _Intersections2D } from "@cesium/core"; /** * @deprecated Intersections2D has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Intersections2DShim: typeof _Intersections2D; export { _Intersections2DShim as Intersections2D }; import { Interval as _Interval } from "@cesium/core"; /** * @deprecated Interval has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _IntervalShim: typeof _Interval; export { _IntervalShim as Interval }; import { Iso8601 as _Iso8601 } from "@cesium/core"; /** * @deprecated Iso8601 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Iso8601Shim: typeof _Iso8601; export { _Iso8601Shim as Iso8601 }; import { JulianDate as _JulianDate } from "@cesium/core"; /** * @deprecated JulianDate has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _JulianDateShim: typeof _JulianDate; export { _JulianDateShim as JulianDate }; import { LagrangePolynomialApproximation as _LagrangePolynomialApproximation } from "@cesium/core"; /** * @deprecated LagrangePolynomialApproximation has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _LagrangePolynomialApproximationShim: typeof _LagrangePolynomialApproximation; export { _LagrangePolynomialApproximationShim as LagrangePolynomialApproximation }; import { LeapSecond as _LeapSecond } from "@cesium/core"; /** * @deprecated LeapSecond has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _LeapSecondShim: typeof _LeapSecond; export { _LeapSecondShim as LeapSecond }; import { LinearApproximation as _LinearApproximation } from "@cesium/core"; /** * @deprecated LinearApproximation has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _LinearApproximationShim: typeof _LinearApproximation; export { _LinearApproximationShim as LinearApproximation }; import { LinearSpline as _LinearSpline } from "@cesium/core"; /** * @deprecated LinearSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _LinearSplineShim: typeof _LinearSpline; export { _LinearSplineShim as LinearSpline }; import { MapProjection as _MapProjection } from "@cesium/core"; /** * @deprecated MapProjection has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ type _MapProjectionShim = _MapProjection; export { _MapProjectionShim as MapProjection }; import { Math as _Math } from "@cesium/core"; /** * @deprecated Math has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _MathShim: typeof _Math; export { _MathShim as Math }; import { Matrix2 as _Matrix2 } from "@cesium/core"; /** * @deprecated Matrix2 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Matrix2Shim: typeof _Matrix2; export { _Matrix2Shim as Matrix2 }; import { Matrix3 as _Matrix3 } from "@cesium/core"; /** * @deprecated Matrix3 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Matrix3Shim: typeof _Matrix3; export { _Matrix3Shim as Matrix3 }; import { Matrix4 as _Matrix4 } from "@cesium/core"; /** * @deprecated Matrix4 has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _Matrix4Shim: typeof _Matrix4; export { _Matrix4Shim as Matrix4 }; import { MorphWeightSpline as _MorphWeightSpline } from "@cesium/core"; /** * @deprecated MorphWeightSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _MorphWeightSplineShim: typeof _MorphWeightSpline; export { _MorphWeightSplineShim as MorphWeightSpline }; import { NearFarScalar as _NearFarScalar } from "@cesium/core"; /** * @deprecated NearFarScalar has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _NearFarScalarShim: typeof _NearFarScalar; export { _NearFarScalarShim as NearFarScalar }; import { Occluder as _Occluder } from "@cesium/core"; /** * @deprecated Occluder has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _OccluderShim: typeof _Occluder; export { _OccluderShim as Occluder }; import { OrientedBoundingBox as _OrientedBoundingBox } from "@cesium/core"; /** * @deprecated OrientedBoundingBox has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _OrientedBoundingBoxShim: typeof _OrientedBoundingBox; export { _OrientedBoundingBoxShim as OrientedBoundingBox }; import { OrthographicFrustum as _OrthographicFrustum } from "@cesium/core"; /** * @deprecated OrthographicFrustum has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _OrthographicFrustumShim: typeof _OrthographicFrustum; export { _OrthographicFrustumShim as OrthographicFrustum }; import { OrthographicOffCenterFrustum as _OrthographicOffCenterFrustum } from "@cesium/core"; /** * @deprecated OrthographicOffCenterFrustum has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _OrthographicOffCenterFrustumShim: typeof _OrthographicOffCenterFrustum; export { _OrthographicOffCenterFrustumShim as OrthographicOffCenterFrustum }; import { Packable as _Packable } from "@cesium/core"; /** * @deprecated Packable has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PackableShim: typeof _Packable; export { _PackableShim as Packable }; import { PackableForInterpolation as _PackableForInterpolation } from "@cesium/core"; /** * @deprecated PackableForInterpolation has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PackableForInterpolationShim: typeof _PackableForInterpolation; export { _PackableForInterpolationShim as PackableForInterpolation }; import { PerspectiveFrustum as _PerspectiveFrustum } from "@cesium/core"; /** * @deprecated PerspectiveFrustum has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PerspectiveFrustumShim: typeof _PerspectiveFrustum; export { _PerspectiveFrustumShim as PerspectiveFrustum }; import { PerspectiveOffCenterFrustum as _PerspectiveOffCenterFrustum } from "@cesium/core"; /** * @deprecated PerspectiveOffCenterFrustum has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PerspectiveOffCenterFrustumShim: typeof _PerspectiveOffCenterFrustum; export { _PerspectiveOffCenterFrustumShim as PerspectiveOffCenterFrustum }; import { PixelDatatype as _PixelDatatype } from "@cesium/core"; /** * @deprecated PixelDatatype has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PixelDatatypeShim: typeof _PixelDatatype; export { _PixelDatatypeShim as PixelDatatype }; import { PixelFormat as _PixelFormat } from "@cesium/core"; /** * @deprecated PixelFormat has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PixelFormatShim: typeof _PixelFormat; export { _PixelFormatShim as PixelFormat }; import { Plane as _Plane } from "@cesium/core"; /** * @deprecated Plane has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PlaneShim: typeof _Plane; export { _PlaneShim as Plane }; import { PlaneGeometry as _PlaneGeometry } from "@cesium/core"; /** * @deprecated PlaneGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PlaneGeometryShim: typeof _PlaneGeometry; export { _PlaneGeometryShim as PlaneGeometry }; import { PlaneOutlineGeometry as _PlaneOutlineGeometry } from "@cesium/core"; /** * @deprecated PlaneOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PlaneOutlineGeometryShim: typeof _PlaneOutlineGeometry; export { _PlaneOutlineGeometryShim as PlaneOutlineGeometry }; import { PolygonGeometry as _PolygonGeometry } from "@cesium/core"; /** * @deprecated PolygonGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PolygonGeometryShim: typeof _PolygonGeometry; export { _PolygonGeometryShim as PolygonGeometry }; import { PolygonHierarchy as _PolygonHierarchy } from "@cesium/core"; /** * @deprecated PolygonHierarchy has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PolygonHierarchyShim: typeof _PolygonHierarchy; export { _PolygonHierarchyShim as PolygonHierarchy }; import { PolygonOutlineGeometry as _PolygonOutlineGeometry } from "@cesium/core"; /** * @deprecated PolygonOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PolygonOutlineGeometryShim: typeof _PolygonOutlineGeometry; export { _PolygonOutlineGeometryShim as PolygonOutlineGeometry }; import { PolylineGeometry as _PolylineGeometry } from "@cesium/core"; /** * @deprecated PolylineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PolylineGeometryShim: typeof _PolylineGeometry; export { _PolylineGeometryShim as PolylineGeometry }; import { PolylineVolumeGeometry as _PolylineVolumeGeometry } from "@cesium/core"; /** * @deprecated PolylineVolumeGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PolylineVolumeGeometryShim: typeof _PolylineVolumeGeometry; export { _PolylineVolumeGeometryShim as PolylineVolumeGeometry }; import { PolylineVolumeOutlineGeometry as _PolylineVolumeOutlineGeometry } from "@cesium/core"; /** * @deprecated PolylineVolumeOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PolylineVolumeOutlineGeometryShim: typeof _PolylineVolumeOutlineGeometry; export { _PolylineVolumeOutlineGeometryShim as PolylineVolumeOutlineGeometry }; import { PrimitiveType as _PrimitiveType } from "@cesium/core"; /** * @deprecated PrimitiveType has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _PrimitiveTypeShim: typeof _PrimitiveType; export { _PrimitiveTypeShim as PrimitiveType }; import { QuadraticRealPolynomial as _QuadraticRealPolynomial } from "@cesium/core"; /** * @deprecated QuadraticRealPolynomial has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _QuadraticRealPolynomialShim: typeof _QuadraticRealPolynomial; export { _QuadraticRealPolynomialShim as QuadraticRealPolynomial }; import { QuarticRealPolynomial as _QuarticRealPolynomial } from "@cesium/core"; /** * @deprecated QuarticRealPolynomial has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _QuarticRealPolynomialShim: typeof _QuarticRealPolynomial; export { _QuarticRealPolynomialShim as QuarticRealPolynomial }; import { Quaternion as _Quaternion } from "@cesium/core"; /** * @deprecated Quaternion has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _QuaternionShim: typeof _Quaternion; export { _QuaternionShim as Quaternion }; import { QuaternionSpline as _QuaternionSpline } from "@cesium/core"; /** * @deprecated QuaternionSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _QuaternionSplineShim: typeof _QuaternionSpline; export { _QuaternionSplineShim as QuaternionSpline }; import { Queue as _Queue } from "@cesium/core"; /** * @deprecated Queue has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _QueueShim: typeof _Queue; export { _QueueShim as Queue }; import { Ray as _Ray } from "@cesium/core"; /** * @deprecated Ray has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _RayShim: typeof _Ray; export { _RayShim as Ray }; import { Rectangle as _Rectangle } from "@cesium/core"; /** * @deprecated Rectangle has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _RectangleShim: typeof _Rectangle; export { _RectangleShim as Rectangle }; import { RectangleGeometry as _RectangleGeometry } from "@cesium/core"; /** * @deprecated RectangleGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _RectangleGeometryShim: typeof _RectangleGeometry; export { _RectangleGeometryShim as RectangleGeometry }; import { RectangleOutlineGeometry as _RectangleOutlineGeometry } from "@cesium/core"; /** * @deprecated RectangleOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _RectangleOutlineGeometryShim: typeof _RectangleOutlineGeometry; export { _RectangleOutlineGeometryShim as RectangleOutlineGeometry }; import { ReferenceFrame as _ReferenceFrame } from "@cesium/core"; /** * @deprecated ReferenceFrame has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ReferenceFrameShim: typeof _ReferenceFrame; export { _ReferenceFrameShim as ReferenceFrame }; import { RuntimeError as _RuntimeError } from "@cesium/core"; /** * @deprecated RuntimeError has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _RuntimeErrorShim: typeof _RuntimeError; export { _RuntimeErrorShim as RuntimeError }; import { ShowGeometryInstanceAttribute as _ShowGeometryInstanceAttribute } from "@cesium/core"; /** * @deprecated ShowGeometryInstanceAttribute has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _ShowGeometryInstanceAttributeShim: typeof _ShowGeometryInstanceAttribute; export { _ShowGeometryInstanceAttributeShim as ShowGeometryInstanceAttribute }; import { SimplePolylineGeometry as _SimplePolylineGeometry } from "@cesium/core"; /** * @deprecated SimplePolylineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _SimplePolylineGeometryShim: typeof _SimplePolylineGeometry; export { _SimplePolylineGeometryShim as SimplePolylineGeometry }; import { SphereGeometry as _SphereGeometry } from "@cesium/core"; /** * @deprecated SphereGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _SphereGeometryShim: typeof _SphereGeometry; export { _SphereGeometryShim as SphereGeometry }; import { SphereOutlineGeometry as _SphereOutlineGeometry } from "@cesium/core"; /** * @deprecated SphereOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _SphereOutlineGeometryShim: typeof _SphereOutlineGeometry; export { _SphereOutlineGeometryShim as SphereOutlineGeometry }; import { Spherical as _Spherical } from "@cesium/core"; /** * @deprecated Spherical has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _SphericalShim: typeof _Spherical; export { _SphericalShim as Spherical }; import { Spline as _Spline } from "@cesium/core"; /** * @deprecated Spline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _SplineShim: typeof _Spline; export { _SplineShim as Spline }; import { SteppedSpline as _SteppedSpline } from "@cesium/core"; /** * @deprecated SteppedSpline has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _SteppedSplineShim: typeof _SteppedSpline; export { _SteppedSplineShim as SteppedSpline }; import { Stereographic as _Stereographic } from "@cesium/core"; /** * @deprecated Stereographic has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _StereographicShim: typeof _Stereographic; export { _StereographicShim as Stereographic }; import { TimeInterval as _TimeInterval } from "@cesium/core"; /** * @deprecated TimeInterval has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _TimeIntervalShim: typeof _TimeInterval; export { _TimeIntervalShim as TimeInterval }; import { TimeIntervalCollection as _TimeIntervalCollection } from "@cesium/core"; /** * @deprecated TimeIntervalCollection has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _TimeIntervalCollectionShim: typeof _TimeIntervalCollection; export { _TimeIntervalCollectionShim as TimeIntervalCollection }; import { TimeStandard as _TimeStandard } from "@cesium/core"; /** * @deprecated TimeStandard has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _TimeStandardShim: typeof _TimeStandard; export { _TimeStandardShim as TimeStandard }; import { TrackingReferenceFrame as _TrackingReferenceFrame } from "@cesium/core"; /** * @deprecated TrackingReferenceFrame has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _TrackingReferenceFrameShim: typeof _TrackingReferenceFrame; export { _TrackingReferenceFrameShim as TrackingReferenceFrame }; import { TranslationRotationScale as _TranslationRotationScale } from "@cesium/core"; /** * @deprecated TranslationRotationScale has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _TranslationRotationScaleShim: typeof _TranslationRotationScale; export { _TranslationRotationScaleShim as TranslationRotationScale }; import { TridiagonalSystemSolver as _TridiagonalSystemSolver } from "@cesium/core"; /** * @deprecated TridiagonalSystemSolver has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _TridiagonalSystemSolverShim: typeof _TridiagonalSystemSolver; export { _TridiagonalSystemSolverShim as TridiagonalSystemSolver }; import { VertexFormat as _VertexFormat } from "@cesium/core"; /** * @deprecated VertexFormat has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _VertexFormatShim: typeof _VertexFormat; export { _VertexFormatShim as VertexFormat }; import { Visibility as _Visibility } from "@cesium/core"; /** * @deprecated Visibility has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _VisibilityShim: typeof _Visibility; export { _VisibilityShim as Visibility }; import { WallGeometry as _WallGeometry } from "@cesium/core"; /** * @deprecated WallGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _WallGeometryShim: typeof _WallGeometry; export { _WallGeometryShim as WallGeometry }; import { WallOutlineGeometry as _WallOutlineGeometry } from "@cesium/core"; /** * @deprecated WallOutlineGeometry has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _WallOutlineGeometryShim: typeof _WallOutlineGeometry; export { _WallOutlineGeometryShim as WallOutlineGeometry }; import { WebGLConstants as _WebGLConstants } from "@cesium/core"; /** * @deprecated WebGLConstants has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _WebGLConstantsShim: typeof _WebGLConstants; export { _WebGLConstantsShim as WebGLConstants }; import { WebMercatorProjection as _WebMercatorProjection } from "@cesium/core"; /** * @deprecated WebMercatorProjection has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _WebMercatorProjectionShim: typeof _WebMercatorProjection; export { _WebMercatorProjectionShim as WebMercatorProjection }; import { WindingOrder as _WindingOrder } from "@cesium/core"; /** * @deprecated WindingOrder has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _WindingOrderShim: typeof _WindingOrder; export { _WindingOrderShim as WindingOrder }; import { barycentricCoordinates as _barycentricCoordinates } from "@cesium/core"; /** * @deprecated barycentricCoordinates has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _barycentricCoordinatesShim: typeof _barycentricCoordinates; export { _barycentricCoordinatesShim as barycentricCoordinates }; import { binarySearch as _binarySearch } from "@cesium/core"; /** * @deprecated binarySearch has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _binarySearchShim: typeof _binarySearch; export { _binarySearchShim as binarySearch }; import { clone as _clone } from "@cesium/core"; /** * @deprecated clone has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _cloneShim: typeof _clone; export { _cloneShim as clone }; import { combine as _combine } from "@cesium/core"; /** * @deprecated combine has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _combineShim: typeof _combine; export { _combineShim as combine }; import { createGuid as _createGuid } from "@cesium/core"; /** * @deprecated createGuid has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _createGuidShim: typeof _createGuid; export { _createGuidShim as createGuid }; import { defined as _defined } from "@cesium/core"; /** * @deprecated defined has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _definedShim: typeof _defined; export { _definedShim as defined }; import { destroyObject as _destroyObject } from "@cesium/core"; /** * @deprecated destroyObject has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _destroyObjectShim: typeof _destroyObject; export { _destroyObjectShim as destroyObject }; import { formatError as _formatError } from "@cesium/core"; /** * @deprecated formatError has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _formatErrorShim: typeof _formatError; export { _formatErrorShim as formatError }; import { getAbsoluteUri as _getAbsoluteUri } from "@cesium/core"; /** * @deprecated getAbsoluteUri has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _getAbsoluteUriShim: typeof _getAbsoluteUri; export { _getAbsoluteUriShim as getAbsoluteUri }; import { getBaseUri as _getBaseUri } from "@cesium/core"; /** * @deprecated getBaseUri has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _getBaseUriShim: typeof _getBaseUri; export { _getBaseUriShim as getBaseUri }; import { getExtensionFromUri as _getExtensionFromUri } from "@cesium/core"; /** * @deprecated getExtensionFromUri has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _getExtensionFromUriShim: typeof _getExtensionFromUri; export { _getExtensionFromUriShim as getExtensionFromUri }; import { getFilenameFromUri as _getFilenameFromUri } from "@cesium/core"; /** * @deprecated getFilenameFromUri has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _getFilenameFromUriShim: typeof _getFilenameFromUri; export { _getFilenameFromUriShim as getFilenameFromUri }; import { getTimestamp as _getTimestamp } from "@cesium/core"; /** * @deprecated getTimestamp has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _getTimestampShim: typeof _getTimestamp; export { _getTimestampShim as getTimestamp }; import { isLeapYear as _isLeapYear } from "@cesium/core"; /** * @deprecated isLeapYear has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _isLeapYearShim: typeof _isLeapYear; export { _isLeapYearShim as isLeapYear }; import { mergeSort as _mergeSort } from "@cesium/core"; /** * @deprecated mergeSort has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _mergeSortShim: typeof _mergeSort; export { _mergeSortShim as mergeSort }; import { objectToQuery as _objectToQuery } from "@cesium/core"; /** * @deprecated objectToQuery has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _objectToQueryShim: typeof _objectToQuery; export { _objectToQueryShim as objectToQuery }; import { pointInsideTriangle as _pointInsideTriangle } from "@cesium/core"; /** * @deprecated pointInsideTriangle has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _pointInsideTriangleShim: typeof _pointInsideTriangle; export { _pointInsideTriangleShim as pointInsideTriangle }; import { queryToObject as _queryToObject } from "@cesium/core"; /** * @deprecated queryToObject has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _queryToObjectShim: typeof _queryToObject; export { _queryToObjectShim as queryToObject }; import { srgbToLinear as _srgbToLinear } from "@cesium/core"; /** * @deprecated srgbToLinear has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _srgbToLinearShim: typeof _srgbToLinear; export { _srgbToLinearShim as srgbToLinear }; import { subdivideArray as _subdivideArray } from "@cesium/core"; /** * @deprecated subdivideArray has been moved from cesium/engine to cesium/core in CesiumJS 1.146, and will be removed from cesium/engine in 1.150. Import from cesium/core instead. */ export const _subdivideArrayShim: typeof _subdivideArray; export { _subdivideArrayShim as subdivideArray }; export namespace ArcGISTiledElevationTerrainProvider { /** * Initialization options for the ArcGISTiledElevationTerrainProvider constructor * @property [token] - The authorization token to use to connect to the service. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. * If neither parameter is specified, the default ellipsoid is used. */ type ConstructorOptions = { token?: string; ellipsoid?: Ellipsoid; }; } /** *
* To construct a CesiumTerrainProvider, call {@link ArcGISTiledElevationTerrainProvider.fromUrl}. Do not call the constructor directly. *
* * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps * retrieved from Elevation Tiles of an an ArcGIS ImageService. * @example * const terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", { * token: "KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg.." * }); * viewer.terrainProvider = terrainProvider; */ export class ArcGISTiledElevationTerrainProvider { constructor(); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: GeographicTilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ readonly hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. */ readonly availability: TileAvailability | undefined; /** * Creates a {@link TerrainProvider} that produces terrain geometry by tessellating height maps * retrieved from Elevation Tiles of an an ArcGIS ImageService. * @example * const terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", { * token: "KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg.." * }); * viewer.terrainProvider = terrainProvider; * @param url - The URL of the ArcGIS ImageServer service. * @param [options] - A url or an object describing initialization options. */ static fromUrl(url: Resource | string | Promise | Promise, options?: ArcGISTiledElevationTerrainProvider.ConstructorOptions): Promise; /** * Requests the geometry for a given tile. The result includes terrain * data and indicates that all child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns This provider does not support loading availability. */ loadTileDataAvailability(x: number, y: number, level: number): undefined; } /** * Provides geocoding through Bing Maps. * @param options - Object with the following properties: * @param options.key - A key to use with the Bing Maps geocoding service * @param [options.culture] - A Bing Maps {@link https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes|Culture Code} to return results in a specific culture and language. */ export class BingMapsGeocoderService { constructor(options: { key: string; culture?: string; }); /** * The URL endpoint for the Bing geocoder service */ readonly url: string; /** * The key for the Bing geocoder service */ readonly key: string; /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * @param query - The query to be sent to the geocoder service */ geocode(query: string): Promise; } /** * Geocodes queries containing longitude and latitude coordinates and an optional height. * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters. */ export class CartographicGeocoderService { /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * @param query - The query to be sent to the geocoder service */ geocode(query: string): Promise; } /** * Terrain data for a single tile where the terrain data is represented as a glb (binary glTF). * @param options - Object with the following properties: * @param options.gltf - The parsed glTF JSON. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh. * @param options.orientedBoundingBox - An oriented bounding box containing all of the vertices in the mesh. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point * is below the horizon, the entire tile is assumed to be below the horizon as well. * The point is expressed in ellipsoid-scaled coordinates. * @param options.skirtHeight - The height of the skirt to add on the edges of the tile. * @param [options.requestVertexNormals = false] - Indicates whether normals should be loaded. * @param [options.requestWaterMask = false] - Indicates whether water mask data should be loaded. * @param [options.credits] - Array of credits for this tile. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. * If a child's bit is set, geometry will be requested for that tile as well when it * is needed. If the bit is cleared, the child tile is not requested and geometry is * instead upsampled from the parent. The bit values are as follows: * * * * * * *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param [options.waterMask] - The buffer containing the water mask. */ export class Cesium3DTilesTerrainData { constructor(options: { gltf: { [key: string]: any; }; minimumHeight: number; maximumHeight: number; boundingSphere: BoundingSphere; orientedBoundingBox: OrientedBoundingBox; horizonOcclusionPoint: Cartesian3; skirtHeight: number; requestVertexNormals?: boolean; requestWaterMask?: boolean; credits?: Credit[]; childTileMask?: number; waterMask?: Uint8Array; }); /** * An array of credits for this tile. */ credits: Credit[] | undefined; /** * The water mask included in this terrain data, if any. A water mask is a rectangular * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement | ImageBitmap | undefined; /** * Returns the terrain height at a specified longitude and latitude, or undefined if the mesh is undefined. * @param rectangle - The rectangle covered by this terrain data. * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position, or undefined if the mesh is undefined. * If the position is outside the rectangle, this method will extrapolate the height, * which is likely to be wildly incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number | undefined; /** * Determines if a given child tile is available, based on the * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed * to be one of the four children of this tile. If non-child tile coordinates are * given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. * @param childY - The tile Y coordinate of the child tile to check for availability. * @returns True if the child tile is available; otherwise, false. */ isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Upsamples this terrain data for use by a descendant tile. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. * @param thisLevel - The level of this tile in the tiling scheme. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled terrain data for the descendant tile, or undefined if createMesh has not been called yet or too many asynchronous upsample operations are in progress and the request has been deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution * terrain data. If this value is false, the data was obtained from some other source, such * as by downloading it from a remote server. This method should return true for instances * returned from a call to {@link Cesium3DTilesTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; } export namespace Cesium3DTilesTerrainProvider { /** * Initialization options for the Cesium3DTilesTerrainProvider constructor * @property [requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available. * @property [requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { requestVertexNormals?: boolean; requestWaterMask?: boolean; ellipsoid?: Ellipsoid; credit?: Credit | string; }; } /** *
* To construct a Cesium3DTilesTerrainProvider, call {@link Cesium3DTilesTerrainProvider.fromIonAssetId} or {@link Cesium3DTilesTerrainProvider.fromUrl}. Do not call the constructor directly. *
* * A {@link TerrainProvider} that accesses terrain data in a 3D Tiles format. * @param [options] - An object describing initialization options */ export class Cesium3DTilesTerrainProvider { constructor(options?: Cesium3DTilesTerrainProvider.ConstructorOptions); /** * Creates a {@link TerrainProvider} that accesses terrain data in a Cesium 3D Tiles format. * @example * // Create terrain with normals. * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.Cesium3DTilesTerrainProvider.fromUrl( * Cesium.IonResource.fromAssetId(3956), { * requestVertexNormals: true * }) * }); * } catch (error) { * console.log(error); * } * @param url - The URL of the Cesium terrain server. * @param [options] - An object describing initialization options. * @returns A promise that resolves to the terrain provider. */ static fromUrl(url: Resource | string | Promise | Promise, options?: Cesium3DTilesTerrainProvider.ConstructorOptions): Promise; /** * Creates a {@link TerrainProvider} from a Cesium ion asset ID that accesses terrain data in a Cesium 3D Tiles format * @example * // Create GTOPO30 with vertex normals * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.Cesium3DTilesTerrainProvider.fromIonAssetId(2732686, { * requestVertexNormals: true * }) * }); * } catch (error) { * console.log(error); * } * @param assetId - The Cesium ion asset id. * @param [options] - An object describing initialization options. */ static fromIonAssetId(assetId: number, options?: CesiumTerrainProvider.ConstructorOptions): Promise; /** * Requests the geometry for a given tile. This function should not be called before * {@link Cesium3DTilesTerrainProvider#ready} returns true. The result must include terrain data and * may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported or availability is unknown, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Make sure we load availability data for a tile * @param _x - The X coordinate of the tile for which to request geometry. * @param _y - The Y coordinate of the tile for which to request geometry. * @param _level - The level of the tile for which to request geometry. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ loadTileDataAvailability(_x: number, _y: number, _level: number): Promise | undefined; /** * Get the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ credit: Credit; /** * Gets the tiling scheme used by the provider. */ tilingScheme: TilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. */ availability: TileAvailability | undefined; } export namespace CesiumTerrainProvider { /** * Initialization options for the CesiumTerrainProvider constructor * @property [requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available. * @property [requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available. * @property [requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { requestVertexNormals?: boolean; requestWaterMask?: boolean; requestMetadata?: boolean; ellipsoid?: Ellipsoid; credit?: Credit | string; }; } /** *
* To construct a CesiumTerrainProvider, call {@link CesiumTerrainProvider.fromIonAssetId} or {@link CesiumTerrainProvider.fromUrl}. Do not call the constructor directly. *
* * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format. * Terrain formats can be one of the following: *
    *
  • {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh}
  • *
  • {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map}
  • *
* @example * // Create Arctic DEM terrain with normals. * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(3956, { * requestVertexNormals: true * }) * }); * } catch (error) { * console.log(error); * } * @param [options] - An object describing initialization options */ export class CesiumTerrainProvider { constructor(options?: CesiumTerrainProvider.ConstructorOptions); /** * Requests the geometry for a given tile. The result must include terrain data and * may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: GeographicTilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ readonly hasVertexNormals: boolean; /** * Gets a value indicating whether or not the requested tiles include metadata. */ readonly hasMetadata: boolean; /** * Boolean flag that indicates if the client should request vertex normals from the server. * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and * if the server provides vertex normals. */ readonly requestVertexNormals: boolean; /** * Boolean flag that indicates if the client should request a watermask from the server. * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and * if the server provides a watermask. */ readonly requestWaterMask: boolean; /** * Boolean flag that indicates if the client should request metadata from the server. * Metadata is appended to the standard tile mesh data only if the client requests the metadata and * if the server provides a metadata. */ readonly requestMetadata: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. Note that this reflects tiles that are known to be available currently. * Additional tiles may be discovered to be available in the future, e.g. if availability information * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that * is available now will not become unavailable in the future. */ readonly availability: TileAvailability | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Creates a {@link TerrainProvider} from a Cesium ion asset ID that accesses terrain data in a Cesium terrain format * Terrain formats can be one of the following: *
    *
  • {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh}
  • *
  • {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map}
  • *
* @example * // Create Arctic DEM terrain with normals. * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(3956, { * requestVertexNormals: true * }) * }); * } catch (error) { * console.log(error); * } * @param assetId - The Cesium ion asset id. * @param [options] - An object describing initialization options. */ static fromIonAssetId(assetId: number, options?: CesiumTerrainProvider.ConstructorOptions): Promise; /** * Creates a {@link TerrainProvider} that accesses terrain data in a Cesium terrain format. * Terrain formats can be one of the following: *
    *
  • {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh}
  • *
  • {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map}
  • *
* @example * // Create Arctic DEM terrain with normals. * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.CesiumTerrainProvider.fromUrl( * Cesium.IonResource.fromAssetId(3956), { * requestVertexNormals: true * }) * }); * } catch (error) { * console.log(error); * } * @param url - The URL of the Cesium terrain server. * @param [options] - An object describing initialization options. */ static fromUrl(url: Resource | string | Promise | Promise, options?: CesiumTerrainProvider.ConstructorOptions): Promise; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported or availability is unknown, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise; } /** * Describes a compressed texture and contains a compressed texture buffer. * @param internalFormat - The pixel format of the compressed texture. * @param pixelDatatype - The pixel datatype of the compressed texture. * @param width - The width of the texture. * @param height - The height of the texture. * @param buffer - The compressed texture buffer. */ export class CompressedTextureBuffer { constructor(internalFormat: PixelFormat, pixelDatatype: PixelDatatype, width: number, height: number, buffer: Uint8Array); /** * The format of the compressed texture. */ readonly internalFormat: PixelFormat; /** * The datatype of the compressed texture. */ readonly pixelDatatype: PixelDatatype; /** * The width of the texture. */ readonly width: number; /** * The height of the texture. */ readonly height: number; /** * The compressed texture buffer. */ readonly bufferView: Uint8Array; /** * The compressed texture buffer. Alias for bufferView. */ readonly arrayBufferView: Uint8Array; /** * Creates a shallow clone of a compressed texture buffer. * @param object - The compressed texture buffer to be cloned. * @returns A shallow clone of the compressed texture buffer. */ static clone(object: CompressedTextureBuffer): CompressedTextureBuffer; /** * Creates a shallow clone of this compressed texture buffer. * @returns A shallow clone of the compressed texture buffer. */ clone(): CompressedTextureBuffer; } /** * A credit contains data pertaining to how to display attributions/credits for certain content on the screen. * @example * // Create a credit with a tooltip, image and link * const credit = new Cesium.Credit(''); * @param html - An string representing an html code snippet * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover. All credits are displayed `inline`, if you have an image we recommend sizing it correctly to match the text or use css to `vertical-align` it. */ export class Credit { constructor(html: string, showOnScreen?: boolean); /** * The credit content */ readonly html: string; /** * Whether the credit should be displayed on screen or in a lightbox */ showOnScreen: boolean; /** * Gets the credit element */ readonly element: HTMLElement; /** * Returns true if the credits are equal * @param [left] - The first credit * @param [right] - The second credit * @returns true if left and right are equal, false otherwise. */ static equals(left?: Credit, right?: Credit): boolean; /** * Returns true if the credits are equal * @param [credit] - The credit to compare to. * @returns true if left and right are equal, false otherwise. */ equals(credit?: Credit): boolean; /** * Duplicates a Credit instance. * @param [credit] - The Credit to duplicate. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined) */ static clone(credit?: Credit): Credit; } export namespace CustomHeightmapTerrainProvider { /** * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. */ type GeometryCallback = (x: number, y: number, level: number) => Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | number[] | Promise | undefined; } /** * A simple {@link TerrainProvider} that gets height values from a callback function. * It can be used for procedurally generated terrain or as a way to load custom * heightmap data without creating a subclass of {@link TerrainProvider}. * * There are some limitations such as no water mask, no vertex normals, and no * availability, so a full-fledged {@link TerrainProvider} subclass is better suited * for these more sophisticated use cases. * @example * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: new Cesium.CustomHeightmapTerrainProvider({ * width: 32, * height: 32, * callback: function (x, y, level) { * return new Float32Array(32 * 32); // all zeros * }, * }), * }); * @param options - Object with the following properties: * @param options.callback - The callback function for requesting tile geometry. * @param options.width - The number of columns per heightmap tile. * @param options.height - The number of rows per heightmap tile. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme} * is used. * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the default ellipsoid is used. * @param [options.credit] - A credit for the data source, which is displayed on the canvas. */ export class CustomHeightmapTerrainProvider { constructor(options: { callback: CustomHeightmapTerrainProvider.GeometryCallback; width: number; height: number; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; credit?: Credit | string; }); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. * Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return * value will always be false. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. * Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return * value will always be false. */ readonly hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. */ readonly availability: TileAvailability; /** * Gets the number of columns per heightmap tile. */ readonly width: boolean; /** * Gets the number of rows per heightmap tile. */ readonly height: boolean; /** * Requests the geometry for a given tile. The result includes terrain * data and indicates that all child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise; } /** * A simple proxy that appends the desired resource as the sole query parameter * to the given proxy URL. * @param proxy - The proxy URL that will be used to requests all resources. */ export class DefaultProxy extends Proxy { constructor(proxy: string); /** * Get the final URL to use to request a given resource. * @param resource - The resource to request. * @returns proxied resource */ getURL(resource: string): string; } /** * Easing functions for use with TweenCollection. These function are from * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. */ export namespace EasingFunction { /** * Linear easing. */ const LINEAR_NONE: EasingFunction.Callback; /** * Quadratic in. */ const QUADRATIC_IN: EasingFunction.Callback; /** * Quadratic out. */ const QUADRATIC_OUT: EasingFunction.Callback; /** * Quadratic in then out. */ const QUADRATIC_IN_OUT: EasingFunction.Callback; /** * Cubic in. */ const CUBIC_IN: EasingFunction.Callback; /** * Cubic out. */ const CUBIC_OUT: EasingFunction.Callback; /** * Cubic in then out. */ const CUBIC_IN_OUT: EasingFunction.Callback; /** * Quartic in. */ const QUARTIC_IN: EasingFunction.Callback; /** * Quartic out. */ const QUARTIC_OUT: EasingFunction.Callback; /** * Quartic in then out. */ const QUARTIC_IN_OUT: EasingFunction.Callback; /** * Quintic in. */ const QUINTIC_IN: EasingFunction.Callback; /** * Quintic out. */ const QUINTIC_OUT: EasingFunction.Callback; /** * Quintic in then out. */ const QUINTIC_IN_OUT: EasingFunction.Callback; /** * Sinusoidal in. */ const SINUSOIDAL_IN: EasingFunction.Callback; /** * Sinusoidal out. */ const SINUSOIDAL_OUT: EasingFunction.Callback; /** * Sinusoidal in then out. */ const SINUSOIDAL_IN_OUT: EasingFunction.Callback; /** * Exponential in. */ const EXPONENTIAL_IN: EasingFunction.Callback; /** * Exponential out. */ const EXPONENTIAL_OUT: EasingFunction.Callback; /** * Exponential in then out. */ const EXPONENTIAL_IN_OUT: EasingFunction.Callback; /** * Circular in. */ const CIRCULAR_IN: EasingFunction.Callback; /** * Circular out. */ const CIRCULAR_OUT: EasingFunction.Callback; /** * Circular in then out. */ const CIRCULAR_IN_OUT: EasingFunction.Callback; /** * Elastic in. */ const ELASTIC_IN: EasingFunction.Callback; /** * Elastic out. */ const ELASTIC_OUT: EasingFunction.Callback; /** * Elastic in then out. */ const ELASTIC_IN_OUT: EasingFunction.Callback; /** * Back in. */ const BACK_IN: EasingFunction.Callback; /** * Back out. */ const BACK_OUT: EasingFunction.Callback; /** * Back in then out. */ const BACK_IN_OUT: EasingFunction.Callback; /** * Bounce in. */ const BOUNCE_IN: EasingFunction.Callback; /** * Bounce out. */ const BOUNCE_OUT: EasingFunction.Callback; /** * Bounce in then out. */ const BOUNCE_IN_OUT: EasingFunction.Callback; /** * Function interface for implementing a custom easing function. * @example * function quadraticIn(time) { * return time * time; * } * @example * function quadraticOut(time) { * return time * (2.0 - time); * } * @param time - The time in the range [0, 1]. */ type Callback = (time: number) => number; } /** * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal * surface. * @param [options] - Object with the following properties: * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme} * is used. * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the default ellipsoid is used. */ export class EllipsoidTerrainProvider { constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; }); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: GeographicTilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ readonly hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. */ readonly availability: TileAvailability | undefined; /** * Requests the geometry for a given tile. The result includes terrain * data and indicates that all child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns This provider does not support loading availability. */ loadTileDataAvailability(x: number, y: number, level: number): undefined; } /** * A set of functions to detect whether the current browser supports * various features. */ export namespace FeatureDetection { /** * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them. * @returns true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not. */ function supportsBasis(scene: Scene): boolean; /** * Detects whether the current browser supports the full screen standard. * @returns true if the browser supports the full screen standard, false if not. */ function supportsFullscreen(): boolean; /** * Detects whether the current browser supports typed arrays. * @returns true if the browser supports typed arrays, false if not. */ function supportsTypedArrays(): boolean; /** * Detects whether the current browser supports BigInt64Array typed arrays. * @returns true if the browser supports BigInt64Array typed arrays, false if not. */ function supportsBigInt64Array(): boolean; /** * Detects whether the current browser supports BigUint64Array typed arrays. * @returns true if the browser supports BigUint64Array typed arrays, false if not. */ function supportsBigUint64Array(): boolean; /** * Detects whether the current browser supports BigInt. * @returns true if the browser supports BigInt, false if not. */ function supportsBigInt(): boolean; /** * Detects whether the current browser supports Web Workers. * @returns true if the browsers supports Web Workers, false if not. */ function supportsWebWorkers(): boolean; /** * Detects whether the current browser supports Web Assembly. * @returns true if the browsers supports Web Assembly, false if not. */ function supportsWebAssembly(): boolean; /** * Detects whether the current browser supports a WebGL2 rendering context for the specified scene. * @param scene - the Cesium scene specifying the rendering context * @returns true if the browser supports a WebGL2 rendering context, false if not. */ function supportsWebgl2(scene: Scene): boolean; /** * Detects whether the current browser supports ECMAScript modules in web workers. * @returns true if the browser supports ECMAScript modules in web workers. */ function supportsEsmWebWorkers(): boolean; } /** * Describes a frustum at the given the origin and orientation. * @param options - Object with the following properties: * @param options.frustum - The frustum. * @param options.origin - The origin of the frustum. * @param options.orientation - The orientation of the frustum. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. */ export class FrustumGeometry { constructor(options: { frustum: PerspectiveFrustum | OrthographicFrustum; origin: Cartesian3; orientation: Quaternion; vertexFormat?: VertexFormat; }); /** * The number of elements used to pack the object into an array. */ packedLength: number; /** * Stores the provided instance into the provided array. * @param value - The value to pack. * @param array - The array to pack into. * @param [startingIndex = 0] - The index into the array at which to start packing the elements. * @returns The array that was packed into */ static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[]; /** * Retrieves an instance from a packed array. * @param array - The packed array. * @param [startingIndex = 0] - The starting index of the element to be unpacked. * @param [result] - The object into which to store the result. */ static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void; /** * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere. * @param frustumGeometry - A description of the frustum. * @returns The computed vertices and indices. */ static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined; } /** * A description of the outline of a frustum with the given the origin and orientation. * @param options - Object with the following properties: * @param options.frustum - The frustum. * @param options.origin - The origin of the frustum. * @param options.orientation - The orientation of the frustum. */ export class FrustumOutlineGeometry { constructor(options: { frustum: PerspectiveFrustum | OrthographicFrustum; origin: Cartesian3; orientation: Quaternion; }); /** * The number of elements used to pack the object into an array. */ packedLength: number; /** * Stores the provided instance into the provided array. * @param value - The value to pack. * @param array - The array to pack into. * @param [startingIndex = 0] - The index into the array at which to start packing the elements. * @returns The array that was packed into */ static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[]; /** * Retrieves an instance from a packed array. * @param array - The packed array. * @param [startingIndex = 0] - The starting index of the element to be unpacked. * @param [result] - The object into which to store the result. */ static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void; /** * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere. * @param frustumGeometry - A description of the frustum. * @returns The computed vertices and indices. */ static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined; } /** * Browser-independent functions for working with the standard fullscreen API. */ export namespace Fullscreen { /** * The element that is currently fullscreen, if any. To simply check if the * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}. */ const element: any; /** * The name of the event on the document that is fired when fullscreen is * entered or exited. This event name is intended for use with addEventListener. * In your event handler, to determine if the browser is in fullscreen mode or not, * use {@link Fullscreen#fullscreen}. */ const changeEventName: string; /** * The name of the event that is fired when a fullscreen error * occurs. This event name is intended for use with addEventListener. */ const errorEventName: string; /** * Determine whether the browser will allow an element to be made fullscreen, or not. * For example, by default, iframes cannot go fullscreen unless the containing page * adds an "allowfullscreen" attribute (or prefixed equivalent). */ const enabled: boolean; /** * Determines if the browser is currently in fullscreen mode. */ const fullscreen: boolean; /** * Detects whether the browser supports the standard fullscreen API. * @returns true if the browser supports the standard fullscreen API, * false otherwise. */ function supportsFullscreen(): boolean; /** * Asynchronously requests the browser to enter fullscreen mode on the given element. * If fullscreen mode is not supported by the browser, does nothing. * @example * // Put the entire page into fullscreen. * Cesium.Fullscreen.requestFullscreen(document.body) * * // Place only the Cesium canvas into fullscreen. * Cesium.Fullscreen.requestFullscreen(scene.canvas) * @param element - The HTML element which will be placed into fullscreen mode. * @param [vrDevice] - The HMDVRDevice device. */ function requestFullscreen(element: any, vrDevice?: any): void; /** * Asynchronously exits fullscreen mode. If the browser is not currently * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing. */ function exitFullscreen(): void; } /** * The type of geocoding to be performed by a {@link GeocoderService}. */ export enum GeocodeType { /** * Perform a search where the input is considered complete. */ SEARCH = 0, /** * Perform an auto-complete using partial input, typically * reserved for providing possible results as a user is typing. */ AUTOCOMPLETE = 1 } export namespace GeocoderService { /** * @property displayName - The display name for a location * @property destination - The bounding box for a location */ type Result = { displayName: string; destination: Rectangle | Cartesian3; attributions?: object[]; }; } /** * Provides geocoding through an external service. This type describes an interface and * is not intended to be used. */ export class GeocoderService { constructor(); /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * Parses credits from the geocoder result attributions, if present. * @param geocoderResult - The geocoder result * @returns A list of credits if present in the result, otherwise undefined */ static getCreditsFromResult(geocoderResult: GeocoderService.Result): Credit[] | undefined; /** * @param query - The query to be sent to the geocoder service * @param [type = GeocodeType.SEARCH] - The type of geocode to perform. */ geocode(query: string, type?: GeocodeType): Promise; } export interface GeographicTilingScheme extends TilingScheme { } /** * A tiling scheme for geometry referenced to a simple {@link 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. * @param [options] - Object with the following properties: * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid whose surface is being tiled. Defaults to * the default ellipsoid. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of * the tile tree. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of * the tile tree. */ export class GeographicTilingScheme implements TilingScheme { constructor(options?: { ellipsoid?: Ellipsoid; rectangle?: Rectangle; numberOfLevelZeroTilesX?: number; numberOfLevelZeroTilesY?: number; }); /** * Gets the ellipsoid that is tiled by this tiling scheme. */ ellipsoid: Ellipsoid; /** * Gets the rectangle, in radians, covered by this tiling scheme. */ rectangle: Rectangle; /** * Gets the map projection used by this tiling scheme. */ projection: MapProjection; /** * Gets the total number of tiles in the X direction at a specified level-of-detail. * @param level - The level-of-detail. * @returns The number of tiles in the X direction at the given level. */ getNumberOfXTilesAtLevel(level: number): number; /** * Gets the total number of tiles in the Y direction at a specified level-of-detail. * @param level - The level-of-detail. * @returns The number of tiles in the Y direction at the given level. */ getNumberOfYTilesAtLevel(level: number): number; /** * Transforms a rectangle specified in geodetic radians to the native coordinate system * of this tiling scheme. * @param rectangle - The rectangle to transform. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the native rectangle if 'result' * is undefined. */ rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates * of the tiling scheme. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ tileXYToNativeRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a cartographic rectangle in radians. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ tileXYToRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle; /** * Calculates the tile x, y coordinates of the tile containing * a given cartographic position. * @param position - The position. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the tile x, y coordinates * if 'result' is undefined. */ positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; } /** *
* To construct GoogleEarthEnterpriseMetadata, call {@link GoogleEarthEnterpriseMetadata.fromUrl}. Do not call the constructor directly. *
* * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider * and GoogleEarthEnterpriseTerrainProvider to share metadata requests. */ export class GoogleEarthEnterpriseMetadata { constructor(); /** * True if imagery is available. */ imageryPresent: boolean; /** * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both. */ protoImagery: boolean | undefined; /** * True if terrain is available. */ terrainPresent: boolean; /** * Exponent used to compute constant to calculate negative height values. */ negativeAltitudeExponentBias: number; /** * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias. */ negativeAltitudeThreshold: number; /** * Dictionary of provider id to copyright strings. */ providers: any; /** * Key used to decode packets */ key: ArrayBuffer; /** * Gets the name of the Google Earth Enterprise server. */ readonly url: string; /** * Gets the proxy used for metadata requests. */ readonly proxy: Proxy; /** * Gets the resource used for metadata requests. */ readonly resource: Resource; /** * Creates a metadata object using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider * and GoogleEarthEnterpriseTerrainProvider to share metadata requests. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery. * @returns A promise which resolves to the created GoogleEarthEnterpriseMetadata instance/ */ static fromUrl(resourceOrUrl: Resource | string): Promise; /** * Converts a tiles (x, y, level) position into a quadkey used to request an image * from a Google Earth Enterprise server. * @param x - The tile's x coordinate. * @param y - The tile's y coordinate. * @param level - The tile's zoom level. */ static tileXYToQuadKey(x: number, y: number, level: number): void; /** * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the * (x, y, level) position. * @param quadkey - The tile's quad key */ static quadKeyToTileXY(quadkey: string): void; } /** * Terrain data for a single tile from a Google Earth Enterprise server. * @example * const buffer = ... * const childTileMask = ... * const terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({ * buffer : heightBuffer, * childTileMask : childTileMask * }); * @param options - Object with the following properties: * @param options.buffer - The buffer containing terrain data. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values. * @param options.negativeElevationThreshold - Threshold for negative values * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. * If a child's bit is set, geometry will be requested for that tile as well when it * is needed. If the bit is cleared, the child tile is not requested and geometry is * instead upsampled from the parent. The bit values are as follows: * * * * * * *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northeast
38Northwest
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; * otherwise, false. * @param [options.credits] - Array of credits for this tile. */ export class GoogleEarthEnterpriseTerrainData { constructor(options: { buffer: ArrayBuffer; negativeAltitudeExponentBias: number; negativeElevationThreshold: number; childTileMask?: number; createdByUpsampling?: boolean; credits?: Credit[]; }); /** * An array of credits for this tile */ credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a rectangular * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement | undefined; /** * Computes the terrain height at a specified longitude and latitude. * @param rectangle - The rectangle covered by this terrain data. * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. If the position * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly * incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the * height samples in this instance, interpolated if necessary. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. * @param thisLevel - The level of this tile in the tiling scheme. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled heightmap terrain data for the descendant tile, * or undefined if too many asynchronous upsample operations are in progress and the request has been * deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Determines if a given child tile is available, based on the * {@link GoogleEarthEnterpriseTerrainData.childTileMask}. The given child tile coordinates are assumed * to be one of the four children of this tile. If non-child tile coordinates are * given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. * @param childY - The tile Y coordinate of the child tile to check for availability. * @returns True if the child tile is available; otherwise, false. */ isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution * terrain data. If this value is false, the data was obtained from some other source, such * as by downloading it from a remote server. This method should return true for instances * returned from a call to {@link HeightmapTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; } export namespace GoogleEarthEnterpriseTerrainProvider { /** * Initialization options for GoogleEarthEnterpriseTerrainProvider constructor * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { ellipsoid?: Ellipsoid; credit?: Credit | string; }; } /** *
* To construct a GoogleEarthEnterpriseTerrainProvider, call {@link GoogleEarthEnterpriseTerrainProvider.fromMetadata}. Do not call the constructor directly. *
* * Provides tiled terrain using the Google Earth Enterprise REST API. * @example * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl("http://www.example.com"); * const gee = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata); * @param [options] - An object describing initialization options */ export class GoogleEarthEnterpriseTerrainProvider { constructor(options?: GoogleEarthEnterpriseTerrainProvider.ConstructorOptions); /** * Gets the name of the Google Earth Enterprise server url hosting the imagery. */ readonly url: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ readonly hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. */ readonly availability: TileAvailability | undefined; /** * Creates a GoogleEarthTerrainProvider from GoogleEarthEnterpriseMetadata * @example * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl("http://www.example.com"); * const gee = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata); * @param metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider. * @param options - An object describing initialization options */ static fromMetadata(metadata: GoogleEarthEnterpriseMetadata, options: GoogleEarthEnterpriseTerrainProvider.ConstructorOptions): GoogleEarthEnterpriseTerrainProvider; /** * Requests the geometry for a given tile. The result must include terrain data and * may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. */ loadTileDataAvailability(x: number, y: number, level: number): undefined; } /** * Provides geocoding through Google. * @param options - Object with the following properties: * @param options.key - An API key to use with the Google geocoding service */ export class GoogleGeocoderService { constructor(options: { key: string; }); /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * Get a list of possible locations that match a search string. * @param query - The query to be sent to the geocoder service */ geocode(query: string): Promise; } /** * Default settings for accessing the Google Maps API. *
* An API key is only required if you are directly using any Google Maps APIs, such as through {@link createGooglePhotorealistic3DTileset}. * Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}. *
* You can enable multiple Google Maps Platform APIs on a single API key. * However, a separate {@link GoogleMaps.defaultStreetViewStaticApiKey} * is available if you prefer to use a dedicated key for the Street View Static API. */ export namespace GoogleMaps { /** * Gets or sets the default Google Maps API key. */ var defaultApiKey: undefined | string; /** * Gets or sets the default Google Map Tiles API endpoint. */ var mapTilesApiEndpoint: string | Resource; /** * Gets or sets the default Google Maps Street View Static API key. */ var defaultStreetViewStaticApiKey: undefined | string; /** * Gets or sets the default Google Street View Static API endpoint. */ var streetViewStaticApiEndpoint: string | Resource; } /** * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}. * @example * const positions = Cesium.Cartesian3.fromDegreesArray([ * -112.1340164450331, 36.05494287836128, * -112.08821010582645, 36.097804071380715, * -112.13296079730024, 36.168769146801104 * ]); * * const geometry = new Cesium.GroundPolylineGeometry({ * positions : positions * }); * @param options - Options with the following properties: * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored. * @param [options.width = 1.0] - The screen space width in pixels. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation. * @param [options.loop = false] - Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. */ export class GroundPolylineGeometry { constructor(options: { positions: Cartesian3[]; width?: number; granularity?: number; loop?: boolean; arcType?: ArcType; }); /** * The screen space width in pixels. */ width: number; /** * The distance interval used for interpolating options.points. Zero indicates no interpolation. * Default of 9999.0 allows centimeter accuracy with 32 bit floating point. */ granularity: boolean; /** * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop. * If the geometry has two positions this parameter will be ignored. */ loop: boolean; /** * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. */ arcType: ArcType; /** * Stores the provided instance into the provided array. * @param value - The value to pack. * @param array - The array to pack into. * @param [startingIndex = 0] - The index into the array at which to start packing the elements. * @returns The array that was packed into */ static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[]; /** * Retrieves an instance from a packed array. * @param array - The packed array. * @param [startingIndex = 0] - The starting index of the element to be unpacked. * @param [result] - The object into which to store the result. */ static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void; } /** * The encoding that is used for a heightmap */ export enum HeightmapEncoding { /** * No encoding */ NONE = 0, /** * LERC encoding */ LERC = 1 } /** * 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 north to south and west to east. * @example * const buffer = ... * const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth); * const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0]; * const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1); * const terrainData = new Cesium.HeightmapTerrainData({ * buffer : heightBuffer, * width : 65, * height : 65, * childTileMask : childTileMask, * waterMask : waterMask * }); * @param options - Object with the following properties: * @param options.buffer - The buffer containing height data. * @param options.width - The width (longitude direction) of the heightmap, in samples. * @param options.height - The height (latitude direction) of the heightmap, in samples. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. * If a child's bit is set, geometry will be requested for that tile as well when it * is needed. If the bit is cleared, the child tile is not requested and geometry is * instead upsampled from the parent. The bit values are as follows: * * * * * * *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @param [options.structure] - An object describing the structure of the height data. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain * the height above the heightOffset, in meters. The heightOffset is added to the resulting * height after multiplying by the scale. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final * height in meters. The offset is added after the height sample is multiplied by the * heightScale. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height * sample. This is usually 1, indicating that each element is a separate height sample. If * it is greater than 1, that number of elements together form the height sample, which is * computed according to the structure.elementMultiplier and structure.isBigEndian properties. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of * one height to the first element of the next height. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier * is 256, the height is computed as follows: * `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. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the * stride property is greater than 1. If this property is false, the first element is the * low-order element. If it is true, the first element is the high-order element. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is * not specified, no minimum value is enforced. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger * than 65535. If this parameter is not specified, no maximum value is enforced. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; * otherwise, false. */ export class HeightmapTerrainData { constructor(options: { buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; width: number; height: number; childTileMask?: number; waterMask?: Uint8Array; structure?: { heightScale?: number; heightOffset?: number; elementsPerHeight?: number; stride?: number; elementMultiplier?: number; isBigEndian?: boolean; lowestEncodedHeight?: number; highestEncodedHeight?: number; }; encoding?: HeightmapEncoding; createdByUpsampling?: boolean; }); /** * An array of credits for this tile. */ credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a square * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement | ImageBitmap | undefined; /** * Computes the terrain height at a specified longitude and latitude. * @param rectangle - The rectangle covered by this terrain data. * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. If the position * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly * incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the * height samples in this instance, interpolated if necessary. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. * @param thisLevel - The level of this tile in the tiling scheme. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled heightmap terrain data for the descendant tile, * or undefined if the mesh is unavailable. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Determines if a given child tile is available, based on the * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed * to be one of the four children of this tile. If non-child tile coordinates are * given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. * @param childY - The tile Y coordinate of the child tile to check for availability. * @returns True if the child tile is available; otherwise, false. */ isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution * terrain data. If this value is false, the data was obtained from some other source, such * as by downloading it from a remote server. This method should return true for instances * returned from a call to {@link HeightmapTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; } /** * Default settings for accessing the iTwin platform. */ export namespace ITwinPlatform { /** * Status states for a mesh-export export. * Valid values are: NotStarted, InProgress, Complete, Invalid */ enum ExportStatus { NotStarted = "NotStarted", InProgress = "InProgress", Complete = "Complete", Invalid = "Invalid" } /** * Types of mesh-export exports. CesiumJS only supports loading 3DTILES type exports. * Valid values are: IMODEL, CESIUM, 3DTILES */ enum ExportType { IMODEL = "IMODEL", CESIUM = "CESIUM", "3DTILES" = "3DTILES" } /** * Types of Reality data. This is a partial list of types we know we can support */ enum RealityDataType { Cesium3DTiles = "Cesium3DTiles", PNTS = "PNTS", RealityMesh3DTiles = "RealityMesh3DTiles", Terrain3DTiles = "Terrain3DTiles", GaussianSplat3DTiles = "GS_3DT", KML = "KML", GeoJSON = "GeoJSON", Unstructured = "Unstructured" } /** * Gets or sets the default iTwin access token. This token should have the itwin-platform scope. * * This value will be ignored if {@link ITwinPlatform.defaultShareKey} is defined. */ var defaultAccessToken: string | undefined; /** * Gets or sets the default iTwin share key. If this value is provided it will override {@link ITwinPlatform.defaultAccessToken} in all requests. * * Share keys can be generated using the iTwin Shares api * https://developer.bentley.com/apis/access-control-v2/operations/create-itwin-share/ */ var defaultShareKey: string | undefined; /** * Gets or sets the default iTwin API endpoint. */ var apiEndpoint: string | Resource; } /** * The interface for interpolation algorithms. */ export interface InterpolationAlgorithm { /** * Gets the name of this interpolation algorithm. */ type: string; /** * Given the desired degree, returns the number of data points required for interpolation. * @param degree - The desired degree of interpolation. * @returns The number of required data points needed for the desired degree of interpolation. */ getRequiredDataPoints(degree: number): number; /** * Performs zero order interpolation. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values * in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to * each independent variable value in xTable. * @param [result] - An existing array into which to store the result. * @returns The array of interpolated values, or the result parameter if one was provided. */ interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; /** * Performs higher order interpolation. Not all interpolators need to support high-order interpolation, * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values * in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to * each independent variable value in xTable. * @param inputOrder - The number of derivatives supplied for input. * @param outputOrder - The number of derivatives desired for output. * @param [result] - An existing array into which to store the result. * @returns The array of interpolated values, or the result parameter if one was provided. */ interpolate?(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[]; } /** * Default settings for accessing the Cesium ion API. * * An ion access token is only required if you are using any ion related APIs. * A default access token is provided for evaluation purposes only. * Sign up for a free ion account and get your own access token at {@link https://cesium.com} */ export namespace Ion { /** * Gets or sets the default Cesium ion access token. */ var defaultAccessToken: string; /** * Gets or sets the default Cesium ion server. */ var defaultServer: string | Resource; } /** * Underlying geocoding services that can be used via Cesium ion. */ export enum IonGeocodeProviderType { /** * Google geocoder, for use with Google data. */ GOOGLE = "GOOGLE", /** * Bing geocoder, for use with Bing data. */ BING = "BING", /** * Use the default geocoder as set on the server. Used when neither Bing or * Google data is used. */ DEFAULT = "DEFAULT" } /** * Provides geocoding through Cesium ion. * @param options - Object with the following properties: * @param options.scene - The scene * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server. * @param [options.geocodeProviderType = IonGeocodeProviderType.DEFAULT] - The geocoder the Cesium ion API server should use to fulfill this request. */ export class IonGeocoderService { constructor(options: { scene: Scene; accessToken?: string; server?: string | Resource; geocodeProviderType?: IonGeocodeProviderType; }); /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * The geocoding service that Cesium ion API server should use to fulfill geocding requests. */ geocodeProviderType: IonGeocodeProviderType; /** * @param query - The query to be sent to the geocoder service * @param [type = GeocodeType.SEARCH] - The type of geocode to perform. */ geocode(query: string, type?: GeocodeType): Promise; } /** * A {@link Resource} instance that encapsulates Cesium ion asset access. * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}. * @param endpoint - The result of the Cesium ion asset endpoint service. * @param endpointResource - The original resource used to retrieve the endpoint. */ export class IonResource extends Resource { constructor(endpoint: any, endpointResource: Resource); /** * Asynchronously creates an instance. * @example * // Load a Cesium3DTileset with asset ID of 124624234 * try { * const resource = await Cesium.IonResource.fromAssetId(124624234); * const tileset = await Cesium.Cesium3DTileset.fromUrl(resource); * scene.primitives.add(tileset); * } catch (error) { * console.error(`Error creating tileset: ${error}`); * } * @example * //Load a CZML file with asset ID of 10890 * Cesium.IonResource.fromAssetId(10890) * .then(function (resource) { * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource)); * }); * @param assetId - The Cesium ion asset id. * @param [options] - An object with the following properties: * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server. * @returns A Promise to an instance representing the Cesium ion Asset. */ static fromAssetId(assetId: number, options?: { accessToken?: string; server?: string | Resource; }): Promise; /** * Gets the credits required for attribution of the asset. */ readonly credits: Credit[]; /** * Duplicates a Resource instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Resource instance if one was not provided. */ clone(result?: Resource): Resource; /** * Asynchronously loads the given image resource. Returns a promise that will resolve to * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. * @example * // load a single image asynchronously * resource.fetchImage().then(function(image) { * // use the loaded image * }).catch(function(error) { * // an error occurred * }); * * // load several images in parallel * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { * // images is an array containing all the loaded images * }); * @param [options] - An object with the following properties. * @param [options.preferBlob = false] - If true, we will load the image via a blob. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchImage(options?: { preferBlob?: boolean; preferImageBitmap?: boolean; flipY?: boolean; skipColorSpaceConversion?: boolean; }): Promise | undefined; } /** * The type of geometry a snap resolved to, reported by {@link IonSnapService#snap} * as {@link IonSnapService.Result} geometryType. Values match the iTwin.js * {@link https://www.itwinjs.org/reference/core-frontend/locatingelements/hitgeomtype/|HitGeomType} enum. */ export enum IonSnapGeometryType { /** * No geometry type. */ NONE = 0, /** * A point. */ POINT = 1, /** * A line segment. */ SEGMENT = 2, /** * A curve. */ CURVE = 3, /** * An arc. */ ARC = 4, /** * A surface. *

* With {@link IonSnapMode} NEAREST, this value indicates * the snap tracked the surface under the cursor because no edge was within * the snap aperture. This means the snap point was not pulled to an edge. * Edge snaps report one of the other types along with the edge geometry in * {@link IonSnapService.Result} curve, which is absent when * tracking a surface. *

*/ SURFACE = 5 } /** * How close a snap result is to the cursor, reported by {@link IonSnapService#snap} * as {@link IonSnapService.Result} heat. Values match the iTwin.js * {@link https://www.itwinjs.org/reference/core-frontend/locatingelements/snapheat/|SnapHeat} enum. */ export enum IonSnapHeat { /** * The snap is not close to the cursor. */ NONE = 0, /** * The snap is of interest, but outside the snap aperture. */ NOT_IN_RANGE = 1, /** * The snap point is within the snap aperture of the close point in view space. */ IN_RANGE = 2 } /** * The snap modes supported by {@link IonSnapService#snap}. These follow the * MicroStation snap mode semantics; see the * {@link https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v27/en/GUID-77D54C0B-D6FF-13DA-5EC8-3196330F5244.html|MicroStation documentation} * for reference. */ export enum IonSnapMode { /** * Snaps to the point on the element nearest to the cursor. When the cursor * is farther than the snap aperture from an edge, tracks the surface under * the cursor instead. */ NEAREST = 1, /** * Snaps to the nearest of the element's keypoints. Keypoints are defined by * the element's geometry type and the snap divisor. *

* On linear elements, keypoints are regularly spaced along each segment: * the number of keypoints on a segment is one greater than the snap * divisor, and a segment's midpoint is a keypoint only when the divisor is * even. The ion API does not currently accept a snap divisor, so the * server's default divisor applies. *

*/ NEAREST_KEYPOINT = 2, /** * Snaps to the center of elements that have centers (such as circles and * arcs). For other elements, may snap to the centroid. */ CENTER = 8 } /** * The type of the parent geometry a snap resolved to, reported by * {@link IonSnapService#snap} as {@link IonSnapService.Result} parentGeometryType. * Values match the iTwin.js * {@link https://www.itwinjs.org/reference/core-frontend/locatingelements/hitparentgeomtype/|HitParentGeomType} enum. */ export enum IonSnapParentGeometryType { /** * No parent geometry type. */ NONE = 0, /** * A wire body. */ WIRE = 1, /** * A sheet body. */ SHEET = 2, /** * A solid body. */ SOLID = 3, /** * A mesh. */ MESH = 4, /** * Text. */ TEXT = 5 } export namespace IonSnapService { /** * The result of a successful {@link IonSnapService#snap}. Extends * {@link SnapService.Result} with ion-specific fields. * @property [snapPoint] - The snapped point. This is the point to consume. * @property [hitPoint] - The point where the cursor hit the geometry: the nearest edge point when within the snap aperture, otherwise the surface point under the cursor. * @property [heat] - How close the snap point is to the close point in view space. * @property [geometryType] - The type of geometry snapped to. * @property [parentGeometryType] - The type of the parent geometry snapped to. * @property [normal] - The surface normal at the snap point, in the model's local cartesian frame. * @property [curve] - The curve geometry near the snap point, with points as WGS84 degrees objects. */ type Result = { snapPoint?: Cartesian3; hitPoint?: Cartesian3; heat?: IonSnapHeat; geometryType?: IonSnapGeometryType; parentGeometryType?: IonSnapParentGeometryType; normal?: any; curve?: any; }; } /** * Provides interactive snap-to-geometry against a Cesium ion 3D Tiles asset * backed by a BIM/CAD Database model, using the ion REST API's element snap * endpoint. * * This class handles conversions between the reference frame of a * source BIM/CAD Database and the view-dependent screen space pixel * coordinates. Each snap, it transforms using the ion asset's source * reference frame, the camera's transform, and the canvas * dimensions so that view-dependent features— such as the pixel aperture, * nearest position, or surface tracking— behave correctly. * * This object is normally not instantiated directly, use {@link IonSnapService.fromAssetId}. * @example * const snapper = await Cesium.IonSnapService.fromAssetId(123456); * const canvas = viewer.scene.canvas; * const result = await snapper.snap({ * elementId: "0x30000000df2", * testPoint: pickedPosition, * camera: viewer.camera, * canvasWidth: canvas.clientWidth, * canvasHeight: canvas.clientHeight, * }); * if (Cesium.defined(result)) { * console.log("snapped to", result.snapPoint); * } * @param options - Object with the following properties: * @param options.assetId - The ion asset id. * @param options.resource - The asset's ion API resource. * @param options.ecefTransform - A 4x4 transformation matrix from the source BIM/CAD Database reference frame local to the world's fixed reference frame. */ export class IonSnapService { constructor(options: { assetId: number; resource: Resource; ecefTransform: Matrix4; }); /** * A 4x4 transformation matrix from the source BIM/CAD Database reference frame local to the world's fixed reference frame. */ readonly ecefTransform: Matrix4; /** * The ion asset id this snapper operates on. */ readonly assetId: number; /** * Creates an {@link IonSnapService} for the given ion asset, fetching * the asset's ECEF transform from the ion REST API. * @param assetId - The ion ID of a 3D Tiles asset backed by a BIM/CAD Database model. * @param [options] - Object with the following properties: * @param [options.accessToken = Ion.defaultAccessToken] - The ion access token to use. * @param [options.server = Ion.defaultServer] - The ion API server to use. * @returns A snapper bound to the asset. */ static fromAssetId(assetId: number, options?: { accessToken?: string; server?: string | Resource; }): Promise; /** * Requests a snap against an element of this asset. * * A view-correct world-to-view matrix is composed from * options.camera, options.canvasWidth, and * options.canvasHeight so view-dependent snapping (nearest * ordering, pixel apertures, surface tracking) matches the current view. * * Only 3D views are supported: the camera must be viewing in * {@link SceneMode.SCENE3D}. * @param options - Object with the following properties: * @param options.elementId - The element id to snap to, as a hex string, e.g. "0x30000000df2". * @param options.testPoint - The point to snap from, typically the picked cursor position. * @param options.camera - The camera defining the current view. Must be viewing in {@link SceneMode.SCENE3D}. * @param options.canvasWidth - The canvas width in CSS pixels. * @param options.canvasHeight - The canvas height in CSS pixels. * @param [options.closePoint = options.testPoint] - A reference point near the target geometry that seeds the snap search. * @param [options.snapAperture = IonSnapService.DEFAULT_SNAP_APERTURE] - The snap tolerance in CSS pixels of the world-to-view output space. * @param [options.snapMode = IonSnapMode.NEAREST] - The type of snap to perform. * @returns The snap result, or undefined if the element was not found or no snap was possible for it. */ snap(options: { elementId: string; testPoint: Cartesian3; camera: Camera; canvasWidth: number; canvasHeight: number; closePoint?: Cartesian3; snapAperture?: number; snapMode?: IonSnapMode; }): Promise; /** * The default snap tolerance used by {@link IonSnapService#snap} when * options.snapAperture is not provided, in CSS pixels of the * world-to-view output space. This is {@link SnapService}'s * DEFAULT_SNAP_APERTURE for this implementation. */ static readonly DEFAULT_SNAP_APERTURE: number; } /** * This enumerated type is for representing keyboard modifiers. These are keys * that are held down in addition to other event types. */ export enum KeyboardEventModifier { /** * Represents the shift key being held down. */ SHIFT = 0, /** * Represents the control key being held down. */ CTRL = 1, /** * Represents the alt key being held down. */ ALT = 2 } /** * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server. * @example * // Configure a Viewer to use the OpenCage Geocoder * const viewer = new Cesium.Viewer('cesiumContainer', { * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '') * }); * @param url - The endpoint to the OpenCage server. * @param apiKey - The OpenCage API Key. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt): * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard). * @param [options.jsonp] - Wraps the returned JSON with a function name. * @param [options.language] - An IETF format language code. * @param [options.limit] - The maximum number of results we should return. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned. * @param [options.no_annotations] - When set to 1 results will not contain annotations. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated. * @param [options.no_record] - When set to 1 the query contents are not logged. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging. * @param [options.proximity] - Provides the geocoder with a hint to bias results in favour of those closer to the specified location (For example: 41.40139,2.12870). */ export class OpenCageGeocoderService { constructor(url: Resource | string, apiKey: string, params?: { abbrv?: number; }); /** * The Resource used to access the OpenCage endpoint. */ readonly url: Resource; /** * Optional params passed to OpenCage in order to customize geocoding */ readonly params: any; /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * @param query - The query to be sent to the geocoder service */ geocode(query: string): Promise; } /** * Provides geocoding via a {@link https://pelias.io/|Pelias} server. * @example * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/ * const viewer = new Cesium.Viewer('cesiumContainer', { * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({ * url: 'https://api.geocode.earth/v1/', * queryParameters: { * api_key: '' * } * })) * }); * @param url - The endpoint to the Pelias server. */ export class PeliasGeocoderService { constructor(url: Resource | string); /** * The Resource used to access the Pelias endpoint. */ readonly url: Resource; /** * Gets the credit to display after a geocode is performed. Typically this is used to credit * the geocoder service. */ readonly credit: Credit | undefined; /** * @param query - The query to be sent to the geocoder service * @param [type = GeocodeType.SEARCH] - The type of geocode to perform. */ geocode(query: string, type?: GeocodeType): Promise; } /** * 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. *
*/ export class PinBuilder { constructor(); /** * Creates an empty pin of the specified color and size. * @param color - The color of the pin. * @param size - The size of the pin, in pixels. * @returns The canvas element that represents the generated pin. */ fromColor(color: Color, size: number): HTMLCanvasElement; /** * Creates a pin with the specified icon, color, and size. * @param url - The url of the image to be stamped onto the pin. * @param color - The color of the pin. * @param size - The size of the pin, in pixels. * @returns The canvas element or a Promise to the canvas element that represents the generated pin. */ fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise; /** * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size. * @param id - The id of the maki icon to be stamped onto the pin. * @param color - The color of the pin. * @param size - The size of the pin, in pixels. * @returns The canvas element or a Promise to the canvas element that represents the generated pin. */ fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise; /** * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible * while still being contained completely within the pin. * @param text - The text to be stamped onto the pin. * @param color - The color of the pin. * @param size - The size of the pin, in pixels. * @returns The canvas element that represents the generated pin. */ fromText(text: string, color: Color, size: number): HTMLCanvasElement; } /** * Base class for proxying requested made by {@link Resource}. */ export class Proxy { constructor(); /** * Get the final URL to use to request a given resource. * @param resource - The resource to request. * @returns proxied resource */ getURL(resource: string): string; } /** * 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. * @example * const 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 * }); * @param options - Object with the following properties: * @param options.quantizedVertices - The buffer containing the quantized mesh. * @param options.indices - The indices specifying how the quantized vertices are linked * together into triangles. Each three indices specifies one triangle. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point * is below the horizon, the entire tile is assumed to be below the horizon as well. * The point is expressed in ellipsoid-scaled coordinates. * @param options.westIndices - The indices of the vertices on the western edge of the tile. * @param options.southIndices - The indices of the vertices on the southern edge of the tile. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile. * @param options.northIndices - The indices of the vertices on the northern edge of the tile. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. * If a child's bit is set, geometry will be requested for that tile as well when it * is needed. If the bit is cleared, the child tile is not requested and geometry is * instead upsampled from the parent. The bit values are as follows: * * * * * * *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; * otherwise, false. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding * @param [options.waterMask] - The buffer containing the watermask. * @param [options.credits] - Array of credits for this tile. */ export class QuantizedMeshTerrainData { constructor(options: { quantizedVertices: Uint16Array; indices: Uint16Array | Uint32Array; minimumHeight: number; maximumHeight: number; boundingSphere: BoundingSphere; orientedBoundingBox?: OrientedBoundingBox; horizonOcclusionPoint: Cartesian3; westIndices: number[]; southIndices: number[]; eastIndices: number[]; northIndices: number[]; westSkirtHeight: number; southSkirtHeight: number; eastSkirtHeight: number; northSkirtHeight: number; childTileMask?: number; createdByUpsampling?: boolean; encodedNormals?: Uint8Array; waterMask?: Uint8Array; credits?: Credit[]; }); /** * An array of credits for this tile. */ credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a rectangular * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement | undefined; /** * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the * vertices in this instance, interpolated if necessary. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. * @param thisLevel - The level of this tile in the tiling scheme. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled heightmap terrain data for the descendant tile, * or undefined if too many asynchronous upsample operations are in progress and the request has been * deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Computes the terrain height at a specified longitude and latitude. * @param rectangle - The rectangle covered by this terrain data. * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. The position is clamped to * the rectangle, so expect incorrect results for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Determines if a given child tile is available, based on the * {@link QuantizedMeshTerrainData.childTileMask}. The given child tile coordinates are assumed * to be one of the four children of this tile. If non-child tile coordinates are * given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. * @param childY - The tile Y coordinate of the child tile to check for availability. * @returns True if the child tile is available; otherwise, false. */ isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution * terrain data. If this value is false, the data was obtained from some other source, such * as by downloading it from a remote server. This method should return true for instances * returned from a call to {@link HeightmapTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; } /** * Stores information for making a request. In general this does not need to be constructed directly. * @param [options] - An object with the following properties: * @param [options.url] - The url to request. * @param [options.requestFunction] - The function that makes the actual data request. * @param [options.cancelFunction] - The function that is called when the request is cancelled. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame. * @param [options.priority = 0.0] - The initial priority of the request. * @param [options.throttle = false] - Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority. * @param [options.throttleByServer = false] - Whether to throttle the request by server. * @param [options.type = RequestType.OTHER] - The type of request. * @param [options.serverKey] - A key used to identify the server that a request is going to. */ export class Request { constructor(options?: { url?: string; requestFunction?: Request.RequestCallback; cancelFunction?: Request.CancelCallback; priorityFunction?: Request.PriorityCallback; priority?: number; throttle?: boolean; throttleByServer?: boolean; type?: RequestType; serverKey?: string; }); /** * The URL to request. */ url: string; /** * The function that makes the actual data request. */ requestFunction: Request.RequestCallback; /** * The function that is called when the request is cancelled. */ cancelFunction: Request.CancelCallback; /** * The function that is called to update the request's priority, which occurs once per frame. */ priorityFunction: Request.PriorityCallback; /** * Priority is a unit-less value where lower values represent higher priority. * For world-based objects, this is usually the distance from the camera. * A request that does not have a priority function defaults to a priority of 0. * * If priorityFunction is defined, this value is updated every frame with the result of that call. */ priority: number; /** * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the * request will be throttled and sent based on priority. */ readonly throttle: boolean; /** * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value * to true is preferable for requests going through HTTP/1 servers. */ readonly throttleByServer: boolean; /** * Type of request. */ readonly type: RequestType; /** * The current state of the request. */ readonly state: RequestState; /** * Duplicates a Request instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Resource instance if one was not provided. */ clone(result?: Request): Request; } export namespace Request { /** * The function that makes the actual data request. */ type RequestCallback = () => Promise; /** * The function that is called when the request is cancelled. */ type CancelCallback = () => void; /** * The function that is called to update the request's priority, which occurs once per frame. */ type PriorityCallback = () => number; } /** * An event that is raised when a request encounters an error. * @param [statusCode] - The HTTP error status code, such as 404. * @param [response] - The response included along with the error. * @param [responseHeaders] - The response headers, represented either as an object literal or as a * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function. */ export class RequestErrorEvent { constructor(statusCode?: number, response?: any, responseHeaders?: string | any); /** * The HTTP error status code, such as 404. If the error does not have a particular * HTTP code, this property will be undefined. */ statusCode: number; /** * The response included along with the error. If the error does not include a response, * this property will be undefined. */ response: any; /** * The headers included in the response, represented as an object literal of key/value pairs. * If the error does not include any headers, this property will be undefined. */ responseHeaders: any | undefined; /** * Creates a string representing this RequestErrorEvent. * @returns A string representing the provided RequestErrorEvent. */ toString(): string; } /** * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position, * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired. */ export namespace RequestScheduler { /** * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit. */ var maximumRequests: number; /** * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically * listed in {@link requestsByServer} do not observe this limit. */ var maximumRequestsPerServer: number; /** * A per server key list of overrides to use for throttling instead of maximumRequestsPerServer. * Useful when streaming data from a known HTTP/2 or HTTP/3 server. * @example * RequestScheduler.requestsByServer["myserver.com:443"] = 18; * @example * RequestScheduler.requestsByServer = { * "api.cesium.com:443": 18, * "assets.cesium.com:443": 18, * }; */ var requestsByServer: any; /** * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control. */ var throttleRequests: boolean; } /** * State of the request. */ export enum RequestState { /** * Initial unissued state. */ UNISSUED = 0, /** * Issued but not yet active. Will become active when open slots are available. */ ISSUED = 1, /** * Actual http request has been sent. */ ACTIVE = 2, /** * Request completed successfully. */ RECEIVED = 3, /** * Request was cancelled, either explicitly or automatically because of low priority. */ CANCELLED = 4, /** * Request failed. */ FAILED = 5 } /** * An enum identifying the type of request. Used for finer grained logging and priority sorting. */ export enum RequestType { /** * Terrain request. */ TERRAIN = 0, /** * Imagery request. */ IMAGERY = 1, /** * 3D Tiles request. */ TILES3D = 2, /** * Other request. */ OTHER = 3 } export namespace Resource { /** * Initialization options for the Resource constructor * @property url - The url of the resource. * @property [queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @property [templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @property [headers = {}] - Additional HTTP headers that will be sent. * @property [proxy] - A proxy to be used when loading the resource. * @property [retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @property [retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @property [request] - A Request object that will be used. Intended for internal use only. * @property [parseUrl = true] - If true, parse the url for query parameters; otherwise store the url without change */ type ConstructorOptions = { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; parseUrl?: boolean; }; /** * A function that returns the value of the property. * @param [resource] - The resource that failed to load. * @param [error] - The error that occurred during the loading of the resource. */ type RetryCallback = (resource?: Resource, error?: RequestErrorEvent) => boolean | Promise; } /** * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests. * @example * function refreshTokenRetryCallback(resource, error) { * if (error.statusCode === 403) { * // 403 status code means a new token should be generated * return getNewAccessToken() * .then(function(token) { * resource.queryParameters.access_token = token; * return true; * }) * .catch(function() { * return false; * }); * } * * return false; * } * * const resource = new Resource({ * url: 'http://server.com/path/to/resource.json', * proxy: new DefaultProxy('/proxy/'), * headers: { * 'X-My-Header': 'valueOfHeader' * }, * queryParameters: { * 'access_token': '123-435-456-000' * }, * retryCallback: refreshTokenRetryCallback, * retryAttempts: 1 * }); * @param options - A url or an object describing initialization options */ export class Resource { constructor(options: string | Resource.ConstructorOptions); /** * Additional HTTP headers that will be sent with the request. */ headers: any; /** * A Request object that will be used. Intended for internal use only. */ request: Request; /** * A proxy to be used when loading the resource. */ proxy: Proxy; /** * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried. */ retryCallback: (...params: any[]) => any; /** * The number of times the retryCallback should be called before giving up. */ retryAttempts: number; /** * Returns true if blobs are supported. */ static readonly isBlobSupported: boolean; /** * Query parameters appended to the url. */ readonly queryParameters: any; /** * The key/value pairs used to replace template parameters in the url. */ readonly templateValues: any; /** * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set. */ url: string; /** * The file extension of the resource. */ readonly extension: string; /** * True if the Resource refers to a data URI. */ isDataUri: boolean; /** * True if the Resource refers to a blob URI. */ isBlobUri: boolean; /** * True if the Resource refers to a cross origin URL. */ isCrossOriginUrl: boolean; /** * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys. */ hasHeaders: boolean; /** * Override Object#toString so that implicit string conversion gives the * complete URL represented by this Resource. * @returns The URL represented by this Resource */ toString(): string; /** * Returns the url, optional with the query string and processed by a proxy. * @param [query = false] - If true, the query string is included. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined. * @returns The url with all the requested components. */ getUrlComponent(query?: boolean, proxy?: boolean): string; /** * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value. * @param params - The query parameters * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined. */ setQueryParameters(params: any, useAsDefault?: boolean): void; /** * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, * as opposed to adding them one at a time to the queryParameters property. * @param params - The query parameters */ appendQueryParameters(params: any): void; /** * Combines the specified object and the existing template values. This allows you to add many values at once, * as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended. * @param template - The template values * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined. */ setTemplateValues(template: any, useAsDefault?: boolean): void; /** * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options. * @param options - An object with the following properties * @param [options.url] - The url that will be resolved relative to the url of the current instance. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance. * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The function to call when loading the resource fails. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.preserveQueryParameters = false] - If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource. * @returns The resource derived from the current one. */ getDerivedResource(options: { url?: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; preserveQueryParameters?: boolean; }): Resource; /** * Duplicates a Resource instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Resource instance if one was not provided. */ clone(result?: Resource): Resource; /** * Returns the base path of the Resource. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri * @returns The base URI of the resource */ getBaseUri(includeQuery?: boolean): string; /** * Appends a forward slash to the URL. */ appendForwardSlash(): void; /** * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load a single URL asynchronously * resource.fetchArrayBuffer().then(function(arrayBuffer) { * // use the data * }).catch(function(error) { * // an error occurred * }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchArrayBuffer(): Promise | undefined; /** * Creates a Resource and calls fetchArrayBuffer() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchArrayBuffer(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; }): Promise | undefined; /** * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to * a Blob once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load a single URL asynchronously * resource.fetchBlob().then(function(blob) { * // use the data * }).catch(function(error) { * // an error occurred * }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchBlob(): Promise | undefined; /** * Creates a Resource and calls fetchBlob() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchBlob(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; }): Promise | undefined; /** * Asynchronously loads the given image resource. Returns a promise that will resolve to * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. * @example * // load a single image asynchronously * resource.fetchImage().then(function(image) { * // use the loaded image * }).catch(function(error) { * // an error occurred * }); * * // load several images in parallel * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { * // images is an array containing all the loaded images * }); * @param [options] - An object with the following properties. * @param [options.preferBlob = false] - If true, we will load the image via a blob. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchImage(options?: { preferBlob?: boolean; preferImageBitmap?: boolean; flipY?: boolean; skipColorSpaceConversion?: boolean; }): Promise | undefined; /** * Creates a Resource and calls fetchImage() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.flipY = false] - Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.preferBlob = false] - If true, we will load the image via a blob. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchImage(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; flipY?: boolean; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; preferBlob?: boolean; preferImageBitmap?: boolean; skipColorSpaceConversion?: boolean; }): Promise | undefined; /** * Asynchronously loads the given resource as text. Returns a promise that will resolve to * a String once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load text from a URL, setting a custom header * const resource = new Resource({ * url: 'http://someUrl.com/someJson.txt', * headers: { * 'X-Custom-Header' : 'some value' * } * }); * resource.fetchText().then(function(text) { * // Do something with the text * }).catch(function(error) { * // an error occurred * }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchText(): Promise | undefined; /** * Creates a Resource and calls fetchText() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchText(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; }): Promise | undefined; /** * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to * a JSON object once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not * already specified. * @example * resource.fetchJson().then(function(jsonData) { * // Do something with the JSON object * }).catch(function(error) { * // an error occurred * }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchJson(): Promise | undefined; /** * Creates a Resource and calls fetchJson() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchJson(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; }): Promise | undefined; /** * Asynchronously loads the given resource as XML. Returns a promise that will resolve to * an XML Document once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load XML from a URL, setting a custom header * Cesium.loadXML('http://someUrl.com/someXML.xml', { * 'X-Custom-Header' : 'some value' * }).then(function(document) { * // Do something with the document * }).catch(function(error) { * // an error occurred * }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchXML(): Promise | undefined; /** * Creates a Resource and calls fetchXML() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchXML(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; }): Promise | undefined; /** * Requests a resource using JSONP. * @example * // load a data asynchronously * resource.fetchJsonp().then(function(data) { * // use the loaded data * }).catch(function(error) { * // an error occurred * }); * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchJsonp(callbackParameterName?: string): Promise | undefined; /** * Creates a Resource from a URL and calls fetchJsonp() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetchJsonp(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; callbackParameterName?: string; }): Promise | undefined; /** * Asynchronously loads the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use * the more specific functions eg. fetchJson, fetchBlob, etc. * @example * resource.fetch() * .then(function(body) { * // use the data * }).catch(function(error) { * // an error occurred * }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetch(options?: { responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls fetch() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static fetch(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * Asynchronously deletes the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.delete() * .then(function(body) { * // use the data * }).catch(function(error) { * // an error occurred * }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ delete(options?: { responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls delete() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.data] - Data that is posted with the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static delete(options: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * Asynchronously gets headers the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.head() * .then(function(headers) { * // use the data * }).catch(function(error) { * // an error occurred * }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ head(options?: { responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls head() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static head(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * Asynchronously gets options the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.options() * .then(function(headers) { * // use the data * }).catch(function(error) { * // an error occurred * }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ options(options?: { responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls options() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static options(options: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * Asynchronously posts data to the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.post(data) * .then(function(result) { * // use the result * }).catch(function(error) { * // an error occurred * }); * @param data - Data that is posted with the resource. * @param [options] - Object with the following properties: * @param [options.data] - Data that is posted with the resource. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ post(data: any, options?: { data?: any; responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls post() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param options.data - Data that is posted with the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static post(options: { url: string; data: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * Asynchronously puts data to the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.put(data) * .then(function(result) { * // use the result * }).catch(function(error) { * // an error occurred * }); * @param data - Data that is posted with the resource. * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ put(data: any, options?: { responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls put() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param options.data - Data that is posted with the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static put(options: { url: string; data: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * Asynchronously patches data to the given resource. Returns a promise that will resolve to * the result once loaded, or reject if the resource failed to load. The data is loaded * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.patch(data) * .then(function(result) { * // use the result * }).catch(function(error) { * // an error occurred * }); * @param data - Data that is posted with the resource. * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ patch(data: any, options?: { responseType?: string; headers?: any; overrideMimeType?: string; }): Promise | undefined; /** * Creates a Resource from a URL and calls patch() on it. * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param options.data - Data that is posted with the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). * @param [options.headers = {}] - Additional HTTP headers that will be sent. * @param [options.proxy] - A proxy to be used when loading the resource. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. * @param [options.request] - A Request object that will be used. Intended for internal use only. * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ static patch(options: { url: string; data: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: Proxy; retryCallback?: Resource.RetryCallback; retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string; }): Promise | undefined; /** * A resource instance initialized to the current browser location */ static readonly DEFAULT: Resource; } export namespace ScreenSpaceEventHandler { /** * An Event that occurs at a single position on screen. */ type PositionedEvent = { position: Cartesian2; }; /** * @param event - The event which triggered the listener */ type PositionedEventCallback = (event: ScreenSpaceEventHandler.PositionedEvent) => void; /** * An Event that starts at one position and ends at another. */ type MotionEvent = { startPosition: Cartesian2; endPosition: Cartesian2; }; /** * @param event - The event which triggered the listener */ type MotionEventCallback = (event: ScreenSpaceEventHandler.MotionEvent) => void; /** * An Event that occurs at a two positions on screen. */ type TwoPointEvent = { position1: Cartesian2; position2: Cartesian2; }; /** * @param event - The event which triggered the listener */ type TwoPointEventCallback = (event: ScreenSpaceEventHandler.TwoPointEvent) => void; /** * An Event that starts at a two positions on screen and moves to two other positions. */ type TwoPointMotionEvent = { position1: Cartesian2; position2: Cartesian2; previousPosition1: Cartesian2; previousPosition2: Cartesian2; }; /** * @param event - The event which triggered the listener */ type TwoPointMotionEventCallback = (event: ScreenSpaceEventHandler.TwoPointMotionEvent) => void; /** * @param delta - The amount that the mouse wheel moved */ type WheelEventCallback = (delta: number) => void; } /** * Handles user input events. Custom functions can be added to be executed on * when the user enters input. * @param [element = document] - The element to add events to. */ export class ScreenSpaceEventHandler { constructor(element?: HTMLElement); /** * Set a function to be executed on an input event. * @param action - Function to be executed when the input event occurs. * @param type - The ScreenSpaceEventType of input event. * @param [modifiers] - The KeyboardEventModifier keys that are held when a type * event occurs. */ setInputAction(action: ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback, type: ScreenSpaceEventType, modifiers?: KeyboardEventModifier[] | KeyboardEventModifier): void; /** * Returns the function to be executed on an input event. * @param type - The ScreenSpaceEventType of input event. * @param [modifiers] - The KeyboardEventModifier keys that are held when a type * event occurs. * @returns The function to be executed on an input event. */ getInputAction(type: ScreenSpaceEventType, modifiers?: KeyboardEventModifier[] | KeyboardEventModifier): ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback; /** * Removes the function to be executed on an input event. * @param type - The ScreenSpaceEventType of input event. * @param [modifiers] - The KeyboardEventModifier keys that are held when a type * event occurs. */ removeInputAction(type: ScreenSpaceEventType, modifiers?: KeyboardEventModifier[] | KeyboardEventModifier): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes listeners held by this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * handler = handler && handler.destroy(); */ destroy(): void; /** * The amount of time, in milliseconds, that mouse events will be disabled after * receiving any touch events, such that any emulated mouse events will be ignored. */ static mouseEmulationIgnoreMilliseconds: number; /** * The amount of time, in milliseconds, before a touch on the screen becomes a * touch and hold. */ static touchHoldDelayMilliseconds: number; } /** * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down. */ export enum ScreenSpaceEventType { /** * Represents a mouse left button down event. */ LEFT_DOWN = 0, /** * Represents a mouse left button up event. */ LEFT_UP = 1, /** * Represents a mouse left click event. */ LEFT_CLICK = 2, /** * Represents a mouse left double click event. */ LEFT_DOUBLE_CLICK = 3, /** * Represents a mouse left button down event. */ RIGHT_DOWN = 5, /** * Represents a mouse right button up event. */ RIGHT_UP = 6, /** * Represents a mouse right click event. */ RIGHT_CLICK = 7, /** * Represents a mouse middle button down event. */ MIDDLE_DOWN = 10, /** * Represents a mouse middle button up event. */ MIDDLE_UP = 11, /** * Represents a mouse middle click event. */ MIDDLE_CLICK = 12, /** * Represents a mouse move event. */ MOUSE_MOVE = 15, /** * Represents a mouse wheel event. */ WHEEL = 16, /** * Represents the start of a two-finger event on a touch surface. */ PINCH_START = 17, /** * Represents the end of a two-finger event on a touch surface. */ PINCH_END = 18, /** * Represents a change of a two-finger event on a touch surface. */ PINCH_MOVE = 19 } /** * Contains functions for finding the Cartesian coordinates of the sun and the moon in the * Earth-centered inertial frame. */ export namespace Simon1994PlanetaryPositions { /** * Computes the position of the Sun in the Earth-centered inertial frame * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used. * @param [result] - The object onto which to store the result. * @returns Calculated sun position */ function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; /** * Computes the position of the Moon in the Earth-centered inertial frame * @param [julianDate] - The time at which to compute the Moon's position, if not provided the current system time is used. * @param [result] - The object onto which to store the result. * @returns Calculated moon position */ function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; } export namespace SnapService { /** * The result of a successful {@link SnapService#snap}. * * Implementations may return additional properties beyond those listed here. * @property [snapPoint] - The snapped point. This is the point to consume. * @property [hitPoint] - The point where the cursor hit the geometry: the nearest edge point when within the snap aperture, otherwise the surface point under the cursor. */ type Result = { snapPoint?: Cartesian3; hitPoint?: Cartesian3; }; } /** * Provides snap-to-geometry through an external service, which snaps against * source geometry hosted remotely rather than geometry loaded in the scene. * This type describes an interface and is not intended to be used. */ export class SnapService { /** * Requests a snap against geometry known to the service. * * The camera and canvas dimensions describe the current view so the * implementation can perform view-dependent snapping (nearest ordering, * pixel apertures, surface tracking) correctly. * * Implementations may accept additional options beyond those listed here. * @param options - Object with the following properties: * @param options.elementId - An implementation-defined identifier of the geometry to snap to. * @param options.testPoint - The point to snap from, typically the picked cursor position. * @param options.camera - The camera defining the current view. * @param options.canvasWidth - The canvas width in CSS pixels. * @param options.canvasHeight - The canvas height in CSS pixels. * @param [options.closePoint = options.testPoint] - A reference point near the target geometry that seeds the snap search. * @param [options.snapAperture = SnapService.DEFAULT_SNAP_APERTURE] - The snap tolerance in CSS pixels. * @returns The snap result, or undefined if no snap was possible. */ snap(options: { elementId: string; testPoint: Cartesian3; camera: Camera; canvasWidth: number; canvasHeight: number; closePoint?: Cartesian3; snapAperture?: number; }): Promise; /** * The default snap tolerance used by {@link SnapService#snap} when * options.snapAperture is not provided, in CSS pixels. * The value is implementation-defined. */ static readonly DEFAULT_SNAP_APERTURE: number; } /** * 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. * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder. * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded, * scheduleTask will not queue any more tasks, allowing * work to be rescheduled in future frames. */ export class TaskProcessor { constructor(workerPath: string, maximumActiveTasks?: number); /** * Schedule a task to be processed by the web worker asynchronously. If there are currently more * tasks active than the maximum set by the constructor, will immediately return undefined. * Otherwise, returns a promise that will resolve to the result posted back by the worker when * finished. * @example * const taskProcessor = new Cesium.TaskProcessor('myWorkerPath'); * const promise = taskProcessor.scheduleTask({ * someParameter : true, * another : 'hello' * }); * if (!Cesium.defined(promise)) { * // too many active tasks - try again later * } else { * promise.then(function(result) { * // use the result of the task * }); * } * @param parameters - Any input data that will be posted to the worker. * @param [transferableObjects] - An array of objects contained in parameters that should be * transferred to the worker instead of copied. * @returns Either a promise that will resolve to the result when available, or undefined * if there are too many active tasks, */ scheduleTask(parameters: any, transferableObjects?: object[]): Promise | undefined; /** * Posts a message to a web worker with configuration to initialize loading * and compiling a web assembly module asynchronously, as well as an optional * fallback JavaScript module to use if Web Assembly is not supported. * @param [webAssemblyOptions] - An object with the following properties: * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported. * @returns A promise that resolves to the result when the web worker has loaded and compiled the web assembly module and is ready to process tasks. */ initWebAssemblyModule(webAssemblyOptions?: { modulePath?: string; wasmBinaryFile?: string; fallbackModulePath?: string; }): Promise; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys this object. This will immediately terminate the Worker. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. */ destroy(): void; } /** * Terrain data for a single tile. This type describes an * interface and is not intended to be instantiated directly. */ export class TerrainData { constructor(); /** * An array of credits for this tile. */ credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a rectangular * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement | ImageBitmap | undefined; /** * Computes the terrain height at a specified longitude and latitude. * @param rectangle - The rectangle covered by this terrain data. * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. If the position * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly * incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Determines if a given child tile is available, based on the * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed * to be one of the four children of this tile. If non-child tile coordinates are * given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. * @param childY - The tile Y coordinate of the child tile to check for availability. * @returns True if the child tile is available; otherwise, false. */ isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Upsamples this terrain data for use by a descendant tile. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. * @param thisLevel - The level of this tile in the tiling scheme. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled terrain data for the descendant tile, * or undefined if too many asynchronous upsample operations are in progress and the request has been * deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution * terrain data. If this value is false, the data was obtained from some other source, such * as by downloading it from a remote server. This method should return true for instances * returned from a call to {@link TerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; } export namespace TerrainProvider { /** * A function that is called when an error occurs. * @param err - An object holding details about the error that occurred. */ type ErrorEvent = (this: TerrainProvider, err: TileProviderError) => void; } /** * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an * interface and is not intended to be instantiated directly. */ export class TerrainProvider { constructor(); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ readonly hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. */ readonly availability: TileAvailability | undefined; /** * Gets a list of indices for a triangle mesh representing a regular grid. Calling * this function multiple times with the same grid width and height returns the * same list of indices. The total number of vertices must be less than or equal * to 65536. * @param width - The number of vertices in the regular grid in the horizontal direction. * @param height - The number of vertices in the regular grid in the vertical direction. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less. */ static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array; /** * Specifies the quality of terrain created from heightmaps. A value of 1.0 will * ensure that adjacent heightmap vertices are separated by no more than * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the * screen pixels between adjacent heightmap vertices and thus rendering more quickly. */ static heightmapTerrainQuality: number; /** * Determines an appropriate geometric error estimate when the geometry comes from a heightmap. * @param ellipsoid - The ellipsoid to which the terrain is attached. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero. * @returns An estimated geometric error. */ static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number; /** * Requests the geometry for a given tile. The result must include terrain data and * may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported by the terrain provider, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise; } /** * Reports the availability of tiles in a {@link TilingScheme}. * @param tilingScheme - The tiling scheme in which to report availability. * @param maximumLevel - The maximum tile level that is potentially available. */ export class TileAvailability { constructor(tilingScheme: TilingScheme, maximumLevel: number); /** * Marks a rectangular range of tiles in a particular level as being available. For best performance, * add your ranges in order of increasing level. * @param level - The level. * @param startX - The X coordinate of the first available tiles at the level. * @param startY - The Y coordinate of the first available tiles at the level. * @param endX - The X coordinate of the last available tiles at the level. * @param endY - The Y coordinate of the last available tiles at the level. */ addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void; /** * Determines the level of the most detailed tile covering the position. This function * usually completes in time logarithmic to the number of rectangles added with * {@link TileAvailability#addAvailableTileRange}. * @param position - The position for which to determine the maximum available level. The height component is ignored. * @returns The level of the most detailed tile covering the position. */ computeMaximumLevelAtPosition(position: Cartographic): number; /** * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function * usually completes in time logarithmic to the number of rectangles added with * {@link TileAvailability#addAvailableTileRange}. * @param rectangle - The rectangle. * @returns The best available level for the entire rectangle. */ computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number; /** * Determines if a particular tile is available. * @param level - The tile level to check. * @param x - The X coordinate of the tile to check. * @param y - The Y coordinate of the tile to check. * @returns True if the tile is available; otherwise, false. */ isTileAvailable(level: number, x: number, y: number): boolean; /** * Computes a bit mask indicating which of a tile's four children exist. * If a child's bit is set, a tile is available for that child. If it is cleared, * the tile is not available. The bit values are as follows: * * * * * * *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param level - The level of the parent tile. * @param x - The X coordinate of the parent tile. * @param y - The Y coordinate of the parent tile. * @returns The bit mask indicating child availability. */ computeChildMaskForTile(level: number, x: number, y: number): number; } /** * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}. * @param provider - The imagery or terrain provider that experienced the error. * @param message - A message describing the error. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error * is not specific to a particular tile. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error * is not specific to a particular tile. * @param [level] - The level of the tile that experienced the error, or undefined if the error * is not specific to a particular tile. * @param [timesRetried = 0] - The number of times this operation has been retried. * @param [error] - The error or exception that occurred, if any. */ export class TileProviderError { constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error); /** * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error. */ provider: ImageryProvider | TerrainProvider; /** * The message describing the error. */ message: string; /** * The X coordinate of the tile that experienced the error. If the error is not specific * to a particular tile, this property will be undefined. */ x: number; /** * The Y coordinate of the tile that experienced the error. If the error is not specific * to a particular tile, this property will be undefined. */ y: number; /** * The level-of-detail of the tile that experienced the error. If the error is not specific * to a particular tile, this property will be undefined. */ level: number; /** * The number of times this operation has been retried. */ timesRetried: number; /** * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider * will set the initial value of this property before raising the event, but any listeners * can change it. The value after the last listener is invoked will be acted upon. */ retry: boolean; /** * The error or exception that occurred, if any. */ error: Error; /** * Reports an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by * logging the error to the console if the event has no listeners. This method also tracks the number * of times the operation has been retried. * @param previousError - The error instance returned by this function the last * time it was called for this error, or undefined if this is the first time this error has * occurred. * @param [provider] - The imagery or terrain provider that encountered the error. * @param [event] - The event to raise to inform listeners of the error. * @param [message] - The message describing the error. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the * error is not specific to a particular tile. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the * error is not specific to a particular tile. * @param [level] - The level-of-detail of the tile that experienced the error, or undefined if the * error is not specific to a particular tile. * @param [errorDetails] - The error or exception that occurred, if any. * @returns The error instance that was passed to the event listeners and that * should be passed to this function the next time it is called for the same error in order * to track retry counts. */ static reportError(previousError: TileProviderError, provider?: ImageryProvider | TerrainProvider, event?: Event, message?: string, x?: number, y?: number, level?: number, errorDetails?: Error): TileProviderError; /** * Reports success of an operation by resetting the retry count of a previous error, if any. This way, * if the error occurs again in the future, the listeners will be informed that it has not yet been retried. * @param previousError - The previous error, or undefined if this operation has * not previously resulted in an error. */ static reportSuccess(previousError: TileProviderError): void; } export namespace TileProviderError { /** * A function that will be called to retry the operation. */ type RetryFunction = () => void; } /** * 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. */ export interface TilingScheme { /** * Gets the ellipsoid that is tiled by the tiling scheme. */ ellipsoid: Ellipsoid; /** * Gets the rectangle, in radians, covered by this tiling scheme. */ rectangle: Rectangle; /** * Gets the map projection used by the tiling scheme. */ projection: MapProjection; /** * Gets the total number of tiles in the X direction at a specified level-of-detail. * @param level - The level-of-detail. * @returns The number of tiles in the X direction at the given level. */ getNumberOfXTilesAtLevel(level: number): number; /** * Gets the total number of tiles in the Y direction at a specified level-of-detail. * @param level - The level-of-detail. * @returns The number of tiles in the Y direction at the given level. */ getNumberOfYTilesAtLevel(level: number): number; /** * Transforms a rectangle specified in geodetic radians to the native coordinate system * of this tiling scheme. * @param rectangle - The rectangle to transform. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the native rectangle if 'result' * is undefined. */ rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates * of the tiling scheme. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ tileXYToNativeRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a cartographic rectangle in radians. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ tileXYToRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle; /** * Calculates the tile x, y coordinates of the tile containing * a given cartographic position. * @param position - The position. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the tile x, y coordinates * if 'result' is undefined. */ positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; } export namespace _CelestialFrameTransforms { /** * The default function to compute a rotation matrix to transform a point or vector from the International Celestial * Reference Frame (GCRF/ICRF) inertial frame axes to the central body, typically Earth, fixed frame axis at a given * time for use in lighting and transformation from inertial reference frames. This function may return undefined if * the data necessary to do the transformation is not yet loaded. * @example * // Set the default ICRF to fixed transformation to that of the Moon. * Cesium.CelestialFrameTransforms.computeIcrfToCentralBodyFixedMatrix = Cesium.CelestialFrameTransforms.computeIcrfToMoonFixedMatrix; * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is * not specified, a new instance is created and returned. * @returns The rotation matrix, or undefined if the data necessary to do the * transformation is not yet loaded. */ function computeIcrfToCentralBodyFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3 | undefined; /** * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC. * @example * //Set the view to the inertial frame. * scene.postUpdate.addEventListener(function(scene, time) { * const now = Cesium.JulianDate.now(); * const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3()); * const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.CelestialFrameTransforms.computeTemeToPseudoFixedMatrix(now)); * const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4()); * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset); * camera.lookAtTransform(transform, offset); * }); * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Matrix3 instance if none was provided. */ function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; /** * Preloads the data necessary to transform between the ICRF and Fixed axes, in either * direction, over a given interval. This function returns a promise that, when resolved, * indicates that the preload has completed. * @example * const interval = new Cesium.TimeInterval(...); * await Cesium.CelestialFrameTransforms.preloadIcrfFixed(interval)); * // the data is now loaded * @param timeInterval - The interval to preload. * @returns A promise that, when resolved, indicates that the preload has completed * and evaluation of the transformation between the fixed and ICRF axes will * no longer return undefined for a time inside the interval. */ function preloadIcrfFixed(timeInterval: TimeInterval): Promise; /** * Computes a rotation matrix to transform a point or vector from the International Celestial * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) * at a given time. This function may return undefined if the data necessary to * do the transformation is not yet loaded. * @example * scene.postUpdate.addEventListener(function(scene, time) { * // View in ICRF. * const icrfToFixed = Cesium.CelestialFrameTransforms.computeIcrfToFixedMatrix(time); * if (Cesium.defined(icrfToFixed)) { * const offset = Cesium.Cartesian3.clone(camera.position); * const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed); * camera.lookAtTransform(transform, offset); * } * }); * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is * not specified, a new instance is created and returned. * @returns The rotation matrix, or undefined if the data necessary to do the * transformation is not yet loaded. */ function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3 | undefined; /** * Computes a rotation matrix to transform a point or vector from the Moon-Fixed frame axes * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes * at a given time. * @example * // Transform a point from the Fixed axes to the ICRF axes. * const now = Cesium.JulianDate.now(); * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0); * const fixedToIcrf = Cesium.CelestialFrameTransforms.computeMoonFixedToIcrfMatrix(now); * let pointInInertial = new Cesium.Cartesian3(); * if (Cesium.defined(fixedToIcrf)) { * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial); * } * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is * not specified, a new instance is created and returned. * @returns The rotation matrix. */ function computeMoonFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3; /** * Computes a rotation matrix to transform a point or vector from the International Celestial * Reference Frame (GCRF/ICRF) inertial frame axes to the Moon-Fixed frame axes * at a given time. * @example * // Set the default ICRF to fixed transformation to that of the Moon. * Cesium.CelestialFrameTransforms.computeIcrfToCentralBodyFixedMatrix = Cesium.CelestialFrameTransforms.computeIcrfToMoonFixedMatrix; * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is * not specified, a new instance is created and returned. * @returns The rotation matrix. */ function computeIcrfToMoonFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; /** * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF) * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes * at a given time. This function may return undefined if the data necessary to * do the transformation is not yet loaded. * @example * // Transform a point from the Fixed axes to the ICRF axes. * const now = Cesium.JulianDate.now(); * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0); * const fixedToIcrf = Cesium.CelestialFrameTransforms.computeFixedToIcrfMatrix(now); * let pointInInertial = new Cesium.Cartesian3(); * if (Cesium.defined(fixedToIcrf)) { * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial); * } * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is * not specified, a new instance is created and returned. * @returns The rotation matrix, or undefined if the data necessary to do the * transformation is not yet loaded. */ function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3 | undefined; } /** * A singleton that contains all of the servers that are trusted. Credentials will be sent with * any requests to these servers. */ export namespace TrustedServers { /** * Adds a trusted server to the registry * @example * // Add a trusted server * TrustedServers.add('my.server.com', 80); * @param host - The host to be added. * @param port - The port used to access the host. */ function add(host: string, port: number): void; /** * Removes a trusted server from the registry * @example * // Remove a trusted server * TrustedServers.remove('my.server.com', 80); * @param host - The host to be removed. * @param port - The port used to access the host. */ function remove(host: string, port: number): void; /** * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url. * @example * // Add server * TrustedServers.add('my.server.com', 81); * * // Check if server is trusted * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) { * // my.server.com:81 is trusted * } * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) { * // my.server.com isn't trusted * } * @param url - The url to be tested against the trusted list * @returns Returns true if url is trusted, false otherwise. */ function contains(url: string): boolean; /** * Clears the registry * @example * // Remove a trusted server * TrustedServers.clear(); */ function clear(): void; } export namespace VRTheWorldTerrainProvider { /** * Initialization options for the VRTheWorldTerrainProvider constructor * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { ellipsoid?: Ellipsoid; credit?: Credit | string; }; } /** *
* To construct a VRTheWorldTerrainProvider, call {@link VRTheWorldTerrainProvider.fromUrl}. Do not call the constructor directly. *
* * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}. * @example * const terrainProvider = await Cesium.VRTheWorldTerrainProvider.fromUrl( * "https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/" * ); * viewer.terrainProvider = terrainProvider; * @param [options] - An object describing initialization options. */ export class VRTheWorldTerrainProvider { constructor(options?: VRTheWorldTerrainProvider.ConstructorOptions); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. */ readonly credit: Credit; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: GeographicTilingScheme; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. */ readonly hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. */ readonly hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This property may be undefined if availability * information is not available. */ readonly availability: TileAvailability | undefined; /** * Creates a {@link TerrainProvider} that produces terrain geometry by tessellating height maps * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}. * @example * const terrainProvider = await Cesium.VRTheWorldTerrainProvider.fromUrl( * "https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/" * ); * viewer.terrainProvider = terrainProvider; * @param url - The URL of the VR-TheWorld TileMap. * @param [options] - An object describing initialization options. */ static fromUrl(url: Resource | string, options?: VRTheWorldTerrainProvider.ConstructorOptions): Promise; /** * Requests the geometry for a given tile. The result includes terrain * data and indicates that all child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ getLevelMaximumGeometricError(level: number): number; /** * Determines whether data for a tile is available to be loaded. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if not supported, otherwise true or false. */ getTileDataAvailable(x: number, y: number, level: number): boolean | undefined; /** * Makes sure we load availability data for a tile * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise; } /** * Synchronizes a video element with a simulation clock. * @param [options] - Object with the following properties: * @param [options.clock] - The clock instance used to drive the video. * @param [options.element] - The video element to be synchronized. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge. */ export class VideoSynchronizer { constructor(options?: { clock?: Clock; element?: HTMLVideoElement; epoch?: JulianDate; tolerance?: number; }); /** * Gets or sets the simulation time that marks the start of the video. */ epoch: JulianDate; /** * Gets or sets the amount of time in seconds the video's currentTime * and the clock's currentTime can diverge before a video seek is performed. * Lower values make the synchronization more accurate but video * performance might suffer. Higher values provide better performance * but at the cost of accuracy. */ tolerance: number; /** * Gets or sets the clock used to drive the video element. */ clock: Clock; /** * Gets or sets the video element to synchronize. */ element: HTMLVideoElement; /** * Destroys and resources used by the object. Once an object is destroyed, it should not be used. */ destroy(): void; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; } export interface WebMercatorTilingScheme extends TilingScheme { } /** * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online. * @param [options] - Object with the following properties: * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid whose surface is being tiled. Defaults to * the default ellipsoid. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of * the tile tree. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of * the tile tree. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire * globe is covered in the longitude direction and an equal distance is covered in the latitude * direction, resulting in a square projection. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire * globe is covered in the longitude direction and an equal distance is covered in the latitude * direction, resulting in a square projection. */ export class WebMercatorTilingScheme implements TilingScheme { constructor(options?: { ellipsoid?: Ellipsoid; numberOfLevelZeroTilesX?: number; numberOfLevelZeroTilesY?: number; rectangleSouthwestInMeters?: Cartesian2; rectangleNortheastInMeters?: Cartesian2; }); /** * Gets the ellipsoid that is tiled by this tiling scheme. */ ellipsoid: Ellipsoid; /** * Gets the rectangle, in radians, covered by this tiling scheme. */ rectangle: Rectangle; /** * Gets the map projection used by this tiling scheme. */ projection: MapProjection; /** * Gets the total number of tiles in the X direction at a specified level-of-detail. * @param level - The level-of-detail. * @returns The number of tiles in the X direction at the given level. */ getNumberOfXTilesAtLevel(level: number): number; /** * Gets the total number of tiles in the Y direction at a specified level-of-detail. * @param level - The level-of-detail. * @returns The number of tiles in the Y direction at the given level. */ getNumberOfYTilesAtLevel(level: number): number; /** * Transforms a rectangle specified in geodetic radians to the native coordinate system * of this tiling scheme. * @param rectangle - The rectangle to transform. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the native rectangle if 'result' * is undefined. */ rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates * of the tiling scheme. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ tileXYToNativeRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a cartographic rectangle in radians. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ tileXYToRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle; /** * Calculates the tile x, y coordinates of the tile containing * a given cartographic position. * @param position - The position. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance * should be created. * @returns The specified 'result', or a new object containing the tile x, y coordinates * if 'result' is undefined. */ positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; } /** * Given a relative URL under the Cesium base URL, returns an absolute URL. * @example * const viewer = new Cesium.Viewer("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromProviderAsync( * Cesium.TileMapServiceImageryProvider.fromUrl( * Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), * )), * baseLayerPicker: false, * }); * @param relativeUrl - The relative path. * @returns The absolutely URL representation of the provided path. */ export function buildModuleUrl(relativeUrl: string): string; /** * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-bathymetry|Cesium World Bathymetry}. * @example * // Create Cesium World Bathymetry with default settings * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.createWorldBathymetryAsync(); * }); * } catch (error) { * console.log(error); * } * @example * // Create Cesium World Bathymetry with normals. * try { * const viewer1 = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.createWorldBathymetryAsync({ * requestVertexNormals: true * }); * }); * } catch (error) { * console.log(error); * } * @param [options] - Object with the following properties: * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. * @returns A promise that resolves to the created CesiumTerrainProvider */ export function createWorldBathymetryAsync(options?: { requestVertexNormals?: boolean; }): Promise; /** * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. * @example * // Create Cesium World Terrain with default settings * try { * const viewer = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.createWorldTerrainAsync(); * }); * } catch (error) { * console.log(error); * } * @example * // Create Cesium World Terrain with water and normals. * try { * const viewer1 = new Cesium.Viewer("cesiumContainer", { * terrainProvider: await Cesium.createWorldTerrainAsync({ * requestWaterMask: true, * requestVertexNormals: true * }); * }); * } catch (error) { * console.log(error); * } * @param [options] - Object with the following properties: * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available. * @returns A promise that resolves to the created CesiumTerrainProvider */ export function createWorldTerrainAsync(options?: { requestVertexNormals?: boolean; requestWaterMask?: boolean; }): Promise; /** * Extract a pixel array from a loaded image. Draws the image * into a canvas so it can read the pixels back. * @param image - The image to extract pixels from. * @param width - The width of the image. If not defined, then image.width is assigned. * @param height - The height of the image. If not defined, then image.height is assigned. * @returns The pixels of the image. */ export function getImagePixels(image: HTMLImageElement | ImageBitmap, width: number, height: number): ImageData; export type Destroyable = any; /** * A GeoJSON position expressed as [longitude, latitude] or [longitude, latitude, altitude]. */ export type GeoJsonPosition = number[]; /** * A GeoJSON geometry object. */ export type GeoJsonGeometry = any; /** * A GeoJSON feature object. */ export type GeoJsonFeature = any; /** * A GeoJSON feature collection object. */ export type GeoJsonFeatureCollection = any; /** * A top-level GeoJSON object (Geometry, Feature, or FeatureCollection). */ export type GeoJson = GeoJsonGeometry | GeoJsonFeature | GeoJsonFeatureCollection; /** * Initiates a terrain height query for an array of {@link Cartographic} positions by * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation * matches the triangles used to render the terrain at the specified level. The query * happens asynchronously, so this function returns a promise that is resolved when * the query completes. Each point height is modified in place. If a height can not be * determined because no terrain data is available for the specified level at that location, * or another error occurs, the height is set to undefined. As is typical of the * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the * terrain level of detail as input, if you need to get the altitude of the terrain as precisely * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}. * @example * // Query the terrain height of two Cartographic positions * const terrainProvider = await Cesium.createWorldTerrainAsync(); * const positions = [ * Cesium.Cartographic.fromDegrees(86.925145, 27.988257), * Cesium.Cartographic.fromDegrees(87.0, 28.0) * ]; * const updatedPositions = await Cesium.sampleTerrain(terrainProvider, 11, positions); * // positions[0].height and positions[1].height have been updated. * // updatedPositions is just a reference to positions. * * // To handle tile errors, pass true for the rejectOnTileFail parameter. * try { * const updatedPositions = await Cesium.sampleTerrain(terrainProvider, 11, positions, true); * } catch (error) { * // A tile request error occurred. * } * @param terrainProvider - The terrain provider from which to query heights. * @param level - The terrain level-of-detail from which to query terrain heights. * @param positions - The positions to update with terrain heights. * @param [rejectOnTileFail = false] - If true, for any failed terrain tile requests, the promise will be rejected. If false, returned heights will be undefined. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. */ export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[], rejectOnTileFail?: boolean): Promise; /** * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. * @example * // Query the terrain height of two Cartographic positions * const terrainProvider = await Cesium.createWorldTerrainAsync(); * const positions = [ * Cesium.Cartographic.fromDegrees(86.925145, 27.988257), * Cesium.Cartographic.fromDegrees(87.0, 28.0) * ]; * const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions); * // positions[0].height and positions[1].height have been updated. * // updatedPositions is just a reference to positions. * * // To handle tile errors, pass true for the rejectOnTileFail parameter. * try { * const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions, true); * } catch (error) { * // A tile request error occurred. * } * @param terrainProvider - The terrain provider from which to query heights. * @param positions - The positions to update with terrain heights. * @param [rejectOnTileFail = false] - If true, for a failed terrain tile request the promise will be rejected. If false, returned heights will be undefined. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This * promise will reject if the terrain provider's `availability` property is undefined. */ export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[], rejectOnTileFail?: boolean): Promise; /** * Wraps a function on the provided objects with another function called in the * object's context so that the new function is always called immediately * before the old one. */ export function wrapFunction(): void; /** * Writes the given text into a new canvas. The canvas will be sized to fit the text. * If text is blank, returns undefined. * @param text - The text to write. * @param [options] - Object with the following properties: * @param [options.font = '10px sans-serif'] - The CSS font to use. * @param [options.fill = true] - Whether to fill the text. * @param [options.stroke = false] - Whether to stroke the text. * @param [options.fillColor = Color.WHITE] - The fill color. * @param [options.strokeColor = Color.BLACK] - The stroke color. * @param [options.strokeWidth = 1] - The stroke width. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas. * @param [options.padding = 0] - The pixel size of the padding to add around the text. * @returns A new canvas with the given text drawn into it. The dimensions object * from measureText will also be added to the returned canvas. If text is * blank, returns undefined. */ export function writeTextToCanvas(text: string, options?: { font?: string; fill?: boolean; stroke?: boolean; fillColor?: Color; strokeColor?: Color; strokeWidth?: number; backgroundColor?: Color; padding?: number; }): HTMLCanvasElement | undefined; export namespace BillboardGraphics { /** * Initialization options for the BillboardGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the billboard. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. * @property [imageSubRegion] - A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to. * @property [splitDirection] - A Property specifying the {@link SplitDirection} of the billboard. */ type ConstructorOptions = { show?: Property | boolean; image?: Property | string | HTMLImageElement | HTMLCanvasElement; scale?: Property | number; pixelOffset?: Property | Cartesian2; eyeOffset?: Property | Cartesian3; horizontalOrigin?: Property | HorizontalOrigin; verticalOrigin?: Property | VerticalOrigin; heightReference?: Property | HeightReference; color?: Property | Color; rotation?: Property | number; alignedAxis?: Property | Cartesian3; sizeInMeters?: Property | boolean; width?: Property | number; height?: Property | number; scaleByDistance?: Property | NearFarScalar; translucencyByDistance?: Property | NearFarScalar; pixelOffsetScaleByDistance?: Property | NearFarScalar; imageSubRegion?: Property | BoundingRectangle; distanceDisplayCondition?: Property | DistanceDisplayCondition; disableDepthTestDistance?: Property | number; splitDirection?: Property | SplitDirection; }; } /** * Describes a two dimensional icon located at the position of the containing {@link Entity}. *

*

*
* Example billboards *
*

* @param [options] - Object describing initialization options */ export class BillboardGraphics { constructor(options?: BillboardGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the billboard. */ show: Property | undefined; /** * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard. */ image: Property | undefined; /** * Gets or sets the numeric Property specifying the uniform scale to apply to the image. * A scale greater than 1.0 enlarges the billboard while a scale less than 1.0 shrinks it. *

*

*
* From left to right in the above image, the scales are 0.5, 1.0, and 2.0. *
*

*/ scale: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space * from the origin of this billboard. This is commonly used to align multiple billboards and labels at * the same position, e.g., an image and text. The screen space origin is the top, left corner of the * canvas; x increases from left to right, and y increases from top to bottom. *

*

* * * *
default
b.pixeloffset = new Cartesian2(50, 25);
* The billboard's origin is indicated by the yellow point. *
*

*/ pixelOffset: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates. * Eye coordinates is a left-handed coordinate system, where x points towards the viewer's * right, y points up, and z points into the screen. *

* An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to * arrange a billboard above its corresponding 3D model. *

* Below, the billboard is positioned at the center of the Earth but an eye offset makes it always * appear on top of the Earth regardless of the viewer's or Earth's orientation. *

*

* * * *
* b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0); *
*

*/ eyeOffset: Property | undefined; /** * Gets or sets the Property specifying the {@link HorizontalOrigin}. */ horizontalOrigin: Property | undefined; /** * Gets or sets the Property specifying the {@link VerticalOrigin}. */ verticalOrigin: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} that is multiplied with the image. * This has two common use cases. First, the same white texture may be used by many different billboards, * each with a different color, to create colored billboards. Second, the color's alpha component can be * used to make the billboard translucent as shown below. An alpha of 0.0 makes the billboard * transparent, and 1.0 makes the billboard opaque. *

*

* * * *
default
alpha : 0.5
*
*

*/ color: Property | undefined; /** * Gets or sets the numeric Property specifying the rotation of the image * counter clockwise from the alignedAxis. */ rotation: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen. */ alignedAxis: Property | undefined; /** * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters. */ sizeInMeters: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the billboard in pixels. * When undefined, the native width is used. */ width: Property | undefined; /** * Gets or sets the numeric Property specifying the height of the billboard in pixels. * When undefined, the native height is used. */ height: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. */ scaleByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. */ translucencyByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera. * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound. */ pixelOffsetScaleByDistance: Property | undefined; /** * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a * sub-region of the image to use for the billboard, rather than the entire image, * measured in pixels from the bottom-left. */ imageSubRegion: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: Property | undefined; /** * Gets or sets the Property specifying the {@link SplitDirection} of this billboard. */ splitDirection: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: BillboardGraphics): BillboardGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: BillboardGraphics): void; } /** * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. * @param entityCollection - The entityCollection to visualize. */ export class BillboardVisualizer { constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); /** * Updates the primitives created by this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * The state of a BoundingSphere computation being performed by a {@link Visualizer}. */ export enum BoundingSphereState { /** * The BoundingSphere has been computed. */ DONE = 0, /** * The BoundingSphere is still being computed. */ PENDING = 1, /** * The BoundingSphere does not exist. */ FAILED = 2 } /** * A {@link GeometryUpdater} for boxes. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class BoxGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace BoxGraphics { /** * Initialization options for the BoxGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the box. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box. * @property [outline = false] - A boolean Property specifying whether the box is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed. */ type ConstructorOptions = { show?: Property | boolean; dimensions?: Property | Cartesian3; heightReference?: Property | HeightReference; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; }; } /** * Describes a box. The center position and orientation are determined by the containing {@link Entity}. * @param [options] - Object describing initialization options */ export class BoxGraphics { constructor(options?: BoxGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the box. */ show: Property | undefined; /** * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box. */ dimensions: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the boolean Property specifying whether the box is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the material used to fill the box. */ material: MaterialProperty | undefined; /** * Gets or sets the Property specifying whether the box is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the box * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: BoxGraphics): BoxGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: BoxGraphics): void; } /** * A {@link PositionProperty} whose value is lazily evaluated by a callback function. * @param callback - The function to be called when the position property is evaluated. * @param isConstant - true when the callback function returns the same value every time, false if the value will change. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ export class CallbackPositionProperty { constructor(callback: CallbackPositionProperty.Callback, isConstant: boolean, referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the reference frame in which the position is defined. */ referenceFrame: ReferenceFrame; /** * Gets the value of the property at the provided time in the fixed frame. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Cartesian3): Cartesian3 | undefined; /** * Sets the callback to be used. * @param callback - The function to be called when the property is evaluated. * @param isConstant - true when the callback function returns the same value every time, false if the value will change. */ setCallback(callback: CallbackPositionProperty.Callback, isConstant: boolean): void; /** * Gets the value of the property at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export namespace CallbackPositionProperty { /** * A function that returns the value of the position property. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into. If omitted, the function must create and return a new instance. */ type Callback = (time?: JulianDate, result?: Cartesian3) => Cartesian3 | undefined; } /** * A {@link Property} whose value is lazily evaluated by a callback function. * @param callback - The function to be called when the property is evaluated. * @param isConstant - true when the callback function returns the same value every time, false if the value will change. */ export class CallbackProperty { constructor(callback: CallbackProperty.Callback, isConstant: boolean); /** * Gets a value indicating if this property is constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setCallback is called. */ readonly definitionChanged: Event; /** * Gets the value of the property. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported. */ getValue(time?: JulianDate, result?: any): any; /** * Sets the callback to be used. * @param callback - The function to be called when the property is evaluated. * @param isConstant - true when the callback function returns the same value every time, false if the value will change. */ setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export namespace CallbackProperty { /** * A function that returns the value of the property. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into. If omitted, the function must create and return a new instance. */ type Callback = (time?: JulianDate, result?: any) => any; } export namespace Cesium3DTilesetGraphics { /** * Initialization options for the Cesium3DTilesetGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the tileset. * @property [uri] - A string or Resource Property specifying the URI of the tileset. * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement. */ type ConstructorOptions = { show?: Property | boolean; uri?: Property | string | Resource; maximumScreenSpaceError?: Property | number; }; } /** * A 3D Tiles tileset represented by an {@link Entity}. * The tileset modelMatrix is determined by the containing Entity position and orientation * or is left unset if position is undefined. * @param [options] - Object describing initialization options */ export class Cesium3DTilesetGraphics { constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the model. */ show: Property | undefined; /** * Gets or sets the string Property specifying the URI of the glTF asset. */ uri: Property | undefined; /** * Gets or sets the maximum screen space error used to drive level of detail refinement. */ maximumScreenSpaceError: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: Cesium3DTilesetGraphics): void; } /** * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}. * @param scene - The scene the primitives will be rendered in. * @param entityCollection - The entityCollection to visualize. */ export class Cesium3DTilesetVisualizer { constructor(scene: Scene, entityCollection: EntityCollection); /** * Updates models created this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}. * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction. */ export class CheckerboardMaterialProperty { constructor(options?: { evenColor?: Property | Color; oddColor?: Property | Color; repeat?: Property | Cartesian2; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying the first {@link Color}. */ evenColor: Property | undefined; /** * Gets or sets the Property specifying the second {@link Color}. */ oddColor: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction. */ repeat: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms. * @param [color = Color.WHITE] - The {@link Color} Property to be used. */ export class ColorMaterialProperty { constructor(color?: Property | Color); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the {@link Color} {@link Property}. */ color: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * Non-destructively composites multiple {@link 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. * @param [collections] - The initial list of EntityCollection instances to merge. * @param [owner] - The data source (or composite entity collection) which created this collection. */ export class CompositeEntityCollection { constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection); /** * Gets the event that is fired when entities are added or removed from the collection. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}. */ readonly collectionChanged: Event; /** * Gets a globally unique identifier for this collection. */ readonly id: string; /** * Gets the array of Entity instances in the collection. * This array should not be modified directly. */ readonly values: Entity[]; /** * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it. */ readonly owner: DataSource | CompositeEntityCollection; /** * Adds a collection to the composite. * @param collection - the collection to add. * @param [index] - the index to add the collection at. If omitted, the collection will * added on top of all existing collections. */ addCollection(collection: EntityCollection, index?: number): void; /** * Removes a collection from this composite, if present. * @param collection - The collection to remove. * @returns true if the collection was in the composite and was removed, * false if the collection was not in the composite. */ removeCollection(collection: EntityCollection): boolean; /** * Removes all collections from this composite. */ removeAllCollections(): void; /** * Checks to see if the composite contains a given collection. * @param collection - the collection to check for. * @returns true if the composite contains the collection, false otherwise. */ containsCollection(collection: EntityCollection): boolean; /** * Returns true if the provided entity is in this collection, false otherwise. * @param entity - The entity. * @returns true if the provided entity is in this collection, false otherwise. */ contains(entity: Entity): boolean; /** * Determines the index of a given collection in the composite. * @param collection - The collection to find the index of. * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite. */ indexOfCollection(collection: EntityCollection): number; /** * Gets a collection by index from the composite. * @param index - the index to retrieve. */ getCollection(index: number): void; /** * Gets the number of collections in this composite. */ getCollectionsLength(): void; /** * Raises a collection up one position in the composite. * @param collection - the collection to move. */ raiseCollection(collection: EntityCollection): void; /** * Lowers a collection down one position in the composite. * @param collection - the collection to move. */ lowerCollection(collection: EntityCollection): void; /** * Raises a collection to the top of the composite. * @param collection - the collection to move. */ raiseCollectionToTop(collection: EntityCollection): void; /** * Lowers a collection to the bottom of the composite. * @param collection - the collection to move. */ lowerCollectionToBottom(collection: EntityCollection): void; /** * Prevents {@link EntityCollection#collectionChanged} events from being raised * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which * point a single event will be raised that covers all suspended operations. * This allows for many items to be added and removed efficiently. * While events are suspended, recompositing of the collections will * also be suspended, as this can be a costly operation. * This function can be safely called multiple times as long as there * are corresponding calls to {@link EntityCollection#resumeEvents}. */ suspendEvents(): void; /** * Resumes raising {@link EntityCollection#collectionChanged} events immediately * when an item is added or removed. Any modifications made while while events were suspended * will be triggered as a single event when this function is called. This function also ensures * the collection is recomposited if events are also resumed. * This function is reference counted and can safely be called multiple times as long as there * are corresponding calls to {@link EntityCollection#resumeEvents}. */ resumeEvents(): void; /** * Computes the maximum availability of the entities in the collection. * If the collection contains a mix of infinitely available data and non-infinite data, * It will return the interval pertaining to the non-infinite data only. If all * data is infinite, an infinite interval will be returned. * @returns The availability of entities in the collection. */ computeAvailability(): TimeInterval; /** * Gets an entity with the specified id. * @param id - The id of the entity to retrieve. * @returns The entity with the provided id or undefined if the id did not exist in the collection. */ getById(id: string): Entity | undefined; } /** * A {@link CompositeProperty} which is also a {@link MaterialProperty}. */ export class CompositeMaterialProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value. */ readonly definitionChanged: Event; /** * Gets the interval collection. */ intervals: TimeIntervalCollection; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link CompositeProperty} which is also a {@link PositionProperty}. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ export class CompositePositionProperty { constructor(referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value. */ readonly definitionChanged: Event; /** * Gets the interval collection. */ intervals: TimeIntervalCollection; /** * Gets or sets the reference frame which this position presents itself as. * Each PositionProperty making up this object has it's own reference frame, * so this property merely exposes a "preferred" reference frame for clients * to use. */ referenceFrame: ReferenceFrame; /** * Gets the value of the property at the provided time in the fixed frame. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Cartesian3): Cartesian3 | undefined; /** * Gets the value of the property at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the * data property of each {@link TimeInterval} is another Property instance which is * evaluated at the provided time. * @example * const constantProperty = ...; * const 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. * const 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 * })); */ export class CompositeProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value. */ readonly definitionChanged: Event; /** * Gets the interval collection. */ intervals: TimeIntervalCollection; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link PositionProperty} whose value does not change in respect to the * {@link ReferenceFrame} in which is it defined. * @param [value] - The property value. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ export class ConstantPositionProperty { constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the reference frame in which the position is defined. */ referenceFrame: ReferenceFrame; /** * Gets the value of the property at the provided time in the fixed frame. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Sets the value of the property. * @param value - The property value. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined. */ setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void; /** * Gets the value of the property at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} whose value does not change with respect to simulation time. * @param [value] - The property value. */ export class ConstantProperty { constructor(value?: any); /** * Gets a value indicating if this property is constant. * This property always returns true. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value. */ readonly definitionChanged: Event; /** * Gets the value of the property. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Sets the value of the property. * @param value - The property value. */ setValue(value: any): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; /** * Gets this property's value. * @returns This property's value. */ valueOf(): any; /** * Creates a string representing this property's value. * @returns A string representing the property's value. */ toString(): string; } /** * A {@link GeometryUpdater} for corridors. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class CorridorGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace CorridorGraphics { /** * Initialization options for the CorridorGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the corridor. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. * @property [width] - A numeric Property specifying the distance between the edges of the corridor. * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude. * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor. * @property [outline = false] - A boolean Property specifying whether the corridor is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. * @property [zIndex] - A Property specifying the zIndex of the corridor, used for ordering. Only has an effect if height and extrudedHeight are undefined, and if the corridor is static. */ type ConstructorOptions = { show?: Property | boolean; positions?: Property | Cartesian3[]; width?: Property | number; height?: Property | number; heightReference?: Property | HeightReference; extrudedHeight?: Property | number; extrudedHeightReference?: Property | HeightReference; cornerType?: Property | CornerType; granularity?: Property | number; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; classificationType?: Property | ClassificationType; zIndex?: ConstantProperty | number; }; } /** * 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. * @param [options] - Object describing initialization options */ export class CorridorGraphics { constructor(options?: CorridorGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the corridor. */ show: Property | undefined; /** * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. */ positions: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. */ width: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the corridor. */ height: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the corridor extrusion. * Setting this property creates a corridor shaped volume starting at height and ending * at this altitude. */ extrudedHeight: Property | undefined; /** * Gets or sets the Property specifying the extruded {@link HeightReference}. */ extrudedHeightReference: Property | undefined; /** * Gets or sets the {@link CornerType} Property specifying how corners are styled. */ cornerType: Property | undefined; /** * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point. */ granularity: Property | undefined; /** * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the corridor. */ material: MaterialProperty | undefined; /** * Gets or sets the Property specifying whether the corridor is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the corridor * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. */ classificationType: Property | undefined; /** * Gets or sets the zIndex Property specifying the ordering of the corridor. Only has an effect if the coridor is static and neither height or exturdedHeight are specified. */ zIndex: ConstantProperty | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: CorridorGraphics): CorridorGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: CorridorGraphics): void; } /** * A {@link DataSource} implementation which can be used to manually manage a group of entities. * @example * const dataSource = new Cesium.CustomDataSource('myData'); * * const entity = dataSource.entities.add({ * position : Cesium.Cartesian3.fromDegrees(1, 2, 0), * billboard : { * image : 'image.png' * } * }); * * viewer.dataSources.add(dataSource); * @param [name] - A human-readable name for this instance. */ export class CustomDataSource { constructor(name?: string); /** * Gets or sets a human-readable name for this instance. */ name: string; /** * Gets or sets the clock for this instance. */ clock: DataSourceClock; /** * Gets the collection of {@link Entity} instances. */ entities: EntityCollection; /** * Gets or sets whether the data source is currently loading data. */ isLoading: boolean; /** * Gets an event that will be raised when the underlying data changes. */ changedEvent: Event; /** * Gets an event that will be raised if an error is encountered during processing. */ errorEvent: Event; /** * Gets an event that will be raised when the data source either starts or stops loading. */ loadingEvent: Event; /** * Gets whether or not this data source should be displayed. */ show: boolean; /** * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. */ clustering: EntityCluster; /** * Updates the data source to the provided time. This function is optional and * is not required to be implemented. It is provided for data sources which * retrieve data based on the current animation time or scene state. * If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; } /** * A {@link GeometryUpdater} for cylinders. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class CylinderGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace CylinderGraphics { /** * Initialization options for the CylinderGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the cylinder. * @property [length] - A numeric Property specifying the length of the cylinder. * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder. * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to. * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder. * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. * @property [slices = 128] - The number of edges around the perimeter of the cylinder. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed. */ type ConstructorOptions = { show?: Property | boolean; length?: Property | number; topRadius?: Property | number; bottomRadius?: Property | number; heightReference?: Property | HeightReference; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; numberOfVerticalLines?: Property | number; slices?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; }; } /** * 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 {@link Entity}. * @param [options] - Object describing initialization options */ export class CylinderGraphics { constructor(options?: CylinderGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the cylinder. */ show: Property | undefined; /** * Gets or sets the numeric Property specifying the length of the cylinder. */ length: Property | undefined; /** * Gets or sets the numeric Property specifying the radius of the top of the cylinder. */ topRadius: Property | undefined; /** * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder. */ bottomRadius: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the cylinder. */ material: MaterialProperty | undefined; /** * Gets or sets the boolean Property specifying whether the cylinder is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline. */ numberOfVerticalLines: Property | undefined; /** * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder. */ slices: Property | undefined; /** * Get or sets the enum Property specifying whether the cylinder * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: CylinderGraphics): CylinderGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: CylinderGraphics): void; } export namespace CzmlDataSource { /** * Initialization options for the load method. * @property [sourceUri] - Overrides the url to use for resolving relative links. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type LoadOptions = { sourceUri?: Resource | string; credit?: Credit | string; }; type UpdaterFunction = (entity: Entity, packet: any, entityCollection: EntityCollection, sourceUri: string) => void; } /** * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}. * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name. */ export class CzmlDataSource { constructor(name?: string); /** * Creates a Promise to a new instance loaded with the provided CZML data. * @param czml - A url or CZML object to be processed. * @param [options] - An object specifying configuration options * @returns A promise that resolves to the new instance once the data is processed. */ static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise; /** * Gets a human-readable name for this instance. */ name: string; /** * Gets the clock settings defined by the loaded CZML. If no clock is explicitly * defined in the CZML, the combined availability of all objects is returned. If * only static data exists, this value is undefined. */ clock: DataSourceClock; /** * Gets the collection of {@link Entity} instances. */ entities: EntityCollection; /** * Gets a value indicating if the data source is currently loading data. */ isLoading: boolean; /** * Gets an event that will be raised when the underlying data changes. */ changedEvent: Event; /** * Gets an event that will be raised if an error is encountered during processing. */ errorEvent: Event; /** * Gets an event that will be raised when the data source either starts or stops loading. */ loadingEvent: Event; /** * Gets whether or not this data source should be displayed. */ show: boolean; /** * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. */ clustering: EntityCluster; /** * Gets the credit that will be displayed for the data source */ credit: Credit; /** * Gets the array of CZML processing functions. */ static updaters: CzmlDataSource.UpdaterFunction[]; /** * Processes the provided url or CZML object without clearing any existing data. * @param czml - A url or CZML object to be processed. * @param [options] - An object specifying configuration options * @returns A promise that resolves to this instances once the data is processed. */ process(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise; /** * Loads the provided url or CZML object, replacing any existing data. * @param czml - A url or CZML object to be processed. * @param [options] - An object specifying configuration options * @returns A promise that resolves to this instances once the data is processed. */ load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise; /** * Updates the data source to the provided time. This function is optional and * is not required to be implemented. It is provided for data sources which * retrieve data based on the current animation time or scene state. * If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; /** * A helper function used by custom CZML updater functions * which creates or updates a {@link Property} from a CZML packet. * @param type - The constructor function for the property being processed. * @param object - The object on which the property will be added or updated. * @param propertyName - The name of the property on the object. * @param packetData - The CZML packet being processed. * @param interval - A constraining interval for which the data is valid. * @param sourceUri - The originating uri of the data being processed. * @param entityCollection - The collection being processsed. */ static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; /** * A helper function used by custom CZML updater functions * which creates or updates a {@link PositionProperty} from a CZML packet. * @param object - The object on which the property will be added or updated. * @param propertyName - The name of the property on the object. * @param packetData - The CZML packet being processed. * @param interval - A constraining interval for which the data is valid. * @param sourceUri - The originating uri of the data being processed. * @param entityCollection - The collection being processsed. */ static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; /** * A helper function used by custom CZML updater functions * which creates or updates a {@link MaterialProperty} from a CZML packet. * @param object - The object on which the property will be added or updated. * @param propertyName - The name of the property on the object. * @param packetData - The CZML packet being processed. * @param interval - A constraining interval for which the data is valid. * @param sourceUri - The originating uri of the data being processed. * @param entityCollection - The collection being processsed. */ static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; } /** * Defines the interface for data sources, which turn arbitrary data into a * {@link EntityCollection} for generic consumption. This object is an interface * for documentation purposes and is not intended to be instantiated directly. */ export class DataSource { constructor(); /** * Gets a human-readable name for this instance. */ name: string; /** * Gets the preferred clock settings for this data source. */ clock: DataSourceClock; /** * Gets the collection of {@link Entity} instances. */ entities: EntityCollection; /** * Gets a value indicating if the data source is currently loading data. */ isLoading: boolean; /** * Gets an event that will be raised when the underlying data changes. */ changedEvent: Event; /** * Gets an event that will be raised if an error is encountered during processing. */ errorEvent: Event<(arg0: this, arg1: RequestErrorEvent) => void>; /** * Gets an event that will be raised when the value of isLoading changes. */ loadingEvent: Event<(arg0: this, arg1: boolean) => void>; /** * Gets whether or not this data source should be displayed. */ show: boolean; /** * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. */ clustering: EntityCluster; /** * Updates the data source to the provided time. This function is optional and * is not required to be implemented. It is provided for data sources which * retrieve data based on the current animation time or scene state. * If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; } /** * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied * to the {@link Clock} when the DataSource is loaded. */ export class DataSourceClock { constructor(); /** * Gets the event that is raised whenever a new property is assigned. */ readonly definitionChanged: Event; /** * Gets or sets the desired start time of the clock. * See {@link Clock#startTime}. */ startTime: JulianDate; /** * Gets or sets the desired stop time of the clock. * See {@link Clock#stopTime}. */ stopTime: JulianDate; /** * Gets or sets the desired current time when this data source is loaded. * See {@link Clock#currentTime}. */ currentTime: JulianDate; /** * Gets or sets the desired clock range setting. * See {@link Clock#clockRange}. */ clockRange: ClockRange; /** * Gets or sets the desired clock step setting. * See {@link Clock#clockStep}. */ clockStep: ClockStep; /** * Gets or sets the desired clock multiplier. * See {@link Clock#multiplier}. */ multiplier: number; /** * Duplicates a DataSourceClock instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: DataSourceClock): DataSourceClock; /** * Returns true if this DataSourceClock is equivalent to the other * @param [other] - The other DataSourceClock to compare to. * @returns true if the DataSourceClocks are equal; otherwise, false. */ equals(other?: DataSourceClock): boolean; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: DataSourceClock): void; /** * Gets the value of this clock instance as a {@link Clock} object. * @returns The modified result parameter or a new instance if one was not provided. */ getValue(): Clock; } /** * A collection of {@link DataSource} instances. */ export class DataSourceCollection { constructor(); /** * Gets the number of data sources in this collection. */ readonly length: number; /** * An event that is raised when a data source is added to the collection. * Event handlers are passed the data source that was added. */ readonly dataSourceAdded: Event; /** * An event that is raised when a data source is removed from the collection. * Event handlers are passed the data source that was removed. */ readonly dataSourceRemoved: Event; /** * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source * that was moved, its new index after the move, and its old index prior to the move. */ readonly dataSourceMoved: Event; /** * Adds a data source to the collection. * @param dataSource - A data source or a promise to a data source to add to the collection. * When passing a promise, the data source will not actually be added * to the collection until the promise resolves successfully. * @returns A Promise that resolves once the data source has been added to the collection. */ add(dataSource: DataSource | Promise): Promise; /** * Removes a data source from this collection, if present. * @param dataSource - The data source to remove. * @param [destroy = false] - Whether to destroy the data source in addition to removing it. * @returns true if the data source was in the collection and was removed, * false if the data source was not in the collection. */ remove(dataSource: DataSource, destroy?: boolean): boolean; /** * Removes all data sources from this collection. * @param [destroy = false] - whether to destroy the data sources in addition to removing them. */ removeAll(destroy?: boolean): void; /** * Checks to see if the collection contains a given data source. * @param dataSource - The data source to check for. * @returns true if the collection contains the data source, false otherwise. */ contains(dataSource: DataSource): boolean; /** * Determines the index of a given data source in the collection. * @param dataSource - The data source to find the index of. * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection. */ indexOf(dataSource: DataSource): number; /** * Gets a data source by index from the collection. * @param index - the index to retrieve. * @returns The data source at the specified index. */ get(index: number): DataSource; /** * Gets a data source by name from the collection. * @param name - The name to retrieve. * @returns A list of all data sources matching the provided name. */ getByName(name: string): DataSource[]; /** * Raises a data source up one position in the collection. * @param dataSource - The data source to move. */ raise(dataSource: DataSource): void; /** * Lowers a data source down one position in the collection. * @param dataSource - The data source to move. */ lower(dataSource: DataSource): void; /** * Raises a data source to the top of the collection. * @param dataSource - The data source to move. */ raiseToTop(dataSource: DataSource): void; /** * Lowers a data source to the bottom of the collection. * @param dataSource - The data source to move. */ lowerToBottom(dataSource: DataSource): void; /** * Returns true if this object was destroyed; otherwise, false. * If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the resources held by all data sources in this collection. Explicitly destroying this * object allows for deterministic release of WebGL resources, instead of relying on the garbage * collector. Once this object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy(); */ destroy(): void; } /** * Visualizes a collection of {@link DataSource} instances. * @param options - Object with the following properties: * @param options.scene - The scene in which to display the data. * @param options.dataSourceCollection - The data sources to display. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization. * If undefined, all standard visualizers are used. */ export class DataSourceDisplay { constructor(options: { scene: Scene; dataSourceCollection: DataSourceCollection; visualizersCallback?: DataSourceDisplay.VisualizersCallback; }); /** * Gets or sets the default function which creates an array of visualizers used for visualization. * By default, this function uses all standard visualizers. */ static defaultVisualizersCallback(): void; /** * Gets the scene associated with this display. */ scene: Scene; /** * Gets the collection of data sources to display. */ dataSources: DataSourceCollection; /** * Gets the default data source instance which can be used to * manually create and visualize entities not tied to * a specific data source. This instance is always available * and does not appear in the list dataSources collection. */ defaultDataSource: CustomDataSource; /** * Gets a value indicating whether or not all entities in the data source are ready */ readonly ready: boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * dataSourceDisplay = dataSourceDisplay.destroy(); */ destroy(): void; /** * Updates the display to the provided time. * @param time - The simulation time. * @returns True if all data sources are ready to be displayed, false otherwise. */ update(time: JulianDate): boolean; } export namespace DataSourceDisplay { /** * A function which creates an array of visualizers used for visualization. * @example * function createVisualizers(scene, entityCluster, dataSource) { * return [new Cesium.BillboardVisualizer(entityCluster, dataSource.entities)]; * } * @param scene - The scene to create visualizers for. * @param entityCluster - The entity cluster to create visualizers for. * @param dataSource - The data source to create visualizers for. */ type VisualizersCallback = (scene: Scene, entityCluster: EntityCluster, dataSource: DataSource) => Visualizer[]; } /** * A {@link GeometryUpdater} for ellipses. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class EllipseGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace EllipseGraphics { /** * Initialization options for the EllipseGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the ellipse. * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis. * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis. * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse. * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse. * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. * @property [zIndex = 0] - A property specifying the zIndex of the Ellipse. Used for ordering ground geometry. Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified. */ type ConstructorOptions = { show?: Property | boolean; semiMajorAxis?: Property | number; semiMinorAxis?: Property | number; height?: Property | number; heightReference?: Property | HeightReference; extrudedHeight?: Property | number; extrudedHeightReference?: Property | HeightReference; rotation?: Property | number; stRotation?: Property | number; granularity?: Property | number; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; numberOfVerticalLines?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; classificationType?: Property | ClassificationType; zIndex?: ConstantProperty | number; }; } /** * 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 {@link Entity}. * @param [options] - Object describing initialization options */ export class EllipseGraphics { constructor(options?: EllipseGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the ellipse. */ show: Property | undefined; /** * Gets or sets the numeric Property specifying the semi-major axis. */ semiMajorAxis: Property | undefined; /** * Gets or sets the numeric Property specifying the semi-minor axis. */ semiMinorAxis: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the ellipse. */ height: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion. * Setting this property creates volume starting at height and ending at this altitude. */ extrudedHeight: Property | undefined; /** * Gets or sets the Property specifying the extruded {@link HeightReference}. */ extrudedHeightReference: Property | undefined; /** * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north. */ rotation: Property | undefined; /** * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north. */ stRotation: Property | undefined; /** * Gets or sets the numeric Property specifying the angular distance between points on the ellipse. */ granularity: Property | undefined; /** * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the ellipse. */ material: MaterialProperty | undefined; /** * Gets or sets the Property specifying whether the ellipse is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. */ numberOfVerticalLines: Property | undefined; /** * Get or sets the enum Property specifying whether the ellipse * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. */ classificationType: Property | undefined; /** * Gets or sets the zIndex Property specifying the ellipse ordering. Only has an effect if the ellipse is constant and neither height or extrudedHeight are specified */ zIndex: ConstantProperty | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: EllipseGraphics): EllipseGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: EllipseGraphics): void; } /** * A {@link GeometryUpdater} for ellipsoids. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class EllipsoidGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance * @param [modelMatrixResult] - Used to store the result of the model matrix calculation * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance * @param [modelMatrixResult] - Used to store the result of the model matrix calculation * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; } export namespace EllipsoidGraphics { /** * Initialization options for the EllipsoidGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid. * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid. * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid. * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid. * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid. * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid. * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to. * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid. * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [stackPartitions = 64] - A Property specifying the number of stacks. * @property [slicePartitions = 64] - A Property specifying the number of radial slices. * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed. */ type ConstructorOptions = { show?: Property | boolean; radii?: Property | Cartesian3; innerRadii?: Property | Cartesian3; minimumClock?: Property | number; maximumClock?: Property | number; minimumCone?: Property | number; maximumCone?: Property | number; heightReference?: Property | HeightReference; fill?: Property | boolean; material?: MaterialProperty | Color | HTMLVideoElement; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; stackPartitions?: Property | number; slicePartitions?: Property | number; subdivisions?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; }; } /** * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}. * @param [options] - Object describing initialization options */ export class EllipsoidGraphics { constructor(options?: EllipsoidGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the ellipsoid. */ show: Property | undefined; /** * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid. */ radii: Property | undefined; /** * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid. */ innerRadii: Property | undefined; /** * Gets or sets the Property specifying the minimum clock angle of the ellipsoid. */ minimumClock: Property | undefined; /** * Gets or sets the Property specifying the maximum clock angle of the ellipsoid. */ maximumClock: Property | undefined; /** * Gets or sets the Property specifying the minimum cone angle of the ellipsoid. */ minimumCone: Property | undefined; /** * Gets or sets the Property specifying the maximum cone angle of the ellipsoid. */ maximumCone: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the ellipsoid. */ material: MaterialProperty; /** * Gets or sets the Property specifying whether the ellipsoid is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Gets or sets the Property specifying the number of stacks. */ stackPartitions: Property | undefined; /** * Gets or sets the Property specifying the number of radial slices per 360 degrees. */ slicePartitions: Property | undefined; /** * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature. */ subdivisions: Property | undefined; /** * Get or sets the enum Property specifying whether the ellipsoid * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: EllipsoidGraphics): EllipsoidGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: EllipsoidGraphics): void; } export namespace Entity { /** * Initialization options for the Entity constructor * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated. * @property [name] - A human readable name to display to users. It does not have to be unique. * @property [availability] - The availability, if any, associated with this object. * @property [show] - A boolean value indicating if the entity and its children are displayed. * @property [trackingReferenceFrame = TrackingReferenceFrame.AUTODETECT] - The reference frame used when this entity is being tracked.
If undefined, reference frame is determined based on entity velocity: near-surface slow moving entities are tracked using the local east-north-up reference frame, whereas fast moving entities such as satellites are tracked using VVLH (Vehicle Velocity, Local Horizontal). * @property [description] - A string Property specifying an HTML description for this entity. * @property [position] - A Property specifying the entity position. * @property [orientation = FixedFrameTransforms.eastNorthUpToFixedFrame(position)] - A Property specifying the entity orientation in respect to Earth-fixed-Earth-centered (ECEF). If undefined, east-north-up at entity position is used. * @property [viewFrom] - A suggested initial offset for viewing this object. * @property [parent] - A parent entity to associate with this entity. * @property [billboard] - A billboard to associate with this entity. * @property [box] - A box to associate with this entity. * @property [corridor] - A corridor to associate with this entity. * @property [cylinder] - A cylinder to associate with this entity. * @property [ellipse] - A ellipse to associate with this entity. * @property [ellipsoid] - A ellipsoid to associate with this entity. * @property [label] - A options.label to associate with this entity. * @property [model] - A model to associate with this entity. * @property [tileset] - A 3D Tiles tileset to associate with this entity. * @property [path] - A path to associate with this entity. * @property [plane] - A plane to associate with this entity. * @property [point] - A point to associate with this entity. * @property [polygon] - A polygon to associate with this entity. * @property [polyline] - A polyline to associate with this entity. * @property [properties] - Arbitrary properties to associate with this entity. * @property [polylineVolume] - A polylineVolume to associate with this entity. * @property [rectangle] - A rectangle to associate with this entity. * @property [wall] - A wall to associate with this entity. */ type ConstructorOptions = { id?: string; name?: string; availability?: TimeIntervalCollection; show?: boolean; trackingReferenceFrame?: TrackingReferenceFrame; description?: Property | string; position?: PositionProperty | Cartesian3 | CallbackPositionProperty; orientation?: Property | Quaternion; viewFrom?: Property | Cartesian3; parent?: Entity; billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions; box?: BoxGraphics | BoxGraphics.ConstructorOptions; corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions; cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions; ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions; ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions; label?: LabelGraphics | LabelGraphics.ConstructorOptions; model?: ModelGraphics | ModelGraphics.ConstructorOptions; tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions; path?: PathGraphics | PathGraphics.ConstructorOptions; plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions; point?: PointGraphics | PointGraphics.ConstructorOptions; polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions; polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions; properties?: PropertyBag | { [key: string]: any; }; polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions; rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions; wall?: WallGraphics | WallGraphics.ConstructorOptions; }; } /** * Entity instances aggregate multiple forms of visualization into a single high-level object. * They can be created manually and added to {@link Viewer#entities} or be produced by * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}. * @param [options] - Object describing initialization options */ export class Entity { constructor(options?: Entity.ConstructorOptions); /** * Gets or sets the entity collection that this entity belongs to. */ entityCollection: EntityCollection; /** * The availability, if any, associated with this object. * If availability is undefined, it is assumed that this object's * other properties will return valid data for any provided time. * If availability exists, the objects other properties will only * provide valid data if queried within the given interval. */ availability: TimeIntervalCollection | undefined; /** * Gets the unique ID associated with this object. */ id: string; /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the name of the object. The name is intended for end-user * consumption and does not need to be unique. */ name: string | undefined; /** * Gets or sets whether this entity should be displayed. When set to true, * the entity is only displayed if the parent entity's show property is also true. */ show: boolean; /** * Gets or sets the entity's tracking reference frame. */ trackingReferenceFrame: TrackingReferenceFrame; /** * Gets whether this entity is being displayed, taking into account * the visibility of any ancestor entities. */ isShowing: boolean; /** * Gets or sets the parent object. */ parent: Entity | undefined; /** * Gets the names of all properties registered on this instance. */ propertyNames: string[]; /** * Gets or sets the billboard. */ billboard: BillboardGraphics | undefined; /** * Gets or sets the box. */ box: BoxGraphics | undefined; /** * Gets or sets the corridor. */ corridor: CorridorGraphics | undefined; /** * Gets or sets the cylinder. */ cylinder: CylinderGraphics | undefined; /** * Gets or sets the description. */ description: Property | string | undefined; /** * Gets or sets the ellipse. */ ellipse: EllipseGraphics | undefined; /** * Gets or sets the ellipsoid. */ ellipsoid: EllipsoidGraphics | undefined; /** * Gets or sets the label. */ label: LabelGraphics | undefined; /** * Gets or sets the model. */ model: ModelGraphics | undefined; /** * Gets or sets the tileset. */ tileset: Cesium3DTilesetGraphics | undefined; /** * Gets or sets the orientation in respect to Earth-fixed-Earth-centered (ECEF). * Defaults to east-north-up at entity position. */ orientation: Property | undefined; /** * Gets or sets the path. */ path: PathGraphics | undefined; /** * Gets or sets the plane. */ plane: PlaneGraphics | undefined; /** * Gets or sets the point graphic. */ point: PointGraphics | undefined; /** * Gets or sets the polygon. */ polygon: PolygonGraphics | undefined; /** * Gets or sets the polyline. */ polyline: PolylineGraphics | undefined; /** * Gets or sets the polyline volume. */ polylineVolume: PolylineVolumeGraphics | undefined; /** * Gets or sets the bag of arbitrary properties associated with this entity. */ properties: PropertyBag | undefined; /** * Gets or sets the position. */ position: PositionProperty | undefined; /** * Gets or sets the rectangle. */ rectangle: RectangleGraphics | undefined; /** * Gets or sets the suggested initial offset when tracking this object. * The offset is typically defined in the east-north-up reference frame, * but may be another frame depending on the object's velocity. */ viewFrom: Property | Cartesian3 | undefined; /** * Gets or sets the wall. */ wall: WallGraphics | undefined; /** * Given a time, returns true if this object should have data during that time. * @param time - The time to check availability for. * @returns true if the object should have data during the provided time, false otherwise. */ isAvailable(time: JulianDate): boolean; /** * Adds a property to this object. Once a property is added, it can be * observed with {@link Entity#definitionChanged} and composited * with {@link CompositeEntityCollection} * @param propertyName - The name of the property to add. */ addProperty(propertyName: string): void; /** * Removed a property previously added with addProperty. * @param propertyName - The name of the property to remove. */ removeProperty(propertyName: string): void; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: Entity): void; /** * Computes the model matrix for the entity's transform at specified time. Returns undefined if position is undefined * @param time - The time to retrieve model matrix for. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position is undefined. */ computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4; /** * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles. * If this feature is not supported, Entities with non-color materials but no `height` will * instead be rendered as if height is 0. * @param scene - The current scene. * @returns Whether or not the current scene supports materials for entities on terrain. */ static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean; /** * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles. * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at * the provided heights and using the `arcType` parameter instead of clamped to the ground. * @param scene - The current scene. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles. */ static supportsPolylinesOnTerrain(scene: Scene): boolean; } /** * Defines how screen space objects (billboards, points, labels) are clustered. * @param [options] - An object with the following properties: * @param [options.enabled = false] - Whether or not to enable clustering. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity. * @param [options.show = true] - Determines if the entities in the cluster will be shown. */ export class EntityCluster { constructor(options?: { enabled?: boolean; pixelRange?: number; minimumClusterSize?: number; clusterBillboards?: boolean; clusterLabels?: boolean; clusterPoints?: boolean; show?: boolean; }); /** * Determines if entities in this collection will be shown. */ show: boolean; /** * Gets or sets whether clustering is enabled. */ enabled: boolean; /** * Gets or sets the pixel range to extend the screen space bounding box. */ pixelRange: number; /** * Gets or sets the minimum number of screen space objects that can be clustered. */ minimumClusterSize: number; /** * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}. */ clusterEvent: Event; /** * Gets or sets whether clustering billboard entities is enabled. */ clusterBillboards: boolean; /** * Gets or sets whether clustering labels entities is enabled. */ clusterLabels: boolean; /** * Gets or sets whether clustering point entities is enabled. */ clusterPoints: boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed * from a data source collection and added to another. *

*/ destroy(): void; } export namespace EntityCluster { /** * A event listener function used to style clusters. * @example * // The default cluster values. * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) { * cluster.label.show = true; * cluster.label.text = entities.length.toLocaleString(); * }); * @param clusteredEntities - An array of the entities contained in the cluster. * @param cluster - An object containing the Billboard, Label, and Point * primitives that represent this cluster of entities. */ type newClusterCallback = (clusteredEntities: Entity[], cluster: { billboard: Billboard; label: Label; point: PointPrimitive; }) => void; } /** * An observable collection of {@link Entity} instances where each entity has a unique id. * @param [owner] - The data source (or composite entity collection) which created this collection. */ export class EntityCollection { constructor(owner?: DataSource | CompositeEntityCollection); /** * Prevents {@link EntityCollection#collectionChanged} events from being raised * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which * point a single event will be raised that covers all suspended operations. * This allows for many items to be added and removed efficiently. * This function can be safely called multiple times as long as there * are corresponding calls to {@link EntityCollection#resumeEvents}. */ suspendEvents(): void; /** * Resumes raising {@link EntityCollection#collectionChanged} events immediately * when an item is added or removed. Any modifications made while while events were suspended * will be triggered as a single event when this function is called. * This function is reference counted and can safely be called multiple times as long as there * are corresponding calls to {@link EntityCollection#resumeEvents}. */ resumeEvents(): void; /** * Gets the event that is fired when entities are added or removed from the collection. * The generated event is a {@link EntityCollection.CollectionChangedEventCallback}. */ readonly collectionChanged: Event; /** * Gets a globally unique identifier for this collection. */ readonly id: string; /** * Gets the array of Entity instances in the collection. * This array should not be modified directly. */ readonly values: Entity[]; /** * Gets whether or not this entity collection should be * displayed. When true, each entity is only displayed if * its own show property is also true. */ show: boolean; /** * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it. */ readonly owner: DataSource | CompositeEntityCollection; /** * Computes the maximum availability of the entities in the collection. * If the collection contains a mix of infinitely available data and non-infinite data, * it will return the interval pertaining to the non-infinite data only. If all * data is infinite, an infinite interval will be returned. * @returns The availability of entities in the collection. */ computeAvailability(): TimeInterval; /** * Add an entity to the collection. * @param entity - The entity to be added. * @returns The entity that was added. */ add(entity: Entity | Entity.ConstructorOptions): Entity; /** * Removes an entity from the collection. * @param entity - The entity to be removed. * @returns true if the item was removed, false if it did not exist in the collection. */ remove(entity: Entity): boolean; /** * Returns true if the provided entity is in this collection, false otherwise. * @param entity - The entity. * @returns true if the provided entity is in this collection, false otherwise. */ contains(entity: Entity): boolean; /** * Removes an entity with the provided id from the collection. * @param id - The id of the entity to remove. * @returns true if the item was removed, false if no item with the provided id existed in the collection. */ removeById(id: string): boolean; /** * Removes all Entities from the collection. */ removeAll(): void; /** * Gets an entity with the specified id. * @param id - The id of the entity to retrieve. * @returns The entity with the provided id or undefined if the id did not exist in the collection. */ getById(id: string): Entity | undefined; /** * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist. * @param id - The id of the entity to retrieve or create. * @returns The new or existing object. */ getOrCreateEntity(id: string): Entity; } export namespace EntityCollection { /** * The signature of the event generated by {@link EntityCollection#collectionChanged}. * @param collection - The collection that triggered the event. * @param added - The array of {@link Entity} instances that have been added to the collection. * @param removed - The array of {@link Entity} instances that have been removed from the collection. * @param changed - The array of {@link Entity} instances that have been modified. */ type CollectionChangedEventCallback = (collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]) => void; } /** * A utility object for tracking an entity with the camera. * @param entity - The entity to track with the camera. * @param scene - The scene to use. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid to use for orienting the camera. */ export class EntityView { constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid); /** * The entity to track with the camera. */ entity: Entity; /** * The scene in which to track the object. */ scene: Scene; /** * The ellipsoid to use for orienting the camera. */ ellipsoid: Ellipsoid; /** * The bounding sphere of the object. */ boundingSphere: BoundingSphere; /** * Gets or sets a camera offset that will be used to * initialize subsequent EntityViews. */ static defaultOffset3D: Cartesian3; /** * Should be called each animation frame to update the camera * to the latest settings. * @param time - The current animation time. * @param [boundingSphere] - bounding sphere of the object. */ update(time: JulianDate, boundingSphere?: BoundingSphere): void; } export namespace GeoJsonDataSource { /** * Initialization options for the load method. * @property [sourceUri] - Overrides the url to use for resolving relative links. * @property [describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string). * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels. * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point. * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point. * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines. * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines. * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors. * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type LoadOptions = { sourceUri?: string; describe?: GeoJsonDataSource.describe; markerSize?: number; markerSymbol?: string; markerColor?: Color; stroke?: Color; strokeWidth?: number; fill?: Color; clampToGround?: boolean; credit?: Credit | string; }; /** * This callback is displayed as part of the GeoJsonDataSource class. * @param properties - The properties of the feature. * @param nameProperty - The property key that Cesium estimates to have the name of the feature. */ type describe = (properties: any, nameProperty: string) => void; } /** * A {@link DataSource} which processes both * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data. * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they * are present. * @example * const 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: '?' * })); * @param [name] - The name of this data source. If undefined, a name will be taken from * the name of the GeoJSON file. */ export class GeoJsonDataSource { constructor(name?: string); /** * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded. * @param [options] - An object specifying configuration options * @returns A promise that will resolve when the data is loaded. */ static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise; /** * Gets or sets the default size of the map pin created for each point, in pixels. */ static markerSize: number; /** * Gets or sets the default symbol of the map pin created for each point. * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character, * or blank if no symbol is to be used. */ static markerSymbol: string; /** * Gets or sets the default color of the map pin created for each point. */ static markerColor: Color; /** * Gets or sets the default color of polylines and polygon outlines. */ static stroke: Color; /** * Gets or sets the default width of polylines and polygon outlines. */ static strokeWidth: number; /** * Gets or sets default color for polygon interiors. */ static fill: Color; /** * Gets or sets default of whether to clamp to the ground. */ static clampToGround: boolean; /** * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name, * for example 'EPSG:4326'. */ static crsNames: any; /** * Gets an object that maps the href property of a crs link to a callback function * which takes the crs properties object and returns a Promise that resolves * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. * Items in this object take precedence over those defined in crsLinkHrefs, assuming * the link has a type specified. */ static crsLinkHrefs: any; /** * Gets an object that maps the type property of a crs link to a callback function * which takes the crs properties object and returns a Promise that resolves * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. * Items in crsLinkHrefs take precedence over this object. */ static crsLinkTypes: any; /** * Gets or sets a human-readable name for this instance. */ name: string; /** * This DataSource only defines static data, therefore this property is always undefined. */ clock: DataSourceClock; /** * Gets the collection of {@link Entity} instances. */ entities: EntityCollection; /** * Gets a value indicating if the data source is currently loading data. */ isLoading: boolean; /** * Gets an event that will be raised when the underlying data changes. */ changedEvent: Event; /** * Gets an event that will be raised if an error is encountered during processing. */ errorEvent: Event; /** * Gets an event that will be raised when the data source either starts or stops loading. */ loadingEvent: Event; /** * Gets whether or not this data source should be displayed. */ show: boolean; /** * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. */ clustering: EntityCluster; /** * Gets the credit that will be displayed for the data source */ credit: Credit; /** * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded. * @param [options] - An object specifying configuration options * @returns a promise that will resolve when the GeoJSON is loaded. */ load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise; /** * Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded. * @param [options] - An object specifying configuration options * @returns a promise that will resolve when the GeoJSON is loaded. */ process(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise; /** * Updates the data source to the provided time. This function is optional and * is not required to be implemented. It is provided for data sources which * retrieve data based on the current animation time or scene state. * If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; } /** * An abstract class for updating geometry entities. * @param options - An object with the following properties: * @param options.entity - The entity containing the geometry to be visualized. * @param options.scene - The scene where visualization is taking place. * @param options.geometryOptions - Options for the geometry * @param options.geometryPropertyName - The geometry property name * @param options.observedPropertyNames - The entity properties this geometry cares about */ export class GeometryUpdater { constructor(options: { entity: Entity; scene: Scene; geometryOptions: any; geometryPropertyName: string; observedPropertyNames: string[]; }); /** * Gets the unique ID associated with this updater */ readonly id: string; /** * Gets the entity associated with this geometry. */ readonly entity: Entity; /** * Gets a value indicating if the geometry has a fill component. */ readonly fillEnabled: boolean; /** * Gets a value indicating if fill visibility varies with simulation time. */ readonly hasConstantFill: boolean; /** * Gets the material property used to fill the geometry. */ readonly fillMaterialProperty: MaterialProperty; /** * Gets a value indicating if the geometry has an outline component. */ readonly outlineEnabled: boolean; /** * Gets a value indicating if the geometry has an outline component. */ readonly hasConstantOutline: boolean; /** * Gets the {@link Color} property for the geometry outline. */ readonly outlineColorProperty: Property; /** * Gets the constant with of the geometry outline, in pixels. * This value is only valid if isDynamic is false. */ readonly outlineWidth: number; /** * Gets the property specifying whether the geometry * casts or receives shadows from light sources. */ readonly shadowsProperty: Property; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed. */ readonly distanceDisplayConditionProperty: Property; /** * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground. */ readonly classificationTypeProperty: Property; /** * Gets a value indicating if the geometry is time-varying. */ readonly isDynamic: boolean; /** * Gets a value indicating if the geometry is closed. * This property is only valid for static geometry. */ readonly isClosed: boolean; /** * Gets a value indicating if the geometry should be drawn on terrain. */ readonly onTerrain: boolean; /** * Gets an event that is raised whenever the public properties * of this updater change. */ readonly geometryChanged: boolean; /** * Checks if the geometry is outlined at the provided time. * @param time - The time for which to retrieve visibility. * @returns true if geometry is outlined at the provided time, false otherwise. */ isOutlineVisible(time: JulianDate): boolean; /** * Checks if the geometry is filled at the provided time. * @param time - The time for which to retrieve visibility. * @returns true if geometry is filled at the provided time, false otherwise. */ isFilled(time: JulianDate): boolean; /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys and resources used by the object. Once an object is destroyed, it should not be used. */ destroy(): void; } /** * A general purpose visualizer for geometry represented by {@link Primitive} instances. * @param scene - The scene the primitives will be rendered in. * @param entityCollection - The entityCollection to visualize. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities */ export class GeometryVisualizer { constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); /** * Updates all of the primitives created by this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns True if the visualizer successfully updated to the provided time, * false if the visualizer is waiting for asynchronous primitives to be created. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * A {@link DataSource} which processes the GPS Exchange Format (GPX). * @example * const viewer = new Cesium.Viewer('cesiumContainer'); * viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx')); */ export class GpxDataSource { constructor(); /** * Creates a Promise to a new instance loaded with the provided GPX data. * @param data - A url, parsed GPX document, or Blob containing binary GPX data. * @param [options] - An object with the following properties: * @param [options.clampToGround] - True if the symbols should be rendered at the same height as the terrain * @param [options.waypointImage] - Image to use for waypoint billboards. * @param [options.trackImage] - Image to use for track billboards. * @param [options.trackColor] - Color to use for track lines. * @param [options.routeColor] - Color to use for route lines. * @returns A promise that will resolve to a new GpxDataSource instance once the gpx is loaded. */ static load(data: string | Document | Blob, options?: { clampToGround?: boolean; waypointImage?: string; trackImage?: string; trackColor?: string; routeColor?: string; }): Promise; /** * Gets a human-readable name for this instance. * This will be automatically be set to the GPX document name on load. */ name: string; /** * Gets the version of the GPX Schema in use. */ version: string; /** * Gets the creator of the GPX document. */ creator: string; /** * Gets an object containing metadata about the GPX file. */ metadata: any; /** * Gets the clock settings defined by the loaded GPX. This represents the total * availability interval for all time-dynamic data. If the GPX does not contain * time-dynamic data, this value is undefined. */ clock: DataSourceClock; /** * Gets the collection of {@link Entity} instances. */ entities: EntityCollection; /** * Gets a value indicating if the data source is currently loading data. */ isLoading: boolean; /** * Gets an event that will be raised when the underlying data changes. */ changedEvent: Event; /** * Gets an event that will be raised if an error is encountered during processing. */ errorEvent: Event; /** * Gets an event that will be raised when the data source either starts or stops loading. */ loadingEvent: Event; /** * Gets whether or not this data source should be displayed. */ show: boolean; /** * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. */ clustering: EntityCluster; /** * Updates the data source to the provided time. This function is optional and * is not required to be implemented. It is provided for data sources which * retrieve data based on the current animation time or scene state. * If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; /** * Asynchronously loads the provided GPX data, replacing any existing data. * @param data - A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document. * @param [options] - An object with the following properties: * @param [options.clampToGround] - True if the symbols should be rendered at the same height as the terrain * @param [options.waypointImage] - Image to use for waypoint billboards. * @param [options.trackImage] - Image to use for track billboards. * @param [options.trackColor] - Color to use for track lines. * @param [options.routeColor] - Color to use for route lines. * @returns A promise that will resolve to this instances once the GPX is loaded. */ load(data: string | Document | Blob, options?: { clampToGround?: boolean; waypointImage?: string; trackImage?: string; trackColor?: string; routeColor?: string; }): Promise; } /** * A {@link MaterialProperty} that maps to grid {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}. * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values. * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis. * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis. * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis. */ export class GridMaterialProperty { constructor(options?: { color?: Property | Color; cellAlpha?: Property | number; lineCount?: Property | Cartesian2; lineThickness?: Property | Cartesian2; lineOffset?: Property | Cartesian2; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying the grid {@link Color}. */ color: Property | undefined; /** * Gets or sets the numeric Property specifying cell alpha values. */ cellAlpha: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis. */ lineCount: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis. */ lineThickness: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis. */ lineOffset: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * An abstract class for updating ground geometry entities. * @param options - An object with the following properties: * @param options.entity - The entity containing the geometry to be visualized. * @param options.scene - The scene where visualization is taking place. * @param options.geometryOptions - Options for the geometry * @param options.geometryPropertyName - The geometry property name * @param options.observedPropertyNames - The entity properties this geometry cares about */ export class GroundGeometryUpdater { constructor(options: { entity: Entity; scene: Scene; geometryOptions: any; geometryPropertyName: string; observedPropertyNames: string[]; }); /** * Gets the zindex */ readonly zIndex: number; /** * Destroys and resources used by the object. Once an object is destroyed, it should not be used. */ destroy(): void; } /** * A {@link MaterialProperty} that maps to image {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction. * @param [options.color = Color.WHITE] - The color applied to the image * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections) */ export class ImageMaterialProperty { constructor(options?: { image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; repeat?: Property | Cartesian2; color?: Property | Color; transparent?: Property | boolean; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying Image, URL, Canvas, or Video to use. */ image: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction. */ repeat: Property | undefined; /** * Gets or sets the Color Property specifying the desired color applied to the image. */ color: Property | undefined; /** * Gets or sets the Boolean Property specifying whether the image has transparency */ transparent: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * Representation of from KML * @param position - camera position * @param headingPitchRoll - camera orientation */ export class KmlCamera { constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll); } export namespace KmlDataSource { /** * Initialization options for the `load` method. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. * @property [ellipsoid = Ellipsoid.default] - The global ellipsoid used for geographical calculations. * @property [screenOverlayContainer] - A container for ScreenOverlay images. */ type LoadOptions = { sourceUri?: string; clampToGround?: boolean; ellipsoid?: Ellipsoid; screenOverlayContainer?: Element | string; }; /** * Options for constructing a new KmlDataSource, or calling the static `load` method. * @property [camera] - The camera that is used for viewRefreshModes and sending camera properties to network links. * @property [canvas] - The canvas that is used for sending viewer properties to network links. * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. * @property [ellipsoid = Ellipsoid.default] - The global ellipsoid used for geographical calculations. * @property [screenOverlayContainer] - A container for ScreenOverlay images. */ type ConstructorOptions = { camera?: Camera; canvas?: HTMLCanvasElement; credit?: Credit | string; sourceUri?: string; clampToGround?: boolean; ellipsoid?: Ellipsoid; screenOverlayContainer?: Element | string; }; } /** * A {@link 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 * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a * detailed list of what is and isn't supported. 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 {@link KmlFeatureData}, which is added to each {@link Entity} * under the kml property. *

* @example * const viewer = new Cesium.Viewer('cesiumContainer'); * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz', * { * camera: viewer.scene.camera, * canvas: viewer.scene.canvas * }) * ); * @param [options] - Object describing initialization options */ export class KmlDataSource { constructor(options?: KmlDataSource.ConstructorOptions); /** * The current size of this Canvas will be used to populate the Link parameters * for client height and width. */ canvas: HTMLCanvasElement | undefined; /** * The position and orientation of this {@link Camera} will be used to * populate various camera parameters when making network requests. * Camera movement will determine when to trigger NetworkLink refresh if * viewRefreshMode is onStop. */ camera: Camera | undefined; /** * Creates a Promise to a new instance loaded with the provided KML data. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. * @param [options] - An object specifying configuration options * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded. */ static load(data: Resource | string | Document | Blob, options?: KmlDataSource.ConstructorOptions): Promise; /** * Gets or sets a human-readable name for this instance. * This will be automatically be set to the KML document name on load. */ name: string; /** * Gets the clock settings defined by the loaded KML. This represents the total * availability interval for all time-dynamic data. If the KML does not contain * time-dynamic data, this value is undefined. */ clock: DataSourceClock; /** * Gets the collection of {@link Entity} instances. */ entities: EntityCollection; /** * Gets a value indicating if the data source is currently loading data. */ isLoading: boolean; /** * Gets an event that will be raised when the underlying data changes. */ changedEvent: Event; /** * Gets an event that will be raised if an error is encountered during processing. */ errorEvent: Event; /** * Gets an event that will be raised when the data source either starts or stops loading. */ loadingEvent: Event; /** * Gets an event that will be raised when the data source refreshes a network link. */ refreshEvent: Event; /** * Gets an event that will be raised when the data source finds an unsupported node type. */ unsupportedNodeEvent: Event; /** * Gets whether or not this data source should be displayed. */ show: boolean; /** * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. */ clustering: EntityCluster; /** * Gets the credit that will be displayed for the data source */ credit: Credit; /** * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals. */ kmlTours: KmlTour[]; /** * Asynchronously loads the provided KML data, replacing any existing data. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. * @param [options] - An object specifying configuration options * @returns A promise that will resolve to this instances once the KML is loaded. */ load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise; /** * Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements. */ destroy(): void; /** * Updates any NetworkLink that require updating. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; } export namespace KmlFeatureData { /** * @property name - Gets the name. * @property uri - Gets the URI. * @property age - Gets the email. */ type Author = { name: string; uri: string; age: number; }; /** * @property href - Gets the href. * @property hreflang - Gets the language of the linked resource. * @property rel - Gets the link relation. * @property type - Gets the link type. * @property title - Gets the link title. * @property length - Gets the link length. */ type Link = { href: string; hreflang: string; rel: string; type: string; title: string; length: string; }; } /** * Contains KML Feature data loaded into the Entity.kml property by {@link KmlDataSource}. */ export class KmlFeatureData { /** * Gets the atom syndication format author field. */ author: KmlFeatureData.Author; /** * Gets the link. */ link: KmlFeatureData.Link; /** * Gets the unstructured address field. */ address: string; /** * Gets the phone number. */ phoneNumber: string; /** * Gets the snippet. */ snippet: string; /** * Gets the extended data, parsed into a JSON object. * Currently only the Data property is supported. * SchemaData and custom data are ignored. */ extendedData: string; } /** * @param position - camera position * @param headingPitchRange - camera orientation */ export class KmlLookAt { constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange); } /** * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to * guide the camera to a specified destinations on given time intervals. * @param name - name parsed from KML * @param id - id parsed from KML * @param playlist - array with KmlTourFlyTos and KmlTourWaits */ export class KmlTour { constructor(name: string, id: string, playlist: any[]); /** * Id of kml gx:Tour entry */ id: string; /** * Tour name */ name: string; /** * Index of current entry from playlist */ playlistIndex: number; /** * Array of playlist entries */ playlist: any[]; /** * Event will be called when tour starts to play, * before any playlist entry starts to play. */ tourStart: Event; /** * Event will be called when all playlist entries are * played, or tour playback being canceled. * * If tour playback was terminated, event callback will * be called with terminated=true parameter. */ tourEnd: Event; /** * Event will be called when entry from playlist starts to play. * * Event callback will be called with curent entry as first parameter. */ entryStart: Event; /** * Event will be called when entry from playlist ends to play. * * Event callback will be called with following parameters: * 1. entry - entry * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop} */ entryEnd: Event; /** * Add entry to this tour playlist. * @param entry - an entry to add to the playlist. */ addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void; /** * Play this tour. * @param widget - The widget. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo} * options for FlyTo playlist entries. */ play(widget: CesiumWidget, cameraOptions?: any): void; /** * Stop curently playing tour. */ stop(): void; } /** * Transitions the KmlTour to the next destination. This transition is facilitated * using a specified flyToMode over a given number of seconds. * @param duration - entry duration * @param flyToMode - KML fly to mode: bounce, smooth, etc * @param view - KmlCamera or KmlLookAt */ export class KmlTourFlyTo { constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt); /** * Play this playlist entry * @param done - function which will be called when playback ends * @param camera - Cesium camera * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo} */ play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void; /** * Stop execution of curent entry. Cancel camera flyTo */ stop(): void; /** * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} * depends on this.view type. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo} * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options */ getCameraOptions(cameraOptions: any): any; } export namespace KmlTourFlyTo { /** * A function that will be executed when the flight completes. * @param terminated - true if {@link KmlTourFlyTo#stop} was * called before entry done playback. */ type DoneCallback = (terminated: boolean) => void; } /** * Pauses the KmlTour for a given number of seconds. * @param duration - entry duration */ export class KmlTourWait { constructor(duration: number); /** * Play this playlist entry * @param done - function which will be called when playback ends */ play(done: KmlTourWait.DoneCallback): void; /** * Stop execution of curent entry, cancel curent timeout */ stop(): void; } export namespace KmlTourWait { /** * A function which will be called when playback ends. * @param terminated - true if {@link KmlTourWait#stop} was * called before entry done playback. */ type DoneCallback = (terminated: boolean) => void; } export namespace LabelGraphics { /** * Initialization options for the LabelGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the label. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported. * @property [font = '30px sans-serif'] - A Property specifying the CSS font. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to. */ type ConstructorOptions = { show?: Property | boolean; text?: Property | string; font?: Property | string; style?: Property | LabelStyle; scale?: Property | number; showBackground?: Property | boolean; backgroundColor?: Property | Color; backgroundPadding?: Property | Cartesian2; pixelOffset?: Property | Cartesian2; eyeOffset?: Property | Cartesian3; horizontalOrigin?: Property | HorizontalOrigin; verticalOrigin?: Property | VerticalOrigin; heightReference?: Property | HeightReference; fillColor?: Property | Color; outlineColor?: Property | Color; outlineWidth?: Property | number; translucencyByDistance?: Property | NearFarScalar; pixelOffsetScaleByDistance?: Property | NearFarScalar; scaleByDistance?: Property | NearFarScalar; distanceDisplayCondition?: Property | DistanceDisplayCondition; disableDepthTestDistance?: Property | number; }; } /** * Describes a two dimensional label located at the position of the containing {@link Entity}. *

*

*
* Example labels *
*

* @param [options] - Object describing initialization options */ export class LabelGraphics { constructor(options?: LabelGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the label. */ show: Property | undefined; /** * Gets or sets the string Property specifying the text of the label. * Explicit newlines '\n' are supported. */ text: Property | undefined; /** * Gets or sets the string Property specifying the font in CSS syntax. */ font: Property | undefined; /** * Gets or sets the Property specifying the {@link LabelStyle}. */ style: Property | undefined; /** * Gets or sets the numeric Property specifying the uniform scale to apply to the image. * A scale greater than 1.0 enlarges the label while a scale less than 1.0 shrinks it. *

*

*
* From left to right in the above image, the scales are 0.5, 1.0, * and 2.0. *
*

*/ scale: Property | undefined; /** * Gets or sets the boolean Property specifying the visibility of the background behind the label. */ showBackground: Property | undefined; /** * Gets or sets the Property specifying the background {@link Color}. */ backgroundColor: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical * background padding in pixels. */ backgroundPadding: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space * from the origin of this label. This is commonly used to align multiple labels and labels at * the same position, e.g., an image and text. The screen space origin is the top, left corner of the * canvas; x increases from left to right, and y increases from top to bottom. *

*

* * * *
default
l.pixeloffset = new Cartesian2(25, 75);
* The label's origin is indicated by the yellow point. *
*

*/ pixelOffset: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates. * Eye coordinates is a left-handed coordinate system, where x points towards the viewer's * right, y points up, and z points into the screen. *

* An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to * arrange a label above its corresponding 3D model. *

* Below, the label is positioned at the center of the Earth but an eye offset makes it always * appear on top of the Earth regardless of the viewer's or Earth's orientation. *

*

* * * *
* l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

*
*

*/ eyeOffset: Property | undefined; /** * Gets or sets the Property specifying the {@link HorizontalOrigin}. */ horizontalOrigin: Property | undefined; /** * Gets or sets the Property specifying the {@link VerticalOrigin}. */ verticalOrigin: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the Property specifying the fill {@link Color}. */ fillColor: Property | undefined; /** * Gets or sets the Property specifying the outline {@link Color}. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the outline width. */ outlineWidth: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's translucency remains clamped to the nearest bound. */ translucencyByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera. * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's pixel offset remains clamped to the nearest bound. */ pixelOffsetScaleByDistance: Property | undefined; /** * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, * scaleByDistance will be disabled. */ scaleByDistance: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: LabelGraphics): LabelGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: LabelGraphics): void; } /** * A {@link Visualizer} which maps the {@link LabelGraphics} instance * in {@link Entity#label} to a {@link Label}. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. * @param entityCollection - The entityCollection to visualize. */ export class LabelVisualizer { constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); /** * Updates the primitives created by this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * The interface for all {@link Property} objects that represent {@link Material} uniforms. * This type defines an interface and cannot be instantiated directly. */ export class MaterialProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export namespace ModelGraphics { /** * Initialization options for the ModelGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the model. * @property [uri] - A string or Resource Property specifying the URI of the glTF asset. * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale. * @property [enableVerticalExaggeration = true] - A boolean Property specifying if the model is exaggerated along the ellipsoid normal when {@link Scene.verticalExaggeration} is set to a value other than 1.0. * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom. * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize. * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded. * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started. * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette. * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels. * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color. * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model. * @property [colorBlendAmount = 0.5] - A numeric Property specifying the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting. * @property [environmentMapOptions] - The properties for managing dynamic environment maps on this entity. * @property [lightColor] - A property specifying the light color when shading the model. When undefined the scene's light color is used instead. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed. * @property [nodeTransformations] - An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. * @property [articulations] - An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties. * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. * @property [customShader] - A property specifying the {@link CustomShader} to apply to this model. */ type ConstructorOptions = { show?: Property | boolean; uri?: Property | string | Resource; scale?: Property | number; enableVerticalExaggeration?: Property | boolean; minimumPixelSize?: Property | number; maximumScale?: Property | number; incrementallyLoadTextures?: Property | boolean; runAnimations?: Property | boolean; clampAnimations?: Property | boolean; shadows?: Property | ShadowMode; heightReference?: Property | HeightReference; silhouetteColor?: Property | Color; silhouetteSize?: Property | number; color?: Property | Color; colorBlendMode?: Property | ColorBlendMode; colorBlendAmount?: Property | number; imageBasedLightingFactor?: Property | Cartesian2; environmentMapOptions?: PropertyBag | { [key: string]: any; }; lightColor?: Property | Color; distanceDisplayCondition?: Property | DistanceDisplayCondition; nodeTransformations?: PropertyBag | { [key: string]: TranslationRotationScale; }; articulations?: PropertyBag | { [key: string]: number; }; clippingPlanes?: Property | ClippingPlaneCollection; customShader?: Property | CustomShader; }; } /** * A 3D model based on {@link 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 {@link Entity}. *

* Cesium includes support for glTF geometry, materials, animations, and skinning. * Cameras and lights are not currently supported. *

* @param [options] - Object describing initialization options */ export class ModelGraphics { constructor(options?: ModelGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the model. */ show: Property | undefined; /** * Gets or sets the string Property specifying the URI of the glTF asset. */ uri: Property | undefined; /** * Gets or sets the numeric Property specifying a uniform linear scale * for this model. Values greater than 1.0 increase the size of the model while * values less than 1.0 decrease it. */ scale: Property | undefined; /** * Gets or sets the boolean Property specifying if the model is exaggerated along the ellipsoid normal when {@link Scene.verticalExaggeration} is set to a value other than 1.0. */ enableVerticalExaggeration: Property | undefined; /** * Gets or sets the numeric Property specifying the approximate minimum * pixel size of the model regardless of zoom. This can be used to ensure that * a model is visible even when the viewer zooms out. When 0.0, * no minimum size is enforced. */ minimumPixelSize: Property | undefined; /** * Gets or sets the numeric Property specifying the maximum scale * size of a model. This property is used as an upper limit for * {@link ModelGraphics#minimumPixelSize}. */ maximumScale: Property | undefined; /** * Get or sets the boolean Property specifying whether textures * may continue to stream in after the model is loaded. */ incrementallyLoadTextures: Property | undefined; /** * Gets or sets the boolean Property specifying if glTF animations should be run. */ runAnimations: Property | undefined; /** * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. */ clampAnimations: Property | undefined; /** * Get or sets the enum Property specifying whether the model * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the silhouette. */ silhouetteColor: Property | undefined; /** * Gets or sets the numeric Property specifying the size of the silhouette in pixels. */ silhouetteSize: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color. */ color: Property | undefined; /** * Gets or sets the enum Property specifying how the color blends with the model. */ colorBlendMode: Property | undefined; /** * A numeric Property specifying the color strength when the colorBlendMode is MIX. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with * any value in-between resulting in a mix of the two. */ colorBlendAmount: Property | undefined; /** * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color. */ imageBasedLightingFactor: Property | undefined; /** * Gets or sets the {@link DynamicEnvironmentMapManager.ConstructorOptions} to apply to this model. This is represented as an {@link PropertyBag}. */ environmentMapOptions: PropertyBag; /** * A property specifying the {@link Cartesian3} light color when shading the model. When undefined the scene's light color is used instead. */ lightColor: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. */ nodeTransformations: PropertyBag; /** * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are * composed as the name of the articulation, a single space, and the name of the stage. */ articulations: PropertyBag; /** * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. */ clippingPlanes: Property | undefined; /** * Gets or sets the {@link CustomShader} to apply to this model. When undefined, no custom shader code is used. */ customShader: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: ModelGraphics): ModelGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: ModelGraphics): void; } /** * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}. * @param scene - The scene the primitives will be rendered in. * @param entityCollection - The entityCollection to visualize. */ export class ModelVisualizer { constructor(scene: Scene, entityCollection: EntityCollection); /** * Updates models created this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * A {@link Property} that produces {@link TranslationRotationScale} data. * @param [options] - Object with the following properties: * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node. * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node. * @param [options.scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node. */ export class NodeTransformationProperty { constructor(options?: { translation?: Property | Cartesian3; rotation?: Property | Quaternion; scale?: Property | Cartesian3; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node. */ translation: Property | undefined; /** * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node. */ rotation: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node. */ scale: Property | undefined; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: TranslationRotationScale): TranslationRotationScale; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export namespace PathGraphics { /** * Initialization options for the PathGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the path. * @property [leadTime] - A Property specifying the number of seconds in front the object to show. * @property [trailTime] - A Property specifying the number of seconds behind of the object to show. * @property [width = 1.0] - A numeric Property specifying the width in pixels. * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position. Fractional positive values are allowed; in PORTIONS materialMode, non-positive values fall back to the default resolution of 60 seconds. * @property [material = Color.WHITE] - A Property specifying the material used to draw the path. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed. * @property [relativeTo] - A Property specifying the frame in which to visualize the path. Use another entity's id to visualize the path relative to that entity, or use the string values "FIXED" or "INERTIAL" to visualize the path in those reference frames. * @property [materialMode] - A Property specifying how material properties are applied along the path. */ type ConstructorOptions = { show?: Property | boolean; leadTime?: Property | number; trailTime?: Property | number; width?: Property | number; resolution?: Property | number; material?: MaterialProperty | Color; distanceDisplayCondition?: Property | DistanceDisplayCondition; relativeTo?: Property | string; materialMode?: Property | PathMode; }; } /** * Describes a polyline defined as the path made by an {@link Entity} as it moves over time. * @param [options] - Object describing initialization options */ export class PathGraphics { constructor(options?: PathGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the path. */ show: Property | undefined; /** * Gets or sets the Property specifying the number of seconds in front of the object to show. */ leadTime: Property | undefined; /** * Gets or sets the Property specifying the number of seconds behind the object to show. */ trailTime: Property | undefined; /** * Gets or sets the numeric Property specifying the width in pixels. */ width: Property | undefined; /** * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position. * Fractional positive values are allowed; in PORTIONS materialMode, non-positive values fall back to the default resolution of 60 seconds. */ resolution: Property | undefined; /** * Gets or sets the Property specifying the material used to draw the path. */ material: MaterialProperty; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the frame in which to visualize the path. Use another entity's id to visualize the path relative to that entity, or use the string values "FIXED" or "INERTIAL" to visualize the path in those reference frames. */ relativeTo: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: PathGraphics): PathGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PathGraphics): void; } /** * Defines how material properties are applied along a path. */ export enum PathMode { /** * The material is applied to the entire path as a whole. */ WHOLE = 0, /** * The material is applied in portions based on temporal position information, * using interval-based material properties. */ PORTIONS = 1 } /** * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}. * @param scene - The scene the primitives will be rendered in. * @param entityCollection - The entityCollection to visualize. */ export class PathVisualizer { constructor(scene: Scene, entityCollection: EntityCollection); /** * Updates all of the primitives created by this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * A {@link GeometryUpdater} for planes. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class PlaneGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace PlaneGraphics { /** * Initialization options for the PlaneGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the plane. * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane. * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane. * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane. * @property [outline = false] - A boolean Property specifying whether the plane is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed. */ type ConstructorOptions = { show?: Property | boolean; plane?: Property | Plane; dimensions?: Property | Cartesian2; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; }; } /** * Describes a plane. The center position and orientation are determined by the containing {@link Entity}. * @param [options] - Object describing initialization options */ export class PlaneGraphics { constructor(options?: PlaneGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the plane. */ show: Property | undefined; /** * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane. */ plane: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane. */ dimensions: Property | undefined; /** * Gets or sets the boolean Property specifying whether the plane is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the material used to fill the plane. */ material: MaterialProperty; /** * Gets or sets the Property specifying whether the plane is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the plane * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: PlaneGraphics): PlaneGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PlaneGraphics): void; } export namespace PointGraphics { /** * Initialization options for the PointGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the point. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to. * @property [splitDirection] - A Property specifying the {@link SplitDirection} split to apply to this point. */ type ConstructorOptions = { show?: Property | boolean; pixelSize?: Property | number; heightReference?: Property | HeightReference; color?: Property | Color; outlineColor?: Property | Color; outlineWidth?: Property | number; scaleByDistance?: Property | NearFarScalar; translucencyByDistance?: Property | NearFarScalar; distanceDisplayCondition?: Property | DistanceDisplayCondition; disableDepthTestDistance?: Property | number; splitDirection?: Property | SplitDirection; }; } /** * Describes a graphical point located at the position of the containing {@link Entity}. * @param [options] - Object describing initialization options */ export class PointGraphics { constructor(options?: PointGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the point. */ show: Property | undefined; /** * Gets or sets the numeric Property specifying the size in pixels. */ pixelSize: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the point. */ color: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the the outline width in pixels. */ outlineWidth: Property | undefined; /** * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance. * If undefined, a constant size is used. */ scaleByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the points's translucency remains clamped to the nearest bound. */ translucencyByDistance: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: Property | undefined; /** * Gets or sets the Property specifying the {@link SplitDirection} of this point. */ splitDirection: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: PointGraphics): PointGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PointGraphics): void; } /** * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. * @param entityCollection - The entityCollection to visualize. */ export class PointVisualizer { constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); /** * Updates the primitives created by this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * A {@link GeometryUpdater} for polygons. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class PolygonGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace PolygonGraphics { /** * Initialization options for the PolygonGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the polygon. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. * @property [zIndex = 0] - A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. * @property [textureCoordinates] - A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives. */ type ConstructorOptions = { show?: Property | boolean; hierarchy?: Property | PolygonHierarchy | Cartesian3[]; height?: Property | number; heightReference?: Property | HeightReference; extrudedHeight?: Property | number; extrudedHeightReference?: Property | HeightReference; stRotation?: Property | number; granularity?: Property | number; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; perPositionHeight?: Property | boolean; closeTop?: boolean | boolean; closeBottom?: boolean | boolean; arcType?: Property | ArcType; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; classificationType?: Property | ClassificationType; zIndex?: ConstantProperty | number; textureCoordinates?: Property | PolygonHierarchy; }; } /** * 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. * @param [options] - Object describing initialization options */ export class PolygonGraphics { constructor(options?: PolygonGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the polygon. */ show: Property | undefined; /** * Gets or sets the Property specifying the {@link PolygonHierarchy}. */ hierarchy: Property | undefined; /** * Gets or sets the numeric Property specifying the constant altitude of the polygon. */ height: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the polygon extrusion. * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude. */ extrudedHeight: Property | undefined; /** * Gets or sets the Property specifying the extruded {@link HeightReference}. */ extrudedHeightReference: Property | undefined; /** * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined. */ stRotation: Property | undefined; /** * Gets or sets the numeric Property specifying the angular distance between points on the polygon. */ granularity: Property | undefined; /** * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the polygon. */ material: MaterialProperty; /** * Gets or sets the Property specifying whether the polygon is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Gets or sets the boolean specifying whether or not the the height of each position is used. * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}. */ perPositionHeight: Property | undefined; /** * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included. */ closeTop: Property | undefined; /** * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included. */ closeBottom: Property | undefined; /** * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use. */ arcType: Property | undefined; /** * Get or sets the enum Property specifying whether the polygon * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. */ classificationType: Property | undefined; /** * Gets or sets the zIndex Prperty specifying the ordering of ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. */ zIndex: ConstantProperty | undefined; /** * A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives. */ textureCoordinates: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: PolygonGraphics): PolygonGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PolygonGraphics): void; } /** * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms. * @param [color = Color.WHITE] - The {@link Color} Property to be used. */ export class PolylineArrowMaterialProperty { constructor(color?: Property | Color); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the {@link Color} {@link Property}. */ color: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash */ export class PolylineDashMaterialProperty { constructor(options?: { color?: Property | Color; gapColor?: Property | Color; dashLength?: Property | number; dashPattern?: Property | number; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying the {@link Color} of the line. */ color: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the gaps in the line. */ gapColor: Property | undefined; /** * Gets or sets the numeric Property specifying the length of a dash cycle */ dashLength: Property | undefined; /** * Gets or sets the numeric Property specifying a dash pattern */ dashPattern: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link GeometryUpdater} for polylines. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class PolylineGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Gets the unique ID associated with this updater */ readonly id: string; /** * Gets the entity associated with this geometry. */ readonly entity: Entity; /** * Gets a value indicating if the geometry has a fill component. */ readonly fillEnabled: boolean; /** * Gets a value indicating if fill visibility varies with simulation time. */ readonly hasConstantFill: boolean; /** * Gets the material property used to fill the geometry. */ readonly fillMaterialProperty: MaterialProperty; /** * Gets the material property used to fill the geometry when it fails the depth test. */ readonly depthFailMaterialProperty: MaterialProperty; /** * Gets a value indicating if the geometry has an outline component. */ readonly outlineEnabled: boolean; /** * Gets a value indicating if outline visibility varies with simulation time. */ readonly hasConstantOutline: boolean; /** * Gets the {@link Color} property for the geometry outline. */ readonly outlineColorProperty: Property; /** * Gets the property specifying whether the geometry * casts or receives shadows from light sources. */ readonly shadowsProperty: Property; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed. */ readonly distanceDisplayConditionProperty: Property; /** * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground. */ readonly classificationTypeProperty: Property; /** * Gets a value indicating if the geometry is time-varying. */ readonly isDynamic: boolean; /** * Gets a value indicating if the geometry is closed. * This property is only valid for static geometry. */ readonly isClosed: boolean; /** * Gets an event that is raised whenever the public properties * of this updater change. */ readonly geometryChanged: boolean; /** * Gets a value indicating if the path of the line. */ readonly arcType: ArcType; /** * Gets a value indicating if the geometry is clamped to the ground. * Returns false if polylines on terrain is not supported. */ readonly clampToGround: boolean; /** * Gets the zindex */ readonly zIndex: number; /** * Checks if the geometry is outlined at the provided time. * @param time - The time for which to retrieve visibility. * @returns true if geometry is outlined at the provided time, false otherwise. */ isOutlineVisible(time: JulianDate): boolean; /** * Checks if the geometry is filled at the provided time. * @param time - The time for which to retrieve visibility. * @returns true if geometry is filled at the provided time, false otherwise. */ isFilled(time: JulianDate): boolean; /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys and resources used by the object. Once an object is destroyed, it should not be used. */ destroy(): void; } /** * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width. * @param [options.taperPower = 1.0] - A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used. */ export class PolylineGlowMaterialProperty { constructor(options?: { color?: Property | Color; glowPower?: Property | number; taperPower?: Property | number; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying the {@link Color} of the line. */ color: Property | undefined; /** * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0). */ glowPower: Property | undefined; /** * Gets or sets the numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used. */ taperPower: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export namespace PolylineGraphics { /** * Initialization options for the PolylineGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the polyline. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip. * @property [width = 1.0] - A numeric Property specifying the width in pixels. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. * @property [zIndex = 0] - A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported. */ type ConstructorOptions = { show?: Property | boolean; positions?: Property | Cartesian3[]; width?: Property | number; granularity?: Property | number; material?: MaterialProperty | Color; depthFailMaterial?: MaterialProperty | Color; arcType?: Property | ArcType; clampToGround?: Property | boolean; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; classificationType?: Property | ClassificationType; zIndex?: Property | number; }; } /** * Describes a polyline. 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, great arcs, or clamped to terrain. * @param [options] - Object describing initialization options */ export class PolylineGraphics { constructor(options?: PolylineGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the polyline. */ show: Property | undefined; /** * Gets or sets the Property specifying the array of {@link Cartesian3} * positions that define the line strip. */ positions: Property | undefined; /** * Gets or sets the numeric Property specifying the width in pixels. */ width: Property | undefined; /** * Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false. */ granularity: Property | undefined; /** * Gets or sets the Property specifying the material used to draw the polyline. */ material: MaterialProperty; /** * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test. *

* Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, * there may be artifacts. *

*/ depthFailMaterial: MaterialProperty; /** * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected. */ arcType: Property | undefined; /** * Gets or sets the boolean Property specifying whether the polyline * should be clamped to the ground. */ clampToGround: Property | undefined; /** * Get or sets the enum Property specifying whether the polyline * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. */ classificationType: Property | undefined; /** * Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported. */ zIndex: ConstantProperty | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: PolylineGraphics): PolylineGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PolylineGraphics): void; } /** * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels. */ export class PolylineOutlineMaterialProperty { constructor(options?: { color?: Property | Color; outlineColor?: Property | Color; outlineWidth?: Property | number; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying the {@link Color} of the line. */ color: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. */ outlineWidth: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A visualizer for polylines represented by {@link Primitive} instances. * @param scene - The scene the primitives will be rendered in. * @param entityCollection - The entityCollection to visualize. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities */ export class PolylineVisualizer { constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); /** * Updates all of the primitives created by this visualizer to match their * Entity counterpart at the given time. * @param time - The time to update to. * @returns True if the visualizer successfully updated to the provided time, * false if the visualizer is waiting for asynchronous primitives to be created. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes and destroys all primitives created by this instance. */ destroy(): void; } /** * A {@link GeometryUpdater} for polyline volumes. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class PolylineVolumeGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace PolylineVolumeGraphics { /** * Initialization options for the PolylineVolumeGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the volume. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip. * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point. * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume. * @property [outline = false] - A boolean Property specifying whether the volume is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed. */ type ConstructorOptions = { show?: Property | boolean; positions?: Property | Cartesian3[]; shape?: Property | Cartesian2[]; cornerType?: Property | CornerType; granularity?: Property | number; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; }; } /** * 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. * @param [options] - Object describing initialization options */ export class PolylineVolumeGraphics { constructor(options?: PolylineVolumeGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the volume. */ show: Property | undefined; /** * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip. */ positions: Property | undefined; /** * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. */ shape: Property | undefined; /** * Gets or sets the {@link CornerType} Property specifying the style of the corners. */ cornerType: Property | undefined; /** * Gets or sets the numeric Property specifying the angular distance between points on the volume. */ granularity: Property | undefined; /** * Gets or sets the boolean Property specifying whether the volume is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the volume. */ material: MaterialProperty; /** * Gets or sets the Property specifying whether the volume is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the volume * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PolylineVolumeGraphics): void; } /** * The interface for all {@link Property} objects that define a world * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}. * This type defines an interface and cannot be instantiated directly. */ export class PositionProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the reference frame that the position is defined in. */ referenceFrame: ReferenceFrame; /** * Gets the value of the property at the provided time in the fixed frame. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Cartesian3): Cartesian3 | undefined; /** * Gets the value of the property at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} whose value is an array whose items are the computed value * of other PositionProperty instances. * @param [value] - An array of Property instances. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ export class PositionPropertyArray { constructor(value?: Property[], referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. This property * is considered constant if all property items in the array are constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value or one of the properties in the array also changes. */ readonly definitionChanged: Event; /** * Gets the reference frame in which the position is defined. */ referenceFrame: ReferenceFrame; /** * Gets the value of the property. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Cartesian3[]): Cartesian3[]; /** * Gets the value of the property at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[]; /** * Sets the value of the property. * @param value - An array of Property instances. */ setValue(value: Property[]): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * 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. */ export class Property { constructor(); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} whose value is an array whose items are the computed value * of other property instances. * @param [value] - An array of Property instances. */ export class PropertyArray { constructor(value?: Property[]); /** * Gets a value indicating if this property is constant. This property * is considered constant if all property items in the array are constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value or one of the properties in the array also changes. */ readonly definitionChanged: Event; /** * Gets the value of the property. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter, which is an array of values produced by evaluating each of the contained properties at the given time or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: object[]): object[]; /** * Sets the value of the property. * @param value - An array of Property instances. */ setValue(value: Property[]): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export interface PropertyBag extends Record { } /** * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties. * @param [value] - An object, containing key-value mapping of property names to properties. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property. */ export class PropertyBag implements Record { constructor(value?: any, createPropertyCallback?: (...params: any[]) => any); /** * Gets the names of all properties registered on this instance. */ propertyNames: any[]; /** * Gets a value indicating if this property is constant. This property * is considered constant if all property items in this object are constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the set of properties contained in this * object changes, or one of the properties itself changes. */ readonly definitionChanged: Event; /** * Determines if this object has defined a property with the given name. * @param propertyName - The name of the property to check for. * @returns True if this object has defined a property with the given name, false otherwise. */ hasProperty(propertyName: string): boolean; /** * Adds a property to this object. * @param propertyName - The name of the property to add. * @param [value] - The value of the new property, if provided. * @param [createPropertyCallback] - A function that will be called when the value of this new property is set to a value that is not a Property. */ addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void; /** * Removed a property previously added with addProperty. * @param propertyName - The name of the property to remove. */ removeProperty(propertyName: string): void; /** * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall * result will be an object, mapping property names to those values. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * Note that any properties in result which are not part of this PropertyBag will be left as-is. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property. */ merge(source: any, createPropertyCallback?: (...params: any[]) => any): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link GeometryUpdater} for rectangles. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class RectangleGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace RectangleGraphics { /** * Initialization options for the RectangleGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the rectangle. * @property [coordinates] - The Property specifying the {@link Rectangle}. * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle. * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle. * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. * @property [zIndex = 0] - A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. */ type ConstructorOptions = { show?: Property | boolean; coordinates?: Property | Rectangle; height?: Property | number; heightReference?: Property | HeightReference; extrudedHeight?: Property | number; extrudedHeightReference?: Property | HeightReference; rotation?: Property | number; stRotation?: Property | number; granularity?: Property | number; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; classificationType?: Property | ClassificationType; zIndex?: Property | number; }; } /** * Describes graphics for a {@link 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. * @param [options] - Object describing initialization options */ export class RectangleGraphics { constructor(options?: RectangleGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the rectangle. */ show: Property | undefined; /** * Gets or sets the Property specifying the {@link Rectangle}. */ coordinates: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the rectangle. */ height: Property | undefined; /** * Gets or sets the Property specifying the {@link HeightReference}. */ heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion. * Setting this property creates volume starting at height and ending at this altitude. */ extrudedHeight: Property | undefined; /** * Gets or sets the Property specifying the extruded {@link HeightReference}. */ extrudedHeightReference: Property | undefined; /** * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north. */ rotation: Property | undefined; /** * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north. */ stRotation: Property | undefined; /** * Gets or sets the numeric Property specifying the angular distance between points on the rectangle. */ granularity: Property | undefined; /** * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the rectangle. */ material: MaterialProperty; /** * Gets or sets the Property specifying whether the rectangle is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the rectangle * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. */ classificationType: Property | undefined; /** * Gets or sets the zIndex Property specifying the ordering of the rectangle. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. */ zIndex: ConstantProperty | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: RectangleGraphics): RectangleGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: RectangleGraphics): void; } /** * A {@link Property} which transparently links to another property on a provided object. * @example * const collection = new Cesium.EntityCollection(); * * //Create a new entity and assign a billboard scale. * const 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. * const 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. * const 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. * const object4 = new Cesium.Entity({id:'#object.4'}); * object4.billboard = new Cesium.BillboardGraphics(); * object4.billboard.scale = new Cesium.ConstantProperty(2.0); * collection.add(object4); * * const 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); * @param targetCollection - The entity collection which will be used to resolve the reference. * @param targetId - The id of the entity which is being referenced. * @param targetPropertyNames - The names of the property on the target entity which we will use. */ export class ReferenceProperty { constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]); /** * Gets a value indicating if this property is constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever the referenced property's definition is changed. */ readonly definitionChanged: Event; /** * Gets the reference frame that the position is defined in. * This property is only valid if the referenced property is a {@link PositionProperty}. */ readonly referenceFrame: ReferenceFrame; /** * Gets the id of the entity being referenced. */ readonly targetId: string; /** * Gets the collection containing the entity being referenced. */ readonly targetCollection: EntityCollection; /** * Gets the array of property names used to retrieve the referenced property. */ readonly targetPropertyNames: any; /** * Gets the resolved instance of the underlying referenced property. */ readonly resolvedProperty: Property | undefined; /** * Creates a new instance given the entity collection that will * be used to resolve it and a string indicating the target entity id and property. * The format of the string is "objectId#foo.bar", where # separates the id from * property path and . separates sub-properties. If the reference identifier or * or any sub-properties contains a # . or \ they must be escaped. * @returns A new instance of ReferenceProperty. */ static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Gets the value of the property at the provided time and in the provided reference frame. * This method is only valid if the property being referenced is a {@link PositionProperty}. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Gets the {@link Material} type at the provided time. * This method is only valid if the property being referenced is a {@link MaterialProperty}. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } export namespace Rotation { /** * The number of elements used to pack the object into an array. */ var packedLength: number; /** * Stores the provided instance into the provided array. * @param value - The value to pack. * @param array - The array to pack into. * @param [startingIndex = 0] - The index into the array at which to start packing the elements. * @returns The array that was packed into */ function pack(value: Rotation, array: number[], startingIndex?: number): number[]; /** * Retrieves an instance from a packed array. * @param array - The packed array. * @param [startingIndex = 0] - The starting index of the element to be unpacked. * @param [result] - The object into which to store the result. * @returns The modified result parameter or a new Rotation instance if one was not provided. */ function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation; /** * Converts a packed array into a form suitable for interpolation. * @param packedArray - The packed array. * @param [startingIndex = 0] - The index of the first element to be converted. * @param [lastIndex = packedArray.length] - The index of the last element to be converted. * @param [result] - The object into which to store the result. */ function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; /** * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}. * @param array - The array previously packed for interpolation. * @param sourceArray - The original packed array. * @param [firstIndex = 0] - The firstIndex used to convert the array. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array. * @param [result] - The object into which to store the result. * @returns The modified result parameter or a new Rotation instance if one was not provided. */ function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation; } /** * Represents a {@link Packable} number that always interpolates values * towards the shortest angle of rotation. This object is never used directly * but is instead passed to the constructor of {@link SampledProperty} * in order to represent a two-dimensional angle of rotation. * @example * const time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00'); * const time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00'); * const time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00'); * * const property = new Cesium.SampledProperty(Cesium.Rotation); * property.addSample(time1, 0); * property.addSample(time3, Cesium.Math.toRadians(350)); * * //Getting the value at time2 will equal 355 degrees instead * //of 175 degrees (which is what you get if you construct * //a SampledProperty(Number) instead. Note, the actual * //return value is in radians, not degrees. * property.getValue(time2); */ export interface Rotation { } /** * A {@link SampledProperty} which is also a {@link PositionProperty}. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc... */ export class SampledPositionProperty { constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the reference frame in which the position is defined. */ referenceFrame: ReferenceFrame; /** * Gets the degree of interpolation to perform when retrieving a value. Call setInterpolationOptions to set this. */ readonly interpolationDegree: number; /** * Gets the interpolation algorithm to use when retrieving a value. Call setInterpolationOptions to set this. */ readonly interpolationAlgorithm: InterpolationAlgorithm; /** * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc. */ numberOfDerivatives: number; /** * Gets or sets the type of extrapolation to perform when a value * is requested at a time after any available samples. */ forwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate forward before * the property becomes undefined. A value of 0 will extrapolate forever. */ forwardExtrapolationDuration: number; /** * Gets or sets the type of extrapolation to perform when a value * is requested at a time before any available samples. */ backwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate backward * before the property becomes undefined. A value of 0 will extrapolate forever. */ backwardExtrapolationDuration: number; /** * Gets the position at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Cartesian3): Cartesian3 | undefined; /** * Gets the position at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined; /** * Sets the algorithm and degree to use when interpolating a position. * @param [options] - Object with the following properties: * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged. */ setInterpolationOptions(options?: { interpolationAlgorithm?: InterpolationAlgorithm; interpolationDegree?: number; }): void; /** * Adds a new sample. * @param time - The sample time. * @param position - The position at the provided time. * @param [derivatives] - The array of derivative values at the provided time. */ addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void; /** * Adds multiple samples via parallel arrays. * @param times - An array of JulianDate instances where each index is a sample time. * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index. * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index. */ addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void; /** * Adds samples as a single packed array where each new sample is represented as a date, * followed by the packed representation of the corresponding value and derivatives. * @param packedSamples - The array of packed samples. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. */ addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; /** * Removes a sample at the given time, if present. * @param time - The sample time. * @returns true if a sample at time was removed, false otherwise. */ removeSample(time: JulianDate): boolean; /** * Removes all samples for the given time interval. * @param time - The time interval for which to remove all samples. */ removeSamples(time: TimeInterval): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} whose value is interpolated for a given time from the * provided set of samples and specified interpolation algorithm and degree. * @example * //Create a linearly interpolated Cartesian2 * const 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 * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z')); * @example * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation * const 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 * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z')); * @param type - The type of property. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types. */ export class SampledProperty { constructor(type: number | Packable, derivativeTypes?: Packable[]); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the type of property. */ type: any; /** * Gets the derivative types used by this property. */ derivativeTypes: Packable[]; /** * Gets the degree of interpolation to perform when retrieving a value. */ interpolationDegree: number; /** * Gets the interpolation algorithm to use when retrieving a value. */ interpolationAlgorithm: InterpolationAlgorithm; /** * Gets or sets the type of extrapolation to perform when a value * is requested at a time after any available samples. */ forwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate forward before * the property becomes undefined. A value of 0 will extrapolate forever. */ forwardExtrapolationDuration: number; /** * Gets or sets the type of extrapolation to perform when a value * is requested at a time before any available samples. */ backwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate backward * before the property becomes undefined. A value of 0 will extrapolate forever. */ backwardExtrapolationDuration: number; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Sets the algorithm and degree to use when interpolating a value. * @param [options] - Object with the following properties: * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged. */ setInterpolationOptions(options?: { interpolationAlgorithm?: InterpolationAlgorithm; interpolationDegree?: number; }): void; /** * Adds a new sample. * @param time - The sample time. * @param value - The value at the provided time. * @param [derivatives] - The array of derivatives at the provided time. */ addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void; /** * Adds an array of samples. * @param times - An array of JulianDate instances where each index is a sample time. * @param values - The array of values, where each value corresponds to the provided times index. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index. */ addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void; /** * Retrieves the time of the provided sample associated with the index. A negative index accesses the list of samples in reverse order. * @param index - The index of samples list. * @returns The JulianDate time of the sample, or undefined if failed. */ getSample(index: number): JulianDate | undefined; /** * Adds samples as a single packed array where each new sample is represented as a date, * followed by the packed representation of the corresponding value and derivatives. * @param packedSamples - The array of packed samples. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. */ addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; /** * Removes a sample at the given time, if present. * @param time - The sample time. * @returns true if a sample at time was removed, false otherwise. */ removeSample(time: JulianDate): boolean; /** * Removes all samples for the given time interval. * @param time - The time interval for which to remove all samples. */ removeSamples(time: TimeInterval): void; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms. * @param [options] - Object with the following properties: * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}. * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material. * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat. */ export class StripeMaterialProperty { constructor(options?: { orientation?: Property | StripeOrientation; evenColor?: Property | Color; oddColor?: Property | Color; offset?: Property | number; repeat?: Property | number; }); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets or sets the Property specifying the {@link StripeOrientation}/ */ orientation: Property | undefined; /** * Gets or sets the Property specifying the first {@link Color}. */ evenColor: Property | undefined; /** * Gets or sets the Property specifying the second {@link Color}. */ oddColor: Property | undefined; /** * Gets or sets the numeric Property specifying the 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. */ offset: Property | undefined; /** * Gets or sets the numeric Property specifying how many times the stripes repeat. */ repeat: Property | undefined; /** * Gets the {@link Material} type at the provided time. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * Defined the orientation of stripes in {@link StripeMaterialProperty}. */ export enum StripeOrientation { /** * Horizontal orientation. */ HORIZONTAL = 0, /** * Vertical orientation. */ VERTICAL = 1 } /** * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ export class TimeIntervalCollectionPositionProperty { constructor(referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. */ readonly definitionChanged: Event; /** * Gets the interval collection. */ readonly intervals: TimeIntervalCollection; /** * Gets the reference frame in which the position is defined. */ readonly referenceFrame: ReferenceFrame; /** * Gets the value of the property at the provided time in the fixed frame. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): Cartesian3 | undefined; /** * Gets the value of the property at the provided time and in the provided reference frame. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the * data property of each {@link TimeInterval} represents the value at time. * @example * //Create a Cartesian2 interval property which contains data on August 1st, 2012 * //and uses a different value every 6 hours. * const 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) * })); */ export class TimeIntervalCollectionProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. * The definition is changed whenever setValue is called with data different * than the current value. */ readonly definitionChanged: Event; /** * Gets the interval collection. */ readonly intervals: TimeIntervalCollection; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} which evaluates to a {@link Quaternion} rotation * based on the velocity of the provided {@link PositionProperty}. * @example * //Create an entity with position and orientation. * const position = new Cesium.SampledProperty(); * position.addSamples(...); * const entity = viewer.entities.add({ * position : position, * orientation : new Cesium.VelocityOrientationProperty(position) * })); * @param [position] - The position property used to compute the orientation. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid used to determine which way is up. */ export class VelocityOrientationProperty { constructor(position?: PositionProperty, ellipsoid?: Ellipsoid); /** * Gets a value indicating if this property is constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. */ readonly definitionChanged: Event; /** * Gets or sets the position property used to compute orientation. */ position: Property | undefined; /** * Gets or sets the ellipsoid used to determine which way is up. */ ellipsoid: Property | undefined; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Quaternion): Quaternion; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * A {@link Property} which evaluates to a {@link Cartesian3} vector * based on the velocity of the provided {@link PositionProperty}. * @example * //Create an entity with a billboard rotated to match its velocity. * const position = new Cesium.SampledProperty(); * position.addSamples(...); * const entity = viewer.entities.add({ * position : position, * billboard : { * image : 'image.png', * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector * } * })); * @param [position] - The position property used to compute the velocity. * @param [normalize = true] - Whether to normalize the computed velocity vector. */ export class VelocityVectorProperty { constructor(position?: PositionProperty, normalize?: boolean); /** * Gets a value indicating if this property is constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. */ readonly definitionChanged: Event; /** * Gets or sets the position property used to compute the velocity vector. */ position: Property | undefined; /** * Gets or sets whether the vector produced by this property * will be normalized or not. */ normalize: boolean; /** * Gets the value of the property at the provided time. * @param [time = JulianDate.now()] - The time for which to retrieve the value. If omitted, the current system time is used. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time?: JulianDate, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns * true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ equals(other?: Property): boolean; } /** * Defines the interface for visualizers. Visualizers are plug-ins to * {@link DataSourceDisplay} that render data associated with * {@link DataSource} instances. * This object is an interface for documentation purposes and is not intended * to be instantiated directly. */ export class Visualizer { constructor(); /** * Updates the visualization to the provided time. * @param time - The time. * @returns True if the display was updated to the provided time, * false if the visualizer is waiting for an asynchronous operation to * complete before data can be updated. */ update(time: JulianDate): boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes all visualization and cleans up any resources associated with this instance. */ destroy(): void; } /** * A {@link GeometryUpdater} for walls. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ export class WallGeometryUpdater { constructor(entity: Entity, scene: Scene); /** * Creates the geometry instance which represents the fill of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the filled portion of the geometry. */ createFillGeometryInstance(time: JulianDate): GeometryInstance; /** * Creates the geometry instance which represents the outline of the geometry. * @param time - The time to use when retrieving initial attribute values. * @returns The geometry instance representing the outline portion of the geometry. */ createOutlineGeometryInstance(time: JulianDate): GeometryInstance; } export namespace WallGraphics { /** * Initialization options for the WallGraphics constructor * @property [show = true] - A boolean Property specifying the visibility of the wall. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall. * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface. * @property [maximumHeights] - A Property specifying an array of heights to be used for the top of the wall instead of the height of each position. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point. * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material. * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall. * @property [outline = false] - A boolean Property specifying whether the wall is outlined. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed. */ type ConstructorOptions = { show?: Property | boolean; positions?: Property | Cartesian3[]; minimumHeights?: Property | number[]; maximumHeights?: Property | number[]; granularity?: Property | number; fill?: Property | boolean; material?: MaterialProperty | Color; outline?: Property | boolean; outlineColor?: Property | Color; outlineWidth?: Property | number; shadows?: Property | ShadowMode; distanceDisplayCondition?: Property | DistanceDisplayCondition; }; } /** * 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. * @param [options] - Object describing initialization options */ export class WallGraphics { constructor(options?: WallGraphics.ConstructorOptions); /** * Gets the event that is raised whenever a property or sub-property is changed or modified. */ readonly definitionChanged: Event; /** * Gets or sets the boolean Property specifying the visibility of the wall. */ show: Property | undefined; /** * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall. */ positions: Property | undefined; /** * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe. * If defined, the array must be the same length as {@link Wall#positions}. */ minimumHeights: Property | undefined; /** * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position. * If defined, the array must be the same length as {@link Wall#positions}. */ maximumHeights: Property | undefined; /** * Gets or sets the numeric Property specifying the angular distance between points on the wall. */ granularity: Property | undefined; /** * Gets or sets the boolean Property specifying whether the wall is filled with the provided material. */ fill: Property | undefined; /** * Gets or sets the Property specifying the material used to fill the wall. */ material: MaterialProperty; /** * Gets or sets the Property specifying whether the wall is outlined. */ outline: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} of the outline. */ outlineColor: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the outline. *

* Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}. *

*/ outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the wall * casts or receives shadows from light sources. */ shadows: Property | undefined; /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed. */ distanceDisplayCondition: Property | undefined; /** * Duplicates this instance. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new instance if one was not provided. */ clone(result?: WallGraphics): WallGraphics; /** * Assigns each unassigned property on this object to the value * of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: WallGraphics): void; } /** * @property kml - The generated KML. * @property externalFiles - An object dictionary of external files */ export type exportKmlResultKml = { kml: string; externalFiles: { [key: string]: Blob; }; }; /** * @property kmz - The generated kmz file. */ export type exportKmlResultKmz = { kmz: Blob; }; /** * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary * color is used. Canvas objects are exported as PNG images. * @example * Cesium.exportKml({ * entities: entityCollection * }) * .then(function(result) { * // The XML string is in result.kml * * const externalFiles = result.externalFiles * for(const file in externalFiles) { * // file is the name of the file used in the KML document as the href * // externalFiles[file] is a blob with the contents of the file * } * }); * @param options - An object with the following properties: * @param options.entities - The EntityCollection to export as KML. * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid for the output file. * @param [options.modelCallback] - A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML. * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability. * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML. * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file. * @returns A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. */ export function exportKml(options: { entities: EntityCollection; ellipsoid?: Ellipsoid; modelCallback?: exportKmlModelCallback; time?: JulianDate; defaultAvailability?: TimeInterval; sampleDuration?: number; kmz?: boolean; }): Promise; /** * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document. * It can also be used to add additional files to the externalFiles object, which is the list of files embedded in the exported KMZ, * or otherwise returned with the KML string when exporting. * @param model - The ModelGraphics instance for an Entity. * @param time - The time that any properties should use to get the value. * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob. */ export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string; /** * If element is a string, look up the element in the DOM by ID. Otherwise return element. */ export function getElement(): void; /** * Options to control the setting up of a WebGL Context. *

* 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. *

* @property [requestWebgl1 = false] - If true and the browser supports it, use a WebGL 1 rendering context * @property [allowTextureFilterAnisotropic = true] - If true, use anisotropic filtering during texture sampling * @property [webgl] - WebGL options to be passed on to canvas.getContext * @property [getWebGLStub] - A function to create a WebGL stub for testing */ export type ContextOptions = { requestWebgl1?: boolean; allowTextureFilterAnisotropic?: boolean; webgl?: WebGLOptions; getWebGLStub?: (...params: any[]) => any; }; /** * WebGL options to be passed on to HTMLCanvasElement.getContext(). * See {@link https://registry.khronos.org/webgl/specs/latest/1.0/#5.2|WebGLContextAttributes} * but note the modified defaults for 'alpha', 'stencil', and 'powerPreference' * *

* 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 * alpha to true. *

*/ export type WebGLOptions = { alpha?: boolean; depth?: boolean; stencil?: boolean; antialias?: boolean; premultipliedAlpha?: boolean; preserveDrawingBuffer?: boolean; powerPreference?: "default" | "low-power" | "high-performance"; failIfMajorPerformanceCaveat?: boolean; }; /** * Enumerates all possible filters used when magnifying WebGL textures. */ export enum TextureMagnificationFilter { /** * Samples the texture by returning the closest pixel. */ NEAREST = WebGLConstants.NEAREST, /** * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than NEAREST filtering. */ LINEAR = WebGLConstants.LINEAR } /** * Enumerates all possible filters used when minifying WebGL textures. */ export enum TextureMinificationFilter { /** * Samples the texture by returning the closest pixel. */ NEAREST = WebGLConstants.NEAREST, /** * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than NEAREST filtering. */ LINEAR = WebGLConstants.LINEAR, /** * Selects the nearest mip level and applies nearest sampling within that level. *

* Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. *

*/ NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST, /** * Selects the nearest mip level and applies linear sampling within that level. *

* Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. *

*/ LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST, /** * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results. *

* This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. *

*

* Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. *

*/ NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR, /** * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results. *

* This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. *

*

* Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. *

*/ LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR } /** * An appearance defines the full GLSL vertex and fragment shaders and the * render state used to draw a {@link Primitive}. All appearances implement * this base Appearance interface. * @param [options] - Object with the following properties: * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled. * @param [options.closed = false] - When true, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled. * @param [options.material = Material.ColorType] - The material used to determine the fragment color. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class Appearance { constructor(options?: { translucent?: boolean; closed?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * The material used to determine the fragment color. Unlike other {@link Appearance} * properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** * When true, the geometry is expected to appear translucent. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader * source is built procedurally taking into account the {@link Appearance#material}. * Use {@link Appearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. */ readonly renderState: any; /** * When true, the geometry is expected to be closed. */ readonly closed: boolean; /** * Procedurally creates the full GLSL fragment shader source for this appearance * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } /** * ArcGisBaseMapType enumerates the ArcGIS image tile layers that are supported by default. */ export enum ArcGisBaseMapType { SATELLITE = 1, OCEANS = 2, HILLSHADE = 3 } export namespace ArcGisMapServerImageryProvider { /** * Initialization options for the ArcGisMapServerImageryProvider constructor * @property [tileDiscardPolicy] - The policy that determines if a tile * is invalid and should be discarded. If this value is not specified, a default * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case, * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200), * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is * disabled and no tiles are discarded. If any of them have a non-transparent color, any * tile that has the same values in these pixel locations is discarded. The end result of * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this * parameter. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached * tiles are used if they are available. Exporting Tiles is only supported with deprecated APIs. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke * the Identify service on the MapServer and return the features included in the response. If false, * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) * without communicating with the server. Set this property to false if you don't want this provider's features to * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing * a tiled layer. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles. * This parameter is ignored when accessing a tiled server. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If the tilingScheme is specified and used, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the default ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing * a tiled server. */ type ConstructorOptions = { tileDiscardPolicy?: TileDiscardPolicy; usePreCachedTilesIfAvailable?: boolean; layers?: string; enablePickFeatures?: boolean; rectangle?: Rectangle; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; credit?: Credit | string; tileWidth?: number; tileHeight?: number; maximumLevel?: number; }; } /** *
* This object is normally not instantiated directly, use {@link ArcGisMapServerImageryProvider.fromBasemapType} or {@link ArcGisMapServerImageryProvider.fromUrl}. *
* * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are * used, if available. * *
* * An {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token } is required to authenticate requests to an ArcGIS Image Tile service. * To access secure ArcGIS resources, it's required to create an ArcGIS developer * account or an ArcGIS online account, then implement an authentication method to obtain an access token. * @example * // Set the default access token for accessing ArcGIS Image Tile service * Cesium.ArcGisMapService.defaultAccessToken = ""; * * // Add a base layer from a default ArcGIS basemap * const viewer = new Cesium.Viewer("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromProviderAsync( * Cesium.ArcGisMapServerImageryProvider.fromBasemapType( * Cesium.ArcGisBaseMapType.SATELLITE * ) * ), * }); * @example * // Create an imagery provider from the url directly * const esri = await Cesium.ArcGisMapServerImageryProvider.fromUrl( * "https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer", { * token: "" * }); * @param [options] - Object describing initialization options */ export class ArcGisMapServerImageryProvider { constructor(options?: ArcGisMapServerImageryProvider.ConstructorOptions); /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false, * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) * without communicating with the server. */ enablePickFeatures: boolean; /** * Creates an {@link ImageryProvider} which provides tiled imagery from an ArcGIS base map. * @example * // Set the default access token for accessing ArcGIS Image Tile service * Cesium.ArcGisMapService.defaultAccessToken = ""; * * // Add a base layer from a default ArcGIS basemap * const provider = await Cesium.ArcGisMapServerImageryProvider.fromBasemapType( * Cesium.ArcGisBaseMapType.SATELLITE); * @example * // Add a base layer from a default ArcGIS Basemap * const viewer = new Cesium.Viewer("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromProviderAsync( * Cesium.ArcGisMapServerImageryProvider.fromBasemapType( * Cesium.ArcGisBaseMapType.HILLSHADE, { * token: "" * } * ) * ), * }); * @param style - The style of the ArcGIS base map imagery. Valid options are {@link ArcGisBaseMapType.SATELLITE}, {@link ArcGisBaseMapType.OCEANS}, and {@link ArcGisBaseMapType.HILLSHADE}. * @param [options] - Object describing initialization options. * @returns A promise that resolves to the created ArcGisMapServerImageryProvider. */ static fromBasemapType(style: ArcGisBaseMapType, options?: ArcGisMapServerImageryProvider.ConstructorOptions): Promise; /** * Gets the URL of the ArcGIS MapServer. */ readonly url: string; /** * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service. */ readonly token: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether this imagery provider is using pre-cached tiles from the * ArcGIS MapServer. */ readonly usingPrecachedTiles: boolean; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the comma-separated list of layer IDs to show. */ layers: string; /** * Creates an {@link ImageryProvider} which provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are * used, if available. * @example * const esri = await Cesium.ArcGisMapServerImageryProvider.fromUrl( * "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" * ); * @param url - The URL of the ArcGIS MapServer service. * @param [options] - Object describing initialization options. * @returns A promise that resolves to the created ArcGisMapServerImageryProvider. */ static fromUrl(url: Resource | string, options?: ArcGisMapServerImageryProvider.ConstructorOptions): Promise; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * Default options for accessing the ArcGIS image tile service. * * An ArcGIS access token is required to access ArcGIS image tile layers. * A default token is provided for evaluation purposes only. * To obtain an access token, go to {@link https://developers.arcgis.com} and create a free account. * More info can be found in the {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security/ | ArcGIS developer guide}. */ export namespace ArcGisMapService { /** * Gets or sets the default ArcGIS access token. */ var defaultAccessToken: string; /** * Gets or sets the URL of the ArcGIS World Imagery tile service. */ var defaultWorldImageryServer: string | Resource; /** * Gets or sets the URL of the ArcGIS World Hillshade tile service. */ var defaultWorldHillshadeServer: string | Resource; /** * Gets or sets the URL of the ArcGIS World Oceans tile service. */ var defaultWorldOceanServer: string | Resource; function getDefaultTokenCredit(providedKey: string): string | undefined; } /** * Common atmosphere settings used by 3D Tiles and models for rendering sky atmosphere, ground atmosphere, and fog. * *

* This class is not to be confused with {@link SkyAtmosphere}, which is responsible for rendering the sky. *

*

* While the atmosphere settings affect the color of fog, see {@link Fog} to control how fog is rendered. *

* @example * // Turn on dynamic atmosphere lighting using the sun direction * scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.SUNLIGHT; * @example * // Turn on dynamic lighting using whatever light source is in the scene * scene.light = new Cesium.DirectionalLight({ * direction: new Cesium.Cartesian3(1, 0, 0) * }); * scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.SCENE_LIGHT; * @example * // Adjust the color of the atmosphere effects. * scene.atmosphere.hueShift = 0.4; // Cycle 40% around the color wheel * scene.atmosphere.brightnessShift = 0.25; // Increase the brightness * scene.atmosphere.saturationShift = -0.1; // Desaturate the colors */ export class Atmosphere { constructor(); /** * The intensity of the light that is used for computing the ground atmosphere color. */ lightIntensity: number; /** * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere. */ rayleighCoefficient: Cartesian3; /** * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere. */ mieCoefficient: Cartesian3; /** * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters. */ rayleighScaleHeight: number; /** * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters. */ mieScaleHeight: number; /** * The anisotropy of the medium to consider for Mie scattering. *

* Valid values are between -1.0 and 1.0. *

*/ mieAnisotropy: number; /** * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A hue shift of 1.0 indicates a complete rotation of the hues available. */ hueShift: number; /** * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A saturation shift of -1.0 is monochrome. */ saturationShift: number; /** * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A brightness shift of -1.0 is complete darkness, which will let space show through. */ brightnessShift: number; /** * When not DynamicAtmosphereLightingType.NONE, the selected light source will * be used for dynamically lighting all atmosphere-related rendering effects. */ dynamicLighting: DynamicAtmosphereLightingType; /** * Returns true if the atmosphere shader requires a color correct step. * @param atmosphere - The atmosphere instance to check * @returns true if the atmosphere shader requires a color correct step */ static requiresColorCorrect(atmosphere: Atmosphere): boolean; } /** * An enum describing the x, y, and z axes and helper conversion functions. */ export enum Axis { /** * Denotes the x-axis. */ X = 0, /** * Denotes the y-axis. */ Y = 1, /** * Denotes the z-axis. */ Z = 2 } export namespace Azure2DImageryProvider { /** * Initialization options for the Azure2DImageryProvider constructor * @property subscriptionKey - The public subscription key for the imagery. * @property [url = "https://atlas.microsoft.com/"] - The Azure server url. * @property [tilesetId = "microsoft.imagery"] - The Azure tileset ID. Valid options are {@link microsoft.imagery}, {@link microsoft.base.road}, and {@link microsoft.base.labels.road} * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @property [maximumLevel = 22] - The maximum level-of-detail supported by the imagery provider. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. */ type ConstructorOptions = { subscriptionKey: string; url?: string; tilesetId?: string; ellipsoid?: Ellipsoid; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; }; } /** * Provides 2D image tiles from Azure. * @example * // Azure 2D imagery provider * const azureImageryProvider = new Cesium.Azure2DImageryProvider({ * subscriptionKey: "subscription-key", * tilesetId: "microsoft.base.road" * }); * @param options - Object describing initialization options */ export class Azure2DImageryProvider { constructor(options: Azure2DImageryProvider.ConstructorOptions); /** * Gets the URL of the Azure 2D Imagery server. */ readonly url: string; /** * Gets the rectangle, in radians, of the imagery provided by the instance. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. Generally, * a minimum level should only be used when the rectangle of the imagery is small * enough that the number of tiles at the minimum level is small. An imagery * provider with more than a few tiles at the minimum level will lead to * rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[] | undefined; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; } export namespace Billboard { /** * Initialization options for the first param of Billboard constructor * @property position - The cartesian position of the billboard. * @property [id] - A user-defined object to return when the billboard is picked with {@link Scene#pick}. * @property [show = true] - Determines if this billboard will be shown. * @property [image] - A loaded HTMLImageElement, ImageData, or a url to an image to use for the billboard. * @property [scale = 1.0] - A number specifying the uniform scale that is multiplied with the billboard's image size in pixels. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Specifying the pixel offset in screen space from the origin of this billboard. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Specifying the 3D Cartesian offset applied to this billboard in eye coordinates. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A {@link HorizontalOrigin} Specifying the horizontal origin of this billboard. * @property [verticalOrigin = VerticalOrigin.CENTER] - A {@link VerticalOrigin} Specifying the vertical origin of this billboard. * @property [heightReference = HeightReference.NONE] - A {@link HeightReference} Specifying the height reference of this billboard. * @property [color = Color.WHITE] - A {@link Color} Specifying the color that is multiplied with the billboard's texture. * @property [rotation = 0] - A number specifying the rotation angle in radians. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Specifying the aligned axis in world space. * @property [sizeInMeters] - A boolean specifying if the billboard size is in meters or pixels. * @property [width] - A number specifying the width of the billboard. If undefined, the image width will be used. * @property [height] - A number specifying the height of the billboard. If undefined, the image height will be used. * @property [scaleByDistance] - A {@link NearFarScalar} Specifying near and far scaling properties of a Billboard based on the billboard's distance from the camera. * @property [translucencyByDistance] - A {@link NearFarScalar} Specifying near and far translucency properties of a Billboard based on the billboard's distance from the camera. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Specifying near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera. * @property [imageSubRegion] - A {@link BoundingRectangle} Specifying the sub-region of the image to use for the billboard, rather than the entire image. * @property [distanceDisplayCondition] - A {@link DistanceDisplayCondition} Specifying the distance from the camera at which this billboard will be displayed. * @property [disableDepthTestDistance] - The distance from the camera, beyond which, depth testing is disabled—to, for example, prevent clipping against terrain. * @property [splitDirection] - A {@link SplitDirection} Specifying the split property of the billboard. */ type ConstructorOptions = { position: Cartesian3; id?: any; show?: boolean; image?: string | HTMLImageElement | HTMLCanvasElement; scale?: number; pixelOffset?: Cartesian2; eyeOffset?: Cartesian3; horizontalOrigin?: HorizontalOrigin; verticalOrigin?: VerticalOrigin; heightReference?: HeightReference; color?: Color; rotation?: number; alignedAxis?: Cartesian3; sizeInMeters?: boolean; width?: number; height?: number; scaleByDistance?: NearFarScalar; translucencyByDistance?: NearFarScalar; pixelOffsetScaleByDistance?: NearFarScalar; imageSubRegion?: BoundingRectangle; distanceDisplayCondition?: DistanceDisplayCondition; disableDepthTestDistance?: number; splitDirection?: SplitDirection; }; /** * A function that creates an image. * @param id - The identifier of the image to load. */ type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise; } /** *
* A billboard is created and its initial * properties are set by calling {@link BillboardCollection#add}. Do not call the constructor directly. *
* A viewport-aligned image positioned in the 3D scene, that is created * and rendered using a {@link BillboardCollection}. *

*
*
* Example billboards *
* @param options - Object describing initialization options * @param billboardCollection - Instance of BillboardCollection */ export class Billboard { constructor(options: Billboard.ConstructorOptions, billboardCollection: BillboardCollection); /** * Determines if this billboard will be shown. Use this to hide or show a billboard, instead * of removing it and re-adding it to the collection. */ show: boolean; /** * Gets or sets the Cartesian position of this billboard. */ position: Cartesian3; /** * Gets or sets the height reference of this billboard. */ heightReference: HeightReference; /** * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used * to align multiple billboards and labels at the same position, e.g., an image and text. The * screen space origin is the top, left corner of the canvas; x increases from * left to right, and y increases from top to bottom. *

*
* * * *
default
b.pixeloffset = new Cartesian2(50, 25);
* The billboard's origin is indicated by the yellow point. *
*/ pixelOffset: Cartesian2; /** * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined, * scaleByDistance will be disabled. * @example * // Example 1. * // Set a billboard's scaleByDistance to scale by 1.5 when the * // camera is 1500 meters from the billboard and disappear as * // the camera distance approaches 8.0e6 meters. * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); * @example * // Example 2. * // disable scaling by distance * b.scaleByDistance = undefined; */ scaleByDistance: NearFarScalar; /** * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined, * translucencyByDistance will be disabled. * @example * // Example 1. * // Set a billboard's translucency to 1.0 when the * // camera is 1500 meters from the billboard and disappear as * // the camera distance approaches 8.0e6 meters. * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); * @example * // Example 2. * // disable translucency by distance * b.translucencyByDistance = undefined; */ translucencyByDistance: NearFarScalar; /** * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera. * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined, * pixelOffsetScaleByDistance will be disabled. * @example * // Example 1. * // Set a billboard's pixel offset scale to 0.0 when the * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels * // in the y direction the camera distance approaches 8.0e6 meters. * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); * @example * // Example 2. * // disable pixel offset by distance * b.pixelOffsetScaleByDistance = undefined; */ pixelOffsetScaleByDistance: NearFarScalar; /** * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed * coordinate system, where x points towards the viewer's right, y points up, and * z points into the screen. Eye coordinates use the same scale as world and model coordinates, * which is typically meters. *

* An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to * arrange a billboard above its corresponding 3D model. *

* Below, the billboard is positioned at the center of the Earth but an eye offset makes it always * appear on top of the Earth regardless of the viewer's or Earth's orientation. *

*
* * * *
* b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

*
*/ eyeOffset: Cartesian3; /** * Gets or sets the horizontal origin of this billboard, which determines if the billboard is * to the left, center, or right of its anchor position. *

*
*
*
* @example * // Use a bottom, left origin * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; */ horizontalOrigin: HorizontalOrigin; /** * Gets or sets the vertical origin of this billboard, which determines if the billboard is * to the above, below, or at the center of its anchor position. *

*
*
*
* @example * // Use a bottom, left origin * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; */ verticalOrigin: VerticalOrigin; /** * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels. * A scale of 1.0 does not change the size of the billboard; a scale greater than * 1.0 enlarges the billboard; a positive scale less than 1.0 shrinks * the billboard. *

*
*
* From left to right in the above image, the scales are 0.5, 1.0, * and 2.0. *
*/ scale: number; /** * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First, * the same white texture may be used by many different billboards, each with a different color, to create * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below. * An alpha of 0.0 makes the billboard transparent, and 1.0 makes the billboard opaque. *

*
* * * *
default
alpha : 0.5
*
*
* The red, green, blue, and alpha values are indicated by value's red, green, * blue, and alpha properties as shown in Example 1. These components range from 0.0 * (no intensity) to 1.0 (full intensity). * @example * // Example 1. Assign yellow. * b.color = Cesium.Color.YELLOW; * @example * // Example 2. Make a billboard 50% translucent. * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); */ color: Color; /** * Gets or sets the rotation angle in radians. */ rotation: number; /** * The aligned axis is the direction vector that the billboard up vector points towards. * The default is the zero vector, which means the billboard is aligned to the screen up vector. * Note that only the zero vector (0,0,0) resets the alignment to screen up. * @example * // Example 1. * // Have the billboard up vector point north * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; * @example * // Example 2. * // Have the billboard point east. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; * billboard.rotation = -Cesium.Math.PI_OVER_TWO; * @example * // Example 3. * // Reset the aligned axis * billboard.alignedAxis = Cesium.Cartesian3.ZERO; */ alignedAxis: Cartesian3; /** * Gets or sets a width for the billboard. If undefined, the image width will be used. */ width: number | undefined; /** * Gets or sets a height for the billboard. If undefined, the image height will be used. */ height: number | undefined; /** * Gets or sets if the billboard size is in meters or pixels. true to size the billboard in meters; * otherwise, the size is in pixels. */ sizeInMeters: boolean; /** * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed. */ distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the distance from the camera, beyond which, depth testing is disbaled—to, * for example, prevent clipping against terrain. When set to undefined or * 0, the depth test is always applied. When set to * Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: number | undefined; /** * Gets or sets the user-defined object returned when the billboard is picked. */ id: any; /** *

* Gets or sets the image to be used for this billboard. If a texture has already been created for the * given image, the existing texture is used. *

*

* This property can be set to a loaded Image, a URL which will be loaded as an Image automatically, * a canvas, or another billboard's image property (from the same billboard collection). *

* @example * // load an image from a URL * b.image = 'some/image/url.png'; * * // assuming b1 and b2 are billboards in the same billboard collection, * // use the same image for both billboards. * b2.image = b1.image; */ image: string; /** * When true, this billboard is ready to render, i.e., the image * has been downloaded and the WebGL resources are created. */ readonly ready: boolean; /** * Gets or sets the {@link SplitDirection} of this billboard. */ splitDirection: SplitDirection; /** *

* Sets the image to be used for this billboard. If a texture has already been created for the * given id, the existing texture is used. *

*

* This function is useful for dynamically creating textures that are shared across many billboards. * Only the first billboard will actually call the function and create the texture, while subsequent * billboards created with the same id will simply re-use the existing texture. *

*

* To load an image from a URL, setting the {@link Billboard#image} property is more convenient. *

* @example * // create a billboard image dynamically * function drawImage(id) { * // create and draw an image using a canvas * const canvas = document.createElement('canvas'); * const context2D = canvas.getContext('2d'); * // ... draw image * return canvas; * } * // drawImage will be called to create the texture * b.setImage('myImage', drawImage); * * // subsequent billboards created in the same collection using the same id will use the existing * // texture, without the need to create the canvas or draw the image * b2.setImage('myImage', drawImage); * @param id - The id of the image. This can be any string that uniquely identifies the image. * @param image - The image to load. This parameter * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically, * or a function which will be called to create the image if it hasn't been loaded already. */ setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void; /** * Uses a sub-region of the image with the given id as the image for this billboard, * measured in pixels from the bottom-left. * @param id - The id of the image to use. * @param subRegion - The sub-region of the image. */ setImageSubRegion(id: string, subRegion: BoundingRectangle): void; /** * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets. * The screen space origin is the top, left corner of the canvas; x increases from * left to right, and y increases from top to bottom. * @example * console.log(b.computeScreenSpacePosition(scene).toString()); * @param scene - The scene. * @param [result] - The object onto which to store the result. * @returns The screen-space position of the billboard. */ computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; /** * Determines if this billboard equals another billboard. Billboards are equal if all their properties * are equal. Billboards in different collections can be equal. * @param [other] - The billboard to compare for equality. * @returns true if the billboards are equal; otherwise, false. */ equals(other?: Billboard): boolean; } /** * 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 {@link BillboardCollection#add} * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures * for images with the same identifier. * @example * // Create a billboard collection with two billboards * const 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' * }); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent, * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. * @param [options.show = true] - Determines if the billboards in the collection will be shown. * @param [options.coarseDepthTestDistance] - The distance from the camera, beyond which, billboards are depth-tested against an approximation of the globe ellipsoid rather than against the full globe depth buffer. If unspecified, the default value is determined relative to the value of {@link Ellipsoid.default}. * @param [options.threePointDepthTestDistance] - The distance from the camera, within which, billboards with a {@link Billboard#heightReference} value of {@link HeightReference.CLAMP_TO_GROUND} or {@link HeightReference.CLAMP_TO_TERRAIN} are depth tested against three key points. This ensures that if any key point of the billboard is visible, the whole billboard will be visible. If unspecified, the default value is determined relative to the value of {@link Ellipsoid.default}. */ export class BillboardCollection { constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean; scene?: Scene; blendOption?: BlendOption; show?: boolean; coarseDepthTestDistance?: number; threePointDepthTestDistance?: number; }); /** * Determines if billboards in this collection will be shown. */ show: boolean; /** * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates. * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates. * Local reference frames can be used by providing a different transformation matrix, like that returned * by {@link Transforms.eastNorthUpToFixedFrame}. * @example * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); * billboards.add({ * image : 'url/to/image', * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center * }); * billboards.add({ * image : 'url/to/image', * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east * }); * billboards.add({ * image : 'url/to/image', * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north * }); * billboards.add({ * image : 'url/to/image', * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up * }); */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the texture atlas for this BillboardCollection as a fullscreen quad. *

*/ debugShowTextureAtlas: boolean; /** * The billboard blending option. The default is used for rendering both opaque and translucent billboards. * However, if either all of the billboards are completely opaque or all are completely translucent, * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve * performance by up to 2x. */ blendOption: BlendOption; /** * Returns the number of billboards in this collection. This is commonly used with * {@link BillboardCollection#get} to iterate over all the billboards * in the collection. */ readonly length: number; /** * The distance from the camera, beyond which, billboards are depth-tested against an approximation of * the globe ellipsoid rather than against the full globe depth buffer. When set to 0, the * approximate depth test is always applied. When set to Number.POSITIVE_INFINITY, the * approximate depth test is never applied. *

* This setting only applies when a billboard's {@link Billboard#disableDepthTestDistance} value would * otherwise allow depth testing—i.e., distance from the camera to the billboard is less than a * billboard's {@link Billboard#disableDepthTestDistance} value. */ coarseDepthTestDistance: number; /** * The distance from the camera, within which, billboards with a {@link Billboard#heightReference} value * of {@link HeightReference.CLAMP_TO_GROUND} or {@link HeightReference.CLAMP_TO_TERRAIN} are depth tested * against three key points. This ensures that if any key point of the billboard is visible, the whole * billboard will be visible. When set to 0, this feature is disabled and portions of a * billboards behind terrain be clipped. *

* This setting only applies when a billboard's {@link Billboard#disableDepthTestDistance} value would * otherwise allow depth testing—i.e., distance from the camera to the billboard is less than a * billboard's {@link Billboard#disableDepthTestDistance} value. */ threePointDepthTestDistance: number; /** * Creates and adds a billboard with the specified initial properties to the collection. * The added billboard is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a billboard, specifying all the default values. * const b = billboards.add({ * show : true, * position : Cesium.Cartesian3.ZERO, * pixelOffset : Cesium.Cartesian2.ZERO, * eyeOffset : Cesium.Cartesian3.ZERO, * heightReference : Cesium.HeightReference.NONE, * horizontalOrigin : Cesium.HorizontalOrigin.CENTER, * verticalOrigin : Cesium.VerticalOrigin.CENTER, * scale : 1.0, * image : 'url/to/image', * imageSubRegion : undefined, * color : Cesium.Color.WHITE, * id : undefined, * rotation : 0.0, * alignedAxis : Cesium.Cartesian3.ZERO, * width : undefined, * height : undefined, * scaleByDistance : undefined, * translucencyByDistance : undefined, * pixelOffsetScaleByDistance : undefined, * sizeInMeters : false, * distanceDisplayCondition : undefined * }); * @example * // Example 2: Specify only the billboard's cartographic position. * const b = billboards.add({ * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) * }); * @param [options] - A template describing the billboard's properties as shown in Example 1. * @returns The billboard that was added to the collection. */ add(options?: Billboard.ConstructorOptions): Billboard; /** * Removes a billboard from the collection. * @example * const b = billboards.add(...); * billboards.remove(b); // Returns true * @param billboard - The billboard to remove. * @returns true if the billboard was removed; false if the billboard was not found in the collection. */ remove(billboard: Billboard): boolean; /** * Removes all billboards from the collection. * @example * billboards.add(...); * billboards.add(...); * billboards.removeAll(); */ removeAll(): void; /** * Check whether this collection contains a given billboard. * @param [billboard] - The billboard to check for. * @returns true if this collection contains the billboard, false otherwise. */ contains(billboard?: Billboard): boolean; /** * Returns the billboard in the collection at the specified index. Indices are zero-based * and increase as billboards are added. Removing a billboard shifts all billboards after * it to the left, changing their indices. This function is commonly used with * {@link BillboardCollection#length} to iterate over all the billboards * in the collection. * @example * // Toggle the show property of every billboard in the collection * const len = billboards.length; * for (let i = 0; i < len; ++i) { * const b = billboards.get(i); * b.show = !b.show; * } * @param index - The zero-based index of the billboard. * @returns The billboard at the specified index. */ get(index: number): Billboard; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * billboards = billboards && billboards.destroy(); */ destroy(): void; } export namespace BingMapsImageryProvider { /** * Initialization options for the BingMapsImageryProvider constructor * @property [key] - The Bing Maps key for your application, which can be * created at {@link https://www.bingmapsportal.com/}. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'. * By default, tiles are loaded using the same protocol as the page. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load. * @property [mapLayer] - Additional display layer options as defined on {@link https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#template-parameters} * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} * for information on the supported cultures. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [tileDiscardPolicy] - The policy that determines if a tile * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy} * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter. */ type ConstructorOptions = { key?: string; tileProtocol?: string; mapStyle?: BingMapsStyle; mapLayer?: string; culture?: string; ellipsoid?: Ellipsoid; tileDiscardPolicy?: TileDiscardPolicy; }; } /** *
* To construct a BingMapsImageryProvider, call {@link BingMapsImageryProvider.fromUrl}. Do not call the constructor directly. *
* * Provides tiled imagery using the Bing Maps Imagery REST API. * @example * const bing = await Cesium.BingMapsImageryProvider.fromUrl( * "https://dev.virtualearth.net", { * key: "get-yours-at-https://www.bingmapsportal.com/", * mapStyle: Cesium.BingMapsStyle.AERIAL * }); * @param options - Object describing initialization options */ export class BingMapsImageryProvider { constructor(options: BingMapsImageryProvider.ConstructorOptions); /** * Gets the name of the BingMaps server url hosting the imagery. */ readonly url: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the Bing Maps key. */ readonly key: string; /** * Gets the type of Bing Maps imagery to load. */ readonly mapStyle: BingMapsStyle; /** * Gets the additional map layer options as defined in {@link https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#template-parameters}/ */ readonly mapLayer: string; /** * The culture to use when requesting Bing Maps imagery. Not * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} * for information on the supported cultures. */ readonly culture: string; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage * and texture upload time. */ readonly hasAlphaChannel: boolean; /** * Creates an {@link ImageryProvider} which provides tiled imagery using the Bing Maps Imagery REST API. * @example * const bing = await Cesium.BingMapsImageryProvider.fromUrl( * "https://dev.virtualearth.net", { * key: "get-yours-at-https://www.bingmapsportal.com/", * mapStyle: Cesium.BingMapsStyle.AERIAL * }); * @param url - The url of the Bing Maps server hosting the imagery. * @param options - Object describing initialization options * @returns A promise that resolves to the created BingMapsImageryProvider */ static fromUrl(url: Resource | string, options: BingMapsImageryProvider.ConstructorOptions): Promise; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; /** * Converts a tiles (x, y, level) position into a quadkey used to request an image * from a Bing Maps server. * @param x - The tile's x coordinate. * @param y - The tile's y coordinate. * @param level - The tile's zoom level. */ static tileXYToQuadKey(x: number, y: number, level: number): void; /** * Converts a tile's quadkey used to request an image from a Bing Maps server into the * (x, y, level) position. * @param quadkey - The tile's quad key */ static quadKeyToTileXY(quadkey: string): void; /** * Gets or sets the URL to the Bing logo for display in the credit. */ static logoUrl: string; } /** * The types of imagery provided by Bing Maps. */ export enum BingMapsStyle { /** * Aerial imagery. */ AERIAL = "Aerial", /** * Aerial imagery with a road overlay. */ AERIAL_WITH_LABELS = "AerialWithLabels", /** * Aerial imagery with a road overlay. */ AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand", /** * Roads without additional imagery. */ ROAD = "Road", /** * Roads without additional imagery. */ ROAD_ON_DEMAND = "RoadOnDemand", /** * A dark version of the road maps. */ CANVAS_DARK = "CanvasDark", /** * A lighter version of the road maps. */ CANVAS_LIGHT = "CanvasLight", /** * A grayscale version of the road maps. */ CANVAS_GRAY = "CanvasGray", /** * Ordnance Survey imagery. This imagery is visible only for the London, UK area. */ ORDNANCE_SURVEY = "OrdnanceSurvey", /** * Collins Bart imagery. */ COLLINS_BART = "CollinsBart" } /** * Determines how two pixels' values are combined. */ export enum BlendEquation { /** * Pixel values are added componentwise. This is used in additive blending for translucency. */ ADD = WebGLConstants.FUNC_ADD, /** * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency. */ SUBTRACT = WebGLConstants.FUNC_SUBTRACT, /** * Pixel values are subtracted componentwise (destination - source). */ REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT, /** * Pixel values are given to the minimum function (min(source, destination)). * * This equation operates on each pixel color component. */ MIN = WebGLConstants.MIN, /** * Pixel values are given to the maximum function (max(source, destination)). * * This equation operates on each pixel color component. */ MAX = WebGLConstants.MAX } /** * Determines how blending factors are computed. */ export enum BlendFunction { /** * The blend factor is zero. */ ZERO = WebGLConstants.ZERO, /** * The blend factor is one. */ ONE = WebGLConstants.ONE, /** * The blend factor is the source color. */ SOURCE_COLOR = WebGLConstants.SRC_COLOR, /** * The blend factor is one minus the source color. */ ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR, /** * The blend factor is the destination color. */ DESTINATION_COLOR = WebGLConstants.DST_COLOR, /** * The blend factor is one minus the destination color. */ ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR, /** * The blend factor is the source alpha. */ SOURCE_ALPHA = WebGLConstants.SRC_ALPHA, /** * The blend factor is one minus the source alpha. */ ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA, /** * The blend factor is the destination alpha. */ DESTINATION_ALPHA = WebGLConstants.DST_ALPHA, /** * The blend factor is one minus the destination alpha. */ ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA, /** * The blend factor is the constant color. */ CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR, /** * The blend factor is one minus the constant color. */ ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR, /** * The blend factor is the constant alpha. */ CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA, /** * The blend factor is one minus the constant alpha. */ ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA, /** * The blend factor is the saturated source alpha. */ SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE } /** * Determines how opaque and translucent parts of primitives in a collection are blended * with the scene. Collections differ in the render pass, blending, and depth behavior * they select for each option; see the blendOption documentation of the * collection in question. */ export enum BlendOption { /** * The primitives in the collection are completely opaque. */ OPAQUE = 0, /** * The primitives in the collection are completely translucent. */ TRANSLUCENT = 1, /** * The primitives in the collection are both opaque and translucent, and each primitive * is drawn according to its own opacity. */ OPAQUE_AND_TRANSLUCENT = 2 } /** * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the * enabled flag to define the full blending state for combining source and * destination fragments when rendering. *

* This is a helper when using custom render states with {@link Appearance#renderState}. *

*/ export namespace BlendingState { /** * Blending is disabled. */ const DISABLED: any; /** * Blending is enabled using alpha blending, source(source.alpha) + destination(1 - source.alpha). */ const ALPHA_BLEND: any; /** * Blending is enabled using alpha blending with premultiplied alpha, source + destination(1 - source.alpha). */ const PRE_MULTIPLIED_ALPHA_BLEND: any; /** * Blending is enabled using additive blending, source(source.alpha) + destination. */ const ADDITIVE_BLEND: any; } /** * A ParticleEmitter that emits particles within a box. * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box. * @param dimensions - The width, height and depth dimensions of the box. */ export class BoxEmitter { constructor(dimensions: Cartesian3); /** * The width, height and depth dimensions of the box in meters. */ dimensions: Cartesian3; } /** * View bound to the underlying buffer data of a {@link BufferPointCollection}. * *

BufferPoint instances are {@link https://en.wikipedia.org/wiki/Flyweight_pattern|flyweights}: * a single BufferPoint instance can be temporarily bound to any conceptual * "point" in a BufferPointCollection, allowing very large collections to be * iterated and updated with a minimal memory footprint.

* * Represented as one (1) position. */ export class BufferPoint extends BufferPrimitive { /** * Copies data from source point to result. */ static clone(point: BufferPoint, result: BufferPoint): BufferPoint; /** * Count of positions (vertices) in this primitive. Always 1. */ readonly vertexCount: number; /** * Gets the position of this point. */ getPosition(result?: Cartesian3): Cartesian3; /** * Sets the position of this point. */ setPosition(position: Cartesian3): void; /** * Returns a JSON-serializable object representing the point. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; } /** * @property [modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. */ export type BufferPointOptions = { modelMatrix?: Matrix4; show?: boolean; material?: BufferPointMaterial; featureId?: number; pickObject?: any; position?: Cartesian3; }; /** * Collection of points held in ArrayBuffer storage for performance and memory optimization. * *

Default buffer memory allocation is arbitrary, and collections cannot be resized, * so specific per-buffer capacities should be provided in the collection * constructor when available.

* @example * const collection = new BufferPointCollection({primitiveCountMax: 1024}); * * const point = new BufferPoint(); * const material = new BufferPointMaterial({color: Color.WHITE}); * * // Create a new point, temporarily bound to 'point' local variable. * collection.add({ * position: new Cartesian3(0.0, 0.0, 0.0), * material * }, point); * * // Iterate over all points in collection, temporarily binding 'point' * // local variable to each, and updating point material. * for (let i = 0; i < collection.primitiveCount; i++) { * collection.get(i, point); * point.setMaterial(material); * } * @param [options.modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. * @param [options.allowPicking = false] - When true, primitives are pickable with {@link Scene#pick}. When false, memory and initialization cost are lower. * @param [options.boundingVolume] - Bounding volume, in world space, for the collection. When * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume * manually, and updating it only as needed, will improve performance for larger dynamic collections. * @param [options.blendOption = BlendOption.TRANSLUCENT] - Determines how primitives in the collection are blended with the scene. Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. */ export class BufferPointCollection extends BufferPrimitiveCollection { constructor(options: { modelMatrix?: Matrix4; primitiveCountMax?: number; positionDatatype?: ComponentDatatype; positionNormalized?: boolean; show?: boolean; allowPicking?: boolean; boundingVolume?: BoundingSphere; debugShowBoundingVolume?: boolean; blendOption?: BlendOption; }); /** * Adds a new point to the collection, with the specified options. A * {@link BufferPoint} instance is linked to the new point, using * the 'result' argument if given, or a new instance if not. For repeated * calls, prefer to reuse a single BufferPoint instance rather than * allocating a new instance on each call. */ add(options: BufferPointOptions, result: BufferPoint): BufferPoint; /** * Updates vertex positions over the specified range of primitives. For * position-only updates to many primitives, `setPositions()` is more * efficient than updating each primitive individually. * * Argument `positions` must contain the same total number of vertices as the * target primitive range; vertices cannot be added/removed by this method. */ setPositions(positions: TypedArray, primitiveOffset: number, primitiveCount: number): void; } /** * @property [color = Color.WHITE] - Color of fill. * @property [outlineColor = Color.WHITE] - Color of outline. * @property [outlineWidth = 0.0] - Width of outline, 0-255px. * @property [size = 1.0] - Size of point, 0-255px. */ export type BufferPointMaterialOptions = { color?: Color; outlineColor?: Color; outlineWidth?: number; size?: number; }; /** * Material description for a {@link BufferPoint}. * *

BufferPointMaterial objects are {@link Packable|packable}, stored * when calling {@link BufferPoint#setMaterial}. Subsequent changes to the * material will not affect the point until setMaterial() is called again.

*/ export class BufferPointMaterial extends BufferPrimitiveMaterial { constructor(options?: BufferPointMaterialOptions); /** * Size of point, 0-255px. */ size: number; static pack(material: BufferPointMaterial, view: DataView, byteOffset: number): void; static unpack(view: DataView, byteOffset: number, result: BufferPointMaterial): BufferPointMaterial; /** * Returns a JSON-serializable object representing the material. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; /** * Color of fill. */ color: Color; /** * Color of outline. */ outlineColor: Color; /** * Width of outline, 0-255px. */ outlineWidth: number; } /** * View bound to the underlying buffer data of a {@link BufferPolygonCollection}. * *

BufferPolygon instances are {@link https://en.wikipedia.org/wiki/Flyweight_pattern|flyweights}: * a single BufferPolygon instance can be temporarily bound to any conceptual * "polygon" in a BufferPolygonCollection, allowing very large collections to be * iterated and updated with a minimal memory footprint.

* *

Represented as one (1) external linear ring of three (3) or more positions. * May optionally define one or more internal linear rings ("holes") within the * polygon. Each hole is represented as a single index into the positions array, * where the vertex at that index is the start of an internal linear ring that * continues along the following vertices until reaching either the vertex * index of the next hole, or the end of the vertex list. Stores a precomputed * triangulation, represented as three vertex indices per triangle.

*/ export class BufferPolygon extends BufferPrimitive { /** * Copies data from source polygon to result. If the result polygon is not * new (the last polygon in the collection) then source and result polygons * must have the same vertex counts, hole counts, and triangle counts. */ static clone(polygon: BufferPolygon, result: BufferPolygon): BufferPolygon; /** * Count of positions (vertices) in this polygon, including both outer ring and * internal rings (holes), number of VEC3 elements. */ readonly vertexCount: number; /** * Returns an array view of this polygon's vertex positions. If 'result' * argument is given, vertex positions are written to that array and returned. * Otherwise, returns an ArrayView on collection memory — changes to this array * will not trigger render updates, which requires `.setPositions()`. * @param [result] - return {TypedArray} */ getPositions(result?: TypedArray): void; setPositions(positions: TypedArray): void; /** * Offset in collection position array to first vertex in polygon's outer * linear ring, number of VEC3 elements. */ readonly outerVertexOffset: number; /** * Count of positions (vertices) in this polygon's outer linear ring, number * of VEC3 elements. */ readonly outerVertexCount: number; /** * Returns an array view of this polygon's outer linear ring vertex positions. * If 'result' argument is given, vertex positions are written to that array * and returned. Otherwise, returns an ArrayView on collection memory — * changes to this array will not trigger render updates, which requires * `.setPositions()`. */ getOuterPositions(result?: TypedArray): TypedArray; /** * Count of holes (indices) in this polygon. */ readonly holeCount: number; /** * Gets this polygon's hole indices, with each hole represented as a single * offset into this polygon's positions array. Each hole implicitly * continues along an internal linear ring from that vertex offset until * reaching either the end of the positions array, or the next hole offset. * * If 'result' argument is given, hole indices are written to that array and * returned. Otherwise, returns an ArrayView on collection memory — changes * to this array will not trigger render updates, which requires `.setHoles()`. */ getHoles(result?: TypedArray): TypedArray; /** * Sets this polygon's hole indices, with holes represented as a single * offset into this polygon's positions array. Each hole implicitly * continues along an internal linear ring from that vertex offset until * reaching either the end of the positions array, or the next hole offset. */ setHoles(holes: TypedArray): void; /** * Returns the number of (VEC3) vertices in the specified hole. */ getHoleVertexCount(holeIndex: number): number; /** * Returns an array view of the inner linear ring vertex positions for the * specified hole. If 'result' argument is given, vertex positions are written * to that array and returned. Otherwise, returns an ArrayView on collection * memory — changes to this array will not trigger render updates, which * requires `.setPositions()`. * @param [result] - return {TypedArray} */ getHolePositions(holeIndex: number, result?: TypedArray): void; /** * Count of triangles in this polygon, number of VEC3 elements. */ readonly triangleCount: number; /** * Returns an array view of this polygon's triangle indices, represented as * three vertex indices per triangle. * * If 'result' argument is given, triangle indices are written to that array * and returned. Otherwise, returns an ArrayView on collection memory — * changes to this array will not trigger render updates, which requires * `.setTriangles()`. */ getTriangles(result?: TypedArray): TypedArray; /** * Sets this polygon's triangle indices, represented as three vertex indices * per triangle. */ setTriangles(indices: TypedArray): void; /** * Returns a JSON-serializable object representing the polygon. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; } /** * @property [modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. */ export type BufferPolygonOptions = { modelMatrix?: Matrix4; show?: boolean; material?: BufferPolygonMaterial; featureId?: number; pickObject?: any; positions?: TypedArray; holes?: TypedArray; triangles?: TypedArray; }; /** * @property [primitiveCountMax = BufferPrimitiveCollection.DEFAULT_CAPACITY] - Maximum number of polygons. * @property [vertexCountMax = BufferPrimitiveCollection.DEFAULT_CAPACITY] - Maximum number of vertices. * @property [holeCountMax = BufferPrimitiveCollection.DEFAULT_CAPACITY] - Maximum number of holes. * @property [triangleCountMax = BufferPrimitiveCollection.DEFAULT_CAPACITY] - Maximum number of triangles. * @property [positionDatatype = ComponentDatatype.DOUBLE] - The component datatype used to store position values. * @property [positionNormalized = false] - When true, integer position values are treated as normalized, * where the full integer range maps to [-1, 1] (signed) or [0, 1] (unsigned). Only relevant for integer position datatypes * (BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT). * @property [allowPicking = true] - When true, primitives are pickable with {@link Scene#pick}. When false, memory and initialization cost are lower. * @property [boundingVolume] - Bounding volume, in world space, for the collection. When * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume * manually, and updating it only as needed, will improve performance for larger dynamic collections. * @property [blendOption = BlendOption.TRANSLUCENT] - Determines how primitives in the collection are blended with the scene. Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. * @property [heightReference = HeightReference.NONE] - When set to a clamping value, the * collection is draped onto terrain and/or 3D Tiles, rather than drawn as geometry of its own. */ export type BufferPolygonCollectionOptions = { primitiveCountMax?: number; vertexCountMax?: number; holeCountMax?: number; triangleCountMax?: number; positionDatatype?: ComponentDatatype; positionNormalized?: boolean; show?: boolean; allowPicking?: boolean; boundingVolume?: BoundingSphere; debugShowBoundingVolume?: boolean; blendOption?: BlendOption; heightReference?: HeightReference; }; /** * Collection of polygons held in ArrayBuffer storage for performance and memory optimization. * *

Default buffer memory allocation is arbitrary, and collections cannot be resized, * so specific per-buffer capacities should be provided in the collection * constructor when available.

* @example * import earcut from "earcut"; * * const collection = new BufferPolygonCollection({ * primitiveCountMax: 1024, * vertexCountMax: 4096, * holeCountMax: 1024, * triangleCountMax: 2048, * }); * * const polygon = new BufferPolygon(); * const positions = [ ... ]; * const holes = [ ... ]; * const material = new BufferPolygonMaterial({color: Color.WHITE}); * * // Create a new polygon, temporarily bound to 'polygon' local variable. * collection.add({ * positions: new Float64Array(positions), * holes: new Uint32Array(holes), * triangles: new Uint32Array(earcut(positions, holes, 3)), * material * }, polygon); * * // Iterate over all polygons in collection, temporarily binding 'polygon' * // local variable to each, and updating polygon material. * for (let i = 0; i < collection.primitiveCount; i++) { * collection.get(i, polygon); * polygon.setMaterial(material); * } */ export class BufferPolygonCollection extends BufferPrimitiveCollection { constructor(options?: BufferPolygonCollectionOptions); /** * Duplicates the contents of this collection into the result collection. * Result collection is not resized, and must contain enough space for all * primitives in the source collection. Existing polygons in the result * collection will be overwritten. * *

Useful when allocating more space for a collection that has reached its * capacity, and efficiently transferring polygons to the new collection.

* @example * const result = new BufferPolygonCollection({ ... }); // allocate larger 'result' collection * BufferPolygonCollection.clone(collection, result); // copy polygons from 'collection' into 'result' * @param [predicate] - When provided, only polygons for which this returns true are copied. Surviving polygons are compacted into contiguous indices. */ static clone(collection: BufferPolygonCollection, result: BufferPolygonCollection, predicate?: (...params: any[]) => any): BufferPolygonCollection; /** * Returns a copy of the given collection, overriding any constructor options * provided. Omitted options are inherited from the source collection. Any * resized buffers must be large enough to hold every polygon. * @param collection - Source collection to copy. * @param [options] - Constructor options to override. Omitted options are inherited from the source collection. * @param [predicate] - When provided, only polygons for which this returns true are copied. Surviving polygons are compacted into contiguous indices. */ static fromCollection(collection: BufferPolygonCollection, options?: BufferPolygonCollectionOptions, predicate?: (...params: any[]) => any): BufferPolygonCollection; /** * Adds a new polygon to the collection, with the specified options. A * {@link BufferPolygon} instance is linked to the new polygon, using * the 'result' argument if given, or a new instance if not. For repeated * calls, prefer to reuse a single BufferPolygon instance rather than * allocating a new instance on each call. */ add(options: BufferPolygonOptions, result: BufferPolygon): BufferPolygon; /** * Total byte length of buffers owned by this collection. Includes any unused * space allocated by {@link primitiveCountMax}, even if no polygons have * yet been added in that space. */ readonly byteLength: number; /** * Number of holes in collection. Must be <= {@link holeCountMax}. */ readonly holeCount: number; /** * Maximum number of holes in collection. Must be >= {@link holeCount}. */ readonly holeCountMax: number; /** * Number of triangles in collection. Must be <= {@link triangleCountMax}. */ readonly triangleCount: number; /** * Maximum number of triangles in collection. Must be >= {@link triangleCount}. */ readonly triangleCountMax: number; /** * Updates vertex positions over the specified range of primitives. For * position-only updates to many primitives, `setPositions()` is more * efficient than updating each primitive individually. * * Argument `positions` must contain the same total number of vertices as the * target primitive range; vertices cannot be added/removed by this method. */ setPositions(positions: TypedArray, primitiveOffset: number, primitiveCount: number): void; } /** * @property [color = Color.WHITE] - Color of fill. * @property [outlineColor = Color.WHITE] - Color of outline. * @property [outlineWidth = 0.0] - Width of outline, 0-255px. */ export type BufferPolygonMaterialOptions = { color?: Color; outlineColor?: Color; outlineWidth?: number; }; /** * Material description for a {@link BufferPolygon}. * *

BufferPolygonMaterial objects are {@link Packable|packable}, stored * when calling {@link BufferPolygon#setMaterial}. Subsequent changes to the * material will not affect the polygon until setMaterial() is called again.

*/ export class BufferPolygonMaterial extends BufferPrimitiveMaterial { constructor(options?: BufferPolygonMaterialOptions); /** * Color of fill. */ color: Color; /** * Color of outline. */ outlineColor: Color; /** * Width of outline, 0-255px. */ outlineWidth: number; /** * Returns a JSON-serializable object representing the material. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; } /** * View bound to the underlying buffer data of a {@link BufferPolylineCollection}. * *

BufferPolyline instances are {@link https://en.wikipedia.org/wiki/Flyweight_pattern|flyweights}: * a single BufferPolyline instance can be temporarily bound to any conceptual * "polyline" in a BufferPolylineCollection, allowing very large collections to be * iterated and updated with a minimal memory footprint.

* * Represented as two (2) or more positions. */ export class BufferPolyline extends BufferPrimitive { /** * Copies data from source polyline to result. If the result polyline is not * new (the last polyline in the collection) then source and result polylines * must have the same vertex counts. */ static clone(polyline: BufferPolyline, result: BufferPolyline): BufferPolyline; /** * Count of positions (vertices) in this polyline, number of VEC3 elements. */ readonly vertexCount: number; /** * Returns an array view of this polyline's vertex positions. If 'result' * argument is given, vertex positions are written to that array and returned. * Otherwise, returns an ArrayView on collection memory — changes to this array * will not trigger render updates, which requires `.setPositions()`. * @param [result] - return {TypedArray} */ getPositions(result?: TypedArray): void; setPositions(positions: TypedArray): void; /** * Returns a JSON-serializable object representing the polyline. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; } /** * @property [modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. */ export type BufferPolylineOptions = { modelMatrix?: Matrix4; show?: boolean; material?: BufferPolylineMaterial; featureId?: number; pickObject?: any; positions?: TypedArray; }; /** * Collection of polylines held in ArrayBuffer storage for performance and memory optimization. * *

Default buffer memory allocation is arbitrary, and collections cannot be resized, * so specific per-buffer capacities should be provided in the collection * constructor when available.

* @example * const collection = new BufferPolylineCollection({ * primitiveCountMax: 1024, * vertexCountMax: 4096, * }); * * const polyline = new BufferPolyline(); * const material = new BufferPolylineMaterial({color: Color.WHITE}); * * // Create a new polyline, temporarily bound to 'polyline' local variable. * collection.add({ * positions: new Float64Array([ ... ]), * material, * }, polyline); * * // Iterate over all polylines in collection, temporarily binding 'polyline' * // local variable to each, and updating polyline material. * for (let i = 0; i < collection.primitiveCount; i++) { * collection.get(i, polyline); * polyline.setMaterial(material); * } * @param [options.modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. * @param [options.allowPicking = false] - When true, primitives are pickable with {@link Scene#pick}. When false, memory and initialization cost are lower. * @param [options.boundingVolume] - Bounding volume, in world space, for the collection. * @param [options.blendOption = BlendOption.TRANSLUCENT] - Determines how primitives in the collection are blended with the scene. Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. * @param [options.widthUnits = "pixels"] - Unit of polyline widths in this collection: * "pixels" on the screen, or "meters" in world space. A clamped * {@link HeightReference} measures those meters on the ellipsoid surface, so elevation and terrain * slope stretch the drawn width. Widths in meters have an upper limit to reduce discontinuities * across tile seams. */ export class BufferPolylineCollection extends BufferPrimitiveCollection { constructor(options?: { modelMatrix?: Matrix4; primitiveCountMax?: number; vertexCountMax?: number; show?: boolean; positionDatatype?: ComponentDatatype; positionNormalized?: boolean; allowPicking?: boolean; boundingVolume?: BoundingSphere; debugShowBoundingVolume?: boolean; blendOption?: BlendOption; heightReference?: HeightReference; widthUnits?: "pixels" | "meters"; }); /** * Unit of polyline widths in this collection: "pixels" on the screen, or * "meters" in world space, measured on the ellipsoid surface when clamped. */ readonly widthUnits: "pixels" | "meters"; /** * Adds a new polyline to the collection, with the specified options. A * {@link BufferPolyline} instance is linked to the new polyline, using * the 'result' argument if given, or a new instance if not. For repeated * calls, prefer to reuse a single BufferPolyline instance rather than * allocating a new instance on each call. */ add(options: BufferPolylineOptions, result: BufferPolyline): BufferPolyline; /** * Updates vertex positions over the specified range of primitives. For * position-only updates to many primitives, `setPositions()` is more * efficient than updating each primitive individually. * * Argument `positions` must contain the same total number of vertices as the * target primitive range; vertices cannot be added/removed by this method. */ setPositions(positions: TypedArray, primitiveOffset: number, primitiveCount: number): void; } /** * @property [color = Color.WHITE] - Color of fill. * @property [outlineColor = Color.WHITE] - Color of outline. * @property [outlineWidth = 0.0] - Width of outline, 0-255px. * @property [width = 1.0] - Width of line, in the unit selected by * {@link BufferPolylineCollection#widthUnits}. */ export type BufferPolylineMaterialOptions = { color?: Color; outlineColor?: Color; outlineWidth?: number; width?: number; }; /** * Material description for a {@link BufferPolyline}. * *

BufferPolylineMaterial objects are {@link Packable|packable}, stored * when calling {@link BufferPolyline#setMaterial}. Subsequent changes to the * material will not affect the polyline until setMaterial() is called again.

*/ export class BufferPolylineMaterial extends BufferPrimitiveMaterial { constructor(options?: BufferPolylineMaterialOptions); /** * Width of polyline, in the unit selected by {@link BufferPolylineCollection#widthUnits}. */ width: number; static pack(material: BufferPolylineMaterial, view: DataView, byteOffset: number): void; static unpack(view: DataView, byteOffset: number, result: BufferPolylineMaterial): BufferPolylineMaterial; /** * Returns a JSON-serializable object representing the material. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; /** * Color of fill. */ color: Color; /** * Color of outline. */ outlineColor: Color; /** * Width of outline, 0-255px. */ outlineWidth: number; } /** * View bound to the underlying buffer data of a {@link BufferPrimitiveCollection}. Abstract. * *

BufferPrimitive instances are intended to be reused when iterating over large collections, * and temporarily bound to a primitive index while performing read/write operations on that primitive, * before being rebound to the next primitive, using the * {@link https://en.wikipedia.org/wiki/Flyweight_pattern|flyweight pattern}.

*/ export class BufferPrimitive { /** * Copies data from source primitive to result. If the result primitive is not * new (the last primitive in the collection) then source and result primitives * must have the same vertex counts. */ static clone(primitive: BufferPrimitive, result: BufferPrimitive): BufferPrimitive; /** * Feature ID associated with the primitive; not required to be unique. */ featureId: number; /** * Whether primitive is shown. */ show: boolean; getMaterial(result: BufferPrimitiveMaterial): BufferPrimitiveMaterial; setMaterial(material: BufferPrimitiveMaterial): void; /** * User-defined pick object, if any. After a primitive has been rendered, its * pick object can no longer be changed. */ pickObject: any | undefined; /** * Returns a JSON-serializable object representing the primitive. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; } /** * @property [modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. */ export type BufferPrimitiveOptions = { modelMatrix?: Matrix4; show?: boolean; material?: BufferPrimitiveMaterial; featureId?: number; pickObject?: any; }; /** * @property [modelMatrix = Matrix4.IDENTITY] - Transforms geometry from model to world coordinates. * @property [primitiveCountMax = BufferPrimitiveCollection.DEFAULT_CAPACITY] - Maximum number of primitives. * @property [vertexCountMax = BufferPrimitiveCollection.DEFAULT_CAPACITY] - Maximum number of vertices. * @property [positionDatatype = ComponentDatatype.DOUBLE] - The component datatype used to store position values. * @property [positionNormalized = false] - When true, integer position values are treated as normalized, * where the full integer range maps to [-1, 1] (signed) or [0, 1] (unsigned). Only relevant for integer position datatypes * (BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT). * @property [allowPicking = false] - When true, primitives are pickable with {@link Scene#pick}. When false, memory and initialization cost are lower. * @property [boundingVolume] - Bounding volume, in world space, for the collection. When * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume * manually, and updating it only as needed, will improve performance for larger dynamic collections. * @property [blendOption = BlendOption.TRANSLUCENT] - Determines how primitives in the collection are blended with the scene. Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. * @property [options.heightReference = HeightReference.NONE] - When set to a clamping value, the * collection is draped onto the surfaces selected by the value: {@link HeightReference.CLAMP_TO_TERRAIN} drapes * onto the globe, {@link HeightReference.CLAMP_TO_3D_TILE} drapes onto 3D Tiles, and * {@link HeightReference.CLAMP_TO_GROUND} drapes onto both. Only {@link BufferPolylineCollection} and * {@link BufferPolygonCollection} support draping, and only once the collection has been added to * {@link Scene#primitives}. A draped collection is not also drawn as geometry of its own. */ export type BufferPrimitiveCollectionOptions = { modelMatrix?: Matrix4; primitiveCountMax?: number; vertexCountMax?: number; show?: boolean; positionDatatype?: ComponentDatatype; positionNormalized?: boolean; allowPicking?: boolean; boundingVolume?: BoundingSphere; debugShowBoundingVolume?: boolean; blendOption?: BlendOption; }; /** * Collection of primitives held in ArrayBuffer storage for performance and memory optimization. * *

To get the full performance benefit of using a BufferPrimitiveCollection containing "N" primitives, * be careful to avoid allocating "N" instances of any related JavaScript object. {@link BufferPrimitive}, * {@link Color}, {@link Cartesian3}, and other objects can all be reused when working with large collections, * using the {@link https://en.wikipedia.org/wiki/Flyweight_pattern|flyweight pattern}.

*/ export class BufferPrimitiveCollection { constructor(options?: BufferPrimitiveCollectionOptions); /** * Determines if primitives in this collection will be shown. */ show: boolean; protected readonly _heightReference: HeightReference; /** * Transforms geometry from model to world coordinates. */ protected readonly _modelMatrix: Matrix4; protected readonly _boundingVolume: BoundingSphere; protected readonly _boundingVolumeAutoUpdate: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * Returns true if this object was destroyed; otherwise, false. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys collection and its GPU resources. */ destroy(): void; /** * Sorts primitives of the collection. * * Because sorting changes the indices (but not the feature IDs) of primitives * in the collection, the function also returns an array mapping from previous * index to new index. When sorting repeatedly, the array can be reused and * passed as the 'result' argument for each call. * @returns Mapping from previous index to new index. */ sort(sortFn: (...params: any[]) => any, result: Uint32Array): Uint32Array; /** * Duplicates the contents of this collection into the result collection. * Result collection is not resized, and must contain enough space for all * primitives in the source collection. Existing primitives in the result * collection will be overwritten. * *

Useful when allocating more space for a collection that has reached its * capacity, and efficiently transferring features to the new collection.

* @example * const result = new BufferPrimitiveCollection({ ... }); // allocate larger 'result' collection * BufferPrimitiveCollection.clone(collection, result); // copy primitives from 'collection' into 'result' * @param [predicate] - When provided, only primitives for which this returns true are copied. Surviving primitives are compacted into contiguous indices. */ static clone(collection: BufferPrimitiveCollection, result: BufferPrimitiveCollection, predicate?: (...params: any[]) => any): void; /** * Returns a copy of the given collection, overriding any constructor options * provided. Omitted options are inherited from the source collection. Any * resized buffers must be large enough to hold every primitive. * *

Collection-level state (model matrix, blend option, picking, bounding-volume * mode, etc.) is carried over, but GPU resources are not: the source collection * retains ownership of its renderer resources, so the caller is responsible for * calling {@link BufferPrimitiveCollection#destroy} on the source once it is no * longer needed.

* @example * const grown = BufferPrimitiveCollection.fromCollection(collection, { * primitiveCountMax: collection.primitiveCountMax * 2, * vertexCountMax: collection.vertexCountMax * 2, * }); * collection.destroy(); // release the source collection's GPU resources * @example * // Grow while dropping hidden primitives. * const compacted = BufferPrimitiveCollection.fromCollection( * collection, * { primitiveCountMax: collection.primitiveCountMax * 2 }, * (primitive) => primitive.show, * ); * @param collection - Source collection to copy. * @param [options] - Constructor options to override. Omitted options are inherited from the source collection. * @param [predicate] - When provided, only primitives for which this returns true are copied. Surviving primitives are compacted into contiguous indices. */ static fromCollection(collection: BufferPrimitiveCollection, options?: BufferPrimitiveCollectionOptions, predicate?: (...params: any[]) => any): BufferPrimitiveCollection; /** * Makes the given {@link BufferPrimitive} a view onto this collection's * primitive at the given index, for use when reading/writing primitive * properties. When iterating over a large collection, prefer to reuse * the same BufferPrimitive instance throughout the loop — rebinding * an existing instance to a different primitive is cheap, and avoids * allocating in-memory objects for every object. * @example * const primitive = new BufferPrimitive(); * for (let i = 0; i < collection.primitiveCount; i++) { * collection.get(i, primitive); * primitive.setColor(Color.RED); * } * @returns The BufferPrimitive instance passed as the * 'result' argument, now bound to the specified primitive index. */ get(index: number, result: BufferPrimitive): BufferPrimitive; /** * Adds a new primitive to the collection, with the specified options. A * {@link BufferPrimitive} instance is linked to the new primitive, using * the 'result' argument if given, or a new instance if not. For repeated * calls, prefer to reuse a single BufferPrimitive instance rather than * allocating a new instance on each call. */ add(options: BufferPrimitiveOptions, result: BufferPrimitive): BufferPrimitive; update(frameState: any): void; /** * Number of primitives in collection. Must be <= {@link primitiveCountMax}. */ readonly primitiveCount: number; /** * Maximum number of primitives this collection can contain. Must be >= * {@link primitiveCount}. */ readonly primitiveCountMax: number; /** * Total byte length of buffers owned by this collection. Includes any unused * space allocated by {@link primitiveCountMax}, even if no primitives have * yet been added in that space. */ readonly byteLength: number; /** * Number of vertices in collection. Must be <= {@link vertexCountMax}. */ readonly vertexCount: number; /** * Maximum number of vertices this collection can contain. Must be >= * {@link vertexCount}. */ readonly vertexCountMax: number; /** * Transforms geometry from model to world coordinates. */ readonly modelMatrix: Matrix4; /** * World-space bounding volume for all primitives in the collection, including both * shown and hidden primitives. */ readonly boundingVolume: BoundingSphere; /** * The component datatype used to store position values. */ readonly positionDatatype: ComponentDatatype; /** * When true, integer position values are treated as normalized * values, where the full integer range maps to [-1, 1] (signed) or [0, 1] * (unsigned). */ readonly positionNormalized: boolean; /** * Determines which surfaces the collection is draped onto, in addition to * being drawn as standalone geometry. Draping requires that the collection * has been added to {@link Scene#primitives}. */ readonly heightReference: HeightReference; /** * Determines how primitives in the collection are blended with the scene. * Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; * {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. * *

{@link BlendOption.OPAQUE} disables blending and writes depth, so primitives * occlude each other and the geometry behind them. {@link BlendOption.TRANSLUCENT} * alpha blends primitives and does not write depth, so they are resolved by * order-independent translucency instead.

*/ blendOption: BlendOption; /** * Updates vertex positions over the specified range of primitives. For * position-only updates to many primitives, `setPositions()` is more * efficient than updating each primitive individually. * * Argument `positions` must contain the same total number of vertices as the * target primitive range; vertices cannot be added/removed by this method. */ setPositions(positions: TypedArray, primitiveOffset: number, primitiveCount: number): void; /** * Returns a JSON-serializable array representing the collection. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @example * console.table(collection.toJSON()); * @returns List of JSON-serializable objects, one for each * primitive in the collection. */ toJSON(): object[]; /** * Default capacity of buffers on new collections. A quantity of elements: * number of vertices in the vertex buffer, primitives in the primitive * buffer, etc. This value is arbitrary, and collections cannot be resized, * so specific per-buffer capacities should be provided in the collection * constructor when available. */ static readonly DEFAULT_CAPACITY: number; } /** * @property [color = Color.WHITE] - Color of fill. * @property [outlineColor = Color.WHITE] - Color of outline. * @property [outlineWidth = 0.0] - Width of outline, 0-255px. */ export type BufferPrimitiveMaterialOptions = { color?: Color; outlineColor?: Color; outlineWidth?: number; }; /** * Material description for a {@link BufferPrimitive}. Abstract. * *

BufferPrimitiveMaterial objects are {@link Packable|packable}, stored * when calling {@link BufferPrimitive#setMaterial}. Subsequent changes to the * material will not affect the primitive until setMaterial() is called again.

*/ export class BufferPrimitiveMaterial { constructor(options?: BufferPrimitiveMaterialOptions); /** * Color of fill. */ color: Color; /** * Color of outline. */ outlineColor: Color; /** * Width of outline, 0-255px. */ outlineWidth: number; static packedLength: number; /** * Stores the provided material into the provided array. */ static pack(material: BufferPrimitiveMaterial, view: DataView, byteOffset: number): void; /** * Retrieves a material from a packed array. * @param view - The packed array. * @param byteOffset - Starting index of the element to be unpacked. * @param result - Material into which results are unpacked. * @returns Modified result material, with results unpacked. */ static unpack(view: DataView, byteOffset: number, result: BufferPrimitiveMaterial): BufferPrimitiveMaterial; /** * Returns a JSON-serializable object representing the material. This encoding * is not memory-efficient, and should generally be used for debugging and * testing. * @returns JSON-serializable object. */ toJSON(): any; } /** * An orientation given by a pair of unit vectors * @property direction - The unit "direction" vector * @property up - The unit "up" vector */ export type DirectionUp = { direction: Cartesian3; up: Cartesian3; }; /** * An orientation given by numeric heading, pitch, and roll * @property [heading = 0.0] - The heading in radians * @property [pitch = -Math.PI_OVER_TWO] - The pitch in radians * @property [roll = 0.0] - The roll in radians */ export type HeadingPitchRollValues = { heading?: number; pitch?: number; roll?: number; }; /** * 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 {@link 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. * @example * // 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. * const 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; * @param scene - The scene. */ export class Camera { constructor(scene: Scene); /** * The position of the camera. */ position: Cartesian3; /** * The view direction of the camera. */ direction: Cartesian3; /** * The up direction of the camera. */ up: Cartesian3; /** * The right direction of the camera. */ right: Cartesian3; /** * The region of space in view. */ frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum; /** * The default amount to move the camera when an argument is not * provided to the move methods. */ defaultMoveAmount: number; /** * The default amount to rotate the camera when an argument is not * provided to the look methods. */ defaultLookAmount: number; /** * The default amount to rotate the camera when an argument is not * provided to the rotate methods. */ defaultRotateAmount: number; /** * The default amount to move the camera when an argument is not * provided to the zoom methods. */ defaultZoomAmount: number; /** * If set, the camera will not be able to rotate past this axis in either direction. */ constrainedAxis: Cartesian3 | undefined; /** * The factor multiplied by the the map size used to determine where to clamp the camera position * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable. */ maximumZoomFactor: number; /** * The amount the camera has to change before the changed event is raised. The value is a percentage in the [0, 1] range. */ percentageChanged: number; /** * The default rectangle the camera will view on creation. */ static DEFAULT_VIEW_RECTANGLE: Rectangle; /** * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle. * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero * will move it further away from the extent, and a value less than zero will move it close to the extent. */ static DEFAULT_VIEW_FACTOR: number; /** * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere. */ static DEFAULT_OFFSET: HeadingPitchRange; /** * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix. */ readonly transform: Matrix4; /** * Gets the inverse camera transform. */ readonly inverseTransform: Matrix4; /** * Gets the view matrix. */ readonly viewMatrix: Matrix4; /** * Gets the inverse view matrix. */ readonly inverseViewMatrix: Matrix4; /** * Gets the {@link Cartographic} position of the camera, with longitude and latitude * expressed in radians and height in meters. In 2D and Columbus View, it is possible * for the returned longitude and latitude to be outside the range of valid longitudes * and latitudes when the camera is outside the map. */ readonly positionCartographic: Cartographic; /** * Gets the position of the camera in world coordinates. */ readonly positionWC: Cartesian3; /** * Gets the view direction of the camera in world coordinates. */ readonly directionWC: Cartesian3; /** * Gets the up direction of the camera in world coordinates. */ readonly upWC: Cartesian3; /** * Gets the right direction of the camera in world coordinates. */ readonly rightWC: Cartesian3; /** * Gets the camera heading in radians. */ readonly heading: number; /** * Gets the camera pitch in radians. */ readonly pitch: number; /** * Gets the camera roll in radians. */ readonly roll: number; /** * Gets the event that will be raised at when the camera starts to move. */ readonly moveStart: Event; /** * Gets the event that will be raised when the camera has stopped moving. */ readonly moveEnd: Event; /** * Gets the event that will be raised when the camera has changed by percentageChanged. */ readonly changed: Event; /** * Sets the camera position, orientation and transform. * @example * // 1. Set position with a top-down view * viewer.camera.setView({ * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) * }); * * // 2 Set view with heading, pitch and roll * viewer.camera.setView({ * destination : cartesianPosition, * orientation: { * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) * pitch : Cesium.Math.toRadians(-90), // default value (looking down) * roll : 0.0 // default value * } * }); * * // 3. Change heading, pitch and roll with the camera position remaining the same. * viewer.camera.setView({ * orientation: { * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) * pitch : Cesium.Math.toRadians(-90), // default value (looking down) * roll : 0.0 // default value * } * }); * * * // 4. View rectangle with a top-down view * viewer.camera.setView({ * destination : Cesium.Rectangle.fromDegrees(west, south, east, north) * }); * * // 5. Set position with an orientation using unit vectors. * viewer.camera.setView({ * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), * orientation : { * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) * } * }); * @param options - Object with the following properties: * @param [options.destination] - The final position of the camera in world coordinates or a rectangle that would be visible from a top-down view. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera. * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to true. */ setView(options: { destination?: Cartesian3 | Rectangle; orientation?: HeadingPitchRollValues | DirectionUp; endTransform?: Matrix4; convert?: boolean; }): void; /** * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set * the default view for the 3D scene. The home view for 2D and columbus view shows the * entire map. * @param [duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo} */ flyHome(duration?: number): void; /** * Transform a vector or point from world coordinates to the camera's reference frame. * @param cartesian - The vector or point to transform. * @param [result] - The object onto which to store the result. * @returns The transformed vector or point. */ worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; /** * Transform a point from world coordinates to the camera's reference frame. * @param cartesian - The point to transform. * @param [result] - The object onto which to store the result. * @returns The transformed point. */ worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Transform a vector from world coordinates to the camera's reference frame. * @param cartesian - The vector to transform. * @param [result] - The object onto which to store the result. * @returns The transformed vector. */ worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Transform a vector or point from the camera's reference frame to world coordinates. * @param cartesian - The vector or point to transform. * @param [result] - The object onto which to store the result. * @returns The transformed vector or point. */ cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; /** * Transform a point from the camera's reference frame to world coordinates. * @param cartesian - The point to transform. * @param [result] - The object onto which to store the result. * @returns The transformed point. */ cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Transform a vector from the camera's reference frame to world coordinates. * @param cartesian - The vector to transform. * @param [result] - The object onto which to store the result. * @returns The transformed vector. */ cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Translates the camera's position by amount along direction. * @param direction - The direction to move. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ move(direction: Cartesian3, amount?: number): void; /** * Translates the camera's position by amount along the camera's view vector. * When in 2D mode, this will zoom in the camera instead of translating the camera's position. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveForward(amount?: number): void; /** * Translates the camera's position by amount along the opposite direction * of the camera's view vector. * When in 2D mode, this will zoom out the camera instead of translating the camera's position. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveBackward(amount?: number): void; /** * Translates the camera's position by amount along the camera's up vector. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveUp(amount?: number): void; /** * Translates the camera's position by amount along the opposite direction * of the camera's up vector. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveDown(amount?: number): void; /** * Translates the camera's position by amount along the camera's right vector. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveRight(amount?: number): void; /** * Translates the camera's position by amount along the opposite direction * of the camera's right vector. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveLeft(amount?: number): void; /** * Rotates the camera around its up vector by amount, in radians, in the opposite direction * of its right vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookLeft(amount?: number): void; /** * Rotates the camera around its up vector by amount, in radians, in the direction * of its right vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookRight(amount?: number): void; /** * Rotates the camera around its right vector by amount, in radians, in the direction * of its up vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookUp(amount?: number): void; /** * Rotates the camera around its right vector by amount, in radians, in the opposite direction * of its up vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookDown(amount?: number): void; /** * Rotate each of the camera's orientation vectors around axis by angle * @param axis - The axis to rotate around. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultLookAmount. */ look(axis: Cartesian3, angle?: number): void; /** * Rotate the camera counter-clockwise around its direction vector by amount, in radians. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ twistLeft(amount?: number): void; /** * Rotate the camera clockwise around its direction vector by amount, in radians. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ twistRight(amount?: number): void; /** * Rotates the camera around axis by angle. The distance * of the camera's position to the center of the camera's reference frame remains the same. * @param axis - The axis to rotate around given in world coordinates. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultRotateAmount. */ rotate(axis: Cartesian3, angle?: number): void; /** * Rotates the camera around the center of the camera's reference frame by angle downwards. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultRotateAmount. */ rotateDown(angle?: number): void; /** * Rotates the camera around the center of the camera's reference frame by angle upwards. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultRotateAmount. */ rotateUp(angle?: number): void; /** * Rotates the camera around the center of the camera's reference frame by angle to the right. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultRotateAmount. */ rotateRight(angle?: number): void; /** * Rotates the camera around the center of the camera's reference frame by angle to the left. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultRotateAmount. */ rotateLeft(angle?: number): void; /** * Zooms amount along the camera's view vector. * @param [amount] - The amount to move. Defaults to defaultZoomAmount. */ zoomIn(amount?: number): void; /** * Zooms amount along the opposite direction of * the camera's view vector. * @param [amount] - The amount to move. Defaults to defaultZoomAmount. */ zoomOut(amount?: number): void; /** * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and * Columbus view, this is the distance to the map. * @returns The magnitude of the position. */ getMagnitude(): number; /** * Sets the camera position and orientation using a target and offset. The target must be given in * world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target. * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. * * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be * determined from the offset, the heading will be north. * @example * // 1. Using a cartesian offset * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0); * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); * * // 2. Using a HeadingPitchRange offset * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0); * const heading = Cesium.Math.toRadians(50.0); * const pitch = Cesium.Math.toRadians(-20.0); * const range = 5000.0; * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range)); * @param target - The target position in world coordinates. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target. */ lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void; /** * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range. * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. * * In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be * determined from the offset, the heading will be north. * @example * // 1. Using a cartesian offset * const transform = Cesium.FixedFrameTransforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0)); * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); * * // 2. Using a HeadingPitchRange offset * const transform = Cesium.FixedFrameTransforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0)); * const heading = Cesium.Math.toRadians(50.0); * const pitch = Cesium.Math.toRadians(-20.0); * const range = 5000.0; * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range)); * @param transform - The transformation matrix defining the reference frame. * @param [offset] - The offset from the target in a reference frame centered at the target. */ lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void; /** * Sets the camera orientation to look at a target position in world coordinates. The camera's up vector will be oriented to the world up vector at the target position. * If the camera is at the target position, the camera will be oriented to the world up vector at the target position. * @param target - The target position in world coordinates. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid to use for determining the world up. */ lookAtWorldPosition(target: Cartesian3, ellipsoid?: Ellipsoid): void; /** * Get the camera position needed to view a rectangle on an ellipsoid or map * @param rectangle - The rectangle to view. * @param [result] - The camera position needed to view the rectangle * @returns The camera position needed to view the rectangle */ getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3; /** * Pick an ellipsoid or map. * @example * const canvas = viewer.scene.canvas; * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0); * const ellipsoid = viewer.scene.ellipsoid; * const result = viewer.camera.pickEllipsoid(center, ellipsoid); * @param windowPosition - The x and y coordinates of a pixel. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid to pick. * @param [result] - The object onto which to store the result. * @returns If the ellipsoid or map was picked, * returns the point on the surface of the ellipsoid or map in world * coordinates. If the ellipsoid or map was not picked, returns undefined. */ pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined; /** * Create a ray from the camera position through the pixel at windowPosition * in world coordinates. * @param windowPosition - The x and y coordinates of a pixel. * @param [result] - The object onto which to store the result. * @returns Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined. */ getPickRay(windowPosition: Cartesian2, result?: Ray): Ray | undefined; /** * Return the distance from the camera to the front of the bounding sphere. * @param boundingSphere - The bounding sphere in world coordinates. * @returns The distance to the bounding sphere. */ distanceToBoundingSphere(boundingSphere: BoundingSphere): number; /** * Return the pixel size in meters. * @param boundingSphere - The bounding sphere in world coordinates. * @param drawingBufferWidth - The drawing buffer width. * @param drawingBufferHeight - The drawing buffer height. * @returns The pixel size in meters. */ getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number; /** * Cancels the current camera flight and leaves the camera at its current location. * If no flight is in progress, this function does nothing. */ cancelFlight(): void; /** * Completes the current camera flight and moves the camera immediately to its final destination. * If no flight is in progress, this function does nothing. */ completeFlight(): void; /** * Flies the camera from its current position to a new position. * @example * // 1. Fly to a position with a top-down view * viewer.camera.flyTo({ * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) * }); * * // 2. Fly to a Rectangle with a top-down view * viewer.camera.flyTo({ * destination : Cesium.Rectangle.fromDegrees(west, south, east, north) * }); * * // 3. Fly to a position with an orientation using unit vectors. * viewer.camera.flyTo({ * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), * orientation : { * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) * } * }); * * // 4. Fly to a position with an orientation using heading, pitch and roll. * viewer.camera.flyTo({ * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), * orientation : { * heading : Cesium.Math.toRadians(175.0), * pitch : Cesium.Math.toRadians(-35.0), * roll : 0.0 * } * }); * @param options - Object with the following properties: * @param options.destination - The final position of the camera in world coordinates or a rectangle that would be visible from a top-down view. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. * @param [options.complete] - The function to execute when the flight is complete. * @param [options.cancel] - The function to execute if the flight is cancelled. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param [options.maximumHeight] - The maximum height at the peak of the flight. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. * @param [options.flyOverLongitude] - There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to true. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight. */ flyTo(options: { destination: Cartesian3 | Rectangle; orientation?: any; duration?: number; complete?: Camera.FlightCompleteCallback; cancel?: Camera.FlightCancelledCallback; endTransform?: Matrix4; maximumHeight?: number; pitchAdjustHeight?: number; flyOverLongitude?: number; flyOverLongitudeWeight?: number; convert?: boolean; easingFunction?: EasingFunction.Callback; }): void; /** * Sets the camera so that the current view contains the provided bounding sphere. * *

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

* *

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

* @param boundingSphere - The bounding sphere to view, in world coordinates. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target. */ viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void; /** * Flies the camera to a location where the current view contains the provided bounding sphere. * *

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

* *

In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the * target will be the range. The heading will be aligned to local north.

* @param boundingSphere - The bounding sphere to view, in world coordinates. * @param [options] - Object with the following properties: * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target. * @param [options.complete] - The function to execute when the flight is complete. * @param [options.cancel] - The function to execute if the flight is cancelled. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param [options.maximumHeight] - The maximum height at the peak of the flight. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. * @param [options.flyOverLongitude] - There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight. */ flyToBoundingSphere(boundingSphere: BoundingSphere, options?: { duration?: number; offset?: HeadingPitchRange; complete?: Camera.FlightCompleteCallback; cancel?: Camera.FlightCancelledCallback; endTransform?: Matrix4; maximumHeight?: number; pitchAdjustHeight?: number; flyOverLongitude?: number; flyOverLongitudeWeight?: number; easingFunction?: EasingFunction.Callback; }): void; /** * Computes the approximate visible rectangle on the ellipsoid. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid that you want to know the visible region. * @param [result] - The rectangle in which to store the result * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all. */ computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined; /** * Switches the frustum/projection to perspective. * * This function is a no-op in 2D which must always be orthographic. */ switchToPerspectiveFrustum(): void; /** * Switches the frustum/projection to orthographic. * * This function is a no-op in 2D which will always be orthographic. */ switchToOrthographicFrustum(): void; } export namespace Camera { /** * A function that will execute when a flight completes. */ type FlightCompleteCallback = () => void; /** * A function that will execute when a flight is cancelled. */ type FlightCancelledCallback = () => void; } /** * 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. * @param [canvas = document] - The element to handle events for. */ export class CameraEventAggregator { constructor(canvas?: HTMLCanvasElement); /** * Gets the current mouse position. */ currentMousePosition: Cartesian2; /** * Gets whether any mouse button is down, a touch has started, or the wheel has been moved. */ anyButtonDown: boolean; /** * Gets if a mouse button down or touch has started and has been moved. * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns Returns true if a mouse button down or touch has started and has been moved; otherwise, false */ isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; /** * Gets the aggregated start and end position of the current event. * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns An object with two {@link Cartesian2} properties: startPosition and endPosition. */ getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any; /** * Gets the start and end position of the last move event (not the aggregated event). * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns An object with two {@link Cartesian2} properties: startPosition and endPosition or undefined. */ getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined; /** * Gets whether the mouse button is down or a touch has started. * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns Whether the mouse button is down or a touch has started. */ isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; /** * Gets the mouse position that started the aggregation. * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns The mouse position. */ getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2; /** * Gets the time the button was pressed or the touch was started. * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns The time the button was pressed or the touch was started. */ getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; /** * Gets the time the button was released or the touch was ended. * @param type - The camera event type. * @param [modifier] - The keyboard modifier. * @returns The time the button was released or the touch was ended. */ getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; /** * Signals that all of the events have been handled and the aggregator should be reset to handle new events. */ reset(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes mouse listeners held by this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * handler = handler && handler.destroy(); */ destroy(): void; } /** * Enumerates the available input for interacting with the camera. */ export enum CameraEventType { /** * A left mouse button press followed by moving the mouse and releasing the button. */ LEFT_DRAG = 0, /** * A right mouse button press followed by moving the mouse and releasing the button. */ RIGHT_DRAG = 1, /** * A middle mouse button press followed by moving the mouse and releasing the button. */ MIDDLE_DRAG = 2, /** * Scrolling the middle mouse button. */ WHEEL = 3, /** * A two-finger touch on a touch surface. */ PINCH = 4 } /** * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded; * the content is loaded on-demand when needed based on the view. *

* Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}. *

* @param tileset - The tileset * @param baseResource - The base resource for the tileset * @param header - The JSON header for the tile * @param parent - The parent tile of the new tile */ export class Cesium3DTile { constructor(tileset: Cesium3DTileset, baseResource: Resource, header: any, parent: Cesium3DTile); /** * The local transform of this tile. */ transform: Matrix4; /** * The final computed transform of this tile. */ readonly computedTransform: Matrix4; /** * The error, in meters, introduced if this tile is rendered and its children are not. * This is used to compute screen space error, i.e., the error measured in pixels. */ readonly geometricError: number; /** * This tile's parent or undefined if this tile is the root. *

* When a tile's content points to an external tileset JSON file, the external tileset's * root tile's parent is not undefined; instead, the parent references * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged. *

*/ readonly parent: Cesium3DTile; /** * The time in seconds after the tile's content is ready when the content expires and new content is requested. */ expireDuration: number; /** * The date when the content expires and new content is requested. */ expireDate: JulianDate; /** * The tileset containing this tile. */ readonly tileset: Cesium3DTileset; /** * Gets the tile's children. Tiles of an implicit tileset are derived the first * time this property is accessed. */ readonly children: Cesium3DTile[]; /** * The tile's content. This represents the actual tile's payload, * not the content's metadata in the tileset JSON file. */ readonly content: Cesium3DTileContent; /** * Get the bounding sphere derived from the tile's bounding volume. */ readonly boundingSphere: BoundingSphere; /** * Returns the extras property in the tileset JSON for this tile, which contains application specific metadata. * Returns undefined if extras does not exist. */ readonly extras: any; /** * Gets the I3S Node for the tile. */ i3sNode: string; } /** * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from * the original feature, e.g. glTF material or per-point color in the tile. *

* When REPLACE or MIX are used and the source color is a glTF material, the technique must assign the * _3DTILESDIFFUSE semantic to the diffuse color parameter. Otherwise only HIGHLIGHT is supported. *

*

* A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the * tileset's color blend mode. *

*

 * "techniques": {
 *   "technique0": {
 *     "parameters": {
 *       "diffuse": {
 *         "semantic": "_3DTILESDIFFUSE",
 *         "type": 35666
 *       }
 *     }
 *   }
 * }
 * 
*/ export enum Cesium3DTileColorBlendMode { /** * Multiplies the source color by the feature color. */ HIGHLIGHT = 0, /** * Replaces the source color with the feature color. */ REPLACE = 1, /** * Blends the source color and feature color together. */ MIX = 2 } /** * The content of a tile in a {@link Cesium3DTileset}. *

* Derived classes of this interface provide access to individual features in the tile. * Access derived objects through {@link Cesium3DTile#content}. *

*

* This type describes an interface and is not intended to be instantiated directly. *

*/ export interface Cesium3DTileContent { /** * Gets the number of features in the tile. */ readonly featuresLength: number; /** * Gets the number of points in the tile. *

* Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which * equals the number of groups of points as distinguished by the BATCH_ID feature table semantic. *

*/ readonly pointsLength: number; /** * Gets the number of triangles in the tile. */ readonly trianglesLength: number; /** * Gets the tile's geometry memory in bytes. */ readonly geometryByteLength: number; /** * Gets the tile's texture memory in bytes. */ readonly texturesByteLength: number; /** * Gets the amount of memory used by the batch table textures and any binary * metadata properties not accounted for in geometryByteLength or * texturesByteLength */ readonly batchTableByteLength: number; /** * Gets the array of {@link Cesium3DTileContent} objects for contents that contain other contents, such as composite tiles. The inner contents may in turn have inner contents, such as a composite tile that contains a composite tile. */ readonly innerContents: any[]; /** * Returns true when the tile's content is ready to render; otherwise false */ readonly ready: boolean; /** * Gets the tileset for this tile. */ readonly tileset: Cesium3DTileset; /** * Gets the tile containing this content. */ readonly tile: Cesium3DTile; /** * Gets the url of the tile's content. */ readonly url: string; /** * Returns whether the feature has this property. * @param batchId - The batchId for the feature. * @param name - The case-sensitive name of the property. * @returns true if the feature has this property; otherwise, false. */ hasProperty(batchId: number, name: string): boolean; /** * Returns the {@link Cesium3DTileFeature} object for the feature with the * given batchId. This object is used to get and modify the * feature's properties. *

* Features in a tile are ordered by batchId, an index used to retrieve their metadata from the batch table. *

* @param batchId - The batchId for the feature. * @returns The corresponding {@link Cesium3DTileFeature} object. */ getFeature(batchId: number): Cesium3DTileFeature; } /** * A feature of a {@link Cesium3DTileset}. *

* Provides access to a feature's properties stored in the tile's batch table, as well * as the ability to show/hide a feature and change its highlight color via * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively. *

*

* Modifications to a Cesium3DTileFeature object have the lifetime of the tile's * content. If the tile's content is unloaded, e.g., due to it going out of view and needing * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. *

*

* Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} * or picking using {@link Scene#pick}. *

* @example * // On mouse over, display all the properties for a feature in the console log. * handler.setInputAction(function(movement) { * const feature = scene.pick(movement.endPosition); * if (feature instanceof Cesium.Cesium3DTileFeature) { * const propertyIds = feature.getPropertyIds(); * const length = propertyIds.length; * for (let i = 0; i < length; ++i) { * const propertyId = propertyIds[i]; * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`); * } * } * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); */ export class Cesium3DTileFeature { constructor(content: Cesium3DTileContent, batchId: number); /** * Gets or sets if the feature will be shown. This is set for all features * when a style's show is evaluated. */ show: boolean; /** * Gets or sets the highlight color multiplied with the feature's color. When * this is white, the feature's color is not changed. This is set for all features * when a style's color is evaluated. */ color: Color; /** * Gets a typed array containing the ECEF positions of the polyline. * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false * or the feature is not a polyline in a vector tile. */ polylinePositions: Float64Array; /** * Gets the tileset containing the feature. */ readonly tileset: Cesium3DTileset; /** * All objects returned by {@link Scene#pick} have a primitive property. This returns * the tileset containing the feature. */ readonly primitive: Cesium3DTileset; /** * Get the feature ID associated with this feature. For 3D Tiles 1.0, the * batch ID is returned. For EXT_mesh_features, this is the feature ID from * the selected feature ID set. */ readonly featureId: number; /** * Returns whether the feature contains this property. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * @param name - The case-sensitive name of the property. * @returns Whether the feature contains this property. */ hasProperty(name: string): boolean; /** * Returns an array of property IDs for the feature. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * @param [results] - An array into which to store the results. * @returns The IDs of the feature's properties. */ getPropertyIds(results?: string[]): string[]; /** * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * @example * // Display all the properties for a feature in the console log. * const propertyIds = feature.getPropertyIds(); * const length = propertyIds.length; * for (let i = 0; i < length; ++i) { * const propertyId = propertyIds[i]; * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`); * } * @param name - The case-sensitive name of the property. * @returns The value of the property or undefined if the feature does not have this property. */ getProperty(name: string): any; /** * Returns a copy of the feature's property with the given name, examining all * the metadata from 3D Tiles 1.0 formats, the EXT_structural_metadata and legacy * EXT_feature_metadata glTF extensions, and the metadata present either in the * tileset JSON (3D Tiles 1.1) or in the 3DTILES_metadata 3D Tiles extension. * Metadata is checked against name from most specific to most general and the * first match is returned. Metadata is checked in this order: * *
    *
  1. Batch table (structural metadata) property by semantic
  2. *
  3. Batch table (structural metadata) property by property ID
  4. *
  5. Content metadata property by semantic
  6. *
  7. Content metadata property by property
  8. *
  9. Tile metadata property by semantic
  10. *
  11. Tile metadata property by property ID
  12. *
  13. Subtree metadata property by semantic
  14. *
  15. Subtree metadata property by property ID
  16. *
  17. Group metadata property by semantic
  18. *
  19. Group metadata property by property ID
  20. *
  21. Tileset metadata property by semantic
  22. *
  23. Tileset metadata property by property ID
  24. *
  25. Otherwise, return undefined
  26. *
*

* For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} * for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} * for glTF. For the legacy glTF extension, see {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} *

* @param content - The content for accessing the metadata * @param batchId - The batch ID (or feature ID) of the feature to get a property for * @param name - The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata. * @returns The value of the property or undefined if the feature does not have this property. */ static getPropertyInherited(content: Cesium3DTileContent, batchId: number, name: string): any; /** * Sets the value of the feature's property with the given name. *

* If a property with the given name doesn't exist, it is created. *

* @example * const height = feature.getProperty('Height'); // e.g., the height of a building * @example * const name = 'clicked'; * if (feature.getProperty(name)) { * console.log('already clicked'); * } else { * feature.setProperty(name, true); * console.log('first click'); * } * @param name - The case-sensitive name of the property. * @param value - The value of the property that will be copied. */ setProperty(name: string, value: any): void; } /** * The pass in which a 3D Tileset is updated. */ export enum Cesium3DTilePass { RENDER = 0, PICK = 1, SHADOW = 2, PRELOAD = 3, PRELOAD_FLIGHT = 4, REQUEST_RENDER_MODE_DEFER_CHECK = 5, MOST_DETAILED_PRELOAD = 6, MOST_DETAILED_PICK = 7, NUMBER_OF_PASSES = 8 } /** * A point feature of a {@link Cesium3DTileset}. *

* Provides access to a feature's properties stored in the tile's batch table, as well * as the ability to show/hide a feature and change its point properties *

*

* Modifications to a Cesium3DTilePointFeature object have the lifetime of the tile's * content. If the tile's content is unloaded, e.g., due to it going out of view and needing * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. *

*

* Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} * or picking using {@link Scene#pick} and {@link Scene#pickPosition}. *

* @example * // On mouse over, display all the properties for a feature in the console log. * handler.setInputAction(function(movement) { * const feature = scene.pick(movement.endPosition); * if (feature instanceof Cesium.Cesium3DTilePointFeature) { * const propertyIds = feature.getPropertyIds(); * const length = propertyIds.length; * for (let i = 0; i < length; ++i) { * const propertyId = propertyIds[i]; * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`); * } * } * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); */ export class Cesium3DTilePointFeature { constructor(content: Cesium3DTileContent, batchId: number, billboard: Billboard, label: Label, polyline: Polyline); /** * Gets or sets if the feature will be shown. This is set for all features * when a style's show is evaluated. */ show: boolean; /** * Gets or sets the color of the point of this feature. *

* Only applied when image is undefined. *

*/ color: Color; /** * Gets or sets the point size of this feature. *

* Only applied when image is undefined. *

*/ pointSize: number; /** * Gets or sets the point outline color of this feature. *

* Only applied when image is undefined. *

*/ pointOutlineColor: Color; /** * Gets or sets the point outline width in pixels of this feature. *

* Only applied when image is undefined. *

*/ pointOutlineWidth: number; /** * Gets or sets the label color of this feature. *

* The color will be applied to the label if labelText is defined. *

*/ labelColor: Color; /** * Gets or sets the label outline color of this feature. *

* The outline color will be applied to the label if labelText is defined. *

*/ labelOutlineColor: Color; /** * Gets or sets the outline width in pixels of this feature. *

* The outline width will be applied to the point if labelText is defined. *

*/ labelOutlineWidth: number; /** * Gets or sets the font of this feature. *

* Only applied when the labelText is defined. *

*/ font: string; /** * Gets or sets the fill and outline style of this feature. *

* Only applied when labelText is defined. *

*/ labelStyle: LabelStyle; /** * Gets or sets the text for this feature. */ labelText: string; /** * Gets or sets the background color of the text for this feature. *

* Only applied when labelText is defined. *

*/ backgroundColor: Color; /** * Gets or sets the background padding of the text for this feature. *

* Only applied when labelText is defined. *

*/ backgroundPadding: Cartesian2; /** * Gets or sets whether to display the background of the text for this feature. *

* Only applied when labelText is defined. *

*/ backgroundEnabled: boolean; /** * Gets or sets the near and far scaling properties for this feature. */ scaleByDistance: NearFarScalar; /** * Gets or sets the near and far translucency properties for this feature. */ translucencyByDistance: NearFarScalar; /** * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed. */ distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the height offset in meters of this feature. */ heightOffset: number; /** * Gets or sets whether the anchor line is displayed. *

* Only applied when heightOffset is defined. *

*/ anchorLineEnabled: boolean; /** * Gets or sets the color for the anchor line. *

* Only applied when heightOffset is defined. *

*/ anchorLineColor: Color; /** * Gets or sets the image of this feature. */ image: string; /** * Gets or sets the distance where depth testing will be disabled. */ disableDepthTestDistance: number; /** * Gets or sets the horizontal origin of this point, which determines if the point is * to the left, center, or right of its anchor position. */ horizontalOrigin: HorizontalOrigin; /** * Gets or sets the vertical origin of this point, which determines if the point is * to the bottom, center, or top of its anchor position. */ verticalOrigin: VerticalOrigin; /** * Gets or sets the horizontal origin of this point's text, which determines if the point's text is * to the left, center, or right of its anchor position. */ labelHorizontalOrigin: HorizontalOrigin; /** * Get or sets the vertical origin of this point's text, which determines if the point's text is * to the bottom, center, top, or baseline of it's anchor point. */ labelVerticalOrigin: VerticalOrigin; /** * Gets the tileset containing the feature. */ readonly tileset: Cesium3DTileset; /** * All objects returned by {@link Scene#pick} have a primitive property. This returns * the tileset containing the feature. */ readonly primitive: Cesium3DTileset; /** * Returns whether the feature contains this property. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * @param name - The case-sensitive name of the property. * @returns Whether the feature contains this property. */ hasProperty(name: string): boolean; /** * Returns an array of property IDs for the feature. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * @param [results] - An array into which to store the results. * @returns The IDs of the feature's properties. */ getPropertyIds(results?: string[]): string[]; /** * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * @example * // Display all the properties for a feature in the console log. * const propertyIds = feature.getPropertyIds(); * const length = propertyIds.length; * for (let i = 0; i < length; ++i) { * const propertyId = propertyIds[i]; * console.log(`{propertyId} : ${feature.getProperty(propertyId)}`); * } * @param name - The case-sensitive name of the property. * @returns The value of the property or undefined if the feature does not have this property. */ getProperty(name: string): any; /** * Sets the value of the feature's property with the given name. *

* If a property with the given name doesn't exist, it is created. *

* @example * const height = feature.getProperty('Height'); // e.g., the height of a building * @example * const name = 'clicked'; * if (feature.getProperty(name)) { * console.log('already clicked'); * } else { * feature.setProperty(name, true); * console.log('first click'); * } * @param name - The case-sensitive name of the property. * @param value - The value of the property that will be copied. */ setProperty(name: string, value: any): void; } /** * A style that is applied to a {@link Cesium3DTileset}. *

* Evaluates an expression defined using the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}. *

* @example * tileset.style = new Cesium.Cesium3DTileStyle({ * color : { * conditions : [ * ['${Height} >= 100', 'color("purple", 0.5)'], * ['${Height} >= 50', 'color("red")'], * ['true', 'color("blue")'] * ] * }, * show : '${Height} > 0', * meta : { * description : '"Building id ${id} has height ${Height}."' * } * }); * @example * tileset.style = new Cesium.Cesium3DTileStyle({ * color : 'vec4(${Temperature})', * pointSize : '${Temperature} * 2.0' * }); * @param [style] - An object defining a style. */ export class Cesium3DTileStyle { constructor(style?: any); /** * Gets the object defining the style using the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}. */ readonly style: any; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's show property. Alternatively a boolean, string, or object defining a show style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return or convert to a Boolean. *

*

* This expression is applicable to all tile formats. *

* @example * const style = new Cesium3DTileStyle({ * show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)' * }); * style.show.evaluate(feature); // returns true or false depending on the feature's properties * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override show expression with a custom function * style.show = { * evaluate : function(feature) { * return true; * } * }; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override show expression with a boolean * style.show = true; * }; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override show expression with a string * style.show = '${Height} > 0'; * }; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override show expression with a condition * style.show = { * conditions: [ * ['${height} > 2', 'false'], * ['true', 'true'] * ]; * }; */ show: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's color property. Alternatively a string or object defining a color style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Color. *

*

* This expression is applicable to all tile formats. *

* @example * const style = new Cesium3DTileStyle({ * color : '(${Temperature} > 90) ? color("red") : color("white")' * }); * style.color.evaluateColor(feature, result); // returns a Cesium.Color object * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override color expression with a custom function * style.color = { * evaluateColor : function(feature, result) { * return Cesium.Color.clone(Cesium.Color.WHITE, result); * } * }; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override color expression with a string * style.color = 'color("blue")'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override color expression with a condition * style.color = { * conditions : [ * ['${height} > 2', 'color("cyan")'], * ['true', 'color("blue")'] * ] * }; */ color: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointSize property. Alternatively a string or object defining a point size style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Number. *

*

* This expression is only applicable to point features in a Vector tile or a Point Cloud tile. *

* @example * const style = new Cesium3DTileStyle({ * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0' * }); * style.pointSize.evaluate(feature); // returns a Number * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointSize expression with a custom function * style.pointSize = { * evaluate : function(feature) { * return 1.0; * } * }; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointSize expression with a number * style.pointSize = 1.0; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointSize expression with a string * style.pointSize = '${height} / 10'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointSize expression with a condition * style.pointSize = { * conditions : [ * ['${height} > 2', '1.0'], * ['true', '2.0'] * ] * }; */ pointSize: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointOutlineColor property. Alternatively a string or object defining a color style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Color. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointOutlineColor expression with a string * style.pointOutlineColor = 'color("blue")'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointOutlineColor expression with a condition * style.pointOutlineColor = { * conditions : [ * ['${height} > 2', 'color("cyan")'], * ['true', 'color("blue")'] * ] * }; */ pointOutlineColor: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointOutlineWidth property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Number. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointOutlineWidth expression with a string * style.pointOutlineWidth = '5'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override pointOutlineWidth expression with a condition * style.pointOutlineWidth = { * conditions : [ * ['${height} > 2', '5'], * ['true', '0'] * ] * }; */ pointOutlineWidth: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelColor property. Alternatively a string or object defining a color style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Color. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelColor expression with a string * style.labelColor = 'color("blue")'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelColor expression with a condition * style.labelColor = { * conditions : [ * ['${height} > 2', 'color("cyan")'], * ['true', 'color("blue")'] * ] * }; */ labelColor: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelOutlineColor property. Alternatively a string or object defining a color style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Color. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelOutlineColor expression with a string * style.labelOutlineColor = 'color("blue")'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelOutlineColor expression with a condition * style.labelOutlineColor = { * conditions : [ * ['${height} > 2', 'color("cyan")'], * ['true', 'color("blue")'] * ] * }; */ labelOutlineColor: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelOutlineWidth property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Number. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelOutlineWidth expression with a string * style.labelOutlineWidth = '5'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelOutlineWidth expression with a condition * style.labelOutlineWidth = { * conditions : [ * ['${height} > 2', '5'], * ['true', '0'] * ] * }; */ labelOutlineWidth: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's font property. Alternatively a string or object defining a string style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a String. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"' * }); * style.font.evaluate(feature); // returns a String * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override font expression with a custom function * style.font = { * evaluate : function(feature) { * return '24px Helvetica'; * } * }; */ font: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's label style property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a LabelStyle. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * labelStyle : `(\${Temperature} > 90) ? ${LabelStyle.FILL_AND_OUTLINE} : ${LabelStyle.FILL}` * }); * style.labelStyle.evaluate(feature); // returns a LabelStyle * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelStyle expression with a custom function * style.labelStyle = { * evaluate : function(feature) { * return LabelStyle.FILL; * } * }; */ labelStyle: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelText property. Alternatively a string or object defining a string style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a String. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * labelText : '(${Temperature} > 90) ? ">90" : "<=90"' * }); * style.labelText.evaluate(feature); // returns a String * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelText expression with a custom function * style.labelText = { * evaluate : function(feature) { * return 'Example label text'; * } * }; */ labelText: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundColor property. Alternatively a string or object defining a color style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Color. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override backgroundColor expression with a string * style.backgroundColor = 'color("blue")'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override backgroundColor expression with a condition * style.backgroundColor = { * conditions : [ * ['${height} > 2', 'color("cyan")'], * ['true', 'color("blue")'] * ] * }; */ backgroundColor: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundPadding property. Alternatively a string or object defining a vec2 style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Cartesian2. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override backgroundPadding expression with a string * style.backgroundPadding = 'vec2(5.0, 7.0)'; * style.backgroundPadding.evaluate(feature); // returns a Cartesian2 */ backgroundPadding: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundEnabled property. Alternatively a string or object defining a boolean style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Boolean. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override backgroundEnabled expression with a string * style.backgroundEnabled = 'true'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override backgroundEnabled expression with a condition * style.backgroundEnabled = { * conditions : [ * ['${height} > 2', 'true'], * ['true', 'false'] * ] * }; */ backgroundEnabled: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's scaleByDistance property. Alternatively a string or object defining a vec4 style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Cartesian4. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override scaleByDistance expression with a string * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)'; * style.scaleByDistance.evaluate(feature); // returns a Cartesian4 */ scaleByDistance: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's translucencyByDistance property. Alternatively a string or object defining a vec4 style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Cartesian4. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override translucencyByDistance expression with a string * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)'; * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4 */ translucencyByDistance: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's distanceDisplayCondition property. Alternatively a string or object defining a vec2 style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Cartesian2. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override distanceDisplayCondition expression with a string * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)'; * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2 */ distanceDisplayCondition: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's heightOffset property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Number. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override heightOffset expression with a string * style.heightOffset = '2.0'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override heightOffset expression with a condition * style.heightOffset = { * conditions : [ * ['${height} > 2', '4.0'], * ['true', '2.0'] * ] * }; */ heightOffset: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's anchorLineEnabled property. Alternatively a string or object defining a boolean style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Boolean. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override anchorLineEnabled expression with a string * style.anchorLineEnabled = 'true'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override anchorLineEnabled expression with a condition * style.anchorLineEnabled = { * conditions : [ * ['${height} > 2', 'true'], * ['true', 'false'] * ] * }; */ anchorLineEnabled: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's anchorLineColor property. Alternatively a string or object defining a color style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Color. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override anchorLineColor expression with a string * style.anchorLineColor = 'color("blue")'; * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override anchorLineColor expression with a condition * style.anchorLineColor = { * conditions : [ * ['${height} > 2', 'color("cyan")'], * ['true', 'color("blue")'] * ] * }; */ anchorLineColor: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's image property. Alternatively a string or object defining a string style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a String. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"' * }); * style.image.evaluate(feature); // returns a String * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override image expression with a custom function * style.image = { * evaluate : function(feature) { * return '/url/to/image'; * } * }; */ image: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's disableDepthTestDistance property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a Number. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium.Cesium3DTileStyle(); * // Override disableDepthTestDistance expression with a string * style.disableDepthTestDistance = '1000.0'; * style.disableDepthTestDistance.evaluate(feature); // returns a Number */ disableDepthTestDistance: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's horizontalOrigin property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a HorizontalOrigin. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * horizontalOrigin : HorizontalOrigin.LEFT * }); * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override horizontalOrigin expression with a custom function * style.horizontalOrigin = { * evaluate : function(feature) { * return HorizontalOrigin.CENTER; * } * }; */ horizontalOrigin: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's verticalOrigin property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a VerticalOrigin. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * verticalOrigin : VerticalOrigin.TOP * }); * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override verticalOrigin expression with a custom function * style.verticalOrigin = { * evaluate : function(feature) { * return VerticalOrigin.CENTER; * } * }; */ verticalOrigin: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelHorizontalOrigin property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a HorizontalOrigin. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * labelHorizontalOrigin : HorizontalOrigin.LEFT * }); * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelHorizontalOrigin expression with a custom function * style.labelHorizontalOrigin = { * evaluate : function(feature) { * return HorizontalOrigin.CENTER; * } * }; */ labelHorizontalOrigin: StyleExpression; /** * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelVerticalOrigin property. Alternatively a string or object defining a number style can be used. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. *

* The expression must return a VerticalOrigin. *

*

* This expression is only applicable to point features in a Vector tile. *

* @example * const style = new Cesium3DTileStyle({ * labelVerticalOrigin : VerticalOrigin.TOP * }); * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin * @example * const style = new Cesium.Cesium3DTileStyle(); * // Override labelVerticalOrigin expression with a custom function * style.labelVerticalOrigin = { * evaluate : function(feature) { * return VerticalOrigin.CENTER; * } * }; */ labelVerticalOrigin: StyleExpression; /** * Gets or sets the object containing application-specific expression that can be explicitly * evaluated, e.g., for display in a UI. * @example * const style = new Cesium3DTileStyle({ * meta : { * description : '"Building id ${id} has height ${Height}."' * } * }); * style.meta.description.evaluate(feature); // returns a String with the substituted variables */ meta: StyleExpression; } export namespace Cesium3DTilesVoxelProvider { /** * Initialization options for the Cesium3DTilesVoxelProvider constructor * @property className - The class in the tileset schema describing voxel metadata. * @property names - The metadata names. * @property types - The metadata types. * @property componentTypes - The metadata component types. * @property shape - The {@link VoxelShapeType}. * @property dimensions - The number of voxels per dimension of a tile. This is the same for all tiles in the dataset. * @property [paddingBefore = Cartesian3.ZERO] - The number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage. * @property [paddingAfter = Cartesian3.ZERO] - The number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage. * @property [globalTransform = Matrix4.IDENTITY] - A transform from local space to global space. * @property [shapeTransform = Matrix4.IDENTITY] - A transform from shape space to local space. * @property [minBounds] - The minimum bounds. * @property [maxBounds] - The maximum bounds. * @property [minimumValues] - The metadata minimum values. * @property [maximumValues] - The metadata maximum values. * @property [maximumTileCount] - The maximum number of tiles that exist for this provider. This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. If this value is not known it can be undefined. */ type ConstructorOptions = { className: string; names: string[]; types: MetadataType[]; componentTypes: MetadataComponentType[]; shape: VoxelShapeType; dimensions: Cartesian3; paddingBefore?: Cartesian3; paddingAfter?: Cartesian3; globalTransform?: Matrix4; shapeTransform?: Matrix4; minBounds?: Cartesian3; maxBounds?: Cartesian3; minimumValues?: number[][]; maximumValues?: number[][]; maximumTileCount?: number; }; } /** * A {@link VoxelProvider} that fetches voxel data from a 3D Tiles tileset. *

* Implements the {@link VoxelProvider} interface. *

*
* This object is normally not instantiated directly, use {@link Cesium3DTilesVoxelProvider.fromUrl} or {@link Cesium3DTilesVoxelProvider.fromGltf}. *
* @param options - An object describing initialization options */ export class Cesium3DTilesVoxelProvider extends VoxelProvider { constructor(options: Cesium3DTilesVoxelProvider.ConstructorOptions); /** * A transform from local space to global space. */ readonly globalTransform: Matrix4; /** * A transform from shape space to local space. */ readonly shapeTransform: Matrix4; /** * Gets the {@link VoxelShapeType} */ readonly shape: VoxelShapeType; /** * Gets the minimum bounds. * If undefined, the shape's default minimum bounds will be used instead. */ readonly minBounds: Cartesian3 | undefined; /** * Gets the maximum bounds. * If undefined, the shape's default maximum bounds will be used instead. */ readonly maxBounds: Cartesian3 | undefined; /** * Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset. */ readonly dimensions: Cartesian3; /** * Gets the number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage. */ readonly paddingBefore: Cartesian3; /** * Gets the number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage. */ readonly paddingAfter: Cartesian3; /** * The metadata class for this tileset. */ readonly className: string; /** * Gets the metadata names. */ readonly names: string[]; /** * Gets the metadata types. */ readonly types: MetadataType[]; /** * Gets the metadata component types. */ readonly componentTypes: MetadataComponentType[]; /** * Gets the metadata minimum values. */ readonly minimumValues: number[][] | undefined; /** * Gets the metadata maximum values. */ readonly maximumValues: number[][] | undefined; /** * The maximum number of tiles that exist for this provider. * This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. * If this value is not known it can be undefined. */ readonly maximumTileCount: number | undefined; /** * The number of levels of detail containing available tiles in the tileset. */ readonly availableLevels: number | undefined; /** * Creates a {@link Cesium3DTilesVoxelProvider} that fetches voxel data from a 3D Tiles tileset. * @example * try { * const voxelProvider = await Cesium3DTilesVoxelProvider.fromUrl( * "http://localhost:8002/tilesets/voxel/tileset.json" * ); * const voxelPrimitive = new VoxelPrimitive({ * provider: voxelProvider, * customShader: customShader, * }); * scene.primitives.add(voxelPrimitive); * } catch (error) { * console.error(`Error creating voxel primitive: ${error}`); * } * @param url - The URL to a tileset JSON file * @returns The created provider */ static fromUrl(url: Resource | string): Promise; /** * Creates a {@link Cesium3DTilesVoxelProvider} that fetches voxel data from a 3D Tiles 2.0 tileset stored as glTF. * @example * try { * const voxelProvider = await Cesium3DTilesVoxelProvider.fromGltf( * "http://localhost:8002/tilesets/voxel/voxels.tileset.gltf" * ); * const voxelPrimitive = new VoxelPrimitive({ provider: voxelProvider }); * scene.primitives.add(voxelPrimitive); * } catch (error) { * console.error(`Error creating voxel primitive: ${error}`); * } * @param url - The URL to a glTF file with the 3DTILES_tileset and 3DTILES_tileset_voxels extensions * @returns The created provider */ static fromGltf(url: Resource | string): Promise; /** * Requests the data for a given tile. * @param [options] - Object with the following properties: * @param [options.tileLevel = 0] - The tile's level. * @param [options.tileX = 0] - The tile's X coordinate. * @param [options.tileY = 0] - The tile's Y coordinate. * @param [options.tileZ = 0] - The tile's Z coordinate. * @returns A promise resolving to a VoxelContent containing the data for the tile, or undefined if the request could not be scheduled this frame. */ requestData(options?: { tileLevel?: number; tileX?: number; tileY?: number; tileZ?: number; }): Promise | undefined; } export namespace Cesium3DTileset { /** * Initialization options for the Cesium3DTileset constructor * @property [show = true] - Determines if the tileset will be shown. * @property [modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile. * @property [modelUpAxis = Axis.Y] - Which axis is considered up when loading models for tile contents. * @property [modelForwardAxis = Axis.X] - Which axis is considered forward when loading models for tile contents. * @property [shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources. * @property [maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement. * @property [cacheBytes = 536870912] - The size (in bytes) to which the tile cache will be trimmed, if the cache contains tiles not needed for the current view. * @property [maximumCacheOverflowBytes = 536870912] - The maximum additional memory (in bytes) to allow for cache headroom, if more than {@link Cesium3DTileset#cacheBytes} are needed for the current view. * @property [cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes. * @property [cullRequestsWhileMoving = true] - Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets. * @property [cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling. * @property [preloadWhenHidden = false] - Preload tiles when tileset.show is false. Loads tiles as if the tileset is visible but does not render them. * @property [preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight. * @property [preferLeaves = false] - Optimization option. Prefer loading of leaves first. * @property [dynamicScreenSpaceError = true] - Optimization option. For street-level horizon views, use lower resolution tiles far from the camera. This reduces the amount of data loaded and improves tileset loading time with a slight drop in visual quality in the distance. * @property [dynamicScreenSpaceErrorDensity = 2.0e-4] - Similar to {@link Fog#density}, this option controls the camera distance at which the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization applies. Larger values will cause tiles closer to the camera to be affected. * @property [dynamicScreenSpaceErrorFactor = 24.0] - A parameter that controls the intensity of the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization for tiles on the horizon. Larger values cause lower resolution tiles to load, improving runtime performance at a slight reduction of visual quality. * @property [dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height that determines where "street level" camera views occur. When the camera is below this height, the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization will have the maximum effect, and it will roll off above this value. * @property [progressiveResolutionHeightFraction = 0.3] - Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of progressiveResolutionHeightFraction*screenHeight will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load. * @property [foveatedScreenSpaceError = true] - Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. * @property [foveatedConeSize = 0.1] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect. * @property [foveatedMinimumScreenSpaceErrorRelaxation = 0.0] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. * @property [foveatedInterpolationCallback = Math.lerp] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} * @property [foveatedTimeDelay = 0.2] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view. * @property [skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal. * @property [baseScreenSpaceError = 1024] - When skipLevelOfDetail is true, the screen space error that must be reached before skipping levels of detail. * @property [skipScreenSpaceErrorFactor = 16] - When skipLevelOfDetail is true, a multiplier defining the minimum screen space error to skip. Used in conjunction with skipLevels to determine which tiles to load. * @property [skipLevels = 1] - When skipLevelOfDetail is true, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with skipScreenSpaceErrorFactor to determine which tiles to load. * @property [immediatelyLoadDesiredLevelOfDetail = false] - When skipLevelOfDetail is true, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded. * @property [loadSiblings = false] - When skipLevelOfDetail is true, determines whether siblings of visible tiles are always downloaded during traversal. * @property [clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset. * @property [clippingPolygons] - The {@link ClippingPolygonCollection} used to selectively disable rendering the tileset. * @property [classificationType] - Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations. * @property [heightReference] - Sets the {@link HeightReference} for features in vector tilesets. * @property [scene] - The {@link CesiumWidget#scene} that the tileset will be rendered in, required for tilesets that specify a {@link heightReference} value for clamping 3D Tiles vector data content- like points, lines, and labels- to terrain or 3D tiles. * @property [ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe. * @property [pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting. * @property [lightColor] - The light color when shading models. When undefined the scene's light color is used instead. * @property [imageBasedLighting] - The properties for managing image-based lighting for this tileset. * @property [environmentMapOptions] - The properties for managing dynamic environment maps on this tileset. * @property [backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled. * @property [enableShowOutline = true] - Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored. * @property [showOutline = true] - Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed. * @property [outlineColor = Color.BLACK] - The color to use when rendering outlines. * @property [vectorClassificationOnly = false] - Indicates that only the tileset's vector tiles should be used for classification. * @property [vectorKeepDecodedPositions = false] - Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}. * @property [vectorBlendOption = BlendOption.TRANSLUCENT] - Determines how vector primitives in the tileset are blended with the scene. Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. * @property [featureIdLabel = "featureId_0"] - Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority. * @property [instanceFeatureIdLabel = "instanceFeatureId_0"] - Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority. * @property [showCreditsOnScreen = false] - Whether to display the credits of this tileset on screen. * @property [splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this tileset. * @property [enableCollision = false] - When true, enables collisions for camera or CPU picking. While this is true the camera will be prevented from going below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true. This also affects the behavior of {@link HeightReference.CLAMP_TO_GROUND} when clamping to 3D Tiles surfaces. If enableCollision is false, entities may not be correctly clamped to the tileset geometry. * @property [projectTo2D = false] - Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has been created. * @property [enablePick = false] - Whether to allow collision and CPU picking with pick when using WebGL 1. If using WebGL 2 or above, this option will be ignored. If using WebGL 1 and this is true, the pick operation will work correctly, but it will use more memory to do so. If running with WebGL 1 and this is false, the model will use less memory, but pick will always return undefined. This cannot be set after the tileset has loaded. * @property [asynchronouslyLoadImagery = false] - Whether loading imagery that is draped over the tileset should be done asynchronously. If this is true, then tile content will be displayed with its original texture until the imagery texture is loaded. If this is false, then the tile content will not be displayed until the imagery is ready. * @property [debugHeatmapTilePropertyName] - The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value. * @property [debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering. * @property [debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile. * @property [enableDebugWireframe = false] - For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has been created. * @property [debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe. * @property [edgeDisplayMode = EdgeDisplayMode.SURFACES_ONLY] - Controls how edges from the {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} glTF extension are rendered relative to surface geometry. * @property [debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile. * @property [debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content. * @property [debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile. * @property [debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile. * @property [debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile. * @property [debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile. * @property [debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile. */ type ConstructorOptions = { show?: boolean; modelMatrix?: Matrix4; modelUpAxis?: Axis; modelForwardAxis?: Axis; shadows?: ShadowMode; maximumScreenSpaceError?: number; cacheBytes?: number; maximumCacheOverflowBytes?: number; cullWithChildrenBounds?: boolean; cullRequestsWhileMoving?: boolean; cullRequestsWhileMovingMultiplier?: number; preloadWhenHidden?: boolean; preloadFlightDestinations?: boolean; preferLeaves?: boolean; dynamicScreenSpaceError?: boolean; dynamicScreenSpaceErrorDensity?: number; dynamicScreenSpaceErrorFactor?: number; dynamicScreenSpaceErrorHeightFalloff?: number; progressiveResolutionHeightFraction?: number; foveatedScreenSpaceError?: boolean; foveatedConeSize?: number; foveatedMinimumScreenSpaceErrorRelaxation?: number; foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback; foveatedTimeDelay?: number; skipLevelOfDetail?: boolean; baseScreenSpaceError?: number; skipScreenSpaceErrorFactor?: number; skipLevels?: number; immediatelyLoadDesiredLevelOfDetail?: boolean; loadSiblings?: boolean; clippingPlanes?: ClippingPlaneCollection; clippingPolygons?: ClippingPolygonCollection; classificationType?: ClassificationType; heightReference?: HeightReference; scene?: Scene; ellipsoid?: Ellipsoid; pointCloudShading?: any; lightColor?: Cartesian3; imageBasedLighting?: ImageBasedLighting; environmentMapOptions?: DynamicEnvironmentMapManager.ConstructorOptions; backFaceCulling?: boolean; enableShowOutline?: boolean; showOutline?: boolean; outlineColor?: Color; vectorClassificationOnly?: boolean; vectorKeepDecodedPositions?: boolean; vectorBlendOption?: BlendOption; featureIdLabel?: string | number; instanceFeatureIdLabel?: string | number; showCreditsOnScreen?: boolean; splitDirection?: SplitDirection; enableCollision?: boolean; projectTo2D?: boolean; enablePick?: boolean; asynchronouslyLoadImagery?: boolean; debugHeatmapTilePropertyName?: string; debugFreezeFrame?: boolean; debugColorizeTiles?: boolean; enableDebugWireframe?: boolean; debugWireframe?: boolean; edgeDisplayMode?: EdgeDisplayMode; debugShowBoundingVolume?: boolean; debugShowContentBoundingVolume?: boolean; debugShowViewerRequestVolume?: boolean; debugShowGeometricError?: boolean; debugShowRenderingStatistics?: boolean; debugShowMemoryUsage?: boolean; debugShowUrl?: boolean; }; /** * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. * @param p - The start value to interpolate. * @param q - The end value to interpolate. * @param time - The time of interpolation generally in the range [0.0, 1.0]. */ type foveatedInterpolationCallback = (p: number, q: number, time: number) => number; } /** * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset}, * used for streaming massive heterogeneous 3D geospatial datasets. * *
* This object is normally not instantiated directly, use {@link Cesium3DTileset.fromUrl}. *
* @example * try { * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json" * ); * scene.primitives.add(tileset); * } catch (error) { * console.error(`Error creating tileset: ${error}`); * } * @example * // Turn on camera collisions with the tileset. * try { * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json", * { enableCollision: true } * ); * scene.primitives.add(tileset); * } catch (error) { * console.error(`Error creating tileset: ${error}`); * } * @example * // Common setting for the skipLevelOfDetail optimization * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json", { * skipLevelOfDetail: true, * baseScreenSpaceError: 1024, * skipScreenSpaceErrorFactor: 16, * skipLevels: 1, * immediatelyLoadDesiredLevelOfDetail: false, * loadSiblings: false, * cullWithChildrenBounds: true * }); * scene.primitives.add(tileset); * @example * // Common settings for the dynamicScreenSpaceError optimization * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json", { * dynamicScreenSpaceError: true, * dynamicScreenSpaceErrorDensity: 2.0e-4, * dynamicScreenSpaceErrorFactor: 24.0, * dynamicScreenSpaceErrorHeightFalloff: 0.25 * }); * scene.primitives.add(tileset); * @param options - An object describing initialization options */ export class Cesium3DTileset { constructor(options: Cesium3DTileset.ConstructorOptions); /** * Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets. */ cullRequestsWhileMoving: boolean; /** * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling. */ cullRequestsWhileMovingMultiplier: number; /** * Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of progressiveResolutionHeightFraction*screenHeight will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load. */ progressiveResolutionHeightFraction: number; /** * Optimization option. Prefer loading of leaves first. */ preferLeaves: boolean; /** * Preload tiles when tileset.show is false. Loads tiles as if the tileset is visible but does not render them. */ preloadWhenHidden: boolean; /** * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight. */ preloadFlightDestinations: boolean; /** * Optimization option. For street-level horizon views, use lower resolution tiles far from the camera. This reduces * the amount of data loaded and improves tileset loading time with a slight drop in visual quality in the distance. *

* This optimization is strongest when the camera is close to the ground plane of the tileset and looking at the * horizon. Furthermore, the results are more accurate for tightly fitting bounding volumes like box and region. */ dynamicScreenSpaceError: boolean; /** * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. */ foveatedScreenSpaceError: boolean; /** * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone, * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. */ foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback; /** * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control * how long in seconds to wait after the camera stops moving before deferred tiles start loading in. * This time delay prevents requesting tiles around the edges of the screen when the camera is moving. * Setting this to 0.0 will immediately request all tiles in any given view. */ foveatedTimeDelay: number; /** * Similar to {@link Fog#density}, this option controls the camera distance at which the {@link Cesium3DTileset#dynamicScreenSpaceError} * optimization applies. Larger values will cause tiles closer to the camera to be affected. This value must be * non-negative. *

* This optimization works by rolling off the tile screen space error (SSE) with camera distance like a bell curve. * This has the effect of selecting lower resolution tiles far from the camera. Near the camera, no adjustment is * made. For tiles further away, the SSE is reduced by up to {@link Cesium3DTileset#dynamicScreenSpaceErrorFactor} * (measured in pixels of error). *

*

* Increasing the density makes the bell curve narrower so tiles closer to the camera are affected. This is analagous * to moving fog closer to the camera. *

*

* When the density is 0, the optimization will have no effect on the tileset. *

*/ dynamicScreenSpaceErrorDensity: number; /** * A parameter that controls the intensity of the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization for * tiles on the horizon. Larger values cause lower resolution tiles to load, improving runtime performance at a slight * reduction of visual quality. The value must be non-negative. *

* More specifically, this parameter represents the maximum adjustment to screen space error (SSE) in pixels for tiles * far away from the camera. See {@link Cesium3DTileset#dynamicScreenSpaceErrorDensity} for more details about how * this optimization works. *

*

* When the SSE factor is set to 0, the optimization will have no effect on the tileset. *

*/ dynamicScreenSpaceErrorFactor: number; /** * A ratio of the tileset's height that determines "street level" for the {@link Cesium3DTileset#dynamicScreenSpaceError} * optimization. When the camera is below this height, the dynamic screen space error optimization will have the maximum * effect, and it will roll off above this value. Valid values are between 0.0 and 1.0. *

*/ dynamicScreenSpaceErrorHeightFalloff: number; /** * Determines whether the tileset casts or receives shadows from light sources. *

* Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view. *

*

* Shadows are rendered only when {@link Viewer#shadows} is true. *

*/ shadows: ShadowMode; /** * Determines if the tileset will be shown. */ show: boolean; /** * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from * the original feature, e.g. glTF material or per-point color in the tile. */ colorBlendMode: Cesium3DTileColorBlendMode; /** * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is MIX. * A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between * resulting in a mix of the source color and feature color. */ colorBlendAmount: number; /** * The event fired to indicate progress of loading new tiles. This event is fired when a new tile * is requested, when a requested tile is finished downloading, and when a downloaded tile has been * processed and is ready to render. *

* The number of pending tile requests, numberOfPendingRequests, and number of tiles * processing, numberOfTilesProcessing are passed to the event listener. *

*

* This event is fired at the end of the frame after the scene is rendered. *

* @example * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) { * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) { * console.log('Stopped loading'); * return; * } * * console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`); * }); */ loadProgress: Event; /** * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset * is completely loaded for this view. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * tileset.allTilesLoaded.addEventListener(function() { * console.log('All tiles are loaded'); * }); */ allTilesLoaded: Event; /** * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event * is fired once when all tiles in the initial view are loaded. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * tileset.initialTilesLoaded.addEventListener(function() { * console.log('Initial tiles are loaded'); * }); */ initialTilesLoaded: Event; /** * The event fired to indicate that a tile's content was loaded. *

* The loaded {@link Cesium3DTile} is passed to the event listener. *

*

* This event is fired during the tileset traversal while the frame is being rendered * so that updates to the tile take effect in the same frame. Do not create or modify * Cesium entities or primitives during the event listener. *

* @example * tileset.tileLoad.addEventListener(function(tile) { * console.log('A tile was loaded.'); * }); */ tileLoad: Event; /** * The event fired to indicate that a tile's content was unloaded. *

* The unloaded {@link Cesium3DTile} is passed to the event listener. *

*

* This event is fired immediately before the tile's content is unloaded while the frame is being * rendered so that the event listener has access to the tile's content. Do not create * or modify Cesium entities or primitives during the event listener. *

* @example * tileset.tileUnload.addEventListener(function(tile) { * console.log('A tile was unloaded from the cache.'); * }); */ tileUnload: Event; /** * The event fired to indicate that a tile's content failed to load. *

* If there are no event listeners, error messages will be logged to the console. *

*

* The error object passed to the listener contains two properties: *

    *
  • url: the url of the failed tile.
  • *
  • message: the error message.
  • *
*

* If multiple contents are present, this event is raised once per inner content with errors. *

* @example * tileset.tileFailed.addEventListener(function(error) { * console.log(`An error occurred loading tile: ${error.url}`); * console.log(`Error: ${error.message}`); * }); */ tileFailed: Event; /** * This event fires once for each visible tile in a frame. This can be used to manually * style a tileset. *

* The visible {@link Cesium3DTile} is passed to the event listener. *

*

* This event is fired during the tileset traversal while the frame is being rendered * so that updates to the tile take effect in the same frame. Do not create or modify * Cesium entities or primitives during the event listener. *

* @example * tileset.tileVisible.addEventListener(function(tile) { * if (tile.content instanceof Cesium.Model3DTileContent) { * console.log('A 3D model tile is visible.'); * } * }); * @example * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible. * tileset.style = new Cesium.Cesium3DTileStyle({ * color : 'color("red")' * }); * tileset.tileVisible.addEventListener(function(tile) { * const content = tile.content; * const featuresLength = content.featuresLength; * for (let i = 0; i < featuresLength; i+=2) { * content.getFeature(i).color = Cesium.Color.fromRandom(); * } * }); */ tileVisible: Event; /** * Optimization option. Determines if level of detail skipping should be applied during the traversal. *

* The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when * using this optimization. *

*/ skipLevelOfDetail: boolean; /** * The screen space error that must be reached before skipping levels of detail. *

* Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. *

*/ baseScreenSpaceError: number; /** * Multiplier defining the minimum screen space error to skip. * For example, if a tile has screen space error of 100, no tiles will be loaded unless they * are leaves or have a screen space error <= 100 / skipScreenSpaceErrorFactor. *

* Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. *

*/ skipScreenSpaceErrorFactor: number; /** * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2. *

* Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. *

*/ skipLevels: number; /** * When true, only tiles that meet the maximum screen space error will ever be downloaded. * Skipping factors are ignored and just the desired tiles are loaded. *

* Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. *

*/ immediatelyLoadDesiredLevelOfDetail: boolean; /** * Determines whether siblings of visible tiles are always downloaded during traversal. * This may be useful for ensuring that tiles are already available when the viewer turns left/right. *

* Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. *

*/ loadSiblings: boolean; /** * The light color when shading models. When undefined the scene's light color is used instead. *

* For example, disabling additional light sources by setting * tileset.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0) * will make the tileset much darker. Here, increasing the intensity of the light source will make the tileset brighter. *

*/ lightColor: Cartesian3; /** * Whether to cull back-facing geometry. When true, back face culling is determined * by the glTF material's doubleSided property; when false, back face culling is disabled. */ backFaceCulling: boolean; /** * Whether to display the outline for models using the * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. * When true, outlines are displayed. When false, outlines are not displayed. */ showOutline: boolean; /** * The color to use when rendering outlines. */ outlineColor: Color; /** * The {@link SplitDirection} to apply to this tileset. */ splitDirection: SplitDirection; /** * If true, allows collisions for camera collisions or picking. While this is true the camera will be prevented from going in or below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true. This can have performance implecations if the tileset contains tile with a larger number of vertices. */ enableCollision: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* Determines if only the tiles from last frame should be used for rendering. This * effectively "freezes" the tileset to the previous frame so it is possible to zoom * out and see what was rendered. *

*/ debugFreezeFrame: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, assigns a random color to each tile. This is useful for visualizing * what features belong to what tiles, especially with additive refinement where features * from parent tiles may be interleaved with features from child tiles. *

*/ debugColorizeTiles: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, renders each tile's content as a wireframe. *

*/ debugWireframe: boolean; /** * Controls how edges from the * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} * glTF extension are rendered relative to surface geometry. Tile content * primitives that do not declare the extension are unaffected. */ edgeDisplayMode: EdgeDisplayMode; /** * This property is for debugging only; it is not optimized for production use. *

* When true, renders the bounding volume for each visible tile. The bounding volume is * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the * screen space error and are still refining to their descendants are yellow. *

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, renders the bounding volume for each visible tile's content. The bounding volume is * blue if the tile has a content bounding volume; otherwise it is red. *

*/ debugShowContentBoundingVolume: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, renders the viewer request volume for each tile. *

*/ debugShowViewerRequestVolume: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, draws labels to indicate the geometric error of each tile. *

*/ debugShowGeometricError: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, draws labels to indicate the number of commands, points, triangles and features of each tile. *

*/ debugShowRenderingStatistics: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, draws labels to indicate the geometry and texture memory usage of each tile. *

*/ debugShowMemoryUsage: boolean; /** * This property is for debugging only; it is not optimized for production use. *

* When true, draws labels to indicate the url of each tile. *

*/ debugShowUrl: boolean; /** * Function for examining vector lines as they are being streamed. */ examineVectorLinesFunction: (...params: any[]) => any; /** * Gets the tileset's asset object property, which contains metadata about the tileset. *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-asset|asset schema reference} * in the 3D Tiles spec for the full set of properties. *

*/ readonly asset: any; /** * Gets the tileset's extensions object property. */ readonly extensions: any; /** * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset. */ clippingPlanes: ClippingPlaneCollection; /** * The {@link ClippingPolygonCollection} used to selectively disable rendering the tileset. */ clippingPolygons: ClippingPolygonCollection; /** * The collection of ImageryLayer objects providing 2D georeferenced * image data that will be rendered over the tileset. * * The imagery will be draped over glTF, B3DM, PNTS, or GeoJSON tile content. * @example * // Drape Bing Maps Aerial imagery over the tileset * const imageryProvider = await Cesium.createWorldImageryAsync({ * style: Cesium.IonWorldImageryStyle.AERIAL, * }); * const imageryLayer = new ImageryLayer(imageryProvider); * tileset.imageryLayers.add(imageryLayer); */ readonly imageryLayers: ImageryLayerCollection; /** * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties. *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-properties|properties schema reference} * in the 3D Tiles spec for the full set of properties. *

* @example * console.log(`Maximum building height: ${tileset.properties.height.maximum}`); * console.log(`Minimum building height: ${tileset.properties.height.minimum}`); */ readonly properties: any; /** * When true, all tiles that meet the screen space error this frame are loaded. The tileset is * completely loaded for this view. */ readonly tilesLoaded: boolean; /** * The resource used to fetch the tileset JSON file */ readonly resource: Resource; /** * The base path that non-absolute paths in tileset JSON file are relative to. */ readonly basePath: string; /** * The style, defined using the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}, * applied to each feature in the tileset. *

* Assign undefined to remove the style, which will restore the visual * appearance of the tileset to its default when no style was applied. *

*

* The style is applied to a tile before the {@link Cesium3DTileset#tileVisible} * event is raised, so code in tileVisible can manually set a feature's * properties (e.g. color and show) after the style is applied. When * a new style is assigned any manually set properties are overwritten. *

*

* Use an always "true" condition to specify the Color for all objects that are not * overridden by pre-existing conditions. Otherwise, the default color Cesium.Color.White * will be used. Similarly, use an always "true" condition to specify the show property * for all objects that are not overridden by pre-existing conditions. Otherwise, the * default show value true will be used. *

* @example * tileset.style = new Cesium.Cesium3DTileStyle({ * color : { * conditions : [ * ['${Height} >= 100', 'color("purple", 0.5)'], * ['${Height} >= 50', 'color("red")'], * ['true', 'color("blue")'] * ] * }, * show : '${Height} > 0', * meta : { * description : '"Building id ${id} has height ${Height}."' * } * }); */ style: Cesium3DTileStyle | undefined; /** * A custom shader to apply to all tiles in the tileset. Only used for * contents that use {@link Model}. Using custom shaders with a * {@link Cesium3DTileStyle} may lead to undefined behavior. */ customShader: CustomShader | undefined; /** * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile * refines to its descendants, and therefore plays a major role in balancing performance with visual quality. *

* A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a * radius equal to the tile's geometric error were rendered at the tile's position. If this value exceeds * maximumScreenSpaceError the tile refines to its descendants. *

*

* Depending on the tileset, maximumScreenSpaceError may need to be tweaked to achieve the right balance. * Higher values provide better performance but lower visual quality. *

*/ maximumScreenSpaceError: number; /** * The amount of GPU memory (in bytes) used to cache tiles. This memory usage is estimated from * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also * includes per-point metadata. *

* Tiles not in view are unloaded to enforce this. *

*

* If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. *

*

* If tiles sized more than cacheBytes are needed to meet the * desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError}, * for the current view, then the memory usage of the tiles loaded will exceed * cacheBytes by up to maximumCacheOverflowBytes. * For example, if cacheBytes is 500000, but 600000 bytes * of tiles are needed to meet the screen space error, then 600000 bytes of tiles * may be loaded (if maximumCacheOverflowBytes is at least 100000). * When these tiles go out of view, they will be unloaded. *

*/ cacheBytes: number; /** * The maximum additional amount of GPU memory (in bytes) that will be used to cache tiles. *

* If tiles sized more than cacheBytes plus maximumCacheOverflowBytes * are needed to meet the desired screen space error, determined by * {@link Cesium3DTileset#maximumScreenSpaceError} for the current view, then * {@link Cesium3DTileset#memoryAdjustedScreenSpaceError} will be adjusted * until the tiles required to meet the adjusted screen space error use less * than cacheBytes plus maximumCacheOverflowBytes. *

*/ maximumCacheOverflowBytes: number; /** * Options for controlling point size based on geometric error and eye dome lighting. */ pointCloudShading: PointCloudShading; /** * The root tile. */ readonly root: Cesium3DTile; /** * The tileset's bounding sphere. * @example * const tileset = await Cesium.Cesium3DTileset.fromUrl("http://localhost:8002/tilesets/Seattle/tileset.json"); * * viewer.scene.primitives.add(tileset); * * // Set the camera to view the newly added tileset * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0)); */ readonly boundingSphere: BoundingSphere; /** * A 4x4 transformation matrix that transforms the entire tileset. * @example * // Adjust a tileset's height from the globe's surface. * const heightOffset = 20.0; * const boundingSphere = tileset.boundingSphere; * const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); * const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); * const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset); * const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); */ modelMatrix: Matrix4; /** * Returns the time, in milliseconds, since the tileset was loaded and first updated. */ readonly timeSinceLoad: number; /** * The total amount of GPU memory in bytes used by the tileset. This value is estimated from * geometry, texture, batch table textures, and binary metadata of loaded tiles. */ readonly totalMemoryUsageInBytes: number; /** * Determines whether terrain, 3D Tiles, or both will be classified by this tileset. *

* This option is only applied to tilesets containing batched 3D models, * glTF content, geometry data, or vector data. Even when undefined, vector * and geometry data must render as classifications and will default to * rendering on both terrain and other 3D Tiles tilesets. *

*

* When enabled for batched 3D model and glTF tilesets, there are a few * requirements/limitations on the glTF: *

    *
  • The glTF cannot contain morph targets, skins, or animations.
  • *
  • The glTF cannot contain the EXT_mesh_gpu_instancing extension.
  • *
  • Only meshes with TRIANGLES can be used to classify other assets.
  • *
  • The meshes must be watertight.
  • *
  • The POSITION semantic is required.
  • *
  • If _BATCHIDs and an index buffer are both present, all indices with the same batch id must occupy contiguous sections of the index buffer.
  • *
  • If _BATCHIDs are present with no index buffer, all positions with the same batch id must occupy contiguous sections of the position buffer.
  • *
*

*

* Additionally, classification is not supported for points or instanced 3D * models. *

*

* The 3D Tiles or terrain receiving the classification must be opaque. *

*/ readonly classificationType: ClassificationType; /** * Specifies if the height is relative to terrain, 3D Tiles, or both. *

* This option is only applied to point features in tilesets containing vector data. * This option requires the Viewer's scene to be passed in through options.scene. *

*/ readonly heightReference: HeightReference | undefined; /** * The {@link CesiumWidget#scene} that the tileset will be rendered in, required for tilesets that specify a {@link heightReference} value for clamping 3D Tiles vector data content- like points, lines, and labels- to terrain or 3D tiles. */ readonly scene: Scene | undefined; /** * Gets an ellipsoid describing the shape of the globe. */ readonly ellipsoid: Ellipsoid; /** * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. * Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. * Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect. */ foveatedConeSize: number; /** * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. */ foveatedMinimumScreenSpaceErrorRelaxation: number; /** * Returns the extras property at the top-level of the tileset JSON, which contains application specific metadata. * Returns undefined if extras does not exist. */ readonly extras: any; /** * The properties for managing image-based lighting on this tileset. */ imageBasedLighting: ImageBasedLighting; /** * The properties for managing dynamic environment maps on this model. Affects lighting. * @example * // Change the ground color used for a tileset's environment map to a forest green * const environmentMapManager = tileset.environmentMapManager; * environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34"); */ readonly environmentMapManager: DynamicEnvironmentMapManager; /** * Indicates that only the tileset's vector tiles should be used for classification. */ vectorClassificationOnly: boolean; /** * Whether vector tiles should keep decoded positions in memory. * This is used with {@link Cesium3DTileFeature.getPolylinePositions}. */ vectorKeepDecodedPositions: boolean; /** * Determines how vector primitives in the tileset are blended with the scene. * Must be {@link BlendOption.OPAQUE} or {@link BlendOption.TRANSLUCENT}; * {@link BlendOption.OPAQUE_AND_TRANSLUCENT} is not supported. */ vectorBlendOption: BlendOption; /** * Determines whether the credits of the tileset will be displayed on the screen */ showCreditsOnScreen: boolean; /** * Label of the feature ID set to use for picking and styling. *

* For EXT_mesh_features, this is the feature ID's label property, or * "featureId_N" (where N is the index in the featureIds array) when not * specified. EXT_feature_metadata did not have a label field, so such * feature ID sets are always labeled "featureId_N" where N is the index in * the list of all feature Ids, where feature ID attributes are listed before * feature ID textures. *

*

* If featureIdLabel is set to an integer N, it is converted to * the string "featureId_N" automatically. If both per-primitive and * per-instance feature IDs are present, the instance feature IDs take * priority. *

*/ featureIdLabel: string | number; /** * Label of the instance feature ID set used for picking and styling. *

* If instanceFeatureIdLabel is set to an integer N, it is converted to * the string "instanceFeatureId_N" automatically. * If both per-primitive and per-instance feature IDs are present, the * instance feature IDs take priority. *

*/ instanceFeatureIdLabel: string | number; /** * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset}, * used for streaming massive heterogeneous 3D geospatial datasets, from a Cesium ion asset ID. * @example * // Load a Cesium3DTileset with a Cesium ion asset ID of 124624234 * try { * const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234); * scene.primitives.add(tileset); * } catch (error) { * console.error(`Error creating tileset: ${error}`); * } * @param assetId - The Cesium ion asset id. * @param [options] - An object describing initialization options */ static fromIonAssetId(assetId: number, options?: Cesium3DTileset.ConstructorOptions): Promise; /** * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset}, * used for streaming massive heterogeneous 3D geospatial datasets. * @example * try { * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json" * ); * scene.primitives.add(tileset); * } catch (error) { * console.error(`Error creating tileset: ${error}`); * } * @example * // Common setting for the skipLevelOfDetail optimization * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json", { * skipLevelOfDetail: true, * baseScreenSpaceError: 1024, * skipScreenSpaceErrorFactor: 16, * skipLevels: 1, * immediatelyLoadDesiredLevelOfDetail: false, * loadSiblings: false, * cullWithChildrenBounds: true * }); * scene.primitives.add(tileset); * @example * // Common settings for the dynamicScreenSpaceError optimization * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json", { * dynamicScreenSpaceError: true, * dynamicScreenSpaceErrorDensity: 2.0e-4, * dynamicScreenSpaceErrorFactor: 24.0, * dynamicScreenSpaceErrorHeightFalloff: 0.25 * }); * scene.primitives.add(tileset); * @param url - The url to a tileset JSON file. * @param [options] - An object describing initialization options */ static fromUrl(url: Resource | string, options?: Cesium3DTileset.ConstructorOptions): Promise; /** * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset}, * used for streaming massive heterogeneous 3D geospatial datasets. * @param url - The url to a tileset JSON file. * @param [options] - An object describing initialization options */ static fromGltf(url: Resource | string, options?: Cesium3DTileset.ConstructorOptions): Promise; /** * Provides a hook to override the method used to request the tileset json * useful when fetching tilesets from remote servers * @param tilesetUrl - The url of the json file to be fetched * @returns A promise that resolves with the fetched json data */ static loadJson(tilesetUrl: Resource | string): Promise; /** * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all * features to re-evaluate the style in the next frame each is visible. */ makeStyleDirty(): void; /** * Unloads all tiles that weren't selected the previous frame. This can be used to * explicitly manage the tile cache and reduce the total number of tiles loaded below * {@link Cesium3DTileset#cacheBytes}. *

* Tile unloads occur at the next frame to keep all the WebGL delete calls * within the render loop. *

*/ trimLoadedTiles(): void; /** * true if the tileset JSON file lists the extension in extensionsUsed; otherwise, false. * @param extensionName - The name of the extension to check. * @returns true if the tileset JSON file lists the extension in extensionsUsed; otherwise, false. */ hasExtension(extensionName: string): boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * tileset = tileset && tileset.destroy(); */ destroy(): void; /** * Get the height of the loaded surface at a given cartographic. This function will only take into account meshes for loaded tiles, not neccisarily the most detailed tiles available for a tileset. This function will always return undefined when sampling a point cloud. * @example * const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234); * scene.primitives.add(tileset); * * const height = tileset.getHeight(scene.camera.positionCartographic, scene); * @param cartographic - The cartographic for which to find the height. * @param scene - The scene where visualization is taking place. * @returns The height of the cartographic or undefined if it could not be found. */ getHeight(cartographic: Cartographic, scene: Scene): number | undefined; } /** * A ParticleEmitter that emits particles from a circle. * Particles will be positioned within a circle and have initial velocities going along the z vector. * @param [radius = 1.0] - The radius of the circle in meters. */ export class CircleEmitter { constructor(radius?: number); /** * The radius of the circle in meters. */ radius: number; } /** * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted. *

* A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including * {@link Material} and {@link 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 {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using * ClassificationPrimitive directly. * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead. *

*

* For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there * will be rendering artifacts for some viewing angles. *

*

* Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}. *

*

* Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}, * are also valid if they are extruded volumes; otherwise, they will not be rendered. *

* @param [options] - Object with the following properties: * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute. * @param [options.show = true] - Determines if this primitive will be shown. * @param [options.vertexCacheOptimize = false] - When true, geometry vertices are optimized for the pre and post-vertex-shader caches. * @param [options.interleave = false] - When true, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. * @param [options.compressVertices = true] - When true, the geometry vertices are compressed, which will save memory. * @param [options.releaseGeometryInstances = true] - When true, the primitive does not keep a reference to the input geometryInstances to save memory. * @param [options.allowPicking = true] - When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. */ export class ClassificationPrimitive { constructor(options?: { geometryInstances?: any[] | GeometryInstance; appearance?: Appearance; show?: boolean; vertexCacheOptimize?: boolean; interleave?: boolean; compressVertices?: boolean; releaseGeometryInstances?: boolean; allowPicking?: boolean; asynchronous?: boolean; classificationType?: ClassificationType; debugShowBoundingVolume?: boolean; debugShowShadowVolume?: boolean; }); /** * The geometry instance rendered with this primitive. This may * be undefined if options.releaseGeometryInstances * is true when the primitive is constructed. *

* Changing this property after the primitive is rendered has no effect. *

*

* Because of the rendering technique used, all geometry instances must be the same color. * If there is an instance with a differing color, a DeveloperError will be thrown * on the first attempt to render. *

*/ readonly geometryInstances: any[] | GeometryInstance; /** * Determines if the primitive will be shown. This affects all geometry * instances in the primitive. */ show: boolean; /** * Determines whether terrain, 3D Tiles or both will be classified. */ classificationType: ClassificationType; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the shadow volume for each geometry in the primitive. *

*/ debugShowShadowVolume: boolean; /** * When true, geometry vertices are optimized for the pre and post-vertex-shader caches. */ readonly vertexCacheOptimize: boolean; /** * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. */ readonly interleave: boolean; /** * When true, the primitive does not keep a reference to the input geometryInstances to save memory. */ readonly releaseGeometryInstances: boolean; /** * When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. */ readonly allowPicking: boolean; /** * Determines if the geometry instances will be created and batched on a web worker. */ readonly asynchronous: boolean; /** * When true, geometry vertices are compressed, which will save memory. */ readonly compressVertices: boolean; /** * Determines if the primitive is complete and ready to render. If this property is * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update} * is called. */ readonly ready: boolean; /** * Determines if ClassificationPrimitive rendering is supported. * @param scene - The scene. * @returns true if ClassificationPrimitives are supported; otherwise, returns false */ static isSupported(scene: Scene): boolean; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * const attributes = primitive.getGeometryInstanceAttributes('an id'); * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

* @example * e = e && e.destroy(); */ destroy(): void; } /** * Whether a classification affects terrain, 3D Tiles or both. */ export enum ClassificationType { /** * Only terrain will be classified. */ TERRAIN = 0, /** * Only 3D Tiles will be classified. */ CESIUM_3D_TILE = 1, /** * Both terrain and 3D Tiles will be classified. */ BOTH = 2 } /** * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}. * Compatible with mathematics functions in {@link Plane} * @param normal - The plane's normal (normalized). * @param distance - The shortest distance from the origin to the plane. The sign of * distance determines which side of the plane the origin * is on. If distance is positive, the origin is in the half-space * in the direction of the normal; if negative, the origin is in the half-space * opposite to the normal; if zero, the plane passes through the origin. */ export class ClippingPlane { constructor(normal: Cartesian3, distance: number); /** * The shortest distance from the origin to the plane. The sign of * distance determines which side of the plane the origin * is on. If distance is positive, the origin is in the half-space * in the direction of the normal; if negative, the origin is in the half-space * opposite to the normal; if zero, the plane passes through the origin. */ distance: number; /** * The plane's normal. */ normal: Cartesian3; /** * Create a ClippingPlane from a Plane object. * @param plane - The plane containing parameters to copy * @param [result] - The object on which to store the result * @returns The ClippingPlane generated from the plane's parameters. */ static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane; /** * Clones the ClippingPlane without setting its ownership. * @param clippingPlane - The ClippingPlane to be cloned * @param [result] - The object on which to store the cloned parameters. * @returns a clone of the input ClippingPlane */ static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane; } /** * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe. *

* In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip * through the center of the object. *

*

* For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead. *

* @example * // This clipping plane's distance is positive, which means its normal * // is facing the origin. This will clip everything that is behind * // the plane, which is anything with y coordinate < -5. * const clippingPlanes = new Cesium.ClippingPlaneCollection({ * planes : [ * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0) * ], * }); * // Create an entity and attach the ClippingPlaneCollection to the model. * const entity = viewer.entities.add({ * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000), * model : { * uri : 'model.gltf', * minimumPixelSize : 128, * maximumScale : 20000, * clippingPlanes : clippingPlanes * } * }); * viewer.zoomTo(entity); * @param [options] - Object with the following properties: * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane. * @param [options.enabled = true] - Determines whether the clipping planes are active. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system. * @param [options.unionClippingRegions = false] - If true, a region will be clipped if it is on the outside of any plane in the collection. Otherwise, a region will only be clipped if it is on the outside of every plane. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped. */ export class ClippingPlaneCollection { constructor(options?: { planes?: ClippingPlane[]; enabled?: boolean; modelMatrix?: Matrix4; unionClippingRegions?: boolean; edgeColor?: Color; edgeWidth?: number; }); /** * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes * original coordinate system. */ modelMatrix: Matrix4; /** * The color applied to highlight the edge along which an object is clipped. */ edgeColor: Color; /** * The width, in pixels, of the highlight applied to the edge along which an object is clipped. */ edgeWidth: number; /** * An event triggered when a new clipping plane is added to the collection. Event handlers * are passed the new plane and the index at which it was added. */ readonly planeAdded: Event; /** * An event triggered when a new clipping plane is removed from the collection. Event handlers * are passed the new plane and the index from which it was removed. */ readonly planeRemoved: Event; /** * Returns the number of planes in this collection. This is commonly used with * {@link ClippingPlaneCollection#get} to iterate over all the planes * in the collection. */ readonly length: number; /** * If true, a region will be clipped if it is on the outside of any plane in the * collection. Otherwise, a region will only be clipped if it is on the * outside of every plane. */ unionClippingRegions: boolean; /** * If true, clipping will be enabled. */ enabled: boolean; /** * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify * how modify the clipping behavior of multiple planes. * @param plane - The ClippingPlane to add to the collection. */ add(plane: ClippingPlane): void; /** * Returns the plane in the collection at the specified index. Indices are zero-based * and increase as planes are added. Removing a plane shifts all planes after * it to the left, changing their indices. This function is commonly used with * {@link ClippingPlaneCollection#length} to iterate over all the planes * in the collection. * @param index - The zero-based index of the plane. * @returns The ClippingPlane at the specified index. */ get(index: number): ClippingPlane; /** * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane. * @param [clippingPlane] - The ClippingPlane to check for. * @returns true if this collection contains the ClippingPlane, false otherwise. */ contains(clippingPlane?: ClippingPlane): boolean; /** * Removes the first occurrence of the given ClippingPlane from the collection. * @returns true if the plane was removed; false if the plane was not found in the collection. */ remove(clippingPlane: ClippingPlane): boolean; /** * Removes all planes from the collection. */ removeAll(): void; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * build the resources for clipping planes. *

* Do not call this function directly. *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * clippingPlanes = clippingPlanes && clippingPlanes.destroy(); */ destroy(): void; } /** * A geodesic polygon to be used with {@link ClippingPlaneCollection} for selectively hiding regions in a model, a 3D tileset, or the globe. * @example * const positions = Cesium.Cartesian3.fromRadiansArray([ * -1.3194369277314022, * 0.6988062530900625, * -1.31941, * 0.69879, * -1.3193955980204217, * 0.6988091578771254, * -1.3193931220959367, * 0.698743632490865, * -1.3194358224045408, * 0.6987471965556998, * ]); * * const polygon = new Cesium.ClippingPolygon({ * positions: positions * }); * @example * // A clipping polygon with two holes. Regions inside the holes are not clipped. * const outerRing = Cesium.Cartesian3.fromDegreesArray([ * -100.0, 40.0, * -90.0, 40.0, * -90.0, 50.0, * -100.0, 50.0, * ]); * * const firstHole = Cesium.Cartesian3.fromDegreesArray([ * -98.0, 42.0, * -96.0, 42.0, * -96.0, 44.0, * -98.0, 44.0, * ]); * * const secondHole = Cesium.Cartesian3.fromDegreesArray([ * -94.0, 46.0, * -92.0, 46.0, * -92.0, 48.0, * -94.0, 48.0, * ]); * * const polygonWithHoles = new Cesium.ClippingPolygon({ * positions: outerRing, * holes: [firstHole, secondHole], * }); * @param options - Object with the following properties: * @param options.positions - A list of three or more Cartesian coordinates defining the outer ring of the clipping polygon. * @param [options.holes] - An array of interior rings (holes), each a list of three or more Cartesian coordinates. Regions inside a hole are excluded from the polygon. */ export class ClippingPolygon { constructor(options: { positions: Cartesian3[]; holes?: Cartesian3[][]; ellipsoid?: Ellipsoid; }); /** * Returns the total number of positions in the polygon, including any holes. */ readonly length: number; /** * Returns the outer ring of positions. A ClippingPolygon's geometry is * immutable; the returned array and its coordinates are frozen. */ readonly positions: Cartesian3[]; /** * Returns the interior rings (holes) of the polygon, each a list of positions. */ readonly holes: Cartesian3[][]; /** * Returns the ellipsoid used to project the polygon onto surfaces when clipping. */ readonly ellipsoid: Ellipsoid; /** * Returns the cartographic rectangle enclosing the polygon, computed once on * construction. Since a ClippingPolygon's geometry is immutable, this rectangle * never changes. */ readonly rectangle: Rectangle; /** * Clones the ClippingPolygon without setting its ownership. * @param polygon - The ClippingPolygon to be cloned * @param [result] - The object on which to store the cloned parameters. * @returns a clone of the input ClippingPolygon */ static clone(polygon: ClippingPolygon, result?: ClippingPolygon): ClippingPolygon; /** * Compares the provided ClippingPolygons and returns * true if they are equal, false otherwise. * @param left - The first polygon. * @param right - The second polygon. * @returns true if left and right are equal, false otherwise. */ static equals(left: ClippingPolygon, right: ClippingPolygon): boolean; /** * Computes a cartographic rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles. * @param [result] - An object in which to store the result. * @returns The result rectangle */ computeRectangle(result?: Rectangle): Rectangle; } /** * Specifies a set of clipping polygons. Clipping polygons selectively disable rendering in a region * inside or outside the specified list of {@link ClippingPolygon} objects for a single glTF model, 3D Tileset, or the globe. * * Clipping Polygons are only supported in WebGL 2 contexts. * @example * const positions = Cesium.Cartesian3.fromRadiansArray([ * -1.3194369277314022, * 0.6988062530900625, * -1.31941, * 0.69879, * -1.3193955980204217, * 0.6988091578771254, * -1.3193931220959367, * 0.698743632490865, * -1.3194358224045408, * 0.6987471965556998, * ]); * * const polygon = new Cesium.ClippingPolygon({ * positions: positions * }); * * const polygons = new Cesium.ClippingPolygonCollection({ * polygons: [ polygon ] * }); * @param [options] - Object with the following properties: * @param [options.polygons = []] - An array of {@link ClippingPolygon} objects used to selectively disable rendering on the inside of each polygon. * @param [options.enabled = true] - Determines whether the clipping polygons are active. * @param [options.inverse = false] - If true, a region will be clipped if it is outside of every polygon in the collection. Otherwise, a region will only be clipped if it is on the inside of any polygon. * @param [options.quality = 1.0] - A scalar that controls the resolution of the signed distance texture used for clipping. Values greater than 1.0 increase quality, values less than 1.0 decrease it. Must be greater than 0.0.

Deprecated in CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this option no longer has any effect.

* @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid to use to project the clipping polygons onto the globe. */ export class ClippingPolygonCollection { constructor(options?: { polygons?: ClippingPolygon[]; enabled?: boolean; inverse?: boolean; quality?: number; ellipsoid?: Ellipsoid; }); /** * If true, clipping will be enabled. */ enabled: boolean; /** * If true, a region will be clipped if it is outside of every polygon in the * collection. Otherwise, a region will only be clipped if it is * inside of any polygon. */ inverse: boolean; /** * An event triggered when a new clipping polygon is added to the collection. Event handlers * are passed the new polygon and the index at which it was added. */ polygonAdded: Event; /** * An event triggered when a new clipping polygon is removed from the collection. Event handlers * are passed the new polygon and the index from which it was removed. */ polygonRemoved: Event; /** * The ellipsoid to use to project the clipping polygons onto the globe. */ ellipsoid: Ellipsoid; /** * Returns the number of polygons in this collection. This is commonly used with * {@link ClippingPolygonCollection#get} to iterate over all the polygons * in the collection. */ readonly length: number; /** * If true, a debug texture visualizing the signed distance field is shown. */ debugShowDistanceTexture: boolean; /** * A scalar that controlled the resolution of the signed distance texture used for clipping. */ quality: number; /** * Adds the specified {@link ClippingPolygon} to the collection to be used to selectively disable rendering * on the inside of each polygon. Use {@link ClippingPolygonCollection#unionClippingRegions} to modify * how modify the clipping behavior of multiple polygons. * @example * const polygons = new Cesium.ClippingPolygonCollection(); * * const positions = Cesium.Cartesian3.fromRadiansArray([ * -1.3194369277314022, * 0.6988062530900625, * -1.31941, * 0.69879, * -1.3193955980204217, * 0.6988091578771254, * -1.3193931220959367, * 0.698743632490865, * -1.3194358224045408, * 0.6987471965556998, * ]); * * polygons.add(new Cesium.ClippingPolygon({ * positions: positions * })); * @param polygon - The ClippingPolygon to add to the collection. * @returns The added ClippingPolygon. */ add(polygon: ClippingPolygon): ClippingPolygon; /** * Returns the clipping polygon in the collection at the specified index. Indices are zero-based * and increase as polygons are added. Removing a polygon polygon all polygons after * it to the left, changing their indices. This function is commonly used with * {@link ClippingPolygonCollection#length} to iterate over all the polygons * in the collection. * @param index - The zero-based index of the polygon. * @returns The ClippingPolygon at the specified index. */ get(index: number): ClippingPolygon; /** * Checks whether this collection contains a ClippingPolygon equal to the given ClippingPolygon. * @param polygon - The ClippingPolygon to check for. * @returns true if this collection contains the ClippingPolygon, false otherwise. */ contains(polygon: ClippingPolygon): boolean; /** * Removes the first occurrence of the given ClippingPolygon from the collection. * @returns true if the polygon was removed; false if the polygon was not found in the collection. */ remove(polygon: ClippingPolygon): boolean; /** * Removes all polygons from the collection. */ removeAll(): void; /** * Function for checking if the context will allow clipping polygons, which require floating point textures. * @param scene - The scene that will contain clipped objects and clipping textures. * @returns true if the context supports clipping polygons. */ static isSupported(scene: Scene | any): boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * clippingPolygons = clippingPolygons && clippingPolygons.destroy(); */ destroy(): void; } /** * A renderable collection of clouds in the 3D scene. *

*
*
* Example cumulus clouds *
*

* Clouds are added and removed from the collection using {@link CloudCollection#add} * and {@link CloudCollection#remove}. * @example * // Create a cloud collection with two cumulus clouds * const clouds = scene.primitives.add(new Cesium.CloudCollection()); * clouds.add({ * position : new Cesium.Cartesian3(1.0, 2.0, 3.0), * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0) * }); * clouds.add({ * position : new Cesium.Cartesian3(4.0, 5.0, 6.0), * maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0), * slice: 0.5 * }); * @param [options] - Object with the following properties: * @param [options.show = true] - Whether to display the clouds. * @param [options.noiseDetail = 16.0] - Desired amount of detail in the noise texture. * @param [options.noiseOffset = Cartesian3.ZERO] - Desired translation of data in noise texture. * @param [options.debugBillboards = false] - For debugging only. Determines if the billboards are rendered with an opaque color. * @param [options.debugEllipsoids = false] - For debugging only. Determines if the clouds will be rendered as opaque ellipsoids. */ export class CloudCollection { constructor(options?: { show?: boolean; noiseDetail?: number; noiseOffset?: Cartesian3; debugBillboards?: boolean; debugEllipsoids?: boolean; }); /** *

* Controls the amount of detail captured in the precomputed noise texture * used to render the cumulus clouds. In order for the texture to be tileable, * this must be a power of two. For best results, set this to be a power of two * between 8.0 and 32.0 (inclusive). *

* *
* * * *
* clouds.noiseDetail = 8.0;
* *
* clouds.noiseDetail = 32.0;
* *
*
*/ noiseDetail: number; /** *

* Applies a translation to noise texture coordinates to generate different data. * This can be modified if the default noise does not generate good-looking clouds. *

* *
* * * *
* default
* *
* clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);
* *
*
*/ noiseOffset: Cartesian3; /** * Determines if billboards in this collection will be shown. */ show: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Renders the billboards with one opaque color for the sake of debugging. *

*/ debugBillboards: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the clouds as opaque, monochrome ellipsoids for the sake of debugging. * If debugBillboards is also true, then the ellipsoids will draw on top of the billboards. *

*/ debugEllipsoids: boolean; /** * Returns the number of clouds in this collection. */ length: number; /** * Creates and adds a cloud with the specified initial properties to the collection. * The added cloud is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a cumulus cloud, specifying all the default values. * const c = clouds.add({ * show : true, * position : Cesium.Cartesian3.ZERO, * scale : new Cesium.Cartesian2(20.0, 12.0), * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0), * slice: -1.0, * cloudType : CloudType.CUMULUS * }); * @example * // Example 2: Specify only the cloud's cartographic position. * const c = clouds.add({ * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) * }); * @param [options] - A template describing the cloud's properties as shown in Example 1. * @returns The cloud that was added to the collection. */ add(options?: any): CumulusCloud; /** * Removes a cloud from the collection. * @example * const c = clouds.add(...); * clouds.remove(c); // Returns true * @param cloud - The cloud to remove. * @returns true if the cloud was removed; false if the cloud was not found in the collection. */ remove(cloud: CumulusCloud): boolean; /** * Removes all clouds from the collection. * @example * clouds.add(...); * clouds.add(...); * clouds.removeAll(); */ removeAll(): void; /** * Check whether this collection contains a given cloud. * @param [cloud] - The cloud to check for. * @returns true if this collection contains the cloud, false otherwise. */ contains(cloud?: CumulusCloud): boolean; /** * Returns the cloud in the collection at the specified index. Indices are zero-based * and increase as clouds are added. Removing a cloud shifts all clouds after * it to the left, changing their indices. This function is commonly used with * {@link CloudCollection#length} to iterate over all the clouds in the collection. * @example * // Toggle the show property of every cloud in the collection * const len = clouds.length; * for (let i = 0; i < len; ++i) { * const c = clouds.get(i); * c.show = !c.show; * } * @param index - The zero-based index of the cloud. * @returns The cloud at the specified index. */ get(index: number): CumulusCloud; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * clouds = clouds && clouds.destroy(); */ destroy(): void; } /** * Specifies the type of the cloud that is added to a {@link CloudCollection} in {@link CloudCollection#add}. */ export enum CloudType { /** * Cumulus cloud. */ CUMULUS = 0 } /** * Defines different modes for blending between a target color and a primitive's source color. * * HIGHLIGHT multiplies the source color by the target color * REPLACE replaces the source color with the target color * MIX blends the source color and target color together */ export enum ColorBlendMode { HIGHLIGHT = 0, REPLACE = 1, MIX = 2 } /** * An expression for a style applied to a {@link Cesium3DTileset}. *

* Evaluates a conditions expression defined using the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}. *

*

* Implements the {@link StyleExpression} interface. *

* @example * const expression = new Cesium.ConditionsExpression({ * conditions : [ * ['${Area} > 10, 'color("#FF0000")'], * ['${id} !== "1"', 'color("#00FF00")'], * ['true', 'color("#FFFFFF")'] * ] * }); * expression.evaluateColor(feature, result); // returns a Cesium.Color object * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language. * @param [defines] - Defines in the style. */ export class ConditionsExpression { constructor(conditionsExpression?: any, defines?: any); /** * Gets the conditions expression defined in the 3D Tiles Styling language. */ readonly conditionsExpression: any; /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of * the expression in the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language} * is of type Boolean, Number, or String, the corresponding JavaScript * primitive type will be returned. If the result is a RegExp, a Javascript RegExp * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. * @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object onto which to store the result. * @returns The result of evaluating the expression. */ evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; /** * Evaluates the result of a Color expression, using the values defined by a feature. *

* This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object. *

* @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object in which to store the result * @returns The modified result parameter or a new Color instance if one was not provided. */ evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color; } /** * A ParticleEmitter that emits particles within a cone. * Particles will be positioned at the tip of the cone and have initial velocities going towards the base. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians. */ export class ConeEmitter { constructor(angle?: number); /** * The angle of the cone in radians. */ angle: number; } /** * An interface for a camera controller that can be registered with the scene to handle input events, camera animations, and other interactions. Implementations of this interface are expected to be registered with the scene via a {@link ControllerHost}. * This type describes an * interface and is not intended to be instantiated directly. */ export class Controller { /** * Determines if the controller is enabled and should be updated by the host scene. */ enabled: boolean; /** * Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ connectedCallback(element: HTMLElement): void; /** * Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ disconnectedCallback(element: HTMLElement): void; /** * Invoked once per frame. Implement update to modify the camera or other parts of the scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; /** * Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene. * @param time - The current simulation time. */ firstUpdate(scene: Scene, time: JulianDate): void; } /** * Creates an instance of a ControllerHost. Typically, a ControllerHost is created by the Scene constructor and accessed via {@link Scene#controllerHost}. */ export class ControllerHost { /** * The number of controllers registered to this host. */ readonly controllerCount: number; /** * Registers a controller implementation with this host. * @param controller - An implementation of the Controller interface to register with this host. * @param element - The DOM element containing the Cesium scene. * @param [priority = 0] - An index, less than or equal to the current count of registed controllers, that defines the precedence of the new controller relative to those previously registered. A priority of 0 would mean the new controller would apply its updates before any other controller. As subsequent controllers are updated, their effects are applied on top of any previous update effects. If omitted, the new controller becomes the highest priority, i.e., its updates are applied after all other controllers. */ registerController(controller: Controller, element: HTMLElement, priority?: number): void; /** * Unregisters a controller implementation from this host. * @param controller - An implementation of the Controller interface to unregister from this host. * @param element - The DOM element containing the Cesium scene. */ unregisterController(controller: Controller, element: HTMLElement): void; /** * Invoked once per frame by the host scene. Updates all registered controllers in order of their priority. * @param scene - The host scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; } export interface HybridScreenSpacePanCameraController extends Controller { } /** * A contextual camera controller that combines screenspace map panning and screenspace elevator panning. The controller automatically switches between the two based on the camera's angle relative to nadir. If the camera is looking mostly down (within angleThreshold of nadir), ScreenSpaceMapCameraController is used. * If the camera is looking towards the horizon (beyond angleThreshold from nadir), the ScreenSpaceElevatorCameraController is used. * @example * viewer.scene.screenSpaceCameraController.enableInputs = false; * viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; * * const hybridController = new HybridScreenSpacePanCameraController(); * viewer.addController(hybridController); */ export class HybridScreenSpacePanCameraController implements Controller { /** * The angle threshold in radians that determines which controller is used. If the camera is looking within this angle of nadir, the map controller is used. Otherwise, the elevator controller is used. */ angleThreshold: number; /** * The controller that is used when the camera is looking more horizontally (beyond angleThreshold from nadir). */ readonly elevatorController: ScreenSpaceElevatorCameraController; /** * The controller that is used when the camera is looking mostly down (within angleThreshold of nadir). */ readonly mapController: ScreenSpaceMapCameraController; /** * Determines if the controller is enabled and should be updated by the host scene. */ enabled: boolean; /** * Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ connectedCallback(element: HTMLElement): void; /** * Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ disconnectedCallback(element: HTMLElement): void; /** * Invoked once per frame. Implement update to modify the camera or other parts of the scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; /** * Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene. * @param time - The current simulation time. */ firstUpdate(scene: Scene, time: JulianDate): void; } /** * This enumerated type is for classifying mouse buttons: left, middle, and right. */ export enum MouseButton { /** * Represents a mouse left button. */ LEFT = 0, /** * Represents a mouse middle button. */ MIDDLE = 1, /** * Represents a mouse right button. */ RIGHT = 2 } export namespace ScreenSpaceElevatorCameraController { /** * @property [dragInputs] - The drag input bindings that control panning. */ type ControllerOptions = { dragInputs?: ScreenSpaceInputBindings.InputBinding[]; }; } export interface ScreenSpaceElevatorCameraController extends Controller { } /** * Creates an instance of a ScreenSpaceElevatorCameraController. * @example * viewer.scene.screenSpaceCameraController.enableInputs = false; * viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; * * const elevatorCameraController = new Cesium.ScreenSpaceElevatorCameraController(); * viewer.addController(elevatorCameraController); * @example * // Configure the controller to use the right mouse button for panning instead of the default left mouse button. * const elevatorCameraController = new Cesium.ScreenSpaceElevatorCameraController({ * dragInputs: [{ button: Cesium.MouseButton.RIGHT}] * }); * viewer.addController(elevatorCameraController); * @param [options] - The options for configuring the controller. */ export class ScreenSpaceElevatorCameraController implements Controller { constructor(options?: ScreenSpaceElevatorCameraController.ControllerOptions); /** * The drag input bindings that control vertical panning. Each binding is a combination of the mouse button * and an optional keyboard modifier. */ dragInputs: ScreenSpaceInputBindings.InputBinding[]; /** * A callback function used to pick the world position from which to pan. The function is called with {@link Scene}, the {@link Cartesian2} screen space position, and a {@link Cartesian3} instance to store the result. The function should return the {@link Cartesian3} world position from which to pan, or undefined if no position could be picked. If undefined is returned, the camera will pan relative to the ellipsoid surface below the camera. * @example * const elevatorCameraController = new Cesium.ScreenSpaceElevatorCameraController(); * elevatorCameraController.pickWorldPosition = function (scene, windowPosition, result) { * // Pick the world position from the depth buffer * return scene.pickPosition(windowPosition, result); * }; * viewer.addController(elevatorCameraController); */ pickWorldPosition: (...params: any[]) => any; /** * The speed in meters per pixel at which the camera pans. */ panSpeed: number; /** * Enable or disable inertia when panning. When enabled, the camera will continue to move after the user stops dragging, gradually slowing down based on {@link ScreenSpaceMapCameraController#inertialDecay}. */ inertiaEnabled: boolean; /** * The rate at which the camera's pan velocity decays over time. */ inertialDecay: number; /** * A parameter in the range [0, 1) used to limit the range * of inputs to a percentage of the window width/height per animation frame. * This helps keep the camera under control in low-frame-rate situations. */ maximumMovementRatio: number; /** * Determines if the controller is enabled and should be updated by the host scene. */ enabled: boolean; /** * Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ connectedCallback(element: HTMLElement): void; /** * Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ disconnectedCallback(element: HTMLElement): void; /** * Invoked once per frame. Implement update to modify the camera or other parts of the scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; /** * Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene. * @param time - The current simulation time. */ firstUpdate(scene: Scene, time: JulianDate): void; } export namespace ScreenSpaceInputBindings { /** * @property button - The mouse button used for drag start/stop. * @property [modifier] - The optional keyboard modifier to register. */ type InputBinding = { button: MouseButton; modifier?: number; }; /** * @property [start] - Called on drag start. * @property [end] - Called on drag stop. * @property [change] - Called on drag move. */ type DragInputActions = { start?: (...params: any[]) => any; end?: (...params: any[]) => any; change?: (...params: any[]) => any; }; /** * @property isDragging - True if a drag is in progress, false otherwise. */ type DragInputState = { isDragging: boolean; }; /** * Registers drag input bindings on a screen space event handler. * @param handler - The screen space event handler. * @param inputBindings - The drag bindings to register. * @param dragInputActions - The callbacks to invoke for drag actions. * @returns The drag input state. */ function registerDragInputBindings(handler: ScreenSpaceEventHandler, inputBindings: InputBinding[], dragInputActions: DragInputActions): DragInputState; } export namespace ScreenSpaceMapCameraController { /** * @property [dragInputs] - The drag input bindings that control panning. */ type ControllerOptions = { dragInputs?: ScreenSpaceInputBindings.InputBinding[]; }; } export interface ScreenSpaceMapCameraController extends Controller { } /** * Creates an instance of a ScreenSpaceMapCameraController. * @example * viewer.scene.screenSpaceCameraController.enableInputs = false; * * const mapCameraController = new Cesium.ScreenSpaceMapCameraController(); * viewer.addController(mapCameraController); * @example * // Configure the controller to use the right mouse button for panning instead of the default left mouse button. * const mapCameraController = new Cesium.ScreenSpaceMapCameraController({ * dragInputs: [{ button: Cesium.MouseButton.RIGHT}] * }); * viewer.addController(mapCameraController); * @param [options] - The options for configuring the controller. */ export class ScreenSpaceMapCameraController implements Controller { constructor(options?: ScreenSpaceMapCameraController.ControllerOptions); /** * The drag input bindings that map panning. Each binding is a combination of the mouse button * and an optional keyboard modifier. */ dragInputs: ScreenSpaceInputBindings.InputBinding[]; /** * A callback function used to pick the world position from which to pan. The function is called with {@link Scene}, the {@link Cartesian2} screen space position, and a {@link Cartesian3} instance to store the result. The function should return the {@link Cartesian3} world position from which to pan, or undefined if no position could be picked. If undefined is returned, the camera will pan relative to the ellipsoid surface below the camera. * @example * const mapCameraController = new Cesium.ScreenSpaceMapCameraController(); * mapCameraController.pickWorldPosition = function (scene, windowPosition, result) { * // Pick the world position from the depth buffer * return scene.pickPosition(windowPosition, result); * }; * viewer.addController(mapCameraController); */ pickWorldPosition: (...params: any[]) => any; /** * The speed in meters per pixel at which the camera pans. */ panSpeed: number; /** * Enable or disable inertia when panning. When enabled, the camera will continue to move after the user stops dragging, gradually slowing down based on {@link ScreenSpaceMapCameraController#inertialDecay}. */ inertiaEnabled: boolean; /** * The rate at which the camera's pan velocity decays over time. */ inertialDecay: number; /** * A parameter in the range [0, 1) used to limit the range * of inputs to a percentage of the window width/height per animation frame. * This helps keep the camera under control in low-frame-rate situations. */ maximumMovementRatio: number; /** * Determines if the controller is enabled and should be updated by the host scene. */ enabled: boolean; /** * Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ connectedCallback(element: HTMLElement): void; /** * Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ disconnectedCallback(element: HTMLElement): void; /** * Invoked once per frame. Implement update to modify the camera or other parts of the scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; /** * Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene. * @param time - The current simulation time. */ firstUpdate(scene: Scene, time: JulianDate): void; } export namespace ScreenSpaceTiltOrbitCameraController { /** * @property [dragInputs] - The drag input bindings that control tilting and orbiting. */ type ControllerOptions = { dragInputs?: ScreenSpaceInputBindings.InputBinding[]; }; } export interface ScreenSpaceTiltOrbitCameraController extends Controller { } /** * Creates a new instance of ScreenSpaceTiltOrbitCameraController. * @example * viewer.scene.screenSpaceCameraController.enableInputs = false; * viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; * * const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController(); * viewer.addController(tiltOrbitController); * @example * // Tilt around the position under the cursor or tap when dragging starts instead of the position at the center of the screen. * viewer.scene.screenSpaceCameraController.enableInputs = false; * viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; * * const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController(); * tiltOrbitController.useDragPosition = true; * viewer.addController(tiltOrbitController); * @example * // Configure the controller to use the left mouse button for tilting and orbiting instead of the default right mouse button. * const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController({ * dragInputs: [{ button: Cesium.MouseButton.LEFT }] * }); * viewer.addController(tiltOrbitController); * @param [options] - The options for configuring the controller. */ export class ScreenSpaceTiltOrbitCameraController implements Controller { constructor(options?: ScreenSpaceTiltOrbitCameraController.ControllerOptions); /** * Enabled dragging to tilt the camera. */ tiltEnabled: boolean; /** * Enabled dragging to orbit the camera. */ orbitEnabled: boolean; /** * If false, the camera will orbit and tilt around the position at the center of the screen. If true, the camera will orbit and tilt around the position under the cursor or tap when dragging starts. */ useDragPosition: boolean; /** * The drag input bindings that control tilting. Each binding is a combination of the mouse button * and an optional keyboard modifier. */ dragInputs: ScreenSpaceInputBindings.InputBinding[]; /** * A callback function used to pick the world position around which to tilt or orbit. The function is called with {@link Scene}, the {@link Cartesian2} screen space position, and a {@link Cartesian3} instance to store the result. The function should return the {@link Cartesian3} world position from which to tilt or orbit, or undefined if no position could be picked. * @example * const tiltOrbitCameraController = new Cesium.ScreenSpaceTiltOrbitCameraController(); * tiltOrbitCameraController.pickWorldPosition = function (scene, windowPosition, result) { * // Pick the world position from the depth buffer * return scene.pickPosition(windowPosition, result); * }; * viewer.addController(tiltOrbitCameraController); */ pickWorldPosition: (...params: any[]) => any; /** * The amount at which the camera tilts per dragged pixel. A value of 1.0 means that dragging the mouse across the entire canvas will tilt the camera by 90 degrees. */ tiltMagnitude: number; /** * Enables or disables damping for tilt and orbit animations. Damping smooths out the camera movement and makes it feel more natural or weighty, but it can also introduce a slight delay in the camera response. If damping is disabled, the camera will respond immediately to user input. */ dampingEnabled: boolean; /** * Specifies the length of time in seconds in which a single tilt animation is targeted to complete. */ tiltAnimationDuration: number; /** * The maximum tilt velocity in radians per second. A value of Number.POSITIVE_INFINITY means that the maximum tilt velocity is unbounded. */ maximumTiltVelocity: number; /** * The amount at which the camera orbits per dragged pixel. A value of 1.0 means that dragging the mouse across the entire canvas will orbit the camera by 180 degrees. */ orbitMagnitude: number; /** * Specifies the length of time in seconds in which a single orbit animation completes. */ orbitAnimationDuration: number; /** * The maximum orbit velocity in radians per second. A value of Number.POSITIVE_INFINITY means that the maximum orbit velocity is unbounded. */ maximumOrbitVelocity: number; /** * A parameter in the range [0, 1) used to limit the range * of inputs to a percentage of the window width/height per animation frame. * This helps keep the camera under control in low-frame-rate situations. */ maximumMovementRatio: number; /** * Attempts to orbit the camera around the specified origin by the specified amount in radians. Positive values orbit the camera clockwise, negative values orbit the camera counterclockwise. If the drag origin is not on the ellipsoid, no orbit is applied. * @param camera - The camera to orbit. * @param target - The origin position to orbit around in world coordinates. * @param axis - The axis to orbit around, typically the negative of the surface normal at the target position. * @param amount - The amount to orbit the camera in radians. Positive values orbit the camera clockwise, negative values orbit the camera counterclockwise. * @param dt - The time delta in seconds since the last update. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid to pick for the orbit origin. If undefined, the default ellipsoid is used. */ orbit(camera: Camera, target: Cartesian3, axis: Cartesian3, amount: number, dt: number, ellipsoid?: Ellipsoid): void; /** * Attempts to tilt the camera by the specified amount in radians. Positive values tilt the camera down, negative values tilt the camera up. If the drag origin is not on the ellipsoid, no tilt is applied. * @param camera - The camera to tilt. * @param target - The origin position to tilt around in world coordinates. * @param axis - The axis to tilt around, typically the negative of the surface normal at the target position. * @param amount - The amount to tilt the camera in radians. Positive values tilt the camera down, negative values tilt the camera up. * @param dt - The time delta in seconds since the last update. Value must be greater than 0. * @param [ellipsoid = Ellipsoid.default] - The ellipsoid to pick for the tilt origin. If undefined, the default ellipsoid is used. */ tilt(camera: Camera, target: Cartesian3, axis: Cartesian3, amount: number, dt: number, ellipsoid?: Ellipsoid): void; /** * Determines if the controller is enabled and should be updated by the host scene. */ enabled: boolean; /** * Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ connectedCallback(element: HTMLElement): void; /** * Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ disconnectedCallback(element: HTMLElement): void; /** * Invoked once per frame. Implement update to modify the camera or other parts of the scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; /** * Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene. * @param time - The current simulation time. */ firstUpdate(scene: Scene, time: JulianDate): void; } export namespace ScreenSpaceZoomCameraController { /** * @property [dragInputs] - The drag input bindings that control zooming. * @property [scrollInputs] - The scroll input bindings that control zooming. */ type ControllerOptions = { dragInputs?: ScreenSpaceInputBindings.InputBinding[]; scrollInputs?: ScreenSpaceEventType[]; }; } export interface ScreenSpaceZoomCameraController extends Controller { } /** * Creates a new instance of ScreenSpaceZoomCameraController. * @example * viewer.scene.screenSpaceCameraController.enableInputs = false; * viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; * * const zoomCameraController = new Cesium.ScreenSpaceZoomCameraController(); * viewer.addController(zoomCameraController); * @param [options] - The options for configuring the controller. */ export class ScreenSpaceZoomCameraController implements Controller { constructor(options?: ScreenSpaceZoomCameraController.ControllerOptions); /** * If false, the camera will zoom to the position at the center of the screen. If true, the camera will zoom to the position under the cursor or tap when dragging starts or when scrolling with the scroll wheel. */ usePointerPosition: boolean; /** * The drag input bindings that control zooming. Each binding is a combination of the mouse button * and an optional keyboard modifier. */ dragInputs: ScreenSpaceInputBindings.InputBinding[]; /** * The scroll input bindings that control zooming. */ scrollInputs: ScreenSpaceEventType[]; /** * The rate at which the camera zooms in and out based on the mouse wheel delta. */ zoomSensitivity: number; /** * A callback function used to pick the world position from which to zoom. The function is called with {@link Scene}, the {@link Cartesian2} screen space position, and a {@link Cartesian3} instance to store the result. The function should return the {@link Cartesian3} world position from which to zoom, or undefined if no position could be picked. * @example * const zoomCameraController = new Cesium.ScreenSpaceZoomCameraController(); * zoomCameraController.pickWorldPosition = function (scene, windowPosition, result) { * // Pick the world position from the depth buffer * return scene.pickPosition(windowPosition, result); * }; * viewer.addController(zoomCameraController); */ pickWorldPosition: (...params: any[]) => any; /** * The ratio of the camera's distance to the zoom target that defines how much the camera zooms in and out per second. */ zoomDistanceRatio: number; /** * Enable or disable inertia when zooming. When enabled, the camera will continue to move after the user input stops, gradually slowing down based on {@link ScreenSpaceZoomCameraController#inertialDecay}. */ inertiaEnabled: boolean; /** * The rate at which the camera's zoom velocity decays over time. */ inertialDecay: number; /** * Maximum distance from the zoom target that the camera can move away. */ maximumZoomDistance: number; /** * The maximum zoom velocity in meters per second. This limits the speed at which the camera can zoom in and out. */ maximumZoomVelocity: number; /** * Enables or disables damping for zooming. Damping smooths out the camera movement and makes it feel more natural or weighty, but it can also introduce a slight delay in the camera response. If damping is disabled, the camera will respond immediately to user input. */ dampingEnabled: boolean; /** * Specifies the length of time in seconds in which a single zoom animation is targeted to complete. */ zoomAnimationDuration: number; /** * Determines if the controller is enabled and should be updated by the host scene. */ enabled: boolean; /** * Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ connectedCallback(element: HTMLElement): void; /** * Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners. * @param element - The DOM element containing the Cesium scene. */ disconnectedCallback(element: HTMLElement): void; /** * Invoked once per frame. Implement update to modify the camera or other parts of the scene. * @param time - The current simulation time. */ update(scene: Scene, time: JulianDate): void; /** * Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene. * @param time - The current simulation time. */ firstUpdate(scene: Scene, time: JulianDate): void; } /** * The credit display is responsible for displaying credits on screen. * @example * // Add a credit with a tooltip, image and link to display onscreen * const credit = new Cesium.Credit(``, true); * viewer.creditDisplay.addStaticCredit(credit); * @example * // Add a credit with a plaintext link to display in the lightbox * const credit = new Cesium.Credit('Cesium'); * viewer.creditDisplay.addStaticCredit(credit); * @param container - The HTML element where credits will be displayed * @param [delimiter = '•'] - The string to separate text credits * @param [viewport = document.body] - The HTML element that will contain the credits popup */ export class CreditDisplay { constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement); /** * The HTML element where credits will be displayed. */ container: HTMLElement; /** * Adds a {@link Credit} that will show on screen or in the lightbox until * the next frame. This is mostly for internal use. Use {@link CreditDisplay.addStaticCredit} to add a persistent credit to the screen. * @param credit - The credit to display in the next frame. */ addCreditToNextFrame(credit: Credit): void; /** * Adds a {@link Credit} that will show on screen or in the lightbox until removed with {@link CreditDisplay.removeStaticCredit}. * @example * // Add a credit with a tooltip, image and link to display onscreen * const credit = new Cesium.Credit(``, true); * viewer.creditDisplay.addStaticCredit(credit); * @example * // Add a credit with a plaintext link to display in the lightbox * const credit = new Cesium.Credit('Cesium'); * viewer.creditDisplay.addStaticCredit(credit); * @param credit - The credit to added */ addStaticCredit(credit: Credit): void; /** * Removes a static credit shown on screen or in the lightbox. * @param credit - The credit to be removed. */ removeStaticCredit(credit: Credit): void; /** * Updates the credit display before a new frame is rendered. */ update(): void; /** * Resets the credit display to a beginning of frame state, clearing out current credits. */ beginFrame(): void; /** * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container. */ endFrame(): void; /** * Destroys the resources held by this object. Destroying an object allows for deterministic * release of resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. */ destroy(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Gets or sets the Cesium logo credit. */ static cesiumCredit: Credit; } export namespace CubeMapPanorama { /** * Initialization options for the CubeMapPanorama constructor * @property [options.sources] - The source URL or Image object for each of the six cube map faces. See the example below. * @property [options.transform] - A 3x3 transformation matrix that defines the panorama’s orientation. If not specified, the default orientation is defined using the True Equator Mean Equinox (TEME) axes. * @property [options.show = true] - Determines if this primitive will be shown. * @property [options.credit] - A credit for the panorama, which is displayed on the canvas. */ type ConstructorOptions = {}; } /** * A {@link Panorama} that displays imagery in cube map format in a scene. *

* This is only supported in 3D. The cube map panorama is faded out when morphing to 2D or Columbus view. The size of * the cube map panorama must not exceed {@link Scene#maximumSkyBoxSize}. *

* @example * const modelMatrix = Cesium.Matrix4.getMatrix3( * Cesium.Transforms.localFrameToFixedFrameGenerator("north", "down")( * Cesium.Cartesian3.fromDegrees(longitude, latitude, height), * Cesium.Ellipsoid.default * ), * new Cesium.Matrix3() * ); * * * scene.primitives.add(new Cesium.CubeMapPanorama({ * sources : { * positiveX : 'cubemap_px.png', * negativeX : 'cubemap_nx.png', * positiveY : 'cubemap_py.png', * negativeY : 'cubemap_ny.png', * positiveZ : 'cubemap_pz.png', * negativeZ : 'cubemap_nz.png' * } * transform: modelMatrix, * })); * @param options - Object describing initialization options */ export class CubeMapPanorama { constructor(options: CubeMapPanorama.ConstructorOptions); /** * The sources used to create the cube map faces: an object * with positiveX, negativeX, positiveY, * negativeY, positiveZ, and negativeZ properties. * These can be either URLs or Image objects. */ sources: any; /** * Determines if the cube map panorama will be shown. */ show: boolean; /** * Gets the transform of the panorama. If undefined, the default orientation uses the True Equator Mean Equinox (TEME) axes. */ readonly transform: Matrix3; /** * Gets the credits of the panorama. */ readonly credit: Credit; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * cubeMapPanorama = cubeMapPanorama && cubeMapPanorama.destroy(); */ destroy(): void; } /** * Determines which triangles, if any, are culled. */ export enum CullFace { /** * Front-facing triangles are culled. */ FRONT = WebGLConstants.FRONT, /** * Back-facing triangles are culled. */ BACK = WebGLConstants.BACK, /** * Both front-facing and back-facing triangles are culled. */ FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK } /** *
* A cloud is created and its initial properties are set by calling {@link CloudCollection#add}. * and {@link CloudCollection#remove}. Do not call the constructor directly. *
* A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}. *

*
*
* Example cumulus clouds *
*/ export class CumulusCloud { constructor(); /** * Determines if this cumulus cloud will be shown. Use this to hide or show a cloud, instead * of removing it and re-adding it to the collection. */ show: boolean; /** * Gets or sets the Cartesian position of this cumulus cloud. */ position: Cartesian3; /** *

Gets or sets the scale of the cumulus cloud billboard in meters. * The scale property will affect the size of the billboard, * but not the cloud's actual appearance.

*
* * * *
* cloud.scale = new Cesium.Cartesian2(12, 8);
* *
* cloud.scale = new Cesium.Cartesian2(24, 10);
* *
*
* *

To modify the cloud's appearance, modify its maximumSize * and slice properties.

*/ scale: Cartesian2; /** *

Gets or sets the maximum size of the cumulus cloud rendered on the billboard. * This defines a maximum ellipsoid volume that the cloud can appear in. * Rather than guaranteeing a specific size, this specifies a boundary for the * cloud to appear in, and changing it can affect the shape of the cloud.

*

Changing the z-value of maximumSize has the most dramatic effect * on the cloud's appearance because it changes the depth of the cloud, and thus the * positions at which the cloud-shaping texture is sampled.

*
* * * * * * * * * *
* cloud.maximumSize = new Cesium.Cartesian3(14, 9, 10);
* *
* cloud.maximumSize.x = 25;
* *
* cloud.maximumSize.y = 5;
* *
* cloud.maximumSize.z = 17;
* *
*
* *

To modify the billboard's actual size, modify the cloud's scale property.

*/ maximumSize: Cartesian3; /** * Sets the color of the cloud */ color: Color; /** *

Gets or sets the "slice" of the cloud that is rendered on the billboard, i.e. * the specific cross-section of the cloud chosen for the billboard's appearance. * Given a value between 0 and 1, the slice specifies how deeply into the cloud * to intersect based on its maximum size in the z-direction.

*
* * * * *
cloud.slice = 0.32;
cloud.slice = 0.5;
cloud.slice = 0.6;
*
* *
*

Due to the nature in which this slice is calculated, * values below 0.2 may result in cross-sections that are too small, * and the edge of the ellipsoid will be visible. Similarly, values above 0.7 * will cause the cloud to appear smaller. Values outside the range [0.1, 0.9] * should be avoided entirely because they do not produce desirable results.

* *
* * * *
cloud.slice = 0.08;
cloud.slice = 0.8;
*
* *

If slice is set to a negative number, the cloud will not render a cross-section. * Instead, it will render the outside of the ellipsoid that is visible. For clouds with * small values of `maximumSize.z`, this can produce good-looking results, but for larger * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.

* *
* * * *
* cloud.slice = -1.0;
cloud.maximumSize.z = 18;

* *
* cloud.slice = -1.0;
cloud.maximumSize.z = 30;

*
*
*/ slice: number; /** * Gets or sets the brightness of the cloud. This can be used to give clouds * a darker, grayer appearance. *

*
* * * * *
cloud.brightness = 1.0;
cloud.brightness = 0.6;
cloud.brightness = 0.0;
*
*/ brightness: number; } /** * Visualizes a vertex attribute by displaying it as a color for debugging. *

* Components for well-known unit-length vectors, i.e., normal, * tangent, and bitangent, are scaled and biased * from [-1.0, 1.0] to (-1.0, 1.0). *

* @example * const primitive = new Cesium.Primitive({ * geometryInstances : // ... * appearance : new Cesium.DebugAppearance({ * attributeName : 'normal' * }) * }); * @param options - Object with the following properties: * @param options.attributeName - The name of the attribute to visualize. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute. * @param [options.glslDatatype = 'vec3'] - The GLSL datatype of the attribute. Supported datatypes are float, vec2, vec3, and vec4. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class DebugAppearance { constructor(options: { attributeName: string; perInstanceAttribute?: boolean; glslDatatype?: string; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * This property is part of the {@link Appearance} interface, but is not * used by {@link DebugAppearance} since a fully custom fragment shader is used. */ material: Material; /** * When true, the geometry is expected to appear translucent. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader * source is built procedurally taking into account the {@link DebugAppearance#material}. * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. */ readonly renderState: any; /** * When true, the geometry is expected to be closed. */ readonly closed: boolean; /** * The name of the attribute being visualized. */ readonly attributeName: string; /** * The GLSL datatype of the attribute being visualized. */ readonly glslDatatype: string; /** * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just * {@link DebugAppearance#fragmentShaderSource}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } /** * Draws the outline of the camera's view frustum. * @example * primitives.add(new Cesium.DebugCameraPrimitive({ * camera : camera, * color : Cesium.Color.YELLOW * })); * @param options - Object with the following properties: * @param options.camera - The camera. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values. * @param [options.color = Color.CYAN] - The color of the debug outline. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes. * @param [options.show = true] - Determines if this primitive will be shown. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}. */ export class DebugCameraPrimitive { constructor(options: { camera: Camera; frustumSplits?: number[]; color?: Color; updateOnChange?: boolean; show?: boolean; id?: any; }); /** * Determines if this primitive will be shown. */ show: boolean; /** * User-defined value returned when the primitive is picked. */ id: any; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

* @example * p = p && p.destroy(); */ destroy(): void; } /** * 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. *

* @example * primitives.add(new Cesium.DebugModelMatrixPrimitive({ * modelMatrix : primitive.modelMatrix, // primitive to debug * length : 100000.0, * width : 10.0 * })); * @param [options] - Object with the following properties: * @param [options.length = 10000000.0] - The length of the axes in meters. * @param [options.width = 2.0] - The width of the axes in pixels. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize. * @param [options.show = true] - Determines if this primitive will be shown. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick} */ export class DebugModelMatrixPrimitive { constructor(options?: { length?: number; width?: number; modelMatrix?: Matrix4; show?: boolean; id?: any; }); /** * The length of the axes in meters. */ length: number; /** * The width of the axes in pixels. */ width: number; /** * Determines if this primitive will be shown. */ show: boolean; /** * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize. */ modelMatrix: Matrix4; /** * User-defined value returned when the primitive is picked. */ id: any; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

* @example * p = p && p.destroy(); */ destroy(): void; } /** * Determines the function used to compare two depths for the depth test. */ export enum DepthFunction { /** * The depth test never passes. */ NEVER = WebGLConstants.NEVER, /** * The depth test passes if the incoming depth is less than the stored depth. */ LESS = WebGLConstants.LESS, /** * The depth test passes if the incoming depth is equal to the stored depth. */ EQUAL = WebGLConstants.EQUAL, /** * The depth test passes if the incoming depth is less than or equal to the stored depth. */ LESS_OR_EQUAL = WebGLConstants.LEQUAL, /** * The depth test passes if the incoming depth is greater than the stored depth. */ GREATER = WebGLConstants.GREATER, /** * The depth test passes if the incoming depth is not equal to the stored depth. */ NOT_EQUAL = WebGLConstants.NOTEQUAL, /** * The depth test passes if the incoming depth is greater than or equal to the stored depth. */ GREATER_OR_EQUAL = WebGLConstants.GEQUAL, /** * The depth test always passes. */ ALWAYS = WebGLConstants.ALWAYS } /** * A light that gets emitted in a single direction from infinitely far away. * @param options - Object with the following properties: * @param options.direction - The direction in which light gets emitted. * @param [options.color = Color.WHITE] - The color of the light. * @param [options.intensity = 1.0] - The intensity of the light. */ export class DirectionalLight { constructor(options: { direction: Cartesian3; color?: Color; intensity?: number; }); /** * The direction in which light gets emitted. */ direction: Cartesian3; /** * The color of the light. */ color: Color; /** * The intensity of the light. */ intensity: number; } /** * A policy for discarding tile images that contain no data (and so aren't actually images). * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is * expected to be used in place of any empty tile images by the image loading code. */ export class DiscardEmptyTileImagePolicy { constructor(); /** * Determines if the discard policy is ready to process images. * @returns True if the discard policy is ready to process images; otherwise, false. */ isReady(): boolean; /** * Given a tile image, decide whether to discard that image. * @param image - An image to test. * @returns True if the image should be discarded; otherwise, false. */ shouldDiscardImage(image: HTMLImageElement): boolean; /** * Default value for representing an empty image. */ static readonly EMPTY_IMAGE: HTMLImageElement; } /** * A policy for discarding tile images that match a known image containing a * "missing" image. * @param options - Object with the following properties: * @param options.missingImageUrl - The URL of the known missing image. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to * compare against the missing image. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the * discard check will proceed no matter the values of the pixelsToCheck. */ export class DiscardMissingTileImagePolicy { constructor(options: { missingImageUrl: Resource | string; pixelsToCheck: Cartesian2[]; disableCheckIfAllPixelsAreTransparent?: boolean; }); /** * Determines if the discard policy is ready to process images. * @returns True if the discard policy is ready to process images; otherwise, false. */ isReady(): boolean; /** * Given a tile image, decide whether to discard that image. * @param image - An image to test. * @returns True if the image should be discarded; otherwise, false. */ shouldDiscardImage(image: HTMLImageElement): boolean; } /** * Atmosphere lighting effects (sky atmosphere, ground atmosphere, fog) can be * further modified with dynamic lighting from the sun or other light source * that changes over time. This enum determines which light source to use. */ export enum DynamicAtmosphereLightingType { /** * Do not use dynamic atmosphere lighting. Atmosphere lighting effects will * be lit from directly above rather than using the scene's light source. */ NONE = 0, /** * Use the scene's current light source for dynamic atmosphere lighting. */ SCENE_LIGHT = 1, /** * Force the dynamic atmosphere lighting to always use the sunlight direction, * even if the scene uses a different light source. */ SUNLIGHT = 2 } export namespace DynamicEnvironmentMapManager { /** * Options for the DynamicEnvironmentMapManager constructor * @property [enabled = true] - If true, the environment map and related properties will continue to update. * @property [mipmapLevels = 7] - The maximum desired number of mipmap levels to generate for specular maps. More mipmap levels will produce a higher resolution specular reflection. The actual number of mipmaps used will be bounded by the cubemap texture size supported on the client machine. The number of mipmaps must be at least one for the environment map to be generated. * @property [maximumSecondsDifference = 3600] - The maximum amount of elapsed seconds before a new environment map is created. * @property [maximumPositionEpsilon = 1000] - The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results. * @property [atmosphereScatteringIntensity = 2.0] - The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of {@link Scene.light} intensity. * @property [gamma = 1.0] - The gamma correction to apply to the range of light emitted from the environment. 1.0 uses the unmodified emitted light color. * @property [brightness = 1.0] - The brightness of light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 makes the light darker while greater than 1.0 makes it brighter. * @property [saturation = 1.0] - The saturation of the light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 reduces the saturation while greater than 1.0 increases it. * @property [groundColor = DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR] - Solid color used to represent the ground. * @property [groundAlbedo = 0.31] - The percentage of light reflected from the ground. The average earth albedo is 0.31. */ type ConstructorOptions = { enabled?: boolean; mipmapLevels?: number; maximumSecondsDifference?: number; maximumPositionEpsilon?: number; atmosphereScatteringIntensity?: number; gamma?: number; brightness?: number; saturation?: number; groundColor?: Color; groundAlbedo?: number; }; } /** * Generates an environment map at the given position based on scene's current lighting conditions. From this, it produces multiple levels of specular maps and spherical harmonic coefficients than can be used with {@link ImageBasedLighting} for models or tilesets. * @example * // Enable time-of-day environment mapping in a scene * scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.SUNLIGHT; * * // Decrease the directional lighting contribution * scene.light.intensity = 0.5 * * // Increase the intensity of of the environment map lighting contribution * const environmentMapManager = tileset.environmentMapManager; * environmentMapManager.atmosphereScatteringIntensity = 3.0; * @example * // Change the ground color used for a model's environment map to a forest green * const environmentMapManager = model.environmentMapManager; * environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34"); * @param [options] - An object describing initialization options. */ export class DynamicEnvironmentMapManager { constructor(options?: DynamicEnvironmentMapManager.ConstructorOptions); /** * If true, the environment map and related properties will continue to update. */ enabled: boolean; /** * The maximum amount of elapsed seconds before a new environment map is created. */ maximumSecondsDifference: number; /** * The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results. */ maximumPositionEpsilon: number; /** * The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of {@link Scene.light} intensity. */ atmosphereScatteringIntensity: number; /** * The gamma correction to apply to the range of light emitted from the environment. 1.0 uses the unmodified incoming light color. */ gamma: number; /** * The brightness of light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 * makes the light darker while greater than 1.0 makes it brighter. */ brightness: number; /** * The saturation of the light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. */ saturation: number; /** * Solid color used to represent the ground. */ groundColor: Color; /** * The percentage of light reflected from the ground. The average earth albedo is 0.31. */ groundAlbedo: number; /** * The position around which the environment map is generated. */ position: Cartesian3 | undefined; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * mapManager = mapManager && mapManager.destroy(); */ destroy(): void; /** * Returns true if dynamic updates are supported in the current WebGL rendering context. * Dynamic updates requires the EXT_color_buffer_float or EXT_color_buffer_half_float extension. * @param scene - The object containing the rendering context * @returns true if supported */ static isDynamicUpdateSupported(scene: Scene): boolean; /** * Average hue of ground color on earth, a warm green-gray. */ static readonly AVERAGE_EARTH_GROUND_COLOR: Color; /** * The default third order spherical harmonic coefficients used for the diffuse color of image-based lighting, a white ambient light with low intensity. *

* There are nine Cartesian3 coefficients. * The order of the coefficients is: L0,0, L1,-1, L1,0, L1,1, L2,-2, L2,-1, L2,0, L2,1, L2,2 *

*/ static readonly DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS: Cartesian3[]; } /** * Defines how edges contributed by the * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} * glTF extension are rendered relative to surface geometry. *

* Primitives that do not include the extension are unaffected by this setting * and always render normally. *

*/ export enum EdgeDisplayMode { /** * Render surfaces only. Edges from the * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} * extension are hidden. */ SURFACES_ONLY = 0, /** * Render both surfaces and edges. Edges from the * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} * extension are composited on top of the surface geometry. */ SURFACES_AND_EDGES = 1, /** * Render edges only. Surface geometry is hidden for primitives that have edge visibility data, * approximating CAD-style wireframe rendering. Primitives without the extension are unaffected. */ EDGES_ONLY = 2 } export namespace ElementService { /** * The geographic location of an {@link ElementService.Element}, present * only when the element is geolocated. * @property center - The center of the element. * @property center.longitude - The longitude in degrees. * @property center.latitude - The latitude in degrees. * @property center.height - The height in meters above the ellipsoid. * @property radius - The radius, in meters, of a sphere centered on center that bounds the element. */ type ElementLocation = { center: { longitude: number; latitude: number; height: number; }; radius: number; }; /** * An element and its metadata. * * Implementations may include additional provider-specific fields. * @property id - The element identifier. * @property [label] - The user-friendly label of the element, if any. * @property [location] - The geographic location of this element, or undefined when the element has no location (e.g. conceptual elements, or assets with no geographic coordinate system). */ type Element = { id: string; label?: string; location?: ElementService.ElementLocation; }; /** * A page of elements returned by {@link ElementService#listElements}. * @property items - The elements on this page. * @property total - The total number of matching elements, or null when the total is unavailable. */ type ElementPage = { items: ElementService.Element[]; total: number | null; }; /** * Aggregate statistics for an element property. * @property [propertyKey] - The property key these statistics describe. * @property count - The number of elements included in the statistics. * @property min - The minimum value, or null when unavailable. * @property max - The maximum value, or null when unavailable. * @property avg - The average value, or null when unavailable. * @property sum - The sum of the values. */ type Aggregation = { propertyKey?: string; count: number; min: number | null; max: number | null; avg: number | null; sum: number; }; /** * A node in an element tree. * @property label - The user-friendly label of this node. * @property hasChildren - Whether this node has any children. * @property id - The identifier of the element represented by this node. */ type ElementTreeNode = { label: string; hasChildren: boolean; id: string; }; /** * An entry in a root-first element tree path. * @property id - The identifier represented by this entry. */ type ElementTreePathEntry = { id: string; }; } /** * Provides access to elements and their metadata in a model. This type * describes an interface and is not intended to be instantiated directly. */ export class ElementService { /** * Retrieves a page of elements, optionally filtered. * @param [options] - Provider-specific query options. * @returns A promise that resolves to a page of elements. */ listElements(options?: any): Promise; /** * Retrieves a single element. * @param elementId - The element identifier. * @returns A promise that resolves to the element. */ getElement(elementId: string): Promise; /** * Computes aggregate statistics for element properties. * @param options - Provider-specific aggregation options. * @returns A promise that resolves to the aggregate statistics. */ aggregate(options: any): Promise<{ aggregations: ElementService.Aggregation[]; total: number; }>; /** * Lists the children of a node in the element tree. * @param [options] - Provider-specific tree query options. * @returns A promise that resolves to the child nodes. */ getElementTreeChildren(options?: any): Promise<{ nodes: ElementService.ElementTreeNode[]; }>; /** * Retrieves the path from the root of the element tree to an element. * @param elementId - The element identifier. * @returns A promise that resolves to the root-first path. */ getElementTreeParents(elementId: string): Promise<{ path: ElementService.ElementTreePathEntry[]; }>; } /** * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry} * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance} * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires * fewer vertex attributes since the fragment shader can procedurally compute normal, * tangent, and bitangent. * @example * const 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') * }) * }); * @param [options] - Object with the following properties: * @param [options.flat = false] - When true, flat shading is used in the fragment shader, which means lighting is not taking into account. * @param [options.faceForward = options.aboveGround] - When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled. * @param [options.aboveGround = false] - When true, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled. * @param [options.material = Material.ColorType] - The material used to determine the fragment color. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class EllipsoidSurfaceAppearance { constructor(options?: { flat?: boolean; faceForward?: boolean; translucent?: boolean; aboveGround?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance} * properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** * When true, the geometry is expected to appear translucent. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material}, * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}. * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. *

* The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance} * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent} * and {@link EllipsoidSurfaceAppearance#aboveGround}. *

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled. * If the viewer enters the geometry, it will not be visible. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. * A geometry can have more vertex attributes and still be compatible - at a * potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * When true, flat shading is used in the fragment shader, * which means lighting is not taking into account. */ readonly flat: boolean; /** * When true, the fragment shader flips the surface normal * as needed to ensure that the normal faces the viewer to avoid * dark spots. This is useful when both sides of a geometry should be * shaded like {@link WallGeometry}. */ readonly faceForward: boolean; /** * When true, the geometry is expected to be on the ellipsoid's * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} * has backface culling enabled. */ readonly aboveGround: boolean; /** * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances * are compatible with, which requires only position and st * attributes. Other attributes are procedurally computed in the fragment shader. */ static readonly VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance}, * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat}, * and {@link EllipsoidSurfaceAppearance#faceForward}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } export namespace EquirectangularPanorama { /** * Initialization options for the EquirectangularPanorama constructor * @property options.transform - A 4x4 transformation matrix that defines the panorama’s position and orientation * (for example, derived from a position and heading-pitch-roll). * @property options.image - A URL to an image resource, or a preloaded image object. * @property [options.radius = 100000.0] - The radius of the panorama in meters. * @property [options.repeatHorizontal = 1.0] - The number of times to repeat the texture horizontally. * @property [options.repeatVertical = 1.0] - The number of times to repeat the texture vertically. * @property [options.credit] - A credit for the panorama, which is displayed on the canvas. */ type ConstructorOptions = {}; } /** * A {@link Panorama} that displays imagery in equirectangular format in a scene. * @example * const position = Cesium.Cartesian3.fromDegrees( * -75.1699, // longitude * 39.9522, // latitude * 100.0 // height in meters * ); * * const heading = Cesium.Math.toRadians(45.0); // rotation about up axis * const pitch = Cesium.Math.toRadians(-30.0); // pitch (negative looks down) * const roll = Cesium.Math.toRadians(10.0); // roll about forward axis * * const hpr = new Cesium.HeadingPitchRoll( * heading, * pitch, * roll * ); * * const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( * position, * hpr, * Cesium.Ellipsoid.WGS84, * Cesium.Transforms.eastNorthUpToFixedFrame * ); * * scene.primitives.add(new Cesium.EquirectangularPanorama({ * transform: modelMatrix, * image: 'path/to/image', * })); * @param options - Object describing initialization options */ export class EquirectangularPanorama { constructor(options: EquirectangularPanorama.ConstructorOptions); /** * Gets the radius of the panorama. */ readonly radius: number; /** * Gets the source image of the panorama. */ readonly image: string | HTMLImageElement | HTMLCanvasElement | ImageBitmap; /** * Gets the transform of the panorama. */ readonly transform: Matrix4; /** * Gets the credits of the panorama. */ readonly credit: Credit; /** * Determines if the equirectangular panorama will be shown. */ show: boolean; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * equirectangularPanorama = equirectangularPanorama && equirectangularPanorama.destroy(); */ destroy(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; } /** * An expression for a style applied to a {@link Cesium3DTileset}. *

* Evaluates an expression defined using the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}. *

*

* Implements the {@link StyleExpression} interface. *

* @example * const expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'); * expression.evaluate(feature); // returns true or false depending on the feature's properties * @example * const expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")'); * expression.evaluateColor(feature, result); // returns a Cesium.Color object * @param [expression] - The expression defined using the 3D Tiles Styling language. * @param [defines] - Defines in the style. */ export class Expression { constructor(expression?: string, defines?: any); /** * Gets the expression defined in the 3D Tiles Styling language. */ readonly expression: string; /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of * the expression in the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language} * is of type Boolean, Number, or String, the corresponding JavaScript * primitive type will be returned. If the result is a RegExp, a Javascript RegExp * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. * @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object onto which to store the result. * @returns The result of evaluating the expression. */ evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; /** * Evaluates the result of a Color expression, optionally using the provided feature's properties. *

* This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object. *

* @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object in which to store the result * @returns The modified result parameter or a new Color instance if one was not provided. */ evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color; } /** * 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. */ export class Fog { constructor(); /** * true if fog is enabled, false otherwise. * @example * // Disable fog in the scene * viewer.scene.fog.enabled = false; */ enabled: boolean; /** * true if fog is renderable in shaders, false otherwise. * This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering. * @example * // Use fog culling but don't render it * viewer.scene.fog.enabled = true; * viewer.scene.fog.renderable = false; */ renderable: boolean; /** * A scalar that determines the density of the fog. Terrain that is in full fog are culled. * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero. * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled. * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered. * @example * // Double the default fog density * viewer.scene.fog.density = 0.0012; */ density: number; /** * A scalar used in the function to adjust density based on the height of the camera above the terrain. */ heightScalar: number; /** * The maximum height fog is applied. If the camera is above this height fog will be disabled. */ maxHeight: number; /** * A scalar that impacts the visual density of fog. This value does not impact the culling of terrain. * Use in combination with the {@link Fog.density} to make fog appear more or less dense. * @example * // Increase fog appearance effect * viewer.scene.fog.visualDensityScalar = 0.6; */ visualDensityScalar: number; /** * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon. */ screenSpaceErrorFactor: number; /** * The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect * the brightness at all. */ minimumBrightness: number; /** * Exponent factor used in the function to adjust how density changes based on the height of the camera above the ellipsoid. Smaller values produce a more gradual transition as camera height increases. * Value must be greater than 0. */ heightFalloff: number; } /** * Monitors the frame rate (frames per second) in a {@link 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 {@link Scene}, use {@link FrameRateMonitor.fromScene} * instead of constructing an instance explicitly. * @param [options] - Object with the following properties: * @param options.scene - The Scene instance for which to monitor performance. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds. * @param [options.quietPeriod = 2.0] - The length of time to wait at startup and each time the page becomes visible (i.e. when the user * switches back to the tab) before starting to measure performance, in seconds. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate * (usually lower) frame rate is required. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. */ export class FrameRateMonitor { constructor(options?: { scene: Scene; samplingWindow?: number; quietPeriod?: number; warmupPeriod?: number; minimumFrameRateDuringWarmup?: number; minimumFrameRateAfterWarmup?: number; }); /** * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds. */ samplingWindow: number; /** * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user * switches back to the tab) before starting to measure performance, in seconds. */ quietPeriod: number; /** * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate * (usually lower) frame rate is required. */ warmupPeriod: number; /** * Gets or sets the minimum frames-per-second that are required for acceptable performance during * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. */ minimumFrameRateDuringWarmup: number; /** * Gets or sets the minimum frames-per-second that are required for acceptable performance after * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. */ minimumFrameRateAfterWarmup: number; /** * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene} * needs to create a new frame rate monitor, and for any settings that are not passed to the * {@link FrameRateMonitor} constructor. */ static defaultSettings: any; /** * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}. * @param scene - The scene for which to get the {@link FrameRateMonitor}. * @returns The scene's {@link FrameRateMonitor}. */ static fromScene(scene: Scene): FrameRateMonitor; /** * Gets the {@link Scene} instance for which to monitor performance. */ scene: Scene; /** * Gets the event that is raised when a low frame rate is detected. The function will be passed * the {@link Scene} instance as its first parameter and the average number of frames per second * over the sampling window as its second parameter. */ lowFrameRate: Event; /** * Gets the event that is raised when the frame rate returns to a normal level after having been low. * The function will be passed the {@link Scene} instance as its first parameter and the average * number of frames per second over the sampling window as its second parameter. */ nominalFrameRate: Event; /** * Gets the most recently computed average frames-per-second over the last samplingWindow. * This property may be undefined if the frame rate has not been computed. */ lastFramesPerSecond: number; /** * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause} * must be called once for each time this function is called. */ pause(): void; /** * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called * multiple times, this function must be called the same number of times in order to * actually resume monitoring. */ unpause(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Unsubscribes this instance from all events it is listening to. * Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. */ destroy(): void; } export interface GaussianSplat3DTileContent extends Cesium3DTileContent { } /** * Represents the contents of a glTF or glb using the {@link https://github.com/CesiumGS/glTF/tree/draft-splat-spz/extensions/2.0/Khronos/KHR_gaussian_splatting | KHR_gaussian_splatting} and {@link https://github.com/CesiumGS/glTF/tree/draft-splat-spz/extensions/2.0/Khronos/KHR_gaussian_splatting_compression_spz_2 | KHR_gaussian_splatting_compression_spz_2} extensions. *

* Implements the {@link Cesium3DTileContent} interface. *

*/ export class GaussianSplat3DTileContent implements Cesium3DTileContent { /** * Performs checks to ensure that the provided tileset has the Gaussian Splatting extensions. * @param tileset - The tileset to check for the extensions. * @returns Returns true if the necessary extensions are included in the tileset. */ static tilesetRequiresGaussianSplattingExt(tileset: Cesium3DTileset): boolean; /** * Gets the number of features in the tile. Currently this is always zero. */ readonly featuresLength: number; /** * Equal to the number of Gaussian splats in the tile. Each splat is represented by a median point and a set of attributes, so we can * treat this as the number of points in the tile. */ readonly pointsLength: number; /** * Gets the number of triangles in the tile. Currently this is always zero because Gaussian splats are not represented as triangles in the tile content. *

*/ readonly trianglesLength: number; /** * The number of bytes used by the geometry attributes of this content. *

*/ readonly geometryByteLength: number; /** * The number of bytes used by the textures of this content. *

*/ readonly texturesByteLength: number; /** * Gets the amount of memory used by the batch table textures and any binary * metadata properties not accounted for in geometryByteLength or * texturesByteLength *

*/ readonly batchTableByteLength: number; /** * Gets the array of {@link Cesium3DTileContent} objects for contents that contain other contents, such as composite tiles. The inner contents may in turn have inner contents, such as a composite tile that contains a composite tile. */ readonly innerContents: any[]; /** * Returns true when the tile's content is ready to render; otherwise false */ readonly ready: boolean; /** * Returns true when the tile's content is transformed to world coordinates; otherwise false *

*/ readonly transformed: boolean; /** * The tileset that this content belongs to. *

*/ readonly tileset: Cesium3DTileset; /** * The tile that this content belongs to. *

*/ readonly tile: Cesium3DTile; /** * The resource that this content was loaded from. *

*/ readonly url: string; /** * Returns whether the feature has this property. * @param batchId - The batchId for the feature. * @param name - The case-sensitive name of the property. * @returns true if the feature has this property; otherwise, false. */ hasProperty(batchId: number, name: string): boolean; /** * Returns the {@link Cesium3DTileFeature} object for the feature with the * given batchId. This object is used to get and modify the * feature's properties. *

* Features in a tile are ordered by batchId, an index used to retrieve their metadata from the batch table. *

* @param batchId - The batchId for the feature. * @returns The corresponding {@link Cesium3DTileFeature} object. */ getFeature(batchId: number): Cesium3DTileFeature; } /** * @property [heightReference = HeightReference.NONE] - Allows clamping (draping) * polylines and polygons on terrain and 3D Tiles. Point clamping is not currently supported. * @property [scene] - Required for primitives that use a clamping {@link HeightReference}. */ export type GeoJsonPrimitiveConstructorOptions = { geoJson?: any; url?: Resource | string; ellipsoid?: Ellipsoid; allowPicking?: boolean; show?: boolean; pickObjectFactory?: (...params: any[]) => any; heightReference?: HeightReference; scene?: Scene; }; /** * Lightweight GeoJSON loader that converts features directly into * {@link BufferPointCollection}, {@link BufferPolylineCollection}, and * {@link BufferPolygonCollection}. * * Unlike {@link GeoJsonDataSource}, this path does not create entities. * Instead, it exposes high-throughput buffer primitive collections that can be * added directly to {@link Scene#primitives}. * @example * // Load GeoJSON * const loader = await Cesium.GeoJsonPrimitive.fromUrl("./data.geojson"); * viewer.scene.primitives.add(loader); * @example * // Access GeoJSON features and properties * loader.points; // BufferPointCollection | undefined * loader.polylines; // BufferPolylineCollection | undefined * loader.polygons; // BufferPolygonCollection | undefined * loader.ids; // source feature IDs * loader.properties; // source feature properties * @example * // Style GeoJSON * const material = new Cesium.BufferPolylineMaterial({ * color: Cesium.Color.RED, * width: 4, * }); * * const polyline = new Cesium.BufferPolyline(); * const count = primitive.polylines.primitiveCount; * for (let i = 0; i < count; i++) { * primitive.polylines.get(i, polyline); * * const properties = primitive.getProperties(polyline.featureId); * if (properties.myCustomProperty === true) { * polyline.setMaterial(material); * } * } */ export class GeoJsonPrimitive { constructor(options?: GeoJsonPrimitiveConstructorOptions); /** * Loader source URL when created via {@link GeoJsonPrimitive.fromUrl}. */ readonly url: string | undefined; /** * Feature count represented by the loaded collections. */ readonly featureCount: number; /** * Lookup table from integer ID generated by GeoJsonPrimitive, to integer or string Feature ID from GeoJSON source. */ readonly ids: (string | number | undefined)[]; /** * Source GeoJSON properties, indexed by generated integer ID. */ readonly properties: Record[]; /** * Buffer point collection for point geometries. */ readonly points: BufferPointCollection | undefined; /** * Buffer polyline collection for linestring geometries. */ readonly polylines: BufferPolylineCollection | undefined; /** * Buffer polygon collection for polygon geometries. */ readonly polygons: BufferPolygonCollection | undefined; /** * Loads GeoJSON from a URL or {@link Resource}. */ static fromUrl(url: Resource | string, options?: GeoJsonPrimitiveConstructorOptions): Promise; /** * Creates a loader directly from a parsed GeoJSON object. */ static fromGeoJson(geoJson: any, options?: GeoJsonPrimitiveConstructorOptions): GeoJsonPrimitive; getId(featureId: number): void; getProperties(featureId: number): void; } /** * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) or Web Map Tile Service (WMTS) server. * @param type - The type of response to expect from a GetFeatureInfo request. Valid * values are 'json', 'xml', 'html', or 'text'. * @param [format] - The info format to request from the server. This is usually a * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json' * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'. * @param [callback] - A function to invoke with the GetFeatureInfo response from the server * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified, * a default function for the type of response is used. */ export class GetFeatureInfoFormat { constructor(type: string, format?: string, callback?: (...params: any[]) => any); } /** * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider}) * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}. * @param [ellipsoid = Ellipsoid.default] - Determines the size and shape of the * globe. */ export class Globe { constructor(ellipsoid?: Ellipsoid); /** * Determines if the globe will be shown. */ show: boolean; /** * The maximum screen-space error used to drive level-of-detail refinement. Higher * values will provide better performance but lower visual quality. */ maximumScreenSpaceError: number; /** * The size of the terrain tile cache, expressed as a number of tiles. Any additional * tiles beyond this number will be freed, as long as they aren't needed for rendering * this frame. A larger number will consume more memory but will show detail faster * when, for example, zooming out and then back in. */ tileCacheSize: number; /** * Gets or sets the number of loading descendant tiles that is considered "too many". * If a tile has too many loading descendants, that tile will be loaded and rendered before any of * its descendants are loaded and rendered. This means more feedback for the user that something * is happening at the cost of a longer overall load time. Setting this to 0 will cause each * tile level to be loaded successively, significantly increasing load time. Setting it to a large * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make * detail appear all at once after a long wait. */ loadingDescendantLimit: number; /** * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded. * Setting this to true optimizes the zoom-out experience and provides more detail in * newly-exposed areas when panning. The down side is that it requires loading more tiles. */ preloadAncestors: boolean; /** * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded. * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even * if they are culled. Setting this to true may provide a better panning experience at the * cost of loading more tiles. */ preloadSiblings: boolean; /** * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not * highlighted at all. The alpha value is used to alpha blend with the tile's * actual color. Because terrain fill tiles do not represent the actual terrain surface, * it may be useful in some applications to indicate visually that they are not to be trusted. */ fillHighlightColor: Color; /** * Enable lighting the globe with the scene's light source. */ enableLighting: boolean; /** * A multiplier to adjust terrain lambert lighting. * This number is multiplied by the result of czm_getLambertDiffuse in GlobeFS.glsl. * This only takes effect when enableLighting is true. */ lambertDiffuseMultiplier: number; /** * Enable dynamic lighting effects on atmosphere and fog. This only takes effect * when enableLighting is true. */ dynamicAtmosphereLighting: boolean; /** * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's * light direction. This only takes effect when enableLighting and * dynamicAtmosphereLighting are true. */ dynamicAtmosphereLightingFromSun: boolean; /** * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between lightingFadeInDistance and lightingFadeOutDistance. */ showGroundAtmosphere: boolean; /** * The intensity of the light that is used for computing the ground atmosphere color. */ atmosphereLightIntensity: number; /** * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere. */ atmosphereRayleighCoefficient: Cartesian3; /** * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere. */ atmosphereMieCoefficient: Cartesian3; /** * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters. */ atmosphereRayleighScaleHeight: number; /** * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters. */ atmosphereMieScaleHeight: number; /** * The anisotropy of the medium to consider for Mie scattering. *

* Valid values are between -1.0 and 1.0. *

*/ atmosphereMieAnisotropy: number; /** * The distance where everything becomes lit. This only takes effect * when enableLighting or showGroundAtmosphere is true. */ lightingFadeOutDistance: number; /** * The distance where lighting resumes. This only takes effect * when enableLighting or showGroundAtmosphere is true. */ lightingFadeInDistance: number; /** * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere. * This only takes effect when showGroundAtmosphere, enableLighting, and * dynamicAtmosphereLighting are true. */ nightFadeOutDistance: number; /** * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere. * This only takes effect when showGroundAtmosphere, enableLighting, and * dynamicAtmosphereLighting are true. */ nightFadeInDistance: number; /** * True if an animated wave effect should be shown in areas of the globe * covered by water; otherwise, false. This property is ignored if the * terrainProvider does not provide a water mask. */ showWaterEffect: boolean; /** * True if primitives such as billboards, polylines, labels, etc. should be depth-tested * against the terrain surface, or false if such primitives should always be drawn on top * of terrain unless they're on the opposite side of the globe. The disadvantage of depth * testing primitives against terrain is that slight numerical noise or terrain level-of-detail * switched can sometimes make a primitive that should be on the surface disappear underneath it. */ depthTestAgainstTerrain: boolean; /** * Determines whether the globe casts or receives shadows from light sources. Setting the globe * to cast shadows may impact performance since the terrain is rendered again from the light's perspective. * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows. */ shadows: ShadowMode; /** * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A hue shift of 1.0 indicates a complete rotation of the hues available. */ atmosphereHueShift: number; /** * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A saturation shift of -1.0 is monochrome. */ atmosphereSaturationShift: number; /** * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A brightness shift of -1.0 is complete darkness, which will let space show through. */ atmosphereBrightnessShift: number; /** * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles. * Skirts are always hidden when the camera is underground or translucency is enabled. */ showSkirts: boolean; /** * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled. */ backFaceCulling: boolean; /** * Determines the darkness of the vertex shadow. * This only takes effect when enableLighting is true. */ vertexShadowDarkness: number; /** * Gets an ellipsoid describing the shape of this globe. */ ellipsoid: Ellipsoid; /** * Gets the collection of image layers that will be rendered on this globe. */ imageryLayers: ImageryLayerCollection; /** * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed. */ readonly imageryLayersUpdatedEvent: Event; /** * Returns true when the tile load queue is empty, false otherwise. When the load queue is empty, * all terrain and imagery for the current view have been loaded. */ readonly tilesLoaded: boolean; /** * Gets or sets the color of the globe when no imagery is available. */ baseColor: Color; /** * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane. */ clippingPlanes: ClippingPlaneCollection; /** * A property specifying a {@link ClippingPolygonCollection} used to selectively disable rendering inside or outside a list of polygons. */ clippingPolygons: ClippingPolygonCollection; /** * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area. * Defaults to the maximum extent of cartographic coordinates. */ cartographicLimitRectangle: Rectangle; /** * The normal map to use for rendering waves in the ocean. Setting this property will * only have an effect if the configured terrain provider includes a water mask. */ oceanNormalMapUrl: string; /** * The terrain provider providing surface geometry for this globe. */ terrainProvider: TerrainProvider; /** * Gets an event that's raised when the terrain provider is changed */ readonly terrainProviderChanged: Event; /** * Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty, * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue. */ tileLoadProgressEvent: Event; /** * Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. */ material: Material | undefined; /** * The color to render the back side of the globe when the camera is underground or the globe is translucent, * blended with the globe color based on the camera's distance. *

* To disable underground coloring, set undergroundColor to undefined. */ undergroundColor: Color; /** * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color. * The alpha will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined, * the underground color will not be blended with the globe color. *

* When the camera is above the ellipsoid the distance is computed from the nearest * point on the ellipsoid instead of the camera's position. */ undergroundColorAlphaByDistance: NearFarScalar; /** * Properties for controlling globe translucency. */ translucency: GlobeTranslucency; /** * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates. * @example * // find intersection of ray through a pixel and the globe * const ray = viewer.camera.getPickRay(windowCoordinates); * const intersection = globe.pick(ray, scene); * @param ray - The ray to test for intersection. * @param scene - The scene. * @param [result] - The object onto which to store the result. * @returns The intersection or undefined if none was found. */ pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined; /** * Get the height of the surface at a given cartographic. * @param cartographic - The cartographic for which to find the height. * @returns The height of the cartographic or undefined if it could not be found. */ getHeight(cartographic: Cartographic): number | undefined; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * globe = globe && globe.destroy(); */ destroy(): void; } /** * Properties for controlling globe translucency. */ export class GlobeTranslucency { constructor(); /** * When true, the globe is rendered as a translucent surface. *

* The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers}, * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces. * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry * is considered front facing. *

* Translucency is disabled by default. */ enabled: boolean; /** * A constant translucency to apply to front faces of the globe. *

* {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Set front face translucency to 0.5. * globe.translucency.frontFaceAlpha = 0.5; * globe.translucency.enabled = true; */ frontFaceAlpha: number; /** * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, * frontFaceAlphaByDistance will be disabled. *

* {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Example 1. * // Set front face translucency to 0.5 when the * // camera is 1500 meters from the surface and 1.0 * // as the camera distance approaches 8.0e6 meters. * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); * globe.translucency.enabled = true; * @example * // Example 2. * // Disable front face translucency by distance * globe.translucency.frontFaceAlphaByDistance = undefined; */ frontFaceAlphaByDistance: NearFarScalar; /** * A constant translucency to apply to back faces of the globe. *

* {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Set back face translucency to 0.5. * globe.translucency.backFaceAlpha = 0.5; * globe.translucency.enabled = true; */ backFaceAlpha: number; /** * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, * backFaceAlphaByDistance will be disabled. *

* {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Example 1. * // Set back face translucency to 0.5 when the * // camera is 1500 meters from the surface and 1.0 * // as the camera distance approaches 8.0e6 meters. * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); * globe.translucency.enabled = true; * @example * // Example 2. * // Disable back face translucency by distance * globe.translucency.backFaceAlphaByDistance = undefined; */ backFaceAlphaByDistance: NearFarScalar; /** * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area. * Defaults to the maximum extent of cartographic coordinates. */ rectangle: Rectangle; } export type EXTMeshPolygonExtension = { count: number; indicesOffsets: number; loopIndices?: number; loopIndicesOffsets?: number; triangleIndices?: number; triangleIndicesOffsets?: number; }; export namespace Google2DImageryProvider { /** * Initialization options for the Google2DImageryProvider constructor * @property key - The Google api key to send with tile requests. * @property session - The Google session token that tracks the current state of your map and viewport. * @property url - The Google 2D maps endpoint. * @property tileWidth - The width of each tile in pixels. * @property tileHeight - The height of each tile in pixels. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @property [maximumLevel = 22] - The maximum level-of-detail supported by the imagery provider. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. */ type ConstructorOptions = { key: string; session: string; url: string | Resource | IonResource; tileWidth: string; tileHeight: string; ellipsoid?: Ellipsoid; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; }; } /** *
* This object is normally not instantiated directly, use {@link Google2DImageryProvider.fromIonAssetId} or {@link Google2DImageryProvider.fromUrl}. *
* * * Provides 2D image tiles from {@link https://developers.google.com/maps/documentation/tile/2d-tiles-overview|Google 2D Tiles}. * * Google 2D Tiles can only be used with the Google geocoder. * @example * // Google 2D imagery provider * const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({ * assetId: 3830184 * }); * @example * // Use your own Google api key * Cesium.GoogleMaps.defaultApiKey = "your-api-key"; * * const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({ * mapType: "SATELLITE" * }); * @param options - Object describing initialization options */ export class Google2DImageryProvider { constructor(options: Google2DImageryProvider.ConstructorOptions); /** * Gets the URL of the Google 2D Imagery server. */ readonly url: string; /** * Gets the rectangle, in radians, of the imagery provided by the instance. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. Generally, * a minimum level should only be used when the rectangle of the imagery is small * enough that the number of tiles at the minimum level is small. An imagery * provider with more than a few tiles at the minimum level will lead to * rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Creates an {@link ImageryProvider} which provides 2D global tiled imagery from {@link https://developers.google.com/maps/documentation/tile/2d-tiles-overview|Google 2D Tiles}, streamed using the Cesium ion REST API. * @example * // Google 2D imagery provider * const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({ * assetId: 3830184 * }); * @example * // Google 2D roadmap overlay with custom styles * const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({ * assetId: 3830184, * overlayLayerType: "layerRoadmap", * styles: [ * { * stylers: [{ hue: "#00ffe6" }, { saturation: -20 }], * }, * { * featureType: "road", * elementType: "geometry", * stylers: [{ lightness: 100 }, { visibility: "simplified" }], * }, * ], * }); * @param options - Object with the following properties: * @param options.assetId - The Cesium ion asset id. * @param [options.mapType = "satellite"] - The map type of the Google map imagery. Valid options are satellite, terrain, and roadmap. If overlayLayerType is set, mapType is ignored and a transparent overlay is returned. If overlayMapType is undefined, then a basemap of mapType is returned. layerRoadmap overlayLayerType is included in terrain and roadmap mapTypes. * @param [options.language = "en_US"] - an IETF language tag that specifies the language used to display information on the tiles * @param [options.region = "US"] - A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user. * @param [options.overlayLayerType] - Returns a transparent overlay map with the specified layerType. If no value is provided, a basemap of mapType is returned. Use multiple instances of Google2DImageryProvider to add multiple Google Maps overlays to a scene. layerRoadmap is included in terrain and roadmap mapTypes, so adding as overlay to terrain or roadmap has no effect. * @param [options.styles] - An array of JSON style objects that specify the appearance and detail level of map features such as roads, parks, and built-up areas. Styling is used to customize the standard Google base map. The styles parameter is valid only if the mapType is roadmap. For the complete style syntax, see the ({@link https://developers.google.com/maps/documentation/tile/style-reference|Google Style Reference}). * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @param [options.minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @param [options.maximumLevel = 22] - The maximum level-of-detail supported by the imagery provider. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @param [options.credit] - A credit for the data source, which is displayed on the canvas. * @returns A promise that resolves to the created Google2DImageryProvider. */ static fromIonAssetId(options: { assetId: string; mapType?: "satellite" | "terrain" | "roadmap"; language?: string; region?: string; overlayLayerType?: "layerRoadmap" | "layerStreetview" | "layerTraffic"; styles?: any; ellipsoid?: Ellipsoid; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; credit?: Credit | string; }): Promise; /** * Creates an {@link ImageryProvider} which provides 2D global tiled imagery from {@link https://developers.google.com/maps/documentation/tile/2d-tiles-overview|Google 2D Tiles}. * @example * // Use your own Google api key * Cesium.GoogleMaps.defaultApiKey = "your-api-key"; * * const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({ * mapType: "satellite" * }); * @example * // Google 2D roadmap overlay with custom styles * Cesium.GoogleMaps.defaultApiKey = "your-api-key"; * * const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({ * overlayLayerType: "layerRoadmap", * styles: [ * { * stylers: [{ hue: "#00ffe6" }, { saturation: -20 }], * }, * { * featureType: "road", * elementType: "geometry", * stylers: [{ lightness: 100 }, { visibility: "simplified" }], * }, * ], * }); * @param options - Object with the following properties: * @param [options.key = GoogleMaps.defaultApiKey] - Your API key to access Google 2D Tiles. See {@link https://developers.google.com/maps/documentation/javascript/get-api-key} for instructions on how to create your own key. * @param [options.mapType = "satellite"] - The map type of the Google map imagery. Valid options are satellite, terrain, and roadmap. If overlayLayerType is set, mapType is ignored and a transparent overlay is returned. If overlayMapType is undefined, then a basemap of mapType is returned. layerRoadmap overlayLayerType is included in terrain and roadmap mapTypes. * @param [options.language = "en_US"] - an IETF language tag that specifies the language used to display information on the tiles * @param [options.region = "US"] - A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user. * @param [options.overlayLayerType] - Returns a transparent overlay map with the specified layerType. If no value is provided, a basemap of mapType is returned. Use multiple instances of Google2DImageryProvider to add multiple Google Maps overlays to a scene. layerRoadmap is included in terrain and roadmap mapTypes, so adding as overlay to terrain or roadmap has no effect. * @param [options.styles] - An array of JSON style objects that specify the appearance and detail level of map features such as roads, parks, and built-up areas. Styling is used to customize the standard Google base map. The styles parameter is valid only if the mapType is roadmap. For the complete style syntax, see the ({@link https://developers.google.com/maps/documentation/tile/style-reference|Google Style Reference}). * @param [options.ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @param [options.minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @param [options.maximumLevel = 22] - The maximum level-of-detail supported by the imagery provider. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @param [options.credit] - A credit for the data source, which is displayed on the canvas. * @returns A promise that resolves to the created Google2DImageryProvider. */ static fromUrl(options: { key?: string; mapType?: "satellite" | "terrain" | "roadmap"; language?: string; region?: string; overlayLayerType?: "layerRoadmap" | "layerStreetview" | "layerTraffic"; styles?: any; ellipsoid?: Ellipsoid; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; credit?: Credit | string; }): Promise; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[] | undefined; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; } export namespace GoogleEarthEnterpriseImageryProvider { /** * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [tileDiscardPolicy] - The policy that determines if a tile * is invalid and should be discarded. If this value is not specified, a default * is to discard tiles that fail to download. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { ellipsoid?: Ellipsoid; tileDiscardPolicy?: TileDiscardPolicy; credit?: Credit | string; }; } /** *
* To construct a GoogleEarthEnterpriseImageryProvider, call {@link GoogleEarthEnterpriseImageryProvider.fromMetadata}. Do not call the constructor directly. *
* * Provides tiled imagery using the Google Earth Enterprise REST API. * * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise, * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API. * @example * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl("http://www.example.com"); * const gee = Cesium.GoogleEarthEnterpriseImageryProvider.fromMetadata(geeMetadata); * @param [options] - Object describing initialization options */ export class GoogleEarthEnterpriseImageryProvider { constructor(options?: GoogleEarthEnterpriseImageryProvider.ConstructorOptions); /** * Gets the name of the Google Earth Enterprise server url hosting the imagery. */ readonly url: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage * and texture upload time. */ readonly hasAlphaChannel: boolean; /** * Creates a tiled imagery provider using the Google Earth Enterprise REST API. * @example * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl("http://www.example.com"); * const gee = Cesium.GoogleEarthEnterpriseImageryProvider.fromMetadata(geeMetadata); * @param metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider. * @param options - Object describing initialization options. */ static fromMetadata(metadata: GoogleEarthEnterpriseMetadata, options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions): GoogleEarthEnterpriseImageryProvider; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; } export namespace GoogleEarthEnterpriseMapsProvider { /** * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor * @property channel - The channel (id) to be used when requesting data from the server. * The channel number can be found by looking at the json file located at: * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that * is associated with a "ImageryMaps" requestType. There may be more than one id available. * Example: * { * layers: [ * { * id: 1002, * requestType: "ImageryMaps" * }, * { * id: 1007, * requestType: "VectorMapsRaster" * } * ] * } * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth * Enterprise server, or undefined if there is no limit. * @property [tileDiscardPolicy] - The policy that determines if a tile * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass * a {@link NeverTileDiscardPolicy} for this parameter. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. */ type ConstructorOptions = { channel: number; path?: string; maximumLevel?: number; tileDiscardPolicy?: TileDiscardPolicy; ellipsoid?: Ellipsoid; }; } /** *
* To construct a GoogleEarthEnterpriseMapsProvider, call {@link GoogleEarthEnterpriseImageryProvider.fromUrl}. Do not call the constructor directly. *
* * 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 * {@link http://www.w3.org/TR/cors/|Cross-Origin 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. * * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it * is necessary to use {@link GoogleEarthEnterpriseImageryProvider} * @example * const google = await Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl("https://earth.localdomain", 1008); * @param options - Object describing initialization options */ export class GoogleEarthEnterpriseMapsProvider { constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions); /** * Gets the URL of the Google Earth MapServer. */ readonly url: string; /** * Gets the url path of the data on the Google Earth server. */ readonly path: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the imagery channel (id) currently being used. */ readonly channel: number; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the version of the data used by this provider. */ readonly version: number; /** * Gets the type of data that is being requested from the provider. */ readonly requestType: string; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Creates a tiled imagery provider using the Google Earth Imagery API. * @example * const google = await Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl("https://earth.localdomain", 1008); * @param url - The url of the Google Earth server hosting the imagery. * @param [options] - Object describing initialization options * @returns The created GoogleEarthEnterpriseMapsProvider. */ static fromUrl(url: Resource | string, options?: GoogleEarthEnterpriseMapsProvider.ConstructorOptions): Promise; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; /** * Gets or sets the URL to the Google Earth logo for display in the credit. */ static logoUrl: string; } /** *
* This object is normally not instantiated directly, use {@link GoogleStreetViewCubeMapPanoramaProvider.fromUrl}. *
* * * Creates a {@link PanoramaProvider} which provides imagery from {@link https://developers.google.com/maps/documentation/streetview|Google Street View Static API} to be displayed in a panorama. */ export class GoogleStreetViewCubeMapPanoramaProvider { constructor(); /** * Gets the panorama primitive for a requested position and orientation. * @example * const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({ * key: 'your Google Streetview Static api key' * }) * * const panoIdObject = provider.getNearestPanoId(position); * const position = Cartographic.fromDegrees(panoIdObject.location.lng, panoIdObject.location.lat, 0); * * const primitive = await provider.loadPanorama({ * cartographic: position, * panoId: panoIdObject.panoId * }); * viewer.scene.primitive.add(primitive); * @param options - Object with the following properties: * @param options.cartographic - The position to place the panorama in the scene. * @param [options.panoId] - The panoramaId identifier for the image in the Google API. If not provided this will be looked up for the provided cartographic location. * @param [options.tileSize] - Optional tile size override (square). * @param [options.signature] - Optional signature for signed URLs. See {@link https://developers.google.com/maps/documentation/streetview/digital-signature} for more information. * @param [options.credit] - A credit for the data source, which is displayed on the canvas. * @returns The panorama primitive textured with imagery. */ loadPanorama(options: { cartographic: Cartographic; panoId?: string; tileSize?: number; signature?: string; credit?: Credit | string; }): CubeMapPanorama; /** * Gets the panoIds for the given cartographic location. See {@link https://developers.google.com/maps/documentation/tile/streetview#panoid-search}. * @example * const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({ * key: 'your Google Streetview Static api key' * }) * const panoIds = provider.getNearestPanoId(position); * @param position - The position to search for the nearest panoId. * @param [radius = 50] - The radius in meters to search for the nearest panoId. * @returns an object containing a panoId, latitude, and longitude of the closest panorama */ getNearestPanoId(position: Cartographic, radius?: number): any; /** * Gets metadata for panoId. See {@link https://developers.google.com/maps/documentation/tile/streetview#metadata_response} for response object. * @example * const panoIdObject = provider.getNearestPanoId(position); * const panoIdMetadata = provider.getPanoIdMetadata(panoIdObject.panoId); * @returns object containing metadata for the panoId. */ getPanoIdMetadata(panoId: string): any; /** * Creates a {@link PanoramaProvider} which provides cube face images from the {@link https://developers.google.com/maps/documentation/streetview|Google Street View Static API}. * @example * const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({ * key: 'your Google Streetview Static api key' * }) * @param options - Object with the following properties: * @param [options.key = GoogleMaps.defaultStreetViewStaticApiKey] - Your API key to access Google Street View Static API. See {@link https://developers.google.com/maps/documentation/javascript/get-api-key} for instructions on how to create your own key. If undefined, defaults to {@link GoogleMaps.defaultStreetViewStaticApiKey}. If that value is unavailable, falls back to {@link GoogleMaps.defaultApiKey}. * @param [options.url = GoogleMaps.streetViewStaticApiEndpoint] - The URL to access Google Street View Static API. See {@link https://developers.google.com/maps/documentation/streetview/overview} for more information. * @param [options.tileSize = 600] - Default width and height (in pixels) of each square tile. * @param [options.credit] - A credit for the data source, which is displayed on the canvas. * @returns A promise that resolves to the created GoogleStreetViewCubeMapPanoramaProvider.' */ static fromUrl(options: { key?: string; url?: string | Resource; tileSize?: number; credit?: Credit | string; }): Promise; } export namespace GridImageryProvider { /** * Initialization options for the GridImageryProvider constructor * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the default ellipsoid is used. * @property [cells = 8] - The number of grids cells. * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines. * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines. * @property [glowWidth = 6] - The width of lines used for rendering the line glow effect. * @property [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes. * @property [canvasSize = 256] - The size of the canvas used for rendering. */ type ConstructorOptions = { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; cells?: number; color?: Color; glowColor?: Color; glowWidth?: number; backgroundColor?: Color; tileWidth?: number; tileHeight?: number; canvasSize?: number; }; } /** * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow. * May be useful for custom rendering effects or debugging terrain. * @param options - Object describing initialization options */ export class GridImageryProvider { constructor(options: GridImageryProvider.ConstructorOptions); /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Draws a grid of lines into a canvas. */ _drawGrid(): void; /** * Render a grid into a canvas with background and glow */ _createGridCanvas(): void; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns The resolved image as a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; } /** * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}. *

* Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}. *

* @example * // 1. Draw a polyline on terrain with a basic color material * * const instance = new Cesium.GeometryInstance({ * geometry : new Cesium.GroundPolylineGeometry({ * positions : Cesium.Cartesian3.fromDegreesArray([ * -112.1340164450331, 36.05494287836128, * -112.08821010582645, 36.097804071380715 * ]), * width : 4.0 * }), * id : 'object returned when this instance is picked and to get/set per-instance attributes' * }); * * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ * geometryInstances : instance, * appearance : new Cesium.PolylineMaterialAppearance() * })); * * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition. * // Distance display conditions for polylines on terrain are based on an approximate terrain height * // instead of true terrain height. * * const instance2 = new Cesium.GeometryInstance({ * geometry : new Cesium.GroundPolylineGeometry({ * positions : Cesium.Cartesian3.fromDegreesArray([ * -112.1340164450331, 36.05494287836128, * -112.08821010582645, 36.097804071380715, * -112.13296079730024, 36.168769146801104 * ]), * loop : true, * width : 4.0 * }), * attributes : { * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)), * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000) * }, * id : 'object returned when this instance is picked and to get/set per-instance attributes' * }); * * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ * geometryInstances : instance2, * appearance : new Cesium.PolylineColorAppearance() * })); * @param [options] - Object with the following properties: * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}. * @param [options.show = true] - Determines if this primitive will be shown. * @param [options.interleave = false] - When true, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. * @param [options.releaseGeometryInstances = true] - When true, the primitive does not keep a reference to the input geometryInstances to save memory. * @param [options.allowPicking = true] - When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on creation to have effect. */ export class GroundPolylinePrimitive { constructor(options?: { geometryInstances?: any[] | GeometryInstance; appearance?: Appearance; show?: boolean; interleave?: boolean; releaseGeometryInstances?: boolean; allowPicking?: boolean; asynchronous?: boolean; classificationType?: ClassificationType; debugShowBoundingVolume?: boolean; debugShowShadowVolume?: boolean; }); /** * The geometry instances rendered with this primitive. This may * be undefined if options.releaseGeometryInstances * is true when the primitive is constructed. *

* Changing this property after the primitive is rendered has no effect. *

*/ readonly geometryInstances: any[] | GeometryInstance; /** * The {@link Appearance} used to shade this primitive. Each geometry * instance is shaded with the same appearance. Some appearances, like * {@link PolylineColorAppearance} allow giving each instance unique * properties. */ appearance: Appearance; /** * Determines if the primitive will be shown. This affects all geometry * instances in the primitive. */ show: boolean; /** * Determines whether terrain, 3D Tiles or both will be classified. */ classificationType: ClassificationType; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. */ readonly interleave: boolean; /** * When true, the primitive does not keep a reference to the input geometryInstances to save memory. */ readonly releaseGeometryInstances: boolean; /** * When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. */ readonly allowPicking: boolean; /** * Determines if the geometry instances will be created and batched on a web worker. */ readonly asynchronous: boolean; /** * Determines if the primitive is complete and ready to render. If this property is * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update} * is called. */ readonly ready: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* If true, draws the shadow volume for each geometry in the primitive. *

*/ readonly debugShowShadowVolume: boolean; /** * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the * GroundPolylinePrimitive synchronously. * @returns A promise that will resolve once the terrain heights have been loaded. */ static initializeTerrainHeights(): Promise; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * const attributes = primitive.getGeometryInstanceAttributes('an id'); * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Checks if the given Scene supports GroundPolylinePrimitives. * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension. * @param scene - The current scene. * @returns Whether or not the current scene supports GroundPolylinePrimitives. */ static isSupported(scene: Scene): boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

* @example * e = e && e.destroy(); */ destroy(): void; } /** * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}. *

* A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including * {@link Material} and {@link 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. *

*

* Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors * or materials besides PerInstanceColorAppearance. *

*

* Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping * textures to terrain - for that use case, use {@link SingleTileImageryProvider}. *

*

* For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there * will be rendering artifacts for some viewing angles. *

*

* Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}. *

* @example * // Example 1: Create primitive with a single instance * const 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 * const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color. * const 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 * } * }); * const 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] * })); * @param [options] - Object with the following properties: * @param [options.geometryInstances] - The geometry instances to render. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute. * @param [options.show = true] - Determines if this primitive will be shown. * @param [options.vertexCacheOptimize = false] - When true, geometry vertices are optimized for the pre and post-vertex-shader caches. * @param [options.interleave = false] - When true, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. * @param [options.compressVertices = true] - When true, the geometry vertices are compressed, which will save memory. * @param [options.releaseGeometryInstances = true] - When true, the primitive does not keep a reference to the input geometryInstances to save memory. * @param [options.allowPicking = true] - When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. */ export class GroundPrimitive { constructor(options?: { geometryInstances?: any[] | GeometryInstance; appearance?: Appearance; show?: boolean; vertexCacheOptimize?: boolean; interleave?: boolean; compressVertices?: boolean; releaseGeometryInstances?: boolean; allowPicking?: boolean; asynchronous?: boolean; classificationType?: ClassificationType; debugShowBoundingVolume?: boolean; debugShowShadowVolume?: boolean; }); /** * The {@link Appearance} used to shade this primitive. Each geometry * instance is shaded with the same appearance. Some appearances, like * {@link PerInstanceColorAppearance} allow giving each instance unique * properties. */ appearance: Appearance; /** * The geometry instances rendered with this primitive. This may * be undefined if options.releaseGeometryInstances * is true when the primitive is constructed. *

* Changing this property after the primitive is rendered has no effect. *

*/ readonly geometryInstances: any[] | GeometryInstance; /** * Determines if the primitive will be shown. This affects all geometry * instances in the primitive. */ show: boolean; /** * Determines whether terrain, 3D Tiles or both will be classified. */ classificationType: ClassificationType; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the shadow volume for each geometry in the primitive. *

*/ debugShowShadowVolume: boolean; /** * When true, geometry vertices are optimized for the pre and post-vertex-shader caches. */ readonly vertexCacheOptimize: boolean; /** * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. */ readonly interleave: boolean; /** * When true, the primitive does not keep a reference to the input geometryInstances to save memory. */ readonly releaseGeometryInstances: boolean; /** * When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. */ readonly allowPicking: boolean; /** * Determines if the geometry instances will be created and batched on a web worker. */ readonly asynchronous: boolean; /** * When true, geometry vertices are compressed, which will save memory. */ readonly compressVertices: boolean; /** * Determines if the primitive is complete and ready to render. If this property is * true, the primitive will be rendered the next time that {@link GroundPrimitive#update} * is called. */ readonly ready: boolean; /** * Determines if GroundPrimitive rendering is supported. * @param scene - The scene. * @returns true if GroundPrimitives are supported; otherwise, returns false */ static isSupported(scene: Scene): boolean; /** * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the * GroundPrimitive synchronously. * @returns A promise that will resolve once the terrain heights have been loaded. */ static initializeTerrainHeights(): Promise; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * const attributes = primitive.getGeometryInstanceAttributes('an id'); * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

* @example * e = e && e.destroy(); */ destroy(): void; /** * Checks if the given Scene supports materials on GroundPrimitives. * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension. * @param scene - The current scene. * @returns Whether or not the current scene supports materials on GroundPrimitives. */ static supportsMaterials(scene: Scene): boolean; } /** * Represents the position relative to the terrain. */ export enum HeightReference { /** * The position is absolute. */ NONE = 0, /** * The position is clamped to the terrain and 3D Tiles. When clamping to 3D Tilesets such as photorealistic 3D Tiles, ensure the tileset has {@link Cesium3DTileset#enableCollision} set to true. Otherwise, the entity may not be correctly clamped to the tileset surface. */ CLAMP_TO_GROUND = 1, /** * The position height is the height above the terrain and 3D Tiles. */ RELATIVE_TO_GROUND = 2, /** * The position is clamped to terrain. */ CLAMP_TO_TERRAIN = 3, /** * The position height is the height above terrain. */ RELATIVE_TO_TERRAIN = 4, /** * The position is clamped to 3D Tiles. */ CLAMP_TO_3D_TILE = 5, /** * The position height is the height above 3D Tiles. */ RELATIVE_TO_3D_TILE = 6 } /** * The horizontal location of an origin relative to an object, e.g., a {@link Billboard} * or {@link Label}. For example, setting the horizontal origin to LEFT * or RIGHT will display a billboard to the left or right (in screen space) * of the anchor position. *

*
*
*
*/ export enum HorizontalOrigin { /** * The origin is at the horizontal center of the object. */ CENTER = 0, /** * The origin is on the left side of the object. */ LEFT = 1, /** * The origin is on the right side of the object. */ RIGHT = -1 } export namespace I3SDataProvider { /** * Initialization options for the I3SDataProvider constructor * @example * // Increase LOD by reducing SSE * const cesium3dTilesetOptions = { * maximumScreenSpaceError: 1, * }; * const i3sOptions = { * cesium3dTilesetOptions: cesium3dTilesetOptions, * }; * @example * // Set a custom outline color to replace the color defined in I3S symbology * const cesium3dTilesetOptions = { * outlineColor: Cesium.Color.BLUE, * }; * const i3sOptions = { * cesium3dTilesetOptions: cesium3dTilesetOptions, * applySymbology: true, * }; * @property [name] - The name of the I3S dataset. * @property [show = true] - Determines if the dataset will be shown. * @property [geoidTiledTerrainProvider] - Tiled elevation provider describing an Earth Gravitational Model. If defined, geometry will be shifted based on the offsets given by this provider. Required to position I3S data sets with gravity-related height at the correct location. * @property [cesium3dTilesetOptions] - Object containing options to pass to an internally created {@link Cesium3DTileset}. See {@link Cesium3DTileset} for list of valid properties. All options can be used with the exception of url and show which are overridden by values from I3SDataProvider. * @property [showFeatures = false] - Determines if the features will be shown. * @property [adjustMaterialAlphaMode = false] - The option to adjust the alpha mode of the material based on the transparency of the vertex color. When true, the alpha mode of the material (if not defined) will be set to BLEND for geometry with any transparency in the color vertex attribute. * @property [applySymbology = false] - Determines if the I3S symbology will be parsed and applied for the layers. * @property [calculateNormals = false] - Determines if the flat normals will be generated for I3S geometry without normals. */ type ConstructorOptions = { name?: string; show?: boolean; geoidTiledTerrainProvider?: ArcGISTiledElevationTerrainProvider | Promise; cesium3dTilesetOptions?: Cesium3DTileset.ConstructorOptions; showFeatures?: boolean; adjustMaterialAlphaMode?: boolean; applySymbology?: boolean; calculateNormals?: boolean; }; } /** * An I3SDataProvider is the main public class for I3S support. The url option * should return a scene object. Currently supported I3S versions are 1.6 and * 1.7/1.8 (OGC I3S 1.2). I3SFeature and I3SNode classes implement the * Object Model for I3S entities, with public interfaces. * *
* This object is normally not instantiated directly, use {@link I3SDataProvider.fromUrl}. *
* @example * try { * const i3sData = await I3SDataProvider.fromUrl( * "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0" * ); * viewer.scene.primitives.add(i3sData); * } catch (error) { * console.log(`There was an error creating the I3S Data Provider: ${error}`); * } * @example * try { * const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( * "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer" * ); * const i3sData = await I3SDataProvider.fromUrl( * "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0", { * geoidTiledTerrainProvider: geoidService * }); * viewer.scene.primitives.add(i3sData); * } catch (error) { * console.log(`There was an error creating the I3S Data Provider: ${error}`); * } * @param options - An object describing initialization options */ export class I3SDataProvider { constructor(options: I3SDataProvider.ConstructorOptions); /** * Gets a human-readable name for this dataset. */ readonly name: string; /** * Determines if the dataset will be shown. */ show: boolean; /** * The terrain provider referencing the GEOID service to be used for orthometric to ellipsoidal conversion. */ readonly geoidTiledTerrainProvider: ArcGISTiledElevationTerrainProvider; /** * Gets the collection of layers. */ readonly layers: I3SLayer[]; /** * Gets the collection of building sublayers. */ readonly sublayers: I3SSublayer[]; /** * Gets the I3S data for this object. */ readonly data: any; /** * Gets the extent covered by this I3S. */ readonly extent: Rectangle; /** * The resource used to fetch the I3S dataset. */ readonly resource: Resource; /** * Determines if the features will be shown. */ readonly showFeatures: boolean; /** * Determines if the alpha mode of the material will be adjusted depending on the color vertex attribute. */ readonly adjustMaterialAlphaMode: boolean; /** * Determines if the I3S symbology will be parsed and applied for the layers. */ readonly applySymbology: boolean; /** * Determines if the flat normals will be generated for I3S geometry without normals. */ readonly calculateNormals: boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

*/ destroy(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Creates an I3SDataProvider. Currently supported I3S versions are 1.6 and * 1.7/1.8 (OGC I3S 1.2). * @example * try { * const i3sData = await I3SDataProvider.fromUrl( * "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0" * ); * viewer.scene.primitives.add(i3sData); * } catch (error) { * console.log(`There was an error creating the I3S Data Provider: ${error}`); * } * @example * try { * const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( * "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer" * ); * const i3sData = await I3SDataProvider.fromUrl( * "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0", { * geoidTiledTerrainProvider: geoidService * }); * viewer.scene.primitives.add(i3sData); * } catch (error) { * console.log(`There was an error creating the I3S Data Provider: ${error}`); * } * @param url - The url of the I3S dataset, which should return an I3S scene object * @param options - An object describing initialization options */ static fromUrl(url: string | Resource, options: I3SDataProvider.ConstructorOptions): Promise; /** * Returns the collection of names for all available attributes * @returns The collection of attribute names */ getAttributeNames(): string[]; /** * Returns the collection of values for the attribute with the given name * @param name - The attribute name * @returns The collection of attribute values */ getAttributeValues(name: string): string[]; /** * Filters the drawn elements of a scene to specific attribute names and values * @param [filters = []] - The collection of attribute filters * @returns A promise that is resolved when the filter is applied */ filterByAttributes(filters?: I3SNode.AttributeFilter[]): Promise; } /** * This class implements an I3S Feature. *

* Do not construct this directly, instead access tiles through {@link I3SNode}. *

*/ export class I3SFeature { constructor(); /** * Gets the resource for the feature */ readonly resource: Resource; /** * Gets the I3S data for this object. */ readonly data: any; } /** * This class implements an I3S Field which is custom data attached * to nodes */ export class I3SField { constructor(); /** * Gets the resource for the fields */ readonly resource: Resource; /** * Gets the header for this field. */ readonly header: any; /** * Gets the values for this field. */ readonly values: any; /** * Gets the name for the field. */ readonly name: string; /** * Loads the content. * @returns A promise that is resolved when the field data is loaded */ load(): Promise; } /** * This class implements an I3S Geometry. Each I3SGeometry * generates an in memory glTF to be used as content for a Cesium3DTile *

* Do not construct this directly, instead access tiles through {@link I3SNode}. *

*/ export class I3SGeometry { constructor(); /** * Gets the resource for the geometry */ readonly resource: Resource; /** * Gets the I3S data for this object. */ readonly data: any; /** * Gets the custom attributes of the geometry. */ readonly customAttributes: any; /** * Find a triangle touching the point [px, py, pz], then return the vertex closest to the search point * @param px - The x component of the point to query * @param py - The y component of the point to query * @param pz - The z component of the point to query * @returns A structure containing the index of the closest point, * the squared distance from the queried point to the point that is found, * the distance from the queried point to the point that is found, * the queried position in local space, * the closest position in local space */ getClosestPointIndexOnTriangle(px: number, py: number, pz: number): any; } /** * This class implements an I3S layer. In CesiumJS each I3SLayer creates a Cesium3DTileset. *

* Do not construct this directly, instead access layers through {@link I3SDataProvider}. *

*/ export class I3SLayer { constructor(); /** * Gets the resource for the layer. */ readonly resource: Resource; /** * Gets the root node of this layer. */ readonly rootNode: I3SNode; /** * Gets the Cesium3DTileset for this layer. */ readonly tileset: Cesium3DTileset | undefined; /** * Gets the I3S data for this object. */ readonly data: any; /** * The version string of the loaded I3S dataset */ readonly version: string; /** * The major version number of the loaded I3S dataset */ readonly majorVersion: number; /** * The minor version number of the loaded I3S dataset */ readonly minorVersion: number; /** * When true, when the loaded I3S version is 1.6 or older */ readonly legacyVersion16: boolean; /** * Filters the drawn elements of a layer to specific attribute names and values * @param [filters = []] - The collection of attribute filters * @returns A promise that is resolved when the filter is applied */ filterByAttributes(filters?: I3SNode.AttributeFilter[]): Promise; } export namespace I3SNode { /** * A filter given by an attribute name and values. * The 3D feature object should be hidden if its value for the attribute name is not specified in the collection of values. * @property name - The name of the attribute * @property values - The collection of values */ type AttributeFilter = { name: string; values: string[] | number[]; }; } /** * This class implements an I3S Node. In CesiumJS each I3SNode creates a Cesium3DTile. *

* Do not construct this directly, instead access tiles through {@link I3SLayer}. *

*/ export class I3SNode { constructor(); /** * Gets the resource for the node. */ readonly resource: Resource; /** * Gets the parent layer. */ readonly layer: I3SLayer; /** * Gets the parent node. */ readonly parent: I3SNode | undefined; /** * Gets the children nodes. */ readonly children: I3SNode[]; /** * Gets the collection of geometries. */ readonly geometryData: I3SGeometry[]; /** * Gets the collection of features. */ readonly featureData: I3SFeature[]; /** * Gets the collection of fields. */ readonly fields: I3SField[]; /** * Gets the Cesium3DTile for this node. */ readonly tile: Cesium3DTile; /** * Gets the I3S data for this object. */ readonly data: any; /** * Loads the node fields. * @returns A promise that is resolved when the I3S Node fields are loaded */ loadFields(): Promise; /** * Loads the node field. * @param name - The field name * @returns A promise that is resolved when the I3S Node field is loaded */ loadField(name: string): Promise; /** * Returns the fields for a given picked position * @param pickedPosition - The picked position * @returns Object containing field names and their values */ getFieldsForPickedPosition(pickedPosition: Cartesian3): any; /** * Returns the fields for a given feature * @param featureIndex - Index of the feature whose attributes we want to get * @returns Object containing field names and their values */ getFieldsForFeature(featureIndex: number): any; } /** * This class implements an I3S statistics for Building Scene Layer. *

* Do not construct this directly, instead access statistics through {@link I3SDataProvider}. *

*/ export class I3SStatistics { constructor(); /** * Gets the resource for the statistics */ readonly resource: Resource; /** * Gets the I3S data for this object. */ readonly data: any; /** * Gets the collection of attribute names. */ readonly names: string[]; } /** * This class implements an I3S sublayer for Building Scene Layer. *

* This object is normally not instantiated directly, use {@link I3SSublayer.fromData}. *

*/ export class I3SSublayer { constructor(); /** * Gets the resource for the sublayer */ readonly resource: Resource; /** * Gets the I3S data for this object. */ readonly data: any; /** * Gets the name for the sublayer. */ readonly name: string; /** * Gets the model name for the sublayer. */ readonly modelName: string; /** * Gets the collection of child sublayers. */ readonly sublayers: I3SSublayer[]; /** * Gets or sets the sublayer visibility. */ visibility: boolean; /** * Determines if the sublayer will be shown. */ readonly show: boolean; } /** * This class implements an I3S symbology for I3S Layers. *

* Do not construct this directly, instead access symbology through {@link I3SLayer}. *

*/ export class I3SSymbology { constructor(); /** * Gets the default symbology data. */ readonly defaultSymbology: any; } /** * Methods for loading iTwin platform data into CesiumJS */ export namespace ITwinData { /** * Create a {@link Cesium3DTileset} for the given iModel id using iTwin's Mesh Export API. * * If there is not a completed export available for the given iModel id, the returned promise will resolve to undefined. * We recommend waiting 10-20 seconds and trying to load the tileset again. * If all exports are Invalid this will throw an error. * * See the {@link https://developer.bentley.com/apis/mesh-export/overview/|iTwin Platform Mesh Export API documentation} for more information on request parameters * @example * const tileset = await Cesium.ITwinData.createTilesetFromIModelId({ iModelId }); * if (Cesium.defined(tileset)) { * viewer.scene.primitives.add(tileset); * } * @param options.iModelId - The id of the iModel to load * @param [options.tilesetOptions] - Object containing options to pass to the internally created {@link Cesium3DTileset}. * @param [options.changesetId] - The id of the changeset to load, if not provided the latest changesets will be used * @returns A promise that will resolve to the created 3D tileset or undefined if there is no completed export for the given iModel id */ function createTilesetFromIModelId(options: { iModelId: string; tilesetOptions?: Cesium3DTileset.ConstructorOptions; changesetId?: string; }): Promise; /** * Create a tileset for the specified reality data id. This function only works * with 3D Tiles meshes and point clouds. * * If the type or rootDocument are not provided this function * will first request the full metadata for the specified reality data to fill these values. * * The maximumScreenSpaceError of the resulting tileset will default to 4, * unless it is explicitly overridden with the given tileset options. * @param options.iTwinId - The id of the iTwin to load data from * @param options.realityDataId - The id of the reality data to load * @param [options.type] - The type of this reality data * @param [options.rootDocument] - The path of the root document for this reality data * @param [options.tilesetOptions] - Object containing * options to pass to the internally created {@link Cesium3DTileset}. */ function createTilesetForRealityDataId(options: { iTwinId: string; realityDataId: string; type?: ITwinPlatform.RealityDataType; rootDocument?: string; tilesetOptions?: Cesium3DTileset.ConstructorOptions; }): Promise; /** * Create a data source of the correct type for the specified reality data id. * This function only works for KML and GeoJSON type data. * * If the type or rootDocument are not provided this function * will first request the full metadata for the specified reality data to fill these values. * @param options.iTwinId - The id of the iTwin to load data from * @param options.realityDataId - The id of the reality data to load * @param [options.type] - The type of this reality data * @param [options.rootDocument] - The path of the root document for this reality data */ function createDataSourceForRealityDataId(options: { iTwinId: string; realityDataId: string; type?: ITwinPlatform.RealityDataType; rootDocument?: string; }): Promise; /** * Load data from the Geospatial Features API as GeoJSON. * @param options.iTwinId - The id of the iTwin to load data from * @param options.collectionId - The id of the data collection to load * @param [options.limit = 10000] - number of items per page, must be between 1 and 10,000 inclusive */ function loadGeospatialFeatures(options: { iTwinId: string; collectionId: string; limit?: number; }): Promise; } /** * Properties for managing image-based lighting on tilesets and models. * Also manages the necessary resources and textures. *

* If specular environment maps are used, {@link ImageBasedLighting#destroy} must be called * when the image-based lighting is no longer needed to clean up GPU resources properly. * If a model or tileset creates an instance of ImageBasedLighting, it will handle this. * Otherwise, the application is responsible for calling destroy(). *

* @param [options] - Object with the following properties: * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. */ export class ImageBasedLighting { constructor(options?: { imageBasedLightingFactor?: Cartesian2; sphericalHarmonicCoefficients?: Cartesian3[]; specularEnvironmentMaps?: string; }); /** * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. * This cartesian is used to scale the final diffuse and specular lighting * contribution from those sources to the final color. A value of 0.0 will * disable those light sources. */ imageBasedLightingFactor: Cartesian2; /** * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When undefined, a diffuse irradiance * computed from the atmosphere color is used. *

* There are nine Cartesian3 coefficients. * The order of the coefficients is: L0,0, L1,-1, L1,0, L1,1, L2,-2, L2,-1, L2,0, L2,1, L2,2 *

* * These values can be obtained by preprocessing the environment map using the cmgen tool of * {@link https://github.com/google/filament/releases|Google's Filament project}. * Be sure to use the --no-mirror option in cmgen. */ sphericalHarmonicCoefficients: Cartesian3[]; /** * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. */ specularEnvironmentMaps: string; } export namespace ImageryLayer { /** * A function that is called when an error occurs. * @param err - An object holding details about the error that occurred. */ type ErrorEventCallback = (this: ImageryLayer, err: Error) => void; /** * A function that is called when the provider has been created * @param provider - The created imagery provider. */ type ReadyEventCallback = (this: ImageryLayer, provider: ImageryProvider) => void; /** * Initialization options for the ImageryLayer constructor. * @property [rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle * can limit the visible portion of the imagery provider. * @property [alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates of the * imagery tile for which the alpha is required, and it is expected to return * the alpha value to use for the tile. * @property [nightAlpha = 1.0] - The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates of the * imagery tile for which the alpha is required, and it is expected to return * the alpha value to use for the tile. This only takes effect when enableLighting is true. * @property [dayAlpha = 1.0] - The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates of the * imagery tile for which the alpha is required, and it is expected to return * the alpha value to use for the tile. This only takes effect when enableLighting is true. * @property [brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates of the * imagery tile for which the brightness is required, and it is expected to return * the brightness value to use for the tile. The function is executed for every * frame and for every tile, so it must be fast. * @property [contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color. * Less than 1.0 reduces the contrast while greater than 1.0 increases it. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates of the * imagery tile for which the contrast is required, and it is expected to return * the contrast value to use for the tile. The function is executed for every * frame and for every tile, so it must be fast. * @property [hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates * of the imagery tile for which the hue is required, and it is expected to return * the hue value to use for the tile. The function is executed for every * frame and for every tile, so it must be fast. * @property [saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color. * Less than 1.0 reduces the saturation while greater than 1.0 increases it. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates * of the imagery tile for which the saturation is required, and it is expected to return * the saturation value to use for the tile. The function is executed for every * frame and for every tile, so it must be fast. * @property [gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color. * This can either be a simple number or a function with the signature * function(frameState, layer, x, y, level). The function is passed the * current frame state, this layer, and the x, y, and level coordinates of the * imagery tile for which the gamma is required, and it is expected to return * the gamma value to use for the tile. The function is executed for every * frame and for every tile, so it must be fast. * @property [splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this layer. * @property [minificationFilter = TextureMinificationFilter.LINEAR] - The * texture minification filter to apply to this layer. Possible values * are TextureMinificationFilter.LINEAR and * TextureMinificationFilter.NEAREST. * @property [magnificationFilter = TextureMagnificationFilter.LINEAR] - The * texture minification filter to apply to this layer. Possible values * are TextureMagnificationFilter.LINEAR and * TextureMagnificationFilter.NEAREST. * @property [show = true] - True if the layer is shown; otherwise, false. * @property [maximumAnisotropy = maximum supported] - The maximum anisotropy level to use * for texture filtering. If this parameter is not specified, the maximum anisotropy supported * by the WebGL stack will be used. Larger values make the imagery look better in horizon * views. * @property [minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer, * or undefined to show it at all levels. Level zero is the least-detailed level. * @property [maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer, * or undefined to show it at all levels. Level zero is the least-detailed level. * @property [cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer. * @property [colorToAlpha] - Color to be used as alpha. * @property [colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha. */ type ConstructorOptions = { rectangle?: Rectangle; alpha?: number | ((...params: any[]) => any); nightAlpha?: number | ((...params: any[]) => any); dayAlpha?: number | ((...params: any[]) => any); brightness?: number | ((...params: any[]) => any); contrast?: number | ((...params: any[]) => any); hue?: number | ((...params: any[]) => any); saturation?: number | ((...params: any[]) => any); gamma?: number | ((...params: any[]) => any); splitDirection?: SplitDirection | ((...params: any[]) => any); minificationFilter?: TextureMinificationFilter; magnificationFilter?: TextureMagnificationFilter; show?: boolean; maximumAnisotropy?: number; minimumTerrainLevel?: number; maximumTerrainLevel?: number; cutoutRectangle?: Rectangle; colorToAlpha?: Color; colorToAlphaThreshold?: number; }; /** * Initialization options for ImageryLayer.fromWorldImagery * @property [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. */ type WorldImageryConstructorOptions = ImageryLayer.ConstructorOptions; } /** * An imagery layer that displays tiled image data from a single imagery provider * on a {@link Globe} or {@link Cesium3DTileset}. * @example * // Add an OpenStreetMaps layer * const imageryLayer = new Cesium.ImageryLayer(new Cesium.OpenStreetMapImageryProvider({ * url: "https://tile.openstreetmap.org/" * })); * scene.imageryLayers.add(imageryLayer); * @example * // Add Cesium ion's default world imagery layer * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery(); * scene.imageryLayers.add(imageryLayer); * @example * // Add a new transparent layer from Cesium ion * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * imageryLayer.alpha = 0.5; * scene.imageryLayers.add(imageryLayer); * @example * // Drape Bing Maps Aerial imagery over a 3D tileset * const tileset = await Cesium.Cesium3DTileset.fromUrl( * "http://localhost:8002/tilesets/Seattle/tileset.json" * ); * scene.primitives.add(tileset); * * const imageryProvider = await Cesium.createWorldImageryAsync({ * style: Cesium.IonWorldImageryStyle.AERIAL, * }); * const imageryLayer = new ImageryLayer(imageryProvider); * tileset.imageryLayers.add(imageryLayer); * @param [imageryProvider] - The imagery provider to use. * @param [options] - An object describing initialization options */ export class ImageryLayer { constructor(imageryProvider?: ImageryProvider, options?: ImageryLayer.ConstructorOptions); /** * The alpha blending value of this layer, with 0.0 representing fully transparent and * 1.0 representing fully opaque. */ alpha: number; /** * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is true. */ nightAlpha: number; /** * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is true. */ dayAlpha: number; /** * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. */ brightness: number; /** * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. */ contrast: number; /** * The hue of this layer in radians. 0.0 uses the unmodified imagery color. */ hue: number; /** * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. */ saturation: number; /** * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color. */ gamma: number; /** * The {@link SplitDirection} to apply to this layer. */ splitDirection: SplitDirection; /** * The {@link TextureMinificationFilter} to apply to this layer. * Possible values are {@link TextureMinificationFilter.LINEAR} (the default) * and {@link TextureMinificationFilter.NEAREST}. * * To take effect, this property must be set immediately after adding the imagery layer. * Once a texture is loaded it won't be possible to change the texture filter used. */ minificationFilter: TextureMinificationFilter; /** * The {@link TextureMagnificationFilter} to apply to this layer. * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default) * and {@link TextureMagnificationFilter.NEAREST}. * * To take effect, this property must be set immediately after adding the imagery layer. * Once a texture is loaded it won't be possible to change the texture filter used. */ magnificationFilter: TextureMagnificationFilter; /** * Determines if this layer is shown. */ show: boolean; /** * Rectangle cutout in this layer of imagery. */ cutoutRectangle: Rectangle; /** * Color value that should be set to transparent. */ colorToAlpha: Color; /** * Normalized (0-1) threshold for color-to-alpha. */ colorToAlphaThreshold: number; /** * Gets the imagery provider for this layer. This should not be called before {@link ImageryLayer#ready} returns true. */ readonly imageryProvider: ImageryProvider; /** * Returns true when the terrain provider has been successfully created. Otherwise, returns false. */ readonly ready: boolean; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of the thrown error. */ readonly errorEvent: Event; /** * Gets an event that is raised when the imagery provider has been successfully created. Event listeners * are passed the created instance of {@link ImageryProvider}. */ readonly readyEvent: Event; /** * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the * {@link ImageryProvider}, only a portion of the imagery provider is shown. */ readonly rectangle: Rectangle; /** * This value is used as the default brightness for the imagery layer if one is not provided during construction * or by the imagery provider. This value does not modify the brightness of the imagery. */ static DEFAULT_BRIGHTNESS: number; /** * This value is used as the default contrast for the imagery layer if one is not provided during construction * or by the imagery provider. This value does not modify the contrast of the imagery. */ static DEFAULT_CONTRAST: number; /** * This value is used as the default hue for the imagery layer if one is not provided during construction * or by the imagery provider. This value does not modify the hue of the imagery. */ static DEFAULT_HUE: number; /** * This value is used as the default saturation for the imagery layer if one is not provided during construction * or by the imagery provider. This value does not modify the saturation of the imagery. */ static DEFAULT_SATURATION: number; /** * This value is used as the default gamma for the imagery layer if one is not provided during construction * or by the imagery provider. This value does not modify the gamma of the imagery. */ static DEFAULT_GAMMA: number; /** * This value is used as the default split for the imagery layer if one is not provided during construction * or by the imagery provider. */ static DEFAULT_SPLIT: SplitDirection; /** * This value is used as the default texture minification filter for the imagery layer if one is not provided * during construction or by the imagery provider. */ static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter; /** * This value is used as the default texture magnification filter for the imagery layer if one is not provided * during construction or by the imagery provider. */ static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter; /** * This value is used as the default threshold for color-to-alpha if one is not provided * during construction or by the imagery provider. */ static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number; /** * Create a new imagery layer from an asynchronous imagery provider. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready. * @example * // Create a new base layer * const viewer = new Cesium.Viewer("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * }); * @example * // Add a new transparent layer * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * imageryLayer.alpha = 0.5; * viewer.imageryLayers.add(imageryLayer); * @example * // Handle loading events * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * viewer.imageryLayers.add(imageryLayer); * * imageryLayer.readyEvent.addEventListener(provider => { * imageryLayer.imageryProvider.errorEvent.addEventListener(error => { * alert(`Encountered an error while loading imagery tiles! ${error}`); * }); * }); * * imageryLayer.errorEvent.addEventListener(error => { * alert(`Encountered an error while creating an imagery layer! ${error}`); * }); * @param imageryProviderPromise - A promise which resolves to a imagery provider * @param [options] - An object describing initialization options * @returns The created imagery layer. */ static fromProviderAsync(imageryProviderPromise: Promise, options?: ImageryLayer.ConstructorOptions): ImageryLayer; /** * Create a new imagery layer for ion's default global base imagery layer, currently Bing Maps. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready. * @example * // Add a new transparent layer * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery(); * imageryLayer.alpha = 0.5; * viewer.imageryLayers.add(imageryLayer); * @example * // Handle loading events * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery(); * viewer.imageryLayers.add(imageryLayer); * * imageryLayer.readyEvent.addEventListener(provider => { * imageryLayer.imageryProvider.errorEvent.addEventListener(error => { * alert(`Encountered an error while loading imagery tiles! ${error}`); * }); * }); * * imageryLayer.errorEvent.addEventListener(error => { * alert(`Encountered an error while creating an imagery layer! ${error}`); * }); * @param options - An object describing initialization options * @returns The created imagery layer. * * * @example * // Create a new base layer * const viewer = new Cesium.Viewer("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromWorldImagery(); * }); */ static fromWorldImagery(options: ImageryLayer.WorldImageryConstructorOptions): ImageryLayer; /** * Gets a value indicating whether this layer is the base layer in the * {@link ImageryLayerCollection}. The base layer is the one that underlies all * others. It is special in that it is treated as if it has global rectangle, even if * it actually does not, by stretching the texels at the edges over the entire * globe. * @returns true if this is the base layer; otherwise, false. */ isBaseLayer(): boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * imageryLayer = imageryLayer && imageryLayer.destroy(); */ destroy(): void; /** * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle, * producing the overall bounds of imagery that can be produced by this layer. * @example * // Zoom to an imagery layer. * const imageryRectangle = imageryLayer.getImageryRectangle(); * scene.camera.flyTo({ * destination: rectangle * }); * @returns A rectangle which defines the overall bounds of imagery that can be produced by this layer. */ getImageryRectangle(): Rectangle; } /** * An ordered collection of imagery layers for rendering raster imagery on a {@link Globe} or {@link Cesium3DTileset}. */ export class ImageryLayerCollection { constructor(); /** * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that * was added and the index at which it was added. */ layerAdded: Event; /** * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that * was removed and the index from which it was removed. */ layerRemoved: Event; /** * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that * was moved, its new index after the move, and its old index prior to the move. */ layerMoved: Event; /** * An event that is raised when a layer is shown or hidden by setting the * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer, * the index of the layer in the collection, and a flag that is true if the layer is now * shown or false if it is now hidden. */ layerShownOrHidden: Event; /** * Gets the number of layers in this collection. */ length: number; /** * Adds a layer to the collection. * @example * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery(); * scene.imageryLayers.add(imageryLayer); * @example * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * scene.imageryLayers.add(imageryLayer); * @param layer - the layer to add. * @param [index] - the index to add the layer at. If omitted, the layer will * be added on top of all existing layers. */ add(layer: ImageryLayer, index?: number): void; /** * Creates a new layer using the given ImageryProvider and adds it to the collection. * @example * try { * const provider = await Cesium.IonImageryProvider.fromAssetId(3812); * scene.imageryLayers.addImageryProvider(provider); * } catch (error) { * console.log(`There was an error creating the imagery layer. ${error}`) * } * @param imageryProvider - the imagery provider to create a new layer for. * @param [index] - the index to add the layer at. If omitted, the layer will * added on top of all existing layers. * @returns The newly created layer. */ addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer; /** * Removes a layer from this collection, if present. * @param layer - The layer to remove. * @param [destroy = true] - whether to destroy the layers in addition to removing them. * @returns true if the layer was in the collection and was removed, * false if the layer was not in the collection. */ remove(layer: ImageryLayer, destroy?: boolean): boolean; /** * Removes all layers from this collection. * @param [destroy = true] - whether to destroy the layers in addition to removing them. */ removeAll(destroy?: boolean): void; /** * Checks to see if the collection contains a given layer. * @param layer - the layer to check for. * @returns true if the collection contains the layer, false otherwise. */ contains(layer: ImageryLayer): boolean; /** * Determines the index of a given layer in the collection. * @param layer - The layer to find the index of. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection. */ indexOf(layer: ImageryLayer): number; /** * Gets a layer by index from the collection. * @param index - the index to retrieve. * @returns The imagery layer at the given index. */ get(index: number): ImageryLayer; /** * Raises a layer up one position in the collection. * @param layer - the layer to move. */ raise(layer: ImageryLayer): void; /** * Lowers a layer down one position in the collection. * @param layer - the layer to move. */ lower(layer: ImageryLayer): void; /** * Raises a layer to the top of the collection. * @param layer - the layer to move. */ raiseToTop(layer: ImageryLayer): void; /** * Lowers a layer to the bottom of the collection. * @param layer - the layer to move. */ lowerToBottom(layer: ImageryLayer): void; /** * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a * location on the screen, use {@link Camera.getPickRay}. * @param ray - The ray to test for intersection. * @param scene - The scene. * @returns An array that includes all of * the layers that are intersected by a given pick ray. Undefined if * no layers are selected. */ pickImageryLayers(ray: Ray, scene: Scene): ImageryLayer[] | undefined; /** * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}. * @example * const pickRay = viewer.camera.getPickRay(windowPosition); * const featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene); * if (!Cesium.defined(featuresPromise)) { * console.log('No features picked.'); * } else { * Promise.resolve(featuresPromise).then(function(features) { * // This function is called asynchronously when the list if picked features is available. * console.log(`Number of features: ${features.length}`); * if (features.length > 0) { * console.log(`First feature name: ${features[0].name}`); * } * }); * } * @param ray - The ray to test for intersection. * @param scene - The scene. * @returns A promise that resolves to an array of features intersected by the pick ray. * If it can be quickly determined that no features are intersected (for example, * because no active imagery providers support {@link ImageryProvider#pickFeatures} * or because the pick ray does not intersect the surface), this function will * return undefined. */ pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise | undefined; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this * object allows for deterministic release of WebGL resources, instead of relying on the garbage * collector. *

* Once this object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * layerCollection = layerCollection && layerCollection.destroy(); */ destroy(): void; } /** * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer. */ export class ImageryLayerFeatureInfo { constructor(); /** * Gets or sets the name of the feature. */ name: string | undefined; /** * Gets or sets an HTML description of the feature. The HTML is not trusted and should * be sanitized before display to the user. */ description: string | undefined; /** * Gets or sets the position of the feature, or undefined if the position is not known. */ position: Cartographic | undefined; /** * Gets or sets the raw data describing the feature. The raw data may be in any * number of formats, such as GeoJSON, KML, etc. */ data: any | undefined; /** * Gets or sets the image layer of the feature. */ imageryLayer: any | undefined; /** * Configures the name of this feature by selecting an appropriate property. The name will be obtained from * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title', * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If * the name cannot be obtained from any of these sources, the existing name will be left unchanged. * @param properties - An object literal containing the properties of the feature. */ configureNameFromProperties(properties: any): void; /** * Configures the description of this feature by creating an HTML table of properties and their values. * @param properties - An object literal containing the properties of the feature. */ configureDescriptionFromProperties(properties: any): void; } /** * The format in which {@link ImageryProvider} methods return an image may * vary by provider, configuration, or server settings. Most common are * HTMLImageElement, HTMLCanvasElement, or on supported * browsers, ImageBitmap. * * See the documentation for each ImageryProvider class for more information about how they return images. */ export type ImageryTypes = HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas; /** * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an * interface and is not intended to be instantiated directly. */ export class ImageryProvider { constructor(); /** * Gets the rectangle, in radians, of the imagery provided by the instance. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. Generally, * a minimum level should only be used when the rectangle of the imagery is small * enough that the number of tiles at the minimum level is small. An imagery * provider with more than a few tiles at the minimum level will lead to * rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns Returns a promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. * This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** * Loads an image from a given URL. If the server referenced by the URL already has * too many requests pending, this function will instead return undefined, indicating * that the request should be retried later. * @param imageryProvider - The imagery provider for the URL. * @param url - The URL of the image. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise | undefined; } export namespace IonAssetElementService { /** * A single property of an {@link IonAssetElementService.Element}. * @property value - The raw value of this property. * @property [displayValue] - The human-readable, pre-formatted value, including any unit suffix (e.g. "0.6208 m³"). * @property [units] - The unit of value, or null or undefined when the property is unitless. */ type ElementProperty = { value: any; displayValue?: string; units?: string | null; }; /** * The geographic location of an {@link IonAssetElementService.Element}, present * only when the element is geolocated. */ type ElementLocation = ElementService.ElementLocation; /** * A single element of a Cesium ion asset, such as a wall or column in a * BIM/CAD model. * @property id - The unique integer identifier of this element, as a decimal string, e.g. "3298534886898". * @property [label] - The user-friendly label of this element, if any. * @property [location] - The geographic location of this element, or undefined when the element has no location (e.g. conceptual elements, or assets with no geographic coordinate system). * @property [properties] - The properties of this element, keyed by property name. List results may omit properties; use {@link IonAssetElementService#getElement} to retrieve the element's details. Property names are kept verbatim, including any dotted namespaces (e.g. "Volume Aspect.Net Volume"). */ type Element = { id: string; label?: string; location?: IonAssetElementService.ElementLocation; properties?: { [key: string]: IonAssetElementService.ElementProperty; }; }; /** * A page of results from {@link IonAssetElementService#listElements}. * @property items - The elements on this page. * @property total - The total number of elements matching the query across all pages, or null when the total is unavailable. * @property [continuationToken] - A token to pass as options.continuationToken to retrieve the next page, or undefined when there are no more results. */ type ElementPage = { items: IonAssetElementService.Element[]; total: number | null; continuationToken?: string; }; /** * Aggregate statistics for a single numeric property across a set of elements, * as returned by {@link IonAssetElementService#aggregate}. * * Non-numeric properties come back with a count of 0, * null for min, max, and avg, and a sum of 0. * @property propertyKey - The qualified property key these statistics describe. * @property count - The number of elements that had a numeric value for this property key. * @property min - The minimum value across the matched elements, or null when there are no numeric values. * @property max - The maximum value across the matched elements, or null when there are no numeric values. * @property avg - The mean value across the matched elements, or null when there are no numeric values. * @property sum - The sum of values across the matched elements. */ type Aggregation = { propertyKey: string; count: number; min: number | null; max: number | null; avg: number | null; sum: number; }; /** * A node in a Cesium ion asset's element tree, as returned by * {@link IonAssetElementService#getElementTreeChildren}. * @property key - The opaque key of this node. Pass it as options.nodeKey to {@link IonAssetElementService#getElementTreeChildren} to list this node's children. * @property label - The user-friendly label of this node. * @property hasChildren - Whether this node has any children. * @property id - The integer instance id represented by this node, as a decimal string. * @property kind - The kind of node. */ type ElementTreeNode = { key: string; label: string; hasChildren: boolean; id: string; kind: "subject" | "model" | "category" | "element"; }; /** * An entry in the root-first path returned by * {@link IonAssetElementService#getElementTreeParents}. Entries include the * target element as well as its ancestors. * @property kind - The kind of path entry. * @property id - The integer instance id for this subject, model, category, or element, as a decimal string. */ type ElementTreePathEntry = { kind: "subject" | "model" | "category" | "element"; id: string; }; } /** * Queries the individual elements within a Cesium ion asset backed by a * BIM/CAD Database model, using the ion REST API's * Asset Elements endpoints. * * Element ids are typically obtained by picking a {@link Cesium3DTileFeature} * and reading its element property. * * This object is normally not instantiated directly, use {@link IonAssetElementService.fromAssetId}. * @example * const elements = Cesium.IonAssetElementService.fromAssetId(123456); * const page = await elements.listElements({ * filter: { "IFC Attributes.name": { $like: "%Rebar%" } }, * top: 50, * }); * console.log(`${page.items.length} of ${page.total} elements`); * @param options - Object with the following properties: * @param options.assetId - The ion asset id. * @param options.resource - The asset's ion API resource. */ export class IonAssetElementService extends ElementService { constructor(options: { assetId: number; resource: Resource; }); /** * The ion asset id this service operates on. */ readonly assetId: number; /** * Creates an {@link IonAssetElementService} for the given ion asset. * @param assetId - The ion id of an asset backed by a BIM/CAD Database model. * @param [options] - Object with the following properties: * @param [options.accessToken = Ion.defaultAccessToken] - The ion access token to use. * @param [options.server = Ion.defaultServer] - The ion API server to use. * @returns A service bound to the asset. */ static fromAssetId(assetId: number, options?: { accessToken?: string; server?: string | Resource; }): IonAssetElementService; /** * Computes a {@link BoundingSphere} enclosing an element from its * location, suitable for framing the camera with * {@link Camera#flyToBoundingSphere} or {@link Viewer#zoomTo}. * @example * const element = await elements.getElement(elementId); * const boundingSphere = Cesium.IonAssetElementService.getBoundingSphere(element); * if (Cesium.defined(boundingSphere)) { * viewer.camera.flyToBoundingSphere(boundingSphere); * } * @param element - An element returned by {@link IonAssetElementService#getElement} or {@link IonAssetElementService#listElements}. * @returns A bounding sphere for the element, or undefined if the element has no valid location. */ static getBoundingSphere(element: IonAssetElementService.Element): BoundingSphere | undefined; /** * Reads the element id from a picked {@link Cesium3DTileFeature}. Rendered * features carry the id of the element they belong to in their * element property. * * The returned id can be passed directly to * {@link IonAssetElementService#getElement}. * @example * const feature = viewer.scene.pick(movement.position); * const elementId = Cesium.IonAssetElementService.getElementId(feature); * if (Cesium.defined(elementId)) { * const element = await elements.getElement(elementId); * } * @param feature - A feature picked from the asset's tileset. * @returns The element id as a decimal string, e.g. "3298534886898", or undefined if the feature has no element id. */ static getElementId(feature: Cesium3DTileFeature): string | undefined; /** * Retrieves a page of elements for this asset, optionally filtered. * * Results are paginated with an opaque cursor. Request subsequent pages by * passing the returned continuationToken as * options.continuationToken until it is undefined. * @example * const page = await elements.listElements({ * filter: { * $or: [{ "IFC Class Name": "ifcwall" }, { "IFC Class Name": "ifccolumn" }], * }, * }); * @param [options] - Object with the following properties: * @param [options.top = 100] - The maximum number of elements to return per page. * @param [options.continuationToken] - A token returned from a previous call to retrieve the next page of results. * @param [options.filter] - An element filter. See the Query parameters section of the List elements ion REST API documentation for the supported structure. * @returns A promise that resolves to a page of elements. The promise rejects with a {@link RequestErrorEvent} if the request fails. */ listElements(options?: { top?: number; continuationToken?: string; filter?: any | string; }): Promise; /** * Retrieves metadata and location information for a single element. * * Use {@link IonAssetElementService.getElementId} to obtain the id from a * picked {@link Cesium3DTileFeature}. * @param elementId - The element id as a decimal string, e.g. "3298534886898". * @returns A promise that resolves to the requested element. The promise rejects with a {@link RequestErrorEvent} if the request fails or the element does not exist. */ getElement(elementId: string): Promise; /** * Computes aggregate statistics (count, min, max, average, and sum) for one * or more numeric properties across the elements of this asset, optionally * filtered. * @example * try { * const result = await elements.aggregate({ * propertyKeys: ["Volume Aspect.Net Volume"], * filter: { "IFC Class Name": "ifcwall" }, * }); * console.log(result.aggregations, result.total); * } catch (error) { * console.error(error.statusCode, error.response); * }; * @param options - Object with the following properties: * @param options.propertyKeys - The qualified property keys to aggregate. At least one is required. * @param [options.filter] - An element filter. See the Query parameters section of the Aggregate elements ion REST API documentation for the supported structure. * @returns A promise that resolves to the aggregate statistics. The promise rejects with a {@link RequestErrorEvent} if the request fails. */ aggregate(options: { propertyKeys: string[]; filter?: any | string; }): Promise<{ aggregations: IonAssetElementService.Aggregation[]; total: number; }>; /** * Lists the children of a node in this asset's element tree, or the root * nodes when no key is given. * @example * try { * const { nodes } = await elements.getElementTreeChildren(); * const { nodes: children } = await elements.getElementTreeChildren({ * nodeKey: nodes[0].key, * }); * console.log(nodes); * } catch (error) { * console.error(error.statusCode, error.response); * } * @param [options] - Object with the following properties: * @param [options.nodeKey] - The opaque node key returned by the endpoint. Omit it to list root nodes. * @returns A promise that resolves to the child nodes. The promise rejects with a {@link RequestErrorEvent} if the request fails or a key for a node that does not exist is provided. */ getElementTreeChildren(options?: { nodeKey?: string; }): Promise<{ nodes: IonAssetElementService.ElementTreeNode[]; }>; /** * Retrieves the parents of an element in this asset's element tree, from the * root down to the element, using ion's tree/parents endpoint. * @example * try { * const { path } = await elements.getElementTreeParents(elementId); * console.log(path); * } catch (error) { * console.error(error.statusCode, error.response); * } * @param elementId - The element id as a decimal string, e.g. "3298534886898". * @returns A promise that resolves to the root-first path. The promise rejects with a {@link RequestErrorEvent} if the request fails or no path exists. */ getElementTreeParents(elementId: string): Promise<{ path: IonAssetElementService.ElementTreePathEntry[]; }>; } export namespace IonImageryProvider { /** * Initialization options for the TileMapServiceImageryProvider constructor * @property [accessToken = Ion.defaultAccessToken] - The access token to use. * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server. */ type ConstructorOptions = { accessToken?: string; server?: string | Resource; }; } /** *
* To construct a IonImageryProvider, call {@link IonImageryProvider.fromAssetId}. Do not call the constructor directly. *
* * Provides tiled imagery using the Cesium ion REST API. * @example * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * viewer.imageryLayers.add(imageryLayer); */ export class IonImageryProvider { constructor(); /** * Gets the rectangle, in radians, of the imagery provided by the instance. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. Generally, * a minimum level should only be used when the rectangle of the imagery is small * enough that the number of tiles at the minimum level is small. An imagery * provider with more than a few tiles at the minimum level will lead to * rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Creates a provider for tiled imagery using the Cesium ion REST API. * @example * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812)); * viewer.imageryLayers.add(imageryLayer); * @param assetId - An ion imagery asset ID. * @param [options] - Object describing initialization options. * @returns A promise which resolves to the created IonImageryProvider. */ static fromAssetId(assetId: number, options?: IonImageryProvider.ConstructorOptions): Promise; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * The types of imagery provided by {@link createWorldImagery}. */ export enum IonWorldImageryStyle { /** * Aerial imagery. */ AERIAL = 2, /** * Aerial imagery with a road overlay. */ AERIAL_WITH_LABELS = 3, /** * Roads without additional imagery. */ ROAD = 4 } export namespace Label { /** * Initialization options for the Label constructor * @property position - The cartesian position of the label. * @property [id] - A user-defined object to return when the label is picked with {@link Scene#pick}. * @property [show = true] - Determines if this label will be shown. * @property [text] - A string specifying the text of the label. * @property [font = '30px sans-serif'] - A string specifying the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property. * @property [style = LabelStyle.FILL] - A {@link LabelStyle} specifying the style of the label. * @property [scale = 1.0] - A number specifying the uniform scale that is multiplied with the label size. * @property [showBackground = false] - Determines if a background behind this label will be shown. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A {@link Color} specifying the background color of the label. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Specifying the horizontal and vertical background padding in pixels. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} specifying the pixel offset in screen space from the origin of this label. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} specifying the 3D Cartesian offset applied to this label in eye coordinates. * @property [horizontalOrigin = HorizontalOrigin.LEFT] - A {@link HorizontalOrigin} specifying the horizontal origin of this label. * @property [verticalOrigin = VerticalOrigin.BASELINE] - A {@link VerticalOrigin} specifying the vertical origin of this label. * @property [heightReference = HeightReference.NONE] - A {@link HeightReference} specifying the height reference of this label. * @property [fillColor = Color.WHITE] - A {@link Color} specifying the fill color of the label. * @property [outlineColor = Color.BLACK] - A {@link Color} specifying the outline color of the label. * @property [outlineWidth = 1.0] - A number specifying the outline width of the label. * @property [translucencyByDistance] - A {@link NearFarScalar} specifying near and far translucency properties of the label based on the label's distance from the camera. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} specifying near and far pixel offset scaling properties of the label based on the label's distance from the camera. * @property [scaleByDistance] - A {@link NearFarScalar} specifying near and far scaling properties of the label based on the label's distance from the camera. * @property [distanceDisplayCondition] - A {@link DistanceDisplayCondition} specifying at what distance from the camera that this label will be displayed. * @property [disableDepthTestDistance] - The distance from the camera, beyond which, depth testing is disabled—to, for example, prevent clipping against terrain. */ type ConstructorOptions = { position: Cartesian3; id?: any; show?: boolean; text?: string; font?: string; style?: LabelStyle; scale?: number; showBackground?: boolean; backgroundColor?: Color; backgroundPadding?: Cartesian2; pixelOffset?: Cartesian2; eyeOffset?: Cartesian3; horizontalOrigin?: HorizontalOrigin; verticalOrigin?: VerticalOrigin; heightReference?: HeightReference; fillColor?: Color; outlineColor?: Color; outlineWidth?: number; translucencyByDistance?: NearFarScalar; pixelOffsetScaleByDistance?: NearFarScalar; scaleByDistance?: NearFarScalar; distanceDisplayCondition?: DistanceDisplayCondition; disableDepthTestDistance?: number; }; } /** *
* Create labels by calling {@link LabelCollection#add}. Do not call the constructor directly. *
* @param options - Object describing initialization options * @param labelCollection - Instance of LabelCollection */ export class Label { constructor(options: Label.ConstructorOptions, labelCollection: LabelCollection); /** * Determines if this label will be shown. Use this to hide or show a label, instead * of removing it and re-adding it to the collection. */ show: boolean; /** * Gets or sets the Cartesian position of this label. */ position: Cartesian3; /** * Gets or sets the height reference of this billboard. */ heightReference: HeightReference; /** * Gets or sets the text of this label. */ text: string; /** * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property. */ font: string; /** * Gets or sets the fill color of this label. */ fillColor: Color; /** * Gets or sets the outline color of this label. */ outlineColor: Color; /** * Gets or sets the outline width of this label. */ outlineWidth: number; /** * Determines if a background behind this label will be shown. */ showBackground: boolean; /** * Gets or sets the background color of this label. */ backgroundColor: Color; /** * Gets or sets the background padding, in pixels, of this label. The x value * controls horizontal padding, and the y value controls vertical padding. */ backgroundPadding: Cartesian2; /** * Gets or sets the style of this label. */ style: LabelStyle; /** * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used * to align multiple labels and billboards at the same position, e.g., an image and text. The * screen space origin is the top, left corner of the canvas; x increases from * left to right, and y increases from top to bottom. *

*
* * * *
default
l.pixeloffset = new Cartesian2(25, 75);
* The label's origin is indicated by the yellow point. *
*/ pixelOffset: Cartesian2; /** * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined, * translucencyByDistance will be disabled. * @example * // Example 1. * // Set a label's translucencyByDistance to 1.0 when the * // camera is 1500 meters from the label and disappear as * // the camera distance approaches 8.0e6 meters. * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); * @example * // Example 2. * // disable translucency by distance * text.translucencyByDistance = undefined; */ translucencyByDistance: NearFarScalar; /** * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera. * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined, * pixelOffsetScaleByDistance will be disabled. * @example * // Example 1. * // Set a label's pixel offset scale to 0.0 when the * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels * // in the y direction the camera distance approaches 8.0e6 meters. * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); * @example * // Example 2. * // disable pixel offset by distance * text.pixelOffsetScaleByDistance = undefined; */ pixelOffsetScaleByDistance: NearFarScalar; /** * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, * scaleByDistance will be disabled. * @example * // Example 1. * // Set a label's scaleByDistance to scale by 1.5 when the * // camera is 1500 meters from the label and disappear as * // the camera distance approaches 8.0e6 meters. * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); * @example * // Example 2. * // disable scaling by distance * label.scaleByDistance = undefined; */ scaleByDistance: NearFarScalar; /** * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed * coordinate system, where x points towards the viewer's right, y points up, and * z points into the screen. Eye coordinates use the same scale as world and model coordinates, * which is typically meters. *

* An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to * arrange a label above its corresponding 3D model. *

* Below, the label is positioned at the center of the Earth but an eye offset makes it always * appear on top of the Earth regardless of the viewer's or Earth's orientation. *

*
* * * *
* l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

*
*/ eyeOffset: Cartesian3; /** * Gets or sets the horizontal origin of this label, which determines if the label is drawn * to the left, center, or right of its anchor position. *

*
*
*
* @example * // Use a top, right origin * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; * l.verticalOrigin = Cesium.VerticalOrigin.TOP; */ horizontalOrigin: HorizontalOrigin; /** * Gets or sets the vertical origin of this label, which determines if the label is * to the above, below, or at the center of its anchor position. *

*
*
*
* @example * // Use a top, right origin * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; * l.verticalOrigin = Cesium.VerticalOrigin.TOP; */ verticalOrigin: VerticalOrigin; /** * Gets or sets the uniform scale that is multiplied with the label's size in pixels. * A scale of 1.0 does not change the size of the label; a scale greater than * 1.0 enlarges the label; a positive scale less than 1.0 shrinks * the label. *

* Applying a large scale value may pixelate the label. To make text larger without pixelation, * use a larger font size when calling {@link Label#font} instead. *

*
*
* From left to right in the above image, the scales are 0.5, 1.0, * and 2.0. *
*/ scale: number; /** * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size * of the desired font compared to the generated glyph size. */ totalScale: number; /** * Gets or sets the condition specifying at what distance from the camera that this label will be displayed. */ distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the distance from the camera, beyond which, depth testing is disabled—to, for example, prevent clipping against terrain. * When set to undefined or * 0, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: number | undefined; /** * Gets or sets the user-defined value returned when the label is picked. */ id: any; /** * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets. * The screen space origin is the top, left corner of the canvas; x increases from * left to right, and y increases from top to bottom. * @example * console.log(l.computeScreenSpacePosition(scene).toString()); * @param scene - The scene the label is in. * @param [result] - The object onto which to store the result. * @returns The screen-space position of the label. */ computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; /** * Determines if this label equals another label. Labels are equal if all their properties * are equal. Labels in different collections can be equal. * @param [other] - The label to compare for equality. * @returns true if the labels are equal; otherwise, false. */ equals(other?: Label): boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages * @example * // Example 1. * // Set a label's rightToLeft before init * Cesium.Label.enableRightToLeftDetection = true; * const myLabelEntity = viewer.entities.add({ * label: { * id: 'my label', * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה', * } * }); * @example * // Example 2. * const myLabelEntity = viewer.entities.add({ * label: { * id: 'my label', * text: 'English text' * } * }); * // Set a label's rightToLeft after init * Cesium.Label.enableRightToLeftDetection = true; * myLabelEntity.text = 'טקסט חדש'; */ static enableRightToLeftDetection: boolean; } /** * 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 {@link LabelCollection#add} * and {@link LabelCollection#remove}. * @example * // Create a label collection with two labels * const 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' * }); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent, * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. * @param [options.show = true] - Determines if the labels in the collection will be shown. * @param [options.coarseDepthTestDistance] - The distance from the camera, beyond which, labels are depth-tested against an approximation of the globe ellipsoid rather than against the full globe depth buffer. If unspecified, the default value is determined relative to the value of {@link Ellipsoid.default}. * @param [options.threePointDepthTestDistance] - The distance from the camera, within which, lables with a {@link Label#heightReference} value of {@link HeightReference.CLAMP_TO_GROUND} or {@link HeightReference.CLAMP_TO_TERRAIN} are depth tested against three key points. This ensures that if any key point of the label is visible, the whole label will be visible. If unspecified, the default value is determined relative to the value of {@link Ellipsoid.default}. */ export class LabelCollection { constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean; scene?: Scene; blendOption?: BlendOption; show?: boolean; coarseDepthTestDistance?: number; threePointDepthTestDistance?: number; }); /** * Determines if labels in this collection will be shown. */ show: boolean; /** * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates. * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates. * Local reference frames can be used by providing a different transformation matrix, like that returned * by {@link Transforms.eastNorthUpToFixedFrame}. * @example * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); * labels.add({ * position : new Cesium.Cartesian3(0.0, 0.0, 0.0), * text : 'Center' * }); * labels.add({ * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0), * text : 'East' * }); * labels.add({ * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0), * text : 'North' * }); * labels.add({ * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0), * text : 'Up' * }); */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * The label blending option. The default is used for rendering both opaque and translucent labels. * However, if either all of the labels are completely opaque or all are completely translucent, * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve * performance by up to 2x. */ blendOption: BlendOption; /** * Returns the number of labels in this collection. This is commonly used with * {@link LabelCollection#get} to iterate over all the labels * in the collection. */ readonly length: number; /** * The distance from the camera, beyond which, labels are depth-tested against an approximation of * the globe ellipsoid rather than against the full globe depth buffer. When set to 0, the * approximate depth test is always applied. When set to Number.POSITIVE_INFINITY, the * approximate depth test is never applied. *

* This setting only applies when a label's {@link Label#disableDepthTestDistance} value would * otherwise allow depth testing—i.e., distance from the camera to the label is less than the * label's {@link Label#disableDepthTestDistance} value. */ coarseDepthTestDistance: number; /** * The distance from the camera, within which, labels with a {@link Label#heightReference} value * of {@link HeightReference.CLAMP_TO_GROUND} or {@link HeightReference.CLAMP_TO_TERRAIN} are depth tested * against three key points. This ensures that if any key point of the label is visible, the whole * label will be visible. When set to 0, this feature is disabled and portions of a * label behind terrain be clipped. *

* This setting only applies when a labels's {@link Label#disableDepthTestDistance} value would * otherwise allow depth testing—i.e., distance from the camera to the label is less than the * labels's {@link Label#disableDepthTestDistance} value. */ threePointDepthTestDistance: number; /** * Creates and adds a label with the specified initial properties to the collection. * The added label is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a label, specifying all the default values. * const l = labels.add({ * show : true, * position : Cesium.Cartesian3.ZERO, * text : '', * font : '30px sans-serif', * fillColor : Cesium.Color.WHITE, * outlineColor : Cesium.Color.BLACK, * outlineWidth : 1.0, * showBackground : false, * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8), * backgroundPadding : new Cesium.Cartesian2(7, 5), * style : Cesium.LabelStyle.FILL, * pixelOffset : Cesium.Cartesian2.ZERO, * eyeOffset : Cesium.Cartesian3.ZERO, * horizontalOrigin : Cesium.HorizontalOrigin.LEFT, * verticalOrigin : Cesium.VerticalOrigin.BASELINE, * scale : 1.0, * translucencyByDistance : undefined, * pixelOffsetScaleByDistance : undefined, * heightReference : HeightReference.NONE, * distanceDisplayCondition : undefined * }); * @example * // Example 2: Specify only the label's cartographic position, * // text, and font. * const l = labels.add({ * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height), * text : 'Hello World', * font : '24px Helvetica', * }); * @param [options] - A template describing the label's properties as shown in Example 1. * @returns The label that was added to the collection. */ add(options?: Label.ConstructorOptions): Label; /** * Removes a label from the collection. Once removed, a label is no longer usable. * @example * const l = labels.add(...); * labels.remove(l); // Returns true * @param label - The label to remove. * @returns true if the label was removed; false if the label was not found in the collection. */ remove(label: Label): boolean; /** * Removes all labels from the collection. * @example * labels.add(...); * labels.add(...); * labels.removeAll(); */ removeAll(): void; /** * Check whether this collection contains a given label. * @param label - The label to check for. * @returns true if this collection contains the label, false otherwise. */ contains(label: Label): boolean; /** * Returns the label in the collection at the specified index. Indices are zero-based * and increase as labels are added. Removing a label shifts all labels after * it to the left, changing their indices. This function is commonly used with * {@link LabelCollection#length} to iterate over all the labels * in the collection. * @example * // Toggle the show property of every label in the collection * const len = labels.length; * for (let i = 0; i < len; ++i) { * const l = billboards.get(i); * l.show = !l.show; * } * @param index - The zero-based index of the billboard. * @returns The label at the specified index. */ get(index: number): Label; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * labels = labels && labels.destroy(); */ destroy(): void; } /** * Describes how to draw a label. */ export enum LabelStyle { /** * Fill the text of the label, but do not outline. */ FILL = 0, /** * Outline the text of the label, but do not fill. */ OUTLINE = 1, /** * Fill and outline the text of the label. */ FILL_AND_OUTLINE = 2 } /** * A light source. This type describes an interface and is not intended to be instantiated directly. Together, color and intensity produce a high-dynamic-range light color. intensity can also be used individually to dim or brighten the light without changing the hue. */ export class Light { constructor(); /** * The color of the light. */ color: Color; /** * The intensity controls the strength of the light. intensity has a minimum value of 0.0 and no maximum value. */ intensity: number; } /** * A Mapbox Vector Tiles (MVT) data provider. Loads .mvt or .pbf tiles, converting tiles * dynamically (at runtime) into 3D Tiles. * *
* This object is normally not instantiated directly, use {@link MVTDataProvider.fromUrl}. *
*/ export class MVTDataProvider extends UrlTemplate3DTilesDataProvider { /** * Creates an MVTDataProvider from the specified URL template and options. * @param url - URL template, containing {z}, {x}, and {y} placeholders. * @param [options] - Provider options. * @param [options.minZoom = 0] - Minimum zoom level represented in the generated tileset. * @param [options.maxZoom = 14] - Maximum zoom level represented in the generated tileset. * @param [options.extent] - Optional geographic extent in radians to constrain the generated tile tree. * @param [options.featureIdProperty] - MVT property name to use as feature ID. * @param [options.heightReference] - Drapes the decoded points, lines and polygons onto the * surfaces selected by the value: {@link HeightReference.CLAMP_TO_TERRAIN} drapes onto the globe, * {@link HeightReference.CLAMP_TO_3D_TILE} drapes onto 3D Tiles and models, and * {@link HeightReference.CLAMP_TO_GROUND} drapes onto both. Requires options.scene. * @param [options.scene] - The scene the generated tileset is rendered in, required when * options.heightReference is a clamping value. */ static fromUrl(url: Resource | string, options?: { minZoom?: number; maxZoom?: number; extent?: Rectangle; featureIdProperty?: string; heightReference?: HeightReference; scene?: Scene; }): Promise; } /** * Describes how the map will operate in 2D. */ export enum MapMode2D { /** * The 2D map can be rotated about the z axis. */ ROTATE = 0, /** * The 2D map can be scrolled infinitely in the horizontal direction. */ INFINITE_SCROLL = 1 } export namespace MapboxImageryProvider { /** * Initialization options for the MapboxImageryProvider constructor * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url. * @property mapId - The Mapbox Map ID. * @property accessToken - The public access token for the imagery. * @property [format = 'png'] - The format of the image request. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { url?: string; mapId: string; accessToken: string; format?: string; ellipsoid?: Ellipsoid; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; credit?: Credit | string; }; } /** * Provides tiled imagery hosted by Mapbox. * @example * // Mapbox tile provider * const mapbox = new Cesium.MapboxImageryProvider({ * mapId: 'mapbox.mapbox-terrain-v2', * accessToken: 'thisIsMyAccessToken' * }); * @param options - Object describing initialization options */ export class MapboxImageryProvider { constructor(options: MapboxImageryProvider.ConstructorOptions); /** * Gets the URL of the Mapbox server. */ readonly url: string; /** * Gets the rectangle, in radians, of the imagery provided by the instance. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. Generally, * a minimum level should only be used when the rectangle of the imagery is small * enough that the number of tiles at the minimum level is small. An imagery * provider with more than a few tiles at the minimum level will lead to * rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } export namespace MapboxStyleImageryProvider { /** * Initialization options for the MapboxStyleImageryProvider constructor * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url. * @property [username = 'mapbox'] - The username of the map account. * @property styleId - The Mapbox Style ID. * @property accessToken - The public access token for the imagery. * @property [tilesize = 512] - The size of the image tiles. * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor. * @property [ellipsoid = Ellipsoid.default] - The ellipsoid. If not specified, the default ellipsoid is used. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { url?: Resource | string; username?: string; styleId: string; accessToken: string; tilesize?: number; scaleFactor?: boolean; ellipsoid?: Ellipsoid; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; credit?: Credit | string; }; } /** * Provides tiled imagery hosted by Mapbox. * @example * // Mapbox style provider * const mapbox = new Cesium.MapboxStyleImageryProvider({ * styleId: 'streets-v11', * accessToken: 'thisIsMyAccessToken' * }); * @param options - Object describing initialization options */ export class MapboxStyleImageryProvider { constructor(options: MapboxStyleImageryProvider.ConstructorOptions); /** * Gets the URL of the Mapbox server. */ readonly url: string; /** * Gets the rectangle, in radians, of the imagery provided by the instance. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. Generally, * a minimum level should only be used when the rectangle of the imagery is small * enough that the number of tiles at the minimum level is small. An imagery * provider with more than a few tiles at the minimum level will lead to * rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * 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 {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page} * for more details on Fabric. *

* * * Base material types and their uniforms: *
*
    *
  • Color
  • *
      *
    • color: rgba color object.
    • *
    *
  • Image
  • *
      *
    • image: path to image.
    • *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • *
    *
  • DiffuseMap
  • *
      *
    • 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.
    • *
    *
  • AlphaMap
  • *
      *
    • 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.
    • *
    *
  • SpecularMap
  • *
      *
    • 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.
    • *
    *
  • EmissionMap
  • *
      *
    • 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.
    • *
    *
  • BumpMap
  • *
      *
    • 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.
    • *
    *
  • NormalMap
  • *
      *
    • 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.
    • *
    *
  • Grid
  • *
      *
    • 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).
    • *
    *
  • Stripe
  • *
      *
    • 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.
    • *
    *
  • Checkerboard
  • *
      *
    • 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.
    • *
    *
  • Dot
  • *
      *
    • 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.
    • *
    *
  • Water
  • *
      *
    • 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.
    • *
    • 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.
    • *
    *
  • RimLighting
  • *
      *
    • color: diffuse color and alpha.
    • *
    • rimColor: diffuse color and alpha of the rim.
    • *
    • width: Number that determines the rim's width.
    • *
    *
  • Fade
  • *
      *
    • 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 position
    • *
    *
  • PolylineArrow
  • *
      *
    • color: diffuse color and alpha.
    • *
    *
  • PolylineDash
  • *
      *
    • color: color for the line.
    • *
    • gapColor: color for the gaps in the line.
    • *
    • dashLength: Dash length in pixels.
    • *
    • dashPattern: The 16 bit stipple pattern for the line..
    • *
    *
  • PolylineGlow
  • *
      *
    • 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).
    • *
    • taperPower: strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
    • *
    *
  • PolylineOutline
  • *
      *
    • 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.
    • *
    *
  • ElevationContour
  • *
      *
    • color: color and alpha for the contour line.
    • *
    • spacing: spacing for contour lines in meters.
    • *
    • width: Number specifying the width of the grid lines in pixels.
    • *
    *
  • ElevationRamp
  • *
      *
    • image: color ramp image to use for coloring the terrain.
    • *
    • minimumHeight: minimum height for the ramp.
    • *
    • maximumHeight: maximum height for the ramp.
    • *
    *
  • SlopeRamp
  • *
      *
    • image: color ramp image to use for coloring the terrain by slope.
    • *
    *
  • AspectRamp
  • *
      *
    • image: color ramp image to use for color the terrain by aspect.
    • *
    *
  • ElevationBand
  • *
      *
    • heights: image of heights sorted from lowest to highest.
    • *
    • colors: image of colors at the corresponding heights.
    • *
    *
  • WaterMask
  • *
      *
    • waterColor: diffuse color and alpha for the areas covered by water.
    • *
    • landColor: diffuse color and alpha for the areas covered by land.
    • *
    *
* *
* @example * // 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) * } * } * }); * @param [options] - Object with the following properties: * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials. * @param [options.translucent = true] - When true or a function that returns true, the geometry * with this material is expected to appear translucent. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures. * @param options.fabric - The fabric JSON used to generate the material. */ export class Material { constructor(options?: { strict?: boolean; translucent?: boolean | ((...params: any[]) => any); minificationFilter?: TextureMinificationFilter; magnificationFilter?: TextureMagnificationFilter; fabric: any; }); /** * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID. */ type: string; /** * The glsl shader source for this material. */ shaderSource: string; /** * Maps sub-material names to Material objects. */ materials: any; /** * Maps uniform names to their values. */ uniforms: any; /** * When true or a function that returns true, * the geometry is expected to appear translucent. */ translucent: boolean | ((...params: any[]) => any); /** * The {@link TextureMinificationFilter} to apply to this material's textures. */ minificationFilter: TextureMinificationFilter; /** * The {@link TextureMagnificationFilter} to apply to this material's textures. */ magnificationFilter: TextureMagnificationFilter; /** * Creates a new material using an existing material type. *

* Shorthand for: new Material({fabric : {type : type}}); * @example * const material = Cesium.Material.fromType('Color', { * color: new Cesium.Color(1.0, 0.0, 0.0, 1.0) * }); * @param type - The base material type. * @param [uniforms] - Overrides for the default uniforms. * @returns New material object. */ static fromType(type: string, uniforms?: any): Material; /** * Creates a new material using an existing material type and returns a promise that resolves when * all of the material's resources have been loaded. * @example * const material = await Cesium.Material.fromTypeAsync('Image', { * image: '../Images/Cesium_Logo_overlay.png' * }); * @param type - The base material type. * @param [uniforms] - Overrides for the default uniforms. * @returns A promise that resolves to a new material object when all resources are loaded. */ static fromTypeAsync(type: string, uniforms?: any): Promise; /** * Gets whether or not this material is translucent. * @returns true if this material is translucent, false otherwise. */ isTranslucent(): boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * material = material && material.destroy(); */ destroy(): void; /** * Gets or sets the default texture uniform value. */ static DefaultImageId: string; /** * Gets or sets the default cube map texture uniform value. */ static DefaultCubeMapId: string; /** * Gets the name of the color material. */ static readonly ColorType: string; /** * Gets the name of the image material. */ static readonly ImageType: string; /** * Gets the name of the diffuce map material. */ static readonly DiffuseMapType: string; /** * Gets the name of the alpha map material. */ static readonly AlphaMapType: string; /** * Gets the name of the specular map material. */ static readonly SpecularMapType: string; /** * Gets the name of the emmision map material. */ static readonly EmissionMapType: string; /** * Gets the name of the bump map material. */ static readonly BumpMapType: string; /** * Gets the name of the normal map material. */ static readonly NormalMapType: string; /** * Gets the name of the grid material. */ static readonly GridType: string; /** * Gets the name of the stripe material. */ static readonly StripeType: string; /** * Gets the name of the checkerboard material. */ static readonly CheckerboardType: string; /** * Gets the name of the dot material. */ static readonly DotType: string; /** * Gets the name of the water material. */ static readonly WaterType: string; /** * Gets the name of the rim lighting material. */ static readonly RimLightingType: string; /** * Gets the name of the fade material. */ static readonly FadeType: string; /** * Gets the name of the polyline arrow material. */ static readonly PolylineArrowType: string; /** * Gets the name of the polyline glow material. */ static readonly PolylineDashType: string; /** * Gets the name of the polyline glow material. */ static readonly PolylineGlowType: string; /** * Gets the name of the polyline outline material. */ static readonly PolylineOutlineType: string; /** * Gets the name of the elevation contour material. */ static readonly ElevationContourType: string; /** * Gets the name of the elevation contour material. */ static readonly ElevationRampType: string; /** * Gets the name of the slope ramp material. */ static readonly SlopeRampMaterialType: string; /** * Gets the name of the aspect ramp material. */ static readonly AspectRampMaterialType: string; /** * Gets the name of the elevation band material. */ static readonly ElevationBandType: string; /** * Gets the name of the water mask material. */ static readonly WaterMaskType: string; } /** * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example) * that supports shading with materials. * @example * const 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 * }) * * }); * @param [options] - Object with the following properties: * @param [options.flat = false] - When true, flat shading is used in the fragment shader, which means lighting is not taking into account. * @param [options.faceForward = !options.closed] - When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled. * @param [options.closed = false] - When true, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported. * @param [options.material = Material.ColorType] - The material used to determine the fragment color. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class MaterialAppearance { constructor(options?: { flat?: boolean; faceForward?: boolean; translucent?: boolean; closed?: boolean; materialSupport?: MaterialAppearance.MaterialSupportType; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * The material used to determine the fragment color. Unlike other {@link MaterialAppearance} * properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** * When true, the geometry is expected to appear translucent. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader * source is built procedurally taking into account {@link MaterialAppearance#material}, * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. *

* The render state can be explicitly defined when constructing a {@link MaterialAppearance} * instance, or it is set implicitly via {@link MaterialAppearance#translucent} * and {@link MaterialAppearance#closed}. *

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so * {@link MaterialAppearance#renderState} has backface culling enabled. * If the viewer enters the geometry, it will not be visible. */ readonly closed: boolean; /** * The type of materials supported by this instance. This impacts the required * {@link VertexFormat} and the complexity of the vertex and fragment shaders. */ readonly materialSupport: MaterialAppearance.MaterialSupportType; /** * The {@link VertexFormat} that this appearance instance is compatible with. * A geometry can have more vertex attributes and still be compatible - at a * potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * When true, flat shading is used in the fragment shader, * which means lighting is not taking into account. */ readonly flat: boolean; /** * When true, the fragment shader flips the surface normal * as needed to ensure that the normal faces the viewer to avoid * dark spots. This is useful when both sides of a geometry should be * shaded like {@link WallGeometry}. */ readonly faceForward: boolean; /** * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance}, * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material}, * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } export namespace MaterialAppearance { type MaterialSupportType = { vertexFormat: VertexFormat; vertexShaderSource: string; fragmentShaderSource: string; }; /** * Determines the type of {@link Material} that is supported by a * {@link MaterialAppearance} instance. This is a trade-off between * flexibility (a wide array of materials) and memory/performance * (required vertex format and GLSL shader complexity. */ namespace MaterialSupport { /** * Only basic materials, which require just position and * normal vertex attributes, are supported. */ const BASIC: MaterialAppearance.MaterialSupportType; /** * Materials with textures, which require position, * normal, and st vertex attributes, * are supported. The vast majority of materials fall into this category. */ const TEXTURED: MaterialAppearance.MaterialSupportType; /** * All materials, including those that work in tangent space, are supported. * This requires position, normal, st, * tangent, and bitangent vertex attributes. */ const ALL: MaterialAppearance.MaterialSupportType; } } /** * A metadata class. * *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles *

* @param options - Object with the following properties: * @param options.id - The ID of the class. * @param [options.name] - The name of the class. * @param [options.description] - The description of the class. * @param [options.properties] - The class properties, where each key is the property ID. * @param [options.extras] - Extra user-defined properties. * @param [options.extensions] - An object containing extensions. */ export class MetadataClass { constructor(options: { id: string; name?: string; description?: string; properties?: { [key: string]: MetadataClassProperty; }; extras?: any; extensions?: any; }); /** * The class properties. */ readonly properties: { [key: string]: MetadataClassProperty; }; /** * The ID of the class. */ readonly id: string; /** * The name of the class. */ readonly name: string; /** * The description of the class. */ readonly description: string; /** * Extra user-defined properties. */ readonly extras: any; /** * An object containing extensions. */ readonly extensions: any; } /** * A metadata property, as part of a {@link MetadataClass}. *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles *

* @param options - Object with the following properties: * @param options.id - The ID of the property. * @param options.type - The type of the property such as SCALAR, VEC2, VEC3. * @param [options.componentType] - The component type of the property. This includes integer (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values. * @param [options.enumType] - The enum type of the property. Only defined when type is ENUM. * @param [options.isArray = false] - True if a property is an array (either fixed length or variable length), false otherwise. * @param [options.isVariableLengthArray = false] - True if a property is a variable length array, false otherwise. * @param [options.arrayLength] - The number of array elements. Only defined for fixed length arrays. * @param [options.normalized = false] - Whether the property is normalized. * @param [options.min] - A number or an array of numbers storing the minimum allowable value of this property. Only defined when type is a numeric type. * @param [options.max] - A number or an array of numbers storing the maximum allowable value of this property. Only defined when type is a numeric type. * @param [options.offset] - The offset to be added to property values as part of the value transform. * @param [options.scale] - The scale to be multiplied to property values as part of the value transform. * @param [options.noData] - The no-data sentinel value that represents null values. * @param [options.default] - A default value to use when an entity's property value is not defined. * @param [options.required = false] - Whether the property is required. * @param [options.name] - The name of the property. * @param [options.description] - The description of the property. * @param [options.semantic] - An identifier that describes how this property should be interpreted. * @param [options.extras] - Extra user-defined properties. * @param [options.extensions] - An object containing extensions. */ export class MetadataClassProperty { constructor(options: { id: string; type: MetadataType; componentType?: MetadataComponentType; enumType?: MetadataEnum; isArray?: boolean; isVariableLengthArray?: boolean; arrayLength?: number; normalized?: boolean; min?: number | number[] | number[][]; max?: number | number[] | number[][]; offset?: number | number[] | number[][]; scale?: number | number[] | number[][]; noData?: number | string | any[]; default?: number | string | any[]; required?: boolean; name?: string; description?: string; semantic?: string; extras?: any; extensions?: any; }); /** * The ID of the property. */ readonly id: string; /** * The name of the property. */ readonly name: string; /** * The description of the property. */ readonly description: string; /** * The type of the property such as SCALAR, VEC2, VEC3 */ readonly type: MetadataType; /** * The enum type of the property. Only defined when type is ENUM. */ readonly enumType: MetadataEnum; /** * The component type of the property. This includes integer * (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values */ readonly componentType: MetadataComponentType; /** * True if a property is an array (either fixed length or variable length), * false otherwise. */ readonly isArray: boolean; /** * True if a property is a variable length array, false otherwise. */ readonly isVariableLengthArray: boolean; /** * The number of array elements. Only defined for fixed-size * arrays. */ readonly arrayLength: number; /** * Whether the property is normalized. */ readonly normalized: boolean; /** * A number or an array of numbers storing the maximum allowable value of this property. Only defined when type is a numeric type. */ readonly max: number | number[] | number[][]; /** * A number or an array of numbers storing the minimum allowable value of this property. Only defined when type is a numeric type. */ readonly min: number | number[] | number[][]; /** * The no-data sentinel value that represents null values */ readonly noData: number | string | any[]; /** * A default value to use when an entity's property value is not defined. */ readonly default: number | string | any[]; /** * Whether the property is required. */ readonly required: boolean; /** * An identifier that describes how this property should be interpreted. */ readonly semantic: string; /** * The offset to be added to property values as part of the value transform. * * This is always defined, even when `hasValueTransform` is `false`. If * the class property JSON itself did not define it, then it will be * initialized to the default value. */ readonly offset: number | number[] | number[][]; /** * The scale to be multiplied to property values as part of the value transform. * * This is always defined, even when `hasValueTransform` is `false`. If * the class property JSON itself did not define it, then it will be * initialized to the default value. */ readonly scale: number | number[] | number[][]; /** * Extra user-defined properties. */ readonly extras: any; /** * An object containing extensions. */ readonly extensions: any; /** * Determines the byte size of a single property element, stored on the GPU. * This differs from the CPU byte size if the element type is a 64-bit type that can be * downcast to a 32-bit type for texture packing (only relevant for textures created from property tables). * @returns The byte size of a single property element on the GPU. */ gpuBytesPerElement(): number; } /** * An enum of metadata component types. */ export enum MetadataComponentType { /** * An 8-bit signed integer */ INT8 = "INT8", /** * An 8-bit unsigned integer */ UINT8 = "UINT8", /** * A 16-bit signed integer */ INT16 = "INT16", /** * A 16-bit unsigned integer */ UINT16 = "UINT16", /** * A 32-bit signed integer */ INT32 = "INT32", /** * A 32-bit unsigned integer */ UINT32 = "UINT32", /** * A 64-bit signed integer. */ INT64 = "INT64", /** * A 64-bit signed integer. */ UINT64 = "UINT64", /** * A 32-bit (single precision) floating point number */ FLOAT32 = "FLOAT32", /** * A 64-bit (double precision) floating point number */ FLOAT64 = "FLOAT64" } /** * A metadata enum. *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles *

* @param options - Object with the following properties: * @param options.id - The ID of the enum. * @param options.values - The enum values. * @param [options.valueType = MetadataComponentType.UINT16] - The enum value type. * @param [options.name] - The name of the enum. * @param [options.description] - The description of the enum. * @param [options.extras] - Extra user-defined properties. * @param [options.extensions] - An object containing extensions. */ export class MetadataEnum { constructor(options: { id: string; values: MetadataEnumValue[]; valueType?: MetadataComponentType; name?: string; description?: string; extras?: any; extensions?: any; }); /** * The enum values. */ readonly values: MetadataEnumValue[]; /** * The enum value type. */ readonly valueType: MetadataComponentType; /** * The ID of the enum. */ readonly id: string; /** * The name of the enum. */ readonly name: string; /** * The description of the enum. */ readonly description: string; /** * Extra user-defined properties. */ readonly extras: any; /** * An object containing extensions. */ readonly extensions: any; } /** * A metadata enum value. *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles *

* @param options - Object with the following properties: * @param options.value - The integer value. * @param options.name - The name of the enum value. * @param [options.description] - The description of the enum value. * @param [options.extras] - Extra user-defined properties. * @param [options.extensions] - An object containing extensions. */ export class MetadataEnumValue { constructor(options: { value: number; name: string; description?: string; extras?: any; extensions?: any; }); /** * The integer value. */ readonly value: number; /** * The name of the enum value. */ readonly name: string; /** * The description of the enum value. */ readonly description: string; /** * Extra user-defined properties. */ readonly extras: any; /** * An object containing extensions. */ readonly extensions: any; } /** * A schema containing classes and enums. *

* See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles *

* @param options - Object with the following properties: * @param [options.id] - The ID of the schema * @param [options.name] - The name of the schema. * @param [options.description] - The description of the schema. * @param [options.version] - The application-specific version of the schema. * @param [options.classes] - Classes defined in the schema, where each key is the class ID. * @param [options.enums] - Enums defined in the schema, where each key is the enum ID. * @param [options.extras] - Extra user-defined properties. * @param [options.extensions] - An object containing extensions. */ export class MetadataSchema { constructor(options: { id?: string; name?: string; description?: string; version?: string; classes?: { [key: string]: MetadataClass; }; enums?: { [key: string]: MetadataEnum; }; extras?: any; extensions?: any; }); /** * Classes defined in the schema. */ readonly classes: { [key: string]: MetadataClass; }; /** * Enums defined in the schema. */ readonly enums: { [key: string]: MetadataEnum; }; /** * The ID of the schema. */ readonly id: string; /** * The name of the schema. */ readonly name: string; /** * The description of the schema. */ readonly description: string; /** * The application-specific version of the schema. */ readonly version: string; /** * Extra user-defined properties. */ readonly extras: any; /** * An object containing extensions. */ readonly extensions: any; } /** * An instance of a metadata value.
*
* This can be one of the following types: *
    *
  • number for type SCALAR and numeric component types except for INT64 or UINT64
  • *
  • bigint for type SCALAR and component type INT64 or UINT64
  • *
  • string for type STRING or ENUM
  • *
  • boolean for type BOOLEAN
  • *
  • Cartesian2 for type VEC2
  • *
  • Cartesian3 for type VEC3
  • *
  • Cartesian4 for type VEC4
  • *
  • Matrix2 for type MAT2
  • *
  • Matrix3 for type MAT3
  • *
  • Matrix4 for type MAT4
  • *
  • Arrays of these types when the metadata value is an array
  • *
*/ export type MetadataValue = number | bigint | string | boolean | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | number[] | bigint[] | string[] | boolean[] | Cartesian2[] | Cartesian3[] | Cartesian4[] | Matrix2[] | Matrix3[] | Matrix4[]; /** * An enum of metadata types. These metadata types are containers containing * one or more components of type {@link MetadataComponentType} */ export enum MetadataType { /** * A single component */ SCALAR = "SCALAR", /** * A vector with two components */ VEC2 = "VEC2", /** * A vector with three components */ VEC3 = "VEC3", /** * A vector with four components */ VEC4 = "VEC4", /** * A 2x2 matrix, stored in column-major format. */ MAT2 = "MAT2", /** * A 3x3 matrix, stored in column-major format. */ MAT3 = "MAT3", /** * A 4x4 matrix, stored in column-major format. */ MAT4 = "MAT4", /** * A boolean (true/false) value */ BOOLEAN = "BOOLEAN", /** * A UTF-8 encoded string value */ STRING = "STRING", /** * An enumerated value. This type is used in conjunction with a {@link MetadataEnum} to describe the valid values. */ ENUM = "ENUM" } /** * An object describing a uniform, its type, and an initial value * @property type - The Glsl type of the uniform. * @property value - The initial value of the uniform */ export type UniformSpecifier = { type: UniformType; value: boolean | number | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | TextureUniform; }; /** * A user defined GLSL shader used with {@link Model} as well * as {@link Cesium3DTileset}. *

* If texture uniforms are used, additional resource management must be done: *

*
    *
  • * The update function must be called each frame. When a * custom shader is passed to a {@link Model} or a * {@link Cesium3DTileset}, this step is handled automaticaly *
  • *
  • * {@link CustomShader#destroy} must be called when the custom shader is * no longer needed to clean up GPU resources properly. The application * is responsible for calling this method. *
  • *
*

* See the {@link https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide|Custom Shader Guide} for more detailed documentation. *

* @example * const customShader = new CustomShader({ * uniforms: { * u_colorIndex: { * type: Cesium.UniformType.FLOAT, * value: 1.0 * }, * u_normalMap: { * type: Cesium.UniformType.SAMPLER_2D, * value: new Cesium.TextureUniform({ * url: "http://example.com/normal.png" * }) * } * }, * varyings: { * v_selectedColor: Cesium.VaryingType.VEC3 * }, * vertexShaderText: ` * void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { * v_selectedColor = mix(vsInput.attributes.color_0, vsInput.attributes.color_1, u_colorIndex); * vsOutput.positionMC += 0.1 * vsInput.attributes.normal; * } * `, * fragmentShaderText: ` * void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { * material.normal = texture(u_normalMap, fsInput.attributes.texCoord_0); * material.diffuse = v_selectedColor; * } * ` * }); * @param options - An object with the following options * @param [options.mode = CustomShaderMode.MODIFY_MATERIAL] - The custom shader mode, which determines how the custom shader code is inserted into the fragment shader. * @param [options.lightingModel] - The lighting model (e.g. PBR or unlit). If present, this overrides the default lighting for the model. * @param [options.translucencyMode = CustomShaderTranslucencyMode.INHERIT] - The translucency mode, which determines how the custom shader will be applied. If the value is CustomShaderTransulcencyMode.OPAQUE or CustomShaderTransulcencyMode.TRANSLUCENT, the custom shader will override settings from the model's material. If the value is CustomShaderTransulcencyMode.INHERIT, the custom shader will render as either opaque or translucent depending on the primitive's material settings. * @param [options.uniforms] - A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code. The value is an object that describes the uniform type and initial value * @param [options.varyings] - A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex shader and using the value in the fragment shader. * @param [options.vertexShaderText] - The custom vertex shader as a string of GLSL code. It must include a GLSL function called vertexMain. See the example for the expected signature. If not specified, the custom vertex shader step will be skipped in the computed vertex shader. * @param [options.fragmentShaderText] - The custom fragment shader as a string of GLSL code. It must include a GLSL function called fragmentMain. See the example for the expected signature. If not specified, the custom fragment shader step will be skipped in the computed fragment shader. */ export class CustomShader { constructor(options: { mode?: CustomShaderMode; lightingModel?: LightingModel; translucencyMode?: CustomShaderTranslucencyMode; uniforms?: { [key: string]: UniformSpecifier; }; varyings?: { [key: string]: VaryingType; }; vertexShaderText?: string; fragmentShaderText?: string; }); /** * A value determining how the custom shader interacts with the overall * fragment shader. This is used by {@link CustomShaderPipelineStage} */ readonly mode: CustomShaderMode; /** * The lighting model to use when using the custom shader. * This is used by {@link CustomShaderPipelineStage} */ readonly lightingModel: LightingModel; /** * Additional uniforms as declared by the user. */ readonly uniforms: { [key: string]: UniformSpecifier; }; /** * Additional varyings as declared by the user. * This is used by {@link CustomShaderPipelineStage} */ readonly varyings: { [key: string]: VaryingType; }; /** * The user-defined GLSL code for the vertex shader */ readonly vertexShaderText: string; /** * The user-defined GLSL code for the fragment shader */ readonly fragmentShaderText: string; /** * The translucency mode, which determines how the custom shader will be applied. If the value is * CustomShaderTransulcencyMode.OPAQUE or CustomShaderTransulcencyMode.TRANSLUCENT, the custom shader * will override settings from the model's material. If the value isCustomShaderTransulcencyMode.INHERIT, * the custom shader will render as either opaque or translucent depending on the primitive's material settings. */ readonly translucencyMode: CustomShaderTranslucencyMode; /** * Update the value of a uniform declared in the shader * @param uniformName - The GLSL name of the uniform. This must match one of the uniforms declared in the constructor * @param value - The new value of the uniform. */ setUniform(uniformName: string, value: boolean | number | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | string | Resource | TextureUniform): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * customShader = customShader && customShader.destroy(); */ destroy(): void; } /** * An enum describing how the {@link CustomShader} will be added to the * fragment shader. This determines how the shader interacts with the material. */ export enum CustomShaderMode { /** * The custom shader will be used to modify the results of the material stage * before lighting is applied. */ MODIFY_MATERIAL = "MODIFY_MATERIAL", /** * The custom shader will be used instead of the material stage. This is a hint * to optimize out the material processing code. */ REPLACE_MATERIAL = "REPLACE_MATERIAL" } /** * An enum for controlling how {@link CustomShader} handles translucency compared with the original * primitive. */ export enum CustomShaderTranslucencyMode { /** * Inherit translucency settings from the primitive's material. If the primitive used a * translucent material, the custom shader will also be considered translucent. If the primitive * used an opaque material, the custom shader will be considered opaque. */ INHERIT = 0, /** * Force the primitive to render the primitive as opaque, ignoring any material settings. */ OPAQUE = 1, /** * Force the primitive to render the primitive as translucent, ignoring any material settings. */ TRANSLUCENT = 2 } /** * @property colors - The packed per-vertex colors. * @property count - The number of vertices. */ export type VertexColorInfo = { colors: Float32Array; count: number; }; export namespace AnchorPointDirect { /** * Initialization options for the AnchorPointDirect constructor * @property position - Anchor point geographic coordinates * @property adjustmentParams - The adjustment values in meters */ type ConstructorOptions = { position: Cartesian3; adjustmentParams: Cartesian3; }; } /** * Metadata for one stored anchor point using direct storage. * * This reflects the `anchronPointDirect` definition of the * {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. * @param options - An object describing initialization options */ export class AnchorPointDirect { constructor(options: AnchorPointDirect.ConstructorOptions); /** * Anchor point geographic coordinates in meters as X/Easting, Y/Northing, Z/HAE */ readonly position: Cartesian3; /** * The delta-x delta-y delta-z adjustment values in meters per anchor * point. */ readonly adjustmentParams: Cartesian3; } export namespace AnchorPointIndirect { /** * Initialization options for the AnchorPointIndirect constructor * @property position - Anchor point geographic coordinates * @property adjustmentParams - The adjustment values in meters * @property covarianceMatrix - The 3x3 covariance matrix */ type ConstructorOptions = { position: Cartesian3; adjustmentParams: Cartesian3; covarianceMatrix: Matrix3; }; } /** * Metadata for one stored anchor point. * * This reflects the `anchronPointIndirect` definition of the * {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. * @param options - An object describing initialization options */ export class AnchorPointIndirect { constructor(options: AnchorPointIndirect.ConstructorOptions); /** * Anchor point geographic coordinates in meters as X/Easting, Y/Northing, Z/HAE */ readonly position: Cartesian3; /** * The delta-x delta-y delta-z adjustment values in meters per anchor * point. */ readonly adjustmentParams: Cartesian3; /** * The 3x3 covariance matrix. */ readonly covarianceMatrix: Matrix3; } export namespace CorrelationGroup { /** * Initialization options for the CorrelationGroup constructor * @property groupFlags - Array of 3 booleans indicating if * parameters delta-x delta-y delta-z used in the correlation group * @property rotationThetas - Rotations in milliradians * about X, Y, Z axes, respectively * @property params - Array of `Spdcf` (Strictly Positive-Definite * Correlation Function) parameters, for the U, V, W directions, respectively */ type ConstructorOptions = { groupFlags: boolean[]; rotationThetas: Cartesian3; params: Spdcf[]; }; } /** * Metadata identifying parameters using same correlation modeling and * associated correlation parameters. * * This reflects the `correlationGroup` definition of the * {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. * @param options - An object describing initialization options */ export class CorrelationGroup { constructor(options: CorrelationGroup.ConstructorOptions); /** * Array of 3 booleans indicating if parameters delta-x delta-y delta-z * used in the correlation group */ readonly groupFlags: boolean[]; /** * Rotations in milliradians about X, Y, Z axes, respectively */ readonly rotationThetas: Cartesian3; /** * Array of 3 sets of SPDCF parameters, for the U, V, W directions, respectively */ readonly params: Spdcf[]; } export namespace GltfGpmLocal { /** * Initialization options for the GltfGpmLocal constructor * @property storageType - The storage type. * This must be one of the `StorageType` constants, i.e. `Direct` or `Indirect`. * @property [anchorPointsIndirect] - The indirect anchor points. * This must be present if and only if the storage type is `Indirect`. * @property [intraTileCorrelationGroups] - The intra-tile correlation groups. * This must be present if and only if the storage type is `Indirect`. * @property [anchorPointsDirect] - The direct anchor points. * This must be present if and only if the storage type is `Direct`. * @property [covarianceDirect] - The covariance of anchor point parameters. * This must be present if and only if the storage type is `Direct`. */ type ConstructorOptions = { storageType: string; anchorPointsIndirect?: AnchorPointIndirect[] | undefined; intraTileCorrelationGroups?: CorrelationGroup[] | undefined; anchorPointsDirect?: AnchorPointDirect[] | undefined; covarianceDirect?: Matrix3 | undefined; }; } /** * The GPM metadata for a Ground-Space Indirect implementation stored * locally (i.e. a tile and/or leaf node). * * This reflects the root extension object of the {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} * glTF extension. When a model that contains this extension was loaded, * then an object of this type can be obtained by calling * ``` * const gltfGpmLocal = model.getExtension("NGA_gpm_local"); * ``` * * The storage type determines the presence of the optional properties: *
    *
  • * When the storage type is `StorageType.Indirect`, then the * `anchorPointsIndirect` and `intraTileCorrelationGroups` * are present. *
  • *
  • * When the storage type is `StorageType.Direct`, then the * `anchorPointsDirect` and `covarianceDirect` are present. *
  • *
* @param options - An object describing initialization options */ export class GltfGpmLocal { constructor(options: GltfGpmLocal.ConstructorOptions); /** * Specifies if covariance storage is indirect or direct. */ readonly storageType: StorageType; /** * Array of stored indirect anchor points */ readonly anchorPointsIndirect: AnchorPointIndirect[] | undefined; /** * Array of stored direct anchor points */ readonly anchorPointsDirect: AnchorPointDirect[] | undefined; /** * Metadata identifying parameters using same correlation modeling and * associated correlation parameters */ readonly intraTileCorrelationGroups: CorrelationGroup[] | undefined; /** * The full covariance of anchor point parameters */ readonly covarianceDirect: Matrix3 | undefined; } export namespace Spdcf { /** * Initialization options for the Spdcf constructor * @property A - The factor A, in (0, 1] * @property alpha - The alpha value, in [0, 1) * @property beta - The beta value, in [0, 10] * @property T - the tau value, in (0, +inf) */ type ConstructorOptions = { A: number; alpha: number; beta: number; T: number; }; } /** * Variables for a Strictly Positive-Definite Correlation Function. * * This reflects the `spdcf` definition of the * {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. * Instances of this type are stored as the parameters within a * `CorrelationGroup`. * * Parameters (A, alpha, beta, T) describe the correlation decrease * between points as a function of delta time: * ``` * spdcf(delta_t) = A_t * (alpha_t + ((1 - alpha_t)(1 + beta_t)) / (beta_t + e^(delta_t/T_t))) * ``` * @param options - An object describing initialization options */ export class Spdcf { constructor(options: Spdcf.ConstructorOptions); /** * In (0, 1] */ readonly A: number; /** * In [0, 1) */ readonly alpha: number; /** * In [0, 10] */ readonly beta: number; /** * In (0, +inf) */ readonly T: number; } /** * An enum of storage types for covariance information. * * This reflects the `gltfGpmLocal.storageType` definition of the * {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. */ export enum StorageType { /** * Store the full error covariance of the anchor points, to include the cross-covariance terms */ Direct = "Direct", /** * A full covariance matrix is stored for each of the anchor points. However, in this case the * cross-covariance terms are not directly stored, but can be computed by a set of spatial * correlation function parameters which are stored in the metadata. */ Indirect = "Indirect" } /** * The lighting model to use for lighting a {@link Model}. */ export enum LightingModel { /** * Use unlit shading, i.e. skip lighting calculations. The model's * diffuse color (assumed to be linear RGB, not sRGB) is used directly * when computing out_FragColor. The alpha mode is still * applied. */ UNLIT = 0, /** * Use physically-based rendering lighting calculations. This includes * both PBR metallic roughness and PBR specular glossiness. Image-based * lighting is also applied when possible. */ PBR = 1 } /** *
* To construct a Model, call {@link Model.fromGltfAsync}. Do not call the constructor directly. *
* A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL. *

* Cesium supports glTF assets with the following extensions: *

    *
  • * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} *
  • *
  • * {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features|EXT_instance_features} *
  • *
  • * {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features|EXT_mesh_features} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing|EXT_mesh_gpu_instancing} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_restart|EXT_mesh_primitive_restart} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} * (edges are hidden by default; set {@link EdgeDisplayMode} via * {@link Model#edgeDisplayMode} or {@link Cesium3DTileset#edgeDisplayMode} to display them) *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_meshopt_compression|EXT_meshopt_compression} *
  • *
  • * {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_texture_webp|EXT_texture_webp} *
  • *
  • * {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-2.0/extensions/2.1/Vendor/EXT_voxels|EXT_voxels} (experimental) *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} *
  • *
  • * {@link https://github.com/CesiumGS/glTF/tree/draft-splat-spz/extensions/2.0/Khronos/KHR_gaussian_splatting|KHR_gaussian_splatting} (experimental) *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Archived/KHR_techniques_webgl/README.md|KHR_techniques_webgl} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_anisotropy|KHR_materials_anisotropy} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat|KHR_materials_clearcoat} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness|KHR_materials_pbrSpecularGlossiness} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_specular|KHR_materials_specular} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/pull/2569|KHR_mesh_primitive_restart} * (requires a WebGL 2 context; behavior on WebGL 1 is undefined) *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_mesh_quantization|KHR_mesh_quantization} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_meshopt_compression|KHR_meshopt_compression} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} *
  • *
  • * {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes} *
  • *
  • * {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local (experimental)} *
  • *
*

*

* Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions * for maximum compatibility. This is because some samplers require power of 2 textures ({@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL|Using textures in WebGL}) * and KHR_texture_basisu requires multiple of 4 dimensions ({@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md#additional-requirements|KHR_texture_basisu additional requirements}). *

*/ export class Model { constructor(); /** * The 4x4 transformation matrix that transforms the model from model to world coordinates. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates. * Local reference frames can be used by providing a different transformation matrix, like that returned * by {@link Transforms.eastNorthUpToFixedFrame}. * @example * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ modelMatrix: Matrix4; /** * Whether to display the outline for models using the * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. * When true, outlines are displayed. When false, outlines are not displayed. */ showOutline: boolean; /** * The color to use when rendering outlines. */ outlineColor: Color; /** * When true, this model is ready to render, i.e., the external binary, image, * and shader files were downloaded and the WebGL resources were created. */ readonly ready: boolean; /** * Gets an event that is raised when the model encounters an asynchronous rendering error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link ModelError}. */ readonly errorEvent: Event; /** * Gets an event that is raised when the model is loaded and ready for rendering, i.e. when the external resources * have been downloaded and the WebGL resources are created. Event listeners * are passed an instance of the {@link Model}. * *

* If {@link Model.incrementallyLoadTextures} is true, this event will be raised before all textures are loaded and ready for rendering. Subscribe to {@link Model.texturesReadyEvent} to be notified when the textures are ready. *

*/ readonly readyEvent: Event; /** * Gets an event that, if {@link Model.incrementallyLoadTextures} is true, is raised when the model textures are loaded and ready for rendering, i.e. when the external resources * have been downloaded and the WebGL resources are created. Event listeners * are passed an instance of the {@link Model}. */ readonly texturesReadyEvent: Event; /** * The currently playing glTF animations. */ readonly activeAnimations: ModelAnimationCollection; /** * Determines if the model's animations should hold a pose over frames where no keyframes are specified. */ clampAnimations: boolean; /** * Point cloud shading settings for controlling point cloud attenuation * and lighting. For 3D Tiles, this is inherited from the * {@link Cesium3DTileset}. */ pointCloudShading: PointCloudShading; /** * The model's custom shader, if it exists. Using custom shaders with a {@link Cesium3DTileStyle} * may lead to undefined behavior. */ customShader: CustomShader; /** * The height reference of the model, which determines how the model is drawn * relative to terrain. */ heightReference: HeightReference; /** * Gets or sets the distance display condition, which specifies at what distance * from the camera this model will be displayed. */ distanceDisplayCondition: DistanceDisplayCondition; /** * A user-defined object that is returned when the model is picked. */ id: any; /** * The style to apply to the features in the model. Cannot be applied if a {@link CustomShader} is also applied. */ style: Cesium3DTileStyle; /** * The color to blend with the model's rendered color. */ color: Color; /** * Defines how the color blends with the model. */ colorBlendMode: Cesium3DTileColorBlendMode | ColorBlendMode; /** * Value used to determine the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. */ colorBlendAmount: number; /** * The silhouette color. */ silhouetteColor: Color; /** * The size of the silhouette in pixels. */ silhouetteSize: number; /** * Gets the model's bounding sphere in world space. This does not take into account * glTF animations, skins, or morph targets. It also does not account for * {@link Model#minimumPixelSize}. */ readonly boundingSphere: BoundingSphere; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the model. *

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the model in wireframe. *

*/ debugWireframe: boolean; /** * Controls how edges from the * {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} * glTF extension are rendered relative to surface geometry. Primitives that * do not declare the extension are unaffected by this setting. */ edgeDisplayMode: EdgeDisplayMode; /** * Whether or not to render the model. */ show: boolean; /** * Label of the feature ID set to use for picking and styling. *

* For EXT_mesh_features, this is the feature ID's label property, or * "featureId_N" (where N is the index in the featureIds array) when not * specified. EXT_feature_metadata did not have a label field, so such * feature ID sets are always labeled "featureId_N" where N is the index in * the list of all feature Ids, where feature ID attributes are listed before * feature ID textures. *

*

* If featureIdLabel is set to an integer N, it is converted to * the string "featureId_N" automatically. If both per-primitive and * per-instance feature IDs are present, the instance feature IDs take * priority. *

*/ featureIdLabel: string; /** * Label of the instance feature ID set used for picking and styling. *

* If instanceFeatureIdLabel is set to an integer N, it is converted to * the string "instanceFeatureId_N" automatically. * If both per-primitive and per-instance feature IDs are present, the * instance feature IDs take priority. *

*/ instanceFeatureIdLabel: string; /** * The {@link ClippingPlaneCollection} used to selectively disable rendering the model. */ clippingPlanes: ClippingPlaneCollection; /** * The {@link ClippingPolygonCollection} used to selectively disable rendering the model. */ clippingPolygons: ClippingPolygonCollection; /** * If true, the model is exaggerated along the ellipsoid normal when {@link Scene.verticalExaggeration} is set to a value other than 1.0. * @example * // Exaggerate terrain by a factor of 2, but prevent model exaggeration * scene.verticalExaggeration = 2.0; * model.enableVerticalExaggeration = false; */ enableVerticalExaggeration: boolean; /** * The directional light color when shading the model. When undefined the scene's light color is used instead. *

* Disabling additional light sources by setting * model.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0) * will make the model much darker. Here, increasing the intensity of the light source will make the model brighter. *

*/ lightColor: Cartesian3; /** * The properties for managing image-based lighting on this model. */ imageBasedLighting: ImageBasedLighting; /** * The properties for managing dynamic environment maps on this model. Affects lighting. * @example * // Change the ground color used for a model's environment map to a forest green * const environmentMapManager = model.environmentMapManager; * environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34"); */ readonly environmentMapManager: DynamicEnvironmentMapManager; /** * Whether to cull back-facing geometry. When true, back face culling is * determined by the material's doubleSided property; when false, back face * culling is disabled. Back faces are not culled if {@link Model#color} * is translucent or {@link Model#silhouetteSize} is greater than 0.0. */ backFaceCulling: boolean; /** * A uniform scale applied to this model before the {@link Model#modelMatrix}. * Values greater than 1.0 increase the size of the model; values * less than 1.0 decrease. */ scale: number; /** * The approximate minimum pixel size of the model regardless of zoom. * This can be used to ensure that a model is visible even when the viewer * zooms out. When 0.0, no minimum size is enforced. */ minimumPixelSize: number; /** * The maximum scale size for a model. This can be used to give * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model * is never an unreasonable scale. */ maximumScale: number; /** * Determines whether the model casts or receives shadows from light sources. */ shadows: ShadowMode; /** * Gets the credit that will be displayed for the model. */ readonly credit: Credit; /** * Gets or sets whether the credits of the model will be displayed * on the screen. */ showCreditsOnScreen: boolean; /** * The {@link SplitDirection} to apply to this model. */ splitDirection: SplitDirection; /** * Gets the model's classification type. This determines whether terrain, * 3D Tiles, or both will be classified by this model. *

* Additionally, there are a few requirements/limitations: *

    *
  • The glTF cannot contain morph targets, skins, or animations.
  • *
  • The glTF cannot contain the EXT_mesh_gpu_instancing extension.
  • *
  • Only meshes with TRIANGLES can be used to classify other assets.
  • *
  • The meshes must be watertight.
  • *
  • The POSITION attribute is required.
  • *
  • If feature IDs and an index buffer are both present, all indices with the same feature id must occupy contiguous sections of the index buffer.
  • *
  • If feature IDs are present without an index buffer, all positions with the same feature id must occupy contiguous sections of the position buffer.
  • *
*

*

* The 3D Tiles or terrain receiving the classification must be opaque. *

*/ readonly classificationType: ClassificationType; /** * Returns the node with the given name in the glTF. This is used to * modify a node's transform for user-defined animation. * * If there are multiple nodes with the same name in the glTF, * then the returned node is unspecified. * @example * // Apply non-uniform scale to node "Hand" * const node = model.getNode("Hand"); * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); * @param name - The name of the node in the glTF. * @returns The node, or undefined if no node with the name exists. */ getNode(name: string): ModelNode; /** * Sets the current value of an articulation stage. After setting one or * multiple stage values, call Model.applyArticulations() to * cause the node matrices to be recalculated. * @example * // Sets the value of the stage named "MoveX" belonging to the articulation named "SampleArticulation" * model.setArticulationStage("SampleArticulation MoveX", 50.0); * @param articulationStageKey - The name of the articulation, a space, and the name of the stage. * @param value - The numeric value of this stage of the articulation. */ setArticulationStage(articulationStageKey: string, value: number): void; /** * Applies any modified articulation stages to the matrix of each node that * participates in any articulation. Note that this will overwrite any node * transformations on participating nodes. */ applyArticulations(): void; /** * Returns the object that was created for the given extension. * * The given name may be the name of a glTF extension, like `"EXT_example_extension"`. * If the specified extension was present in the root of the underlying glTF asset, * and a loader for the specified extension has processed the extension data, then * this will return the model representation of the extension. * @param extensionName - The name of the extension * @returns The object, or `undefined` */ getExtension(extensionName: string): any | undefined; /** * Marks the model's {@link Model#style} as dirty, which forces all features * to re-evaluate the style in the next frame the model is visible. */ makeStyleDirty(): void; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * model = model && model.destroy(); */ destroy(): void; /** *

* Asynchronously creates a model from a glTF asset. This function returns a promise that resolves 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. *

*

* The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension. * @example * // Load a model and add it to the scene * try { * const model = await Cesium.Model.fromGltfAsync({ * url: "../../SampleData/models/CesiumMan/Cesium_Man.glb" * }); * viewer.scene.primitives.add(model); * } catch (error) { * console.log(`Failed to load model. ${error}`); * } * @example * // Position a model with modelMatrix and display it with a minimum size of 128 pixels * const position = Cesium.Cartesian3.fromDegrees( * -123.0744619, * 44.0503706, * 5000.0 * ); * const headingPositionRoll = new Cesium.HeadingPitchRoll(); * const fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator( * "north", * "west" * ); * try { * const model = await Cesium.Model.fromGltfAsync({ * url: "../../SampleData/models/CesiumAir/Cesium_Air.glb", * modelMatrix: Cesium.Transforms.headingPitchRollToFixedFrame( * position, * headingPositionRoll, * Cesium.Ellipsoid.WGS84, * fixedFrameTransform * ), * minimumPixelSize: 128, * }); * viewer.scene.primitives.add(model); * } catch (error) { * console.log(`Failed to load model. ${error}`); * } * @example * // Load a model and play the last animation at half speed * let animations; * try { * const model = await Cesium.Model.fromGltfAsync({ * url: "../../SampleData/models/CesiumMan/Cesium_Man.glb", * gltfCallback: gltf => { * animations = gltf.animations * } * }); * viewer.scene.primitives.add(model); * model.readyEvent.addEventListener(() => { * model.activeAnimations.add({ * index: animations.length - 1, * loop: Cesium.ModelAnimationLoop.REPEAT, * multiplier: 0.5, * }); * }); * } catch (error) { * console.log(`Failed to load model. ${error}`); * } * @param options - Object with the following properties: * @param options.url - The url to the .gltf or .glb file. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to. * @param [options.show = true] - Whether or not to render the model. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates. * @param [options.scale = 1.0] - A uniform scale applied to this model. * @param [options.enableVerticalExaggeration = true] - If true, the model is exaggerated along the ellipsoid normal when {@link Scene.verticalExaggeration} is set to a value other than 1.0. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}. * @param [options.allowPicking = true] - When true, each primitive is pickable with {@link Scene#pick}. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded. * @param [options.asynchronous = true] - Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources. * @param [options.releaseGltfJson = false] - When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model. * @param [options.enableDebugWireframe = false] - For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true. * @param [options.cull = true] - Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used. * @param [options.opaquePass = Pass.OPAQUE] - The pass to use in the {@link DrawCommand} for the opaque portions of the model. * @param [options.upAxis = Axis.Y] - The up-axis of the glTF model. * @param [options.forwardAxis = Axis.Z] - The forward-axis of the glTF model. * @param [options.customShader] - A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior. * @param [options.content] - The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain. * @param [options.scene] - Must be passed in for models that use the height reference property. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed. * @param [options.color] - A color that blends with the model's rendered color. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model. * @param [options.colorBlendAmount = 0.5] - Value used to determine the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. * @param [options.edgeDisplayMode = EdgeDisplayMode.SURFACES_ONLY] - Controls how edges from the {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_primitive_edge_visibility|EXT_mesh_primitive_edge_visibility} extension are rendered relative to surface geometry. * @param [options.silhouetteColor = Color.RED] - The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels. * @param [options.enableShowOutline = true] - Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time. When false, the showOutlines and outlineColor options are ignored. * @param [options.showOutline = true] - Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed. * @param [options.outlineColor = Color.BLACK] - The color to use when rendering outlines. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model. * @param [options.clippingPolygons] - The {@link ClippingPolygonCollection} used to selectively disable rendering the model. * @param [options.lightColor] - The light color when shading the model. When undefined the scene's light color is used instead. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model. * @param [options.environmentMapOptions] - The properties for managing dynamic environment maps on this model. * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent. * @param [options.credit] - A credit for the data source, which is displayed on the canvas. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model. * @param [options.projectTo2D = false] - Whether to accurately project the model's positions in 2D. If this is true, the model will be projected accurately to 2D, but it will use more memory to do so. If this is false, the model will use less memory and will still render in 2D / CV mode, but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to the model matrix. This also cannot be set after the model has loaded. * @param [options.enablePick = false] - Whether to allow with CPU picking with pick when not using WebGL 2 or above. If using WebGL 2 or above, this option will be ignored. If using WebGL 1 and this is true, the pick operation will work correctly, but it will use more memory to do so. If running with WebGL 1 and this is false, the model will use less memory, but pick will always return undefined. This cannot be set after the model has loaded. * @param [options.featureIdLabel = "featureId_0"] - Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority. * @param [options.instanceFeatureIdLabel = "instanceFeatureId_0"] - Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting. * @param [options.classificationType] - Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded. * @param [options.gltfCallback] - A function that is called with the loaded gltf object once loaded. * @returns A promise that resolves to the created model when it is ready to render. */ static fromGltfAsync(options: { url: string | Resource; basePath?: string | Resource; show?: boolean; modelMatrix?: Matrix4; scale?: number; enableVerticalExaggeration?: boolean; minimumPixelSize?: number; maximumScale?: number; id?: any; allowPicking?: boolean; incrementallyLoadTextures?: boolean; asynchronous?: boolean; clampAnimations?: boolean; shadows?: ShadowMode; releaseGltfJson?: boolean; debugShowBoundingVolume?: boolean; enableDebugWireframe?: boolean; debugWireframe?: boolean; cull?: boolean; opaquePass?: boolean; upAxis?: Axis; forwardAxis?: Axis; customShader?: CustomShader; content?: Cesium3DTileContent; heightReference?: HeightReference; scene?: Scene; distanceDisplayCondition?: DistanceDisplayCondition; color?: Color; colorBlendMode?: ColorBlendMode; colorBlendAmount?: number; edgeDisplayMode?: EdgeDisplayMode; silhouetteColor?: Color; silhouetteSize?: number; enableShowOutline?: boolean; showOutline?: boolean; outlineColor?: Color; clippingPlanes?: ClippingPlaneCollection; clippingPolygons?: ClippingPolygonCollection; lightColor?: Cartesian3; imageBasedLighting?: ImageBasedLighting; environmentMapOptions?: DynamicEnvironmentMapManager.ConstructorOptions; backFaceCulling?: boolean; credit?: Credit | string; showCreditsOnScreen?: boolean; splitDirection?: SplitDirection; projectTo2D?: boolean; enablePick?: boolean; featureIdLabel?: string | number; instanceFeatureIdLabel?: string | number; pointCloudShading?: any; classificationType?: ClassificationType; gltfCallback?: Model.GltfCallback; }): Promise; } export namespace Model { /** * Interface for the function that is called with the loaded gltf object once loaded. * @param gltf - The gltf object */ type GltfCallback = (gltf: any) => void; } /** *

* Create animations by calling {@link ModelAnimationCollection#add}. Do not call the constructor directly. *
* * An active animation derived from a glTF asset. An active animation is an * animation that is either currently playing or scheduled to be played due to * being added to a model's {@link 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. */ export class ModelAnimation { constructor(); /** * When true, the animation is removed after it stops playing. * This is slightly more efficient that not removing it, but if, for example, * time is reversed, the animation is not played again. */ removeOnStop: boolean; /** * The event fired when this animation is started. This can be used, for * example, to play a sound or start a particle system, when the animation starts. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * animation.start.addEventListener(function(model, animation) { * console.log(`Animation started: ${animation.name}`); * }); */ start: Event; /** * The event fired when on each frame when this animation is updated. The * current time of the animation, relative to the glTF animation time span, is * passed to the event, which allows, for example, starting new animations at a * specific time relative to a playing animation. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * animation.update.addEventListener(function(model, animation, time) { * console.log(`Animation updated: ${animation.name}. glTF animation time: ${time}`); * }); */ update: Event; /** * The event fired when this animation is stopped. This can be used, for * example, to play a sound or start a particle system, when the animation stops. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * animation.stop.addEventListener(function(model, animation) { * console.log(`Animation stopped: ${animation.name}`); * }); */ stop: Event; /** * The name that identifies this animation in the model, if it exists. */ readonly name: string; /** * The scene time to start playing this animation. When this is undefined, * the animation starts at the next frame. */ readonly startTime: JulianDate; /** * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing. */ readonly delay: number; /** * The scene time to stop playing this animation. When this is undefined, * the animation is played for its full duration and perhaps repeated depending on * {@link ModelAnimation#loop}. */ readonly stopTime: JulianDate; /** * Values greater than 1.0 increase the speed that the animation is played relative * to the scene clock speed; values less than 1.0 decrease the speed. A value of * 1.0 plays the animation at the speed in the glTF animation mapped to the scene * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation * will play in one second even if multiplier is 1.0. */ readonly multiplier: number; /** * When true, the animation is played in reverse. */ readonly reverse: boolean; /** * Determines if and how the animation is looped. */ readonly loop: ModelAnimationLoop; /** * If this is defined, it will be used to compute the local animation time * instead of the scene's time. */ animationTime: ModelAnimation.AnimationTimeCallback; } export namespace ModelAnimation { /** * A function used to compute the local animation time for a ModelAnimation. * @example * // Use real time for model animation (assuming animateWhilePaused was set to true) * function animationTime(duration) { * return Date.now() / 1000 / duration; * } * @example * // Offset the phase of the animation, so it starts halfway through its cycle. * function animationTime(duration, seconds) { * return seconds / duration + 0.5; * } * @param duration - The animation's original duration in seconds. * @param seconds - The seconds since the animation started, in scene time. */ type AnimationTimeCallback = (duration: number, seconds: number) => number; } /** *
* Access a model's animations {@link Model#activeAnimations}. Do not call the constructor directly *
* * A collection of active model animations. */ export class ModelAnimationCollection { constructor(); /** * The event fired when an animation is added to the collection. This can be used, for * example, to keep a UI in sync. * @example * model.activeAnimations.animationAdded.addEventListener(function(model, animation) { * console.log(`Animation added: ${animation.name}`); * }); */ animationAdded: Event; /** * The event fired when an animation is removed from the collection. This can be used, for * example, to keep a UI in sync. * @example * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) { * console.log(`Animation removed: ${animation.name}`); * }); */ animationRemoved: Event; /** * When true, the animation will play even when the scene time is paused. However, * whether animation takes place will depend on the animationTime functions assigned * to the model's animations. By default, this is based on scene time, so models using * the default will not animate regardless of this setting. */ animateWhilePaused: boolean; /** * The number of animations in the collection. */ readonly length: number; /** * The model that owns this animation collection. */ readonly model: Model; /** * Creates and adds an animation with the specified initial properties to the collection. *

* This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync. *

* @example * // Example 1. Add an animation by name * model.activeAnimations.add({ * name : 'animation name' * }); * @example * // Example 2. Add an animation by index * model.activeAnimations.add({ * index : 0 * }); * @example * // Example 3. Add an animation and provide all properties and events * const startTime = Cesium.JulianDate.now(); * * const animation = model.activeAnimations.add({ * name : 'another animation name', * startTime : startTime, * delay : 0.0, // Play at startTime (default) * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()), * removeOnStop : false, // Do not remove when animation stops (default) * multiplier : 2.0, // Play at double speed * reverse : true, // Play in reverse * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation * }); * * animation.start.addEventListener(function(model, animation) { * console.log(`Animation started: ${animation.name}`); * }); * animation.update.addEventListener(function(model, animation, time) { * console.log(`Animation updated: ${animation.name}. glTF animation time: ${time}`); * }); * animation.stop.addEventListener(function(model, animation) { * console.log(`Animation stopped: ${animation.name}`); * }); * @param options - Object with the following properties: * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if options.index is undefined. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if options.name is undefined. * @param [options.startTime] - The scene time to start playing the animation. When this is undefined, the animation starts at the next frame. * @param [options.delay = 0.0] - The delay, in seconds, from startTime to start playing. This will only affect the animation if options.loop is ModelAnimationLoop.NONE. * @param [options.stopTime] - The scene time to stop playing the animation. When this is undefined, the animation is played for its full duration. * @param [options.removeOnStop = false] - When true, the animation is removed after it stops playing. This will only affect the animation if options.loop is ModelAnimationLoop.NONE. * @param [options.multiplier = 1.0] - Values greater than 1.0 increase the speed that the animation is played relative to the scene clock speed; values less than 1.0 decrease the speed. * @param [options.reverse = false] - When true, the animation is played in reverse. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped. * @param [options.animationTime] - If defined, computes the local animation time for this animation. * @returns The animation that was added to the collection. */ add(options: { name?: string; index?: number; startTime?: JulianDate; delay?: number; stopTime?: JulianDate; removeOnStop?: boolean; multiplier?: number; reverse?: boolean; loop?: ModelAnimationLoop; animationTime?: ModelAnimation.AnimationTimeCallback; }): ModelAnimation; /** * Creates and adds animations with the specified initial properties to the collection * for all animations in the model. *

* This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync. *

* @example * model.activeAnimations.addAll({ * multiplier : 0.5, // Play at half-speed * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations * }); * @param [options] - Object with the following properties: * @param [options.startTime] - The scene time to start playing the animations. When this is undefined, the animations starts at the next frame. * @param [options.delay = 0.0] - The delay, in seconds, from startTime to start playing. This will only affect the animation if options.loop is ModelAnimationLoop.NONE. * @param [options.stopTime] - The scene time to stop playing the animations. When this is undefined, the animations are played for its full duration. * @param [options.removeOnStop = false] - When true, the animations are removed after they stop playing. This will only affect the animation if options.loop is ModelAnimationLoop.NONE. * @param [options.multiplier = 1.0] - Values greater than 1.0 increase the speed that the animations play relative to the scene clock speed; values less than 1.0 decrease the speed. * @param [options.reverse = false] - When true, the animations are played in reverse. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped. * @param [options.animationTime] - If defined, computes the local animation time for all of the animations. * @returns An array of {@link ModelAnimation} objects, one for each animation added to the collection. If there are no glTF animations, the array is empty. */ addAll(options?: { startTime?: JulianDate; delay?: number; stopTime?: JulianDate; removeOnStop?: boolean; multiplier?: number; reverse?: boolean; loop?: ModelAnimationLoop; animationTime?: ModelAnimation.AnimationTimeCallback; }): ModelAnimation[]; /** * Removes an animation from the collection. *

* This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync. *

*

* An animation can also be implicitly removed from the collection by setting {@link ModelAnimationCollection#removeOnStop} to * true. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed. *

* @example * const a = model.activeAnimations.add({ * name : 'animation name' * }); * model.activeAnimations.remove(a); // Returns true * @param runtimeAnimation - The runtime animation to remove. * @returns true if the animation was removed; false if the animation was not found in the collection. */ remove(runtimeAnimation: ModelAnimation): boolean; /** * Removes all animations from the collection. *

* This raises the {@link ModelAnimationCollection#animationRemoved} event for each * animation so, for example, a UI can stay in sync. *

*/ removeAll(): void; /** * Determines whether this collection contains a given animation. * @param runtimeAnimation - The runtime animation to check for. * @returns true if this collection contains the animation, false otherwise. */ contains(runtimeAnimation: ModelAnimation): boolean; /** * Returns the animation in the collection at the specified index. Indices are zero-based * and increase as animations are added. Removing an animation shifts all animations after * it to the left, changing their indices. This function is commonly used to iterate over * all the animations in the collection. * @example * // Output the names of all the animations in the collection. * const animations = model.activeAnimations; * const length = animations.length; * for (let i = 0; i < length; ++i) { * console.log(animations.get(i).name); * } * @param index - The zero-based index of the animation. * @returns The runtime animation at the specified index. */ get(index: number): ModelAnimation; } /** * A feature of a {@link Model}. *

* Provides access to a feature's properties stored in the model's feature table. *

*

* Modifications to a ModelFeature object have the lifetime of the model. *

*

* Do not construct this directly. Access it through picking using {@link Scene#pick}. *

* @example * // On mouse over, display all the properties for a feature in the console log. * handler.setInputAction(function(movement) { * const feature = scene.pick(movement.endPosition); * if (feature instanceof Cesium.ModelFeature) { * console.log(feature); * } * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param options - Object with the following properties: * @param options.model - The model the feature belongs to. * @param options.featureId - The unique integral identifier for this feature. */ export class ModelFeature { constructor(options: { model: Model; featureId: number; }); /** * Gets or sets if the feature will be shown. This is set for all features * when a style's show is evaluated. */ show: boolean; /** * Gets or sets the highlight color multiplied with the feature's color. When * this is white, the feature's color is not changed. This is set for all features * when a style's color is evaluated. */ color: Color; /** * Get the feature ID associated with this feature. For 3D Tiles 1.0, the * batch ID is returned. For EXT_mesh_features, this is the feature ID from * the selected feature ID set. */ readonly featureId: number; /** * Returns whether the feature contains this property. * @param name - The case-sensitive name of the property. * @returns Whether the feature contains this property. */ hasProperty(name: string): boolean; /** * Returns a copy of the value of the feature's property with the given name. * @example * // Display all the properties for a feature in the console log. * const propertyIds = feature.getPropertyIds(); * const length = propertyIds.length; * for (let i = 0; i < length; ++i) { * const propertyId = propertyIds[i]; * console.log(propertyId + ': ' + feature.getProperty(propertyId)); * } * @param name - The case-sensitive name of the property. * @returns The value of the property or undefined if the feature does not have this property. */ getProperty(name: string): any; /** * Returns a copy of the feature's property with the given name, examining all * the metadata from the EXT_structural_metadata and legacy EXT_feature_metadata glTF * extensions. Metadata is checked against name from most specific to most * general and the first match is returned. Metadata is checked in this order: *
    *
  1. structural metadata property by semantic
  2. *
  3. structural metadata property by property ID
  4. *
*

* See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF. *

* @param name - The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata. * @returns The value of the property or undefined if the feature does not have this property. */ getPropertyInherited(name: string): any; /** * Returns an array of property IDs for the feature. * @param [results] - An array into which to store the results. * @returns The IDs of the feature's properties. */ getPropertyIds(results?: string[]): string[]; /** * Sets the value of the feature's property with the given name. * @example * const height = feature.getProperty('Height'); // e.g., the height of a building * @example * const name = 'clicked'; * if (feature.getProperty(name)) { * console.log('already clicked'); * } else { * feature.setProperty(name, true); * console.log('first click'); * } * @param name - The case-sensitive name of the property. * @param value - The value of the property that will be copied. * @returns true if the property was set, false otherwise. */ setProperty(name: string, value: any): boolean; } /** *
* Use {@link Model#getNode} to get a node from a loaded model. Do not call the constructor directly. *
* * A model node with a modifiable transform to allow users to define their * own animations. While a model's asset can contain animations that target * a node's transform, this class allows users to change a node's transform * externally. In this way, animation can be driven by another source, not * just by the model's asset. * @example * const node = model.getNode("Hand"); * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); */ export class ModelNode { constructor(); /** * The value of the name property of this node. */ readonly name: string; /** * The index of the node in the glTF. */ readonly id: number; /** * Determines if this node and its children will be shown. */ show: boolean; /** * The node's 4x4 matrix transform from its local coordinates to * its parent's. Setting the matrix to undefined will restore the * node's original transform, and allow the node to be animated by * any animations in the model again. *

* For changes to take effect, this property must be assigned to; * setting individual elements of the matrix will not work. *

*/ matrix: Matrix4; /** * Gets the node's original 4x4 matrix transform from its local * coordinates to its parent's, without any node transformations * or articulations applied. */ originalMatrix: Matrix4; } /** * Reads and returns a value with the given type * at the given byte offset from the data view, in little-endian * order * @param dataView - Typed data view into a binary buffer * @param byteOffset - The offset, in bytes, from the start of the view to read the data from * @param numberOfComponents - The number of components to read * @param result - The array in which to read the result */ export type ComponentsReaderCallback = (dataView: DataView, byteOffset: number, numberOfComponents: number, result: number[]) => void; /** * Reads and returns a value with the given type * at the given byte offset from the data view, in little-endian * order * @param dataView - Typed data view into a binary buffer * @param byteOffset - The offset, in bytes, from the start of the view to read the data from */ export type ComponentReaderCallback = (dataView: DataView, byteOffset: number) => number | bigint; /** * A simple struct that serves as a value of a sampler2D-valued * uniform. This is used with {@link CustomShader} and {@link TextureManager} * @param options - An object with the following properties: * @param [options.typedArray] - A typed array storing the contents of a texture. Values are stored in row-major order. Since WebGL uses a y-up convention for textures, rows are listed from bottom to top. * @param [options.width] - The width of the image. Required when options.typedArray is present * @param [options.height] - The height of the image. Required when options.typedArray is present. * @param [options.url] - A URL string or resource pointing to a texture image. * @param [options.repeat = true] - When defined, the texture sampler will be set to wrap in both directions * @param [options.pixelFormat = PixelFormat.RGBA] - When options.typedArray is defined, this is used to determine the pixel format of the texture * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - When options.typedArray is defined, this is the data type of pixel values in the typed array. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The minification filter of the texture sampler. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The magnification filter of the texture sampler. * @param [options.maximumAnisotropy = 1.0] - The maximum anisotropy of the texture sampler */ export class TextureUniform { constructor(options: { typedArray?: Uint8Array; width?: number; height?: number; url?: string | Resource; repeat?: boolean; pixelFormat?: PixelFormat; pixelDatatype?: PixelDatatype; minificationFilter?: TextureMinificationFilter; magnificationFilter?: TextureMagnificationFilter; maximumAnisotropy?: number; }); } /** * An enum of the basic GLSL uniform types. These can be used with * {@link CustomShader} to declare user-defined uniforms. */ export enum UniformType { /** * A single floating point value. */ FLOAT = "float", /** * A vector of 2 floating point values. */ VEC2 = "vec2", /** * A vector of 3 floating point values. */ VEC3 = "vec3", /** * A vector of 4 floating point values. */ VEC4 = "vec4", /** * A single integer value */ INT = "int", /** * A vector of 2 integer values. */ INT_VEC2 = "ivec2", /** * A vector of 3 integer values. */ INT_VEC3 = "ivec3", /** * A vector of 4 integer values. */ INT_VEC4 = "ivec4", /** * A single boolean value. */ BOOL = "bool", /** * A vector of 2 boolean values. */ BOOL_VEC2 = "bvec2", /** * A vector of 3 boolean values. */ BOOL_VEC3 = "bvec3", /** * A vector of 4 boolean values. */ BOOL_VEC4 = "bvec4", /** * A 2x2 matrix of floating point values. */ MAT2 = "mat2", /** * A 3x3 matrix of floating point values. */ MAT3 = "mat3", /** * A 4x4 matrix of floating point values. */ MAT4 = "mat4", /** * A 2D sampled texture. */ SAMPLER_2D = "sampler2D", SAMPLER_CUBE = "samplerCube" } /** * An enum for the GLSL varying types. These can be used for declaring varyings * in {@link CustomShader} */ export enum VaryingType { /** * A single floating point value. */ FLOAT = "float", /** * A vector of 2 floating point values. */ VEC2 = "vec2", /** * A vector of 3 floating point values. */ VEC3 = "vec3", /** * A vector of 4 floating point values. */ VEC4 = "vec4", /** * A 2x2 matrix of floating point values. */ MAT2 = "mat2", /** * A 3x3 matrix of floating point values. */ MAT3 = "mat3", /** * A 4x4 matrix of floating point values. */ MAT4 = "mat4" } /** * Determines if and how a glTF animation is looped. */ export enum ModelAnimationLoop { /** * Play the animation once; do not loop it. */ NONE = 0, /** * Loop the animation playing it from the start immediately after it stops. */ REPEAT = 1, /** * Loop the animation. First, playing it forward, then in reverse, then forward, and so on. */ MIRRORED_REPEAT = 2 } /** * Draws the Moon in 3D. * @example * scene.moon = new Cesium.Moon(); * @param [options] - Object with the following properties: * @param [options.show = true] - Determines whether the moon will be rendered. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid. * @param [options.onlySunLighting = true] - Use the sun as the only light source. */ export class Moon { constructor(options?: { show?: boolean; textureUrl?: string; ellipsoid?: Ellipsoid; onlySunLighting?: boolean; }); /** * Determines if the moon will be shown. */ show: boolean; /** * The moon texture. */ textureUrl: string; /** * Use the sun as the only light source. */ onlySunLighting: boolean; /** * Get the ellipsoid that defines the shape of the moon. */ readonly ellipsoid: Ellipsoid; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * moon = moon && moon.destroy(); */ destroy(): void; } /** * A {@link TileDiscardPolicy} specifying that tile images should never be discard. */ export class NeverTileDiscardPolicy { constructor(); /** * Determines if the discard policy is ready to process images. * @returns True if the discard policy is ready to process images; otherwise, false. */ isReady(): boolean; /** * Given a tile image, decide whether to discard that image. * @param image - An image to test. * @returns True if the image should be discarded; otherwise, false. */ shouldDiscardImage(image: HTMLImageElement): boolean; } export namespace OpenStreetMapImageryProvider { /** * Initialization options for the OpenStreetMapImageryProvider constructor * @property [url = 'https://tile.openstreetmap.org'] - The OpenStreetMap server url. * @property [fileExtension = 'png'] - The file extension for images on the server. * @property [retinaTiles = false] - When true, request tiles at the 2x resolution for retina displays. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { url?: string; fileExtension?: string; retinaTiles?: boolean; rectangle?: Rectangle; minimumLevel?: number; maximumLevel?: number; ellipsoid?: Ellipsoid; credit?: Credit | string; }; } /** * An imagery provider that provides tiled imagery hosted by OpenStreetMap * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run * servers, so you must conform to their * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}. * @example * const osm = new Cesium.OpenStreetMapImageryProvider({ * url : 'https://tile.openstreetmap.org/' * }); * @param options - Object describing initialization options */ export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider { constructor(options: OpenStreetMapImageryProvider.ConstructorOptions); } /** * Displays panorama imagery in a scene. This type describes an interface and is not intended to be instantiated directly. */ export class Panorama { constructor(); /** * Determines if the panorama will be shown. */ show: boolean; /** * Gets the transform of the panorama. */ readonly transform: Matrix4; /** * Gets the credits of the panorama. */ readonly credit: Credit; } /** * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an * interface and is not intended to be instantiated directly. */ export class PanoramaProvider { constructor(); /** * Returns a panorama provider. * @param options - Input options to create the panorama provider. * @returns The panorama provider for loading panoramas into a scene. */ static fromUrl(options: any): PanoramaProvider; /** * Returns a panorama primitive. * @param options - Input options to create the panorama primitive. * @returns The panorama primitive for displaying panoramas in a scene. */ loadPanorama(options: any): Panorama; } /** * A particle emitted by a {@link ParticleSystem}. * @param options - An object with the following properties: * @param [options.mass = 1.0] - The mass of the particle in kilograms. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies. * @param [options.startScale = 1.0] - The scale of the particle when it is born. * @param [options.endScale = 1.0] - The scale of the particle when it dies. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels. */ export class Particle { constructor(options: { mass?: number; position?: Cartesian3; velocity?: Cartesian3; life?: number; image?: any; startColor?: Color; endColor?: Color; startScale?: number; endScale?: number; imageSize?: Cartesian2; }); /** * The mass of the particle in kilograms. */ mass: number; /** * The positon of the particle in world coordinates. */ position: Cartesian3; /** * The velocity of the particle in world coordinates. */ velocity: Cartesian3; /** * The life of the particle in seconds. */ life: number; /** * The image to use for the particle. */ image: any; /** * The color of the particle when it is born. */ startColor: Color; /** * The color of the particle when it dies. */ endColor: Color; /** * the scale of the particle when it is born. */ startScale: number; /** * The scale of the particle when it dies. */ endScale: number; /** * The dimensions, width by height, to scale the particle image in pixels. */ imageSize: Cartesian2; /** * Gets the age of the particle in seconds. */ age: number; /** * Gets the age normalized to a value in the range [0.0, 1.0]. */ normalizedAge: number; } /** * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime. * @param [options] - An object with the following properties: * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur. * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst. * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst. */ export class ParticleBurst { constructor(options?: { time?: number; minimum?: number; maximum?: number; }); /** * The time in seconds after the beginning of the particle system's lifetime that the burst will occur. */ time: number; /** * The minimum number of particles emitted. */ minimum: number; /** * The maximum number of particles emitted. */ maximum: number; /** * true if the burst has been completed; false otherwise. */ complete: boolean; } /** *

* An object that initializes a {@link Particle} from a {@link ParticleSystem}. *

*

* This type describes an interface and is not intended to be instantiated directly. *

*/ export class ParticleEmitter { constructor(); } /** * A ParticleSystem manages the updating and display of a collection of particles. * @param [options] - Object with the following properties: * @param [options.show = true] - Whether to display the particle system. * @param [options.updateCallback] - The callback function to be called each frame to update a particle. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system. * @param [options.emissionRate = 5] - The number of particles to emit per second. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife. * @param [options.startColor] - The color of the particle at the beginning of its life. * @param [options.endColor] - The color of the particle at the end of its life. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - If set, overrides the minimumImageSize and maximumImageSize inputs that scale the particle image's dimensions in pixels. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels. * @param [options.sizeInMeters] - Sets if the size of particles is in meters or pixels. true to size the particles in meters; otherwise, the size is in pixels. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value. * @param [options.minimumParticleLife] - Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen. * @param [options.maximumParticleLife] - Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms. * @param [options.minimumMass] - Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value. * @param [options.maximumMass] - Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value. */ export class ParticleSystem { constructor(options?: { show?: boolean; updateCallback?: ParticleSystem.updateCallback; emitter?: ParticleEmitter; modelMatrix?: Matrix4; emitterModelMatrix?: Matrix4; emissionRate?: number; bursts?: ParticleBurst[]; loop?: boolean; scale?: number; startScale?: number; endScale?: number; color?: Color; startColor?: Color; endColor?: Color; image?: any; imageSize?: Cartesian2; minimumImageSize?: Cartesian2; maximumImageSize?: Cartesian2; sizeInMeters?: boolean; speed?: number; minimumSpeed?: number; maximumSpeed?: number; lifetime?: number; particleLife?: number; minimumParticleLife?: number; maximumParticleLife?: number; mass?: number; minimumMass?: number; maximumMass?: number; }); /** * Whether to display the particle system. */ show: boolean; /** * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time */ updateCallback: ParticleSystem.updateCallback; /** * Whether the particle system should loop it's bursts when it is complete. */ loop: boolean; /** * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard. */ image: any; /** * The particle emitter for this */ emitter: ParticleEmitter; /** * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times. */ bursts: ParticleBurst[]; /** * The 4x4 transformation matrix that transforms the particle system from model to world coordinates. */ modelMatrix: Matrix4; /** * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system. */ emitterModelMatrix: Matrix4; /** * The color of the particle at the beginning of its life. */ startColor: Color; /** * The color of the particle at the end of its life. */ endColor: Color; /** * The initial scale to apply to the image of the particle at the beginning of its life. */ startScale: number; /** * The final scale to apply to the image of the particle at the end of its life. */ endScale: number; /** * The number of particles to emit per second. */ emissionRate: number; /** * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen. */ minimumSpeed: number; /** * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen. */ maximumSpeed: number; /** * Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen. */ minimumParticleLife: number; /** * Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen. */ maximumParticleLife: number; /** * Sets the minimum mass of particles in kilograms. */ minimumMass: number; /** * Sets the maximum mass of particles in kilograms. */ maximumMass: number; /** * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels. */ minimumImageSize: Cartesian2; /** * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels. */ maximumImageSize: Cartesian2; /** * Gets or sets if the particle size is in meters or pixels. true to size particles in meters; otherwise, the size is in pixels. */ sizeInMeters: boolean; /** * How long the particle system will emit particles, in seconds. */ lifetime: number; /** * Fires an event when the particle system has reached the end of its lifetime. */ complete: Event; /** * When true, the particle system has reached the end of its lifetime; false otherwise. */ isComplete: boolean; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. */ destroy(): void; } export namespace ParticleSystem { /** * A function used to modify attributes of the particle at each time step. This can include force modifications, * color, sizing, etc. * @example * function applyGravity(particle, dt) { * const position = particle.position; * const gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3()); * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector); * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity); * } * @param particle - The particle being updated. * @param dt - The time in seconds since the last update. */ type updateCallback = (particle: Particle, dt: number) => void; } /** * An appearance for {@link GeometryInstance} instances with color attributes. * This allows several geometry instances, each with a different color, to * be drawn with the same {@link Primitive} as shown in the second example below. * @example * // A solid white line segment * const 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 * const instance = new Cesium.GeometryInstance({ * geometry : new Cesium.RectangleGeometry({ * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0) * }), * attributes : { * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5) * } * }); * * const anotherInstance = new Cesium.GeometryInstance({ * geometry : new Cesium.RectangleGeometry({ * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0) * }), * attributes : { * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5) * } * }); * * const rectanglePrimitive = new Cesium.Primitive({ * geometryInstances : [instance, anotherInstance], * appearance : new Cesium.PerInstanceColorAppearance() * }); * @param [options] - Object with the following properties: * @param [options.flat = false] - When true, flat shading is used in the fragment shader, which means lighting is not taking into account. * @param [options.faceForward = !options.closed] - When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled. * @param [options.closed = false] - When true, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class PerInstanceColorAppearance { constructor(options?: { flat?: boolean; faceForward?: boolean; translucent?: boolean; closed?: boolean; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * This property is part of the {@link Appearance} interface, but is not * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used. */ material: Material; /** * When true, the geometry is expected to appear translucent so * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. *

* The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance} * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent} * and {@link PerInstanceColorAppearance#closed}. *

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so * {@link PerInstanceColorAppearance#renderState} has backface culling enabled. * If the viewer enters the geometry, it will not be visible. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. * A geometry can have more vertex attributes and still be compatible - at a * potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * When true, flat shading is used in the fragment shader, * which means lighting is not taking into account. */ readonly flat: boolean; /** * When true, the fragment shader flips the surface normal * as needed to ensure that the normal faces the viewer to avoid * dark spots. This is useful when both sides of a geometry should be * shaded like {@link WallGeometry}. */ readonly faceForward: boolean; /** * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances * are compatible with. This requires only position and normal * attributes. */ static readonly VERTEX_FORMAT: VertexFormat; /** * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances * are compatible with when {@link PerInstanceColorAppearance#flat} is true. * This requires only a position attribute. */ static readonly FLAT_VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance}, * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat}, * and {@link PerInstanceColorAppearance#faceForward}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } export function PerformanceDisplay(): void; /** * Information about metadata that is supposed to be picked * @property schemaId - The optional ID of the metadata schema * @property className - The name of the metadata class * @property propertyName - The name of the metadata property * @property classProperty - The metadata class property */ export type PickedMetadataInfo = { schemaId: string | undefined; className: string; propertyName: string; classProperty: MetadataClassProperty; }; /** * Options for performing point attenuation based on geometric error when rendering * point clouds using 3D Tiles. * @param [options] - Object with the following properties: * @param [options.attenuation = false] - Perform point attenuation based on geometric error. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source. */ export class PointCloudShading { constructor(options?: { attenuation?: boolean; geometricErrorScale?: number; maximumAttenuation?: number; baseResolution?: number; eyeDomeLighting?: boolean; eyeDomeLightingStrength?: number; eyeDomeLightingRadius?: number; backFaceCulling?: boolean; normalShading?: boolean; }); /** * Perform point attenuation based on geometric error. */ attenuation: boolean; /** * Scale to be applied to the geometric error before computing attenuation. */ geometricErrorScale: number; /** * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used. */ maximumAttenuation: number; /** * Average base resolution for the dataset in meters. * Used in place of geometric error when geometric error is 0. * If undefined, an approximation will be computed for each tile that has geometric error of 0. */ baseResolution: number; /** * Use eye dome lighting when drawing with point attenuation * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0, * otherwise eye dome lighting is ignored. */ eyeDomeLighting: boolean; /** * Eye dome lighting strength (apparent contrast) */ eyeDomeLightingStrength: number; /** * Thickness of contours from eye dome lighting */ eyeDomeLightingRadius: number; /** * Determines whether back-facing points are hidden. * This option works only if data has normals included. */ backFaceCulling: boolean; /** * Determines whether a point cloud that contains normals is shaded by the scene's light source. */ normalShading: boolean; /** * Determines if point cloud shading is supported. * @param scene - The scene. * @returns true if point cloud shading is supported; otherwise, returns false */ static isSupported(scene: Scene): boolean; } /** *
* A point is created and its initial properties are set by calling {@link PointPrimitiveCollection#add}. Do not call the constructor directly. *
* A graphical point positioned in the 3D scene, that is created * and rendered using a {@link PointPrimitiveCollection}. */ export class PointPrimitive { constructor(); /** * Determines if this point will be shown. Use this to hide or show a point, instead * of removing it and re-adding it to the collection. */ show: boolean; /** * Gets or sets the Cartesian position of this point. */ position: Cartesian3; /** * Gets or sets near and far scaling properties of a point based on the point's distance from the camera. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined, * scaleByDistance will be disabled. * @example * // Example 1. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the * // camera is 1500 meters from the pointPrimitive and disappear as * // the camera distance approaches 8.0e6 meters. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0); * @example * // Example 2. * // disable scaling by distance * p.scaleByDistance = undefined; */ scaleByDistance: NearFarScalar; /** * Gets or sets near and far translucency properties of a point based on the point's distance from the camera. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined, * translucencyByDistance will be disabled. * @example * // Example 1. * // Set a point's translucency to 1.0 when the * // camera is 1500 meters from the point and disappear as * // the camera distance approaches 8.0e6 meters. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); * @example * // Example 2. * // disable translucency by distance * p.translucencyByDistance = undefined; */ translucencyByDistance: NearFarScalar; /** * Gets or sets the inner size of the point in pixels. */ pixelSize: number; /** * Gets or sets the inner color of the point. * The red, green, blue, and alpha values are indicated by value's red, green, * blue, and alpha properties as shown in Example 1. These components range from 0.0 * (no intensity) to 1.0 (full intensity). * @example * // Example 1. Assign yellow. * p.color = Cesium.Color.YELLOW; * @example * // Example 2. Make a pointPrimitive 50% translucent. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); */ color: Color; /** * Gets or sets the outline color of the point. */ outlineColor: Color; /** * Gets or sets the outline width in pixels. This width adds to pixelSize, * increasing the total size of the point. */ outlineWidth: number; /** * Gets or sets the condition specifying at what distance from the camera that this point will be displayed. */ distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: number; /** * Gets or sets the user-defined value returned when the point is picked. */ id: any; /** * The {@link SplitDirection} to apply to this point. */ splitDirection: SplitDirection; /** * Computes the screen-space position of the point's origin. * The screen space origin is the top, left corner of the canvas; x increases from * left to right, and y increases from top to bottom. * @example * console.log(p.computeScreenSpacePosition(scene).toString()); * @param scene - The scene. * @param [result] - The object onto which to store the result. * @returns The screen-space position of the point. */ computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; /** * Determines if this point equals another point. Points are equal if all their properties * are equal. Points in different collections can be equal. * @param [other] - The point to compare for equality. * @returns true if the points are equal; otherwise, false. */ equals(other?: PointPrimitive): boolean; } /** * A renderable collection of points. *

* Points are added and removed from the collection using {@link PointPrimitiveCollection#add} * and {@link PointPrimitiveCollection#remove}. * @example * // Create a pointPrimitive collection with two points * const 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 * }); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. * @param [options.show = true] - Determines if the primitives in the collection will be shown. */ export class PointPrimitiveCollection { constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean; blendOption?: BlendOption; show?: boolean; }); /** * Determines if primitives in this collection will be shown. */ show: boolean; /** * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. * Local reference frames can be used by providing a different transformation matrix, like that returned * by {@link Transforms.eastNorthUpToFixedFrame}. * @example * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); * pointPrimitives.add({ * color : Cesium.Color.ORANGE, * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center * }); * pointPrimitives.add({ * color : Cesium.Color.YELLOW, * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east * }); * pointPrimitives.add({ * color : Cesium.Color.GREEN, * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north * }); * pointPrimitives.add({ * color : Cesium.Color.CYAN, * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up * }); */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * The point blending option. The default is used for rendering both opaque and translucent points. * However, if either all of the points are completely opaque or all are completely translucent, * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve * performance by up to 2x. */ blendOption: BlendOption; /** * Returns the number of points in this collection. This is commonly used with * {@link PointPrimitiveCollection#get} to iterate over all the points * in the collection. */ length: number; /** * Creates and adds a point with the specified initial properties to the collection. * The added point is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a point, specifying all the default values. * const p = pointPrimitives.add({ * show : true, * position : Cesium.Cartesian3.ZERO, * pixelSize : 10.0, * color : Cesium.Color.WHITE, * outlineColor : Cesium.Color.TRANSPARENT, * outlineWidth : 0.0, * id : undefined * }); * @example * // Example 2: Specify only the point's cartographic position. * const p = pointPrimitives.add({ * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) * }); * @param [options] - A template describing the point's properties as shown in Example 1. * @returns The point that was added to the collection. */ add(options?: any): PointPrimitive; /** * Removes a point from the collection. * @example * const p = pointPrimitives.add(...); * pointPrimitives.remove(p); // Returns true * @param pointPrimitive - The point to remove. * @returns true if the point was removed; false if the point was not found in the collection. */ remove(pointPrimitive: PointPrimitive): boolean; /** * Removes all points from the collection. * @example * pointPrimitives.add(...); * pointPrimitives.add(...); * pointPrimitives.removeAll(); */ removeAll(): void; /** * Check whether this collection contains a given point. * @param [pointPrimitive] - The point to check for. * @returns true if this collection contains the point, false otherwise. */ contains(pointPrimitive?: PointPrimitive): boolean; /** * Returns the point in the collection at the specified index. Indices are zero-based * and increase as points are added. Removing a point shifts all points after * it to the left, changing their indices. This function is commonly used with * {@link PointPrimitiveCollection#length} to iterate over all the points * in the collection. * @example * // Toggle the show property of every point in the collection * const len = pointPrimitives.length; * for (let i = 0; i < len; ++i) { * const p = pointPrimitives.get(i); * p.show = !p.show; * } * @param index - The zero-based index of the point. * @returns The point at the specified index. */ get(index: number): PointPrimitive; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * pointPrimitives = pointPrimitives && pointPrimitives.destroy(); */ destroy(): void; } /** *
* Create this by calling {@link PolylineCollection#add}. Do not call the constructor directly. *
* * A renderable polyline. */ export class Polyline { constructor(); /** * Determines if this polyline will be shown. Use this to hide or show a polyline, instead * of removing it and re-adding it to the collection. */ show: boolean; /** * Gets or sets the positions of the polyline. * @example * polyline.positions = Cesium.Cartesian3.fromDegreesArray([ * 0.0, 0.0, * 10.0, 0.0, * 0.0, 20.0 * ]); */ positions: Cartesian3[]; /** * Gets or sets the surface appearance of the polyline. This can be one of several built-in {@link Material} objects or a custom material, scripted with * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. */ material: Material; /** * Gets or sets the width of the polyline. */ width: number; /** * Gets or sets whether a line segment will be added between the first and last polyline positions. */ loop: boolean; /** * Gets or sets the user-defined value returned when the polyline is picked. */ id: any; /** * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed. */ distanceDisplayCondition: DistanceDisplayCondition; } /** * A renderable collection of polylines. *

*
*
* Example polylines *
*

* Polylines are added and removed from the collection using {@link PolylineCollection#add} * and {@link PolylineCollection#remove}. * @example * // Create a polyline collection with two polylines * const 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 * }); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.show = true] - Determines if the polylines in the collection will be shown. */ export class PolylineCollection { constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean; show?: boolean; }); /** * Determines if polylines in this collection will be shown. */ show: boolean; /** * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates. * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates. * Local reference frames can be used by providing a different transformation matrix, like that returned * by {@link Transforms.eastNorthUpToFixedFrame}. */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * Returns the number of polylines in this collection. This is commonly used with * {@link PolylineCollection#get} to iterate over all the polylines * in the collection. */ length: number; /** * Creates and adds a polyline with the specified initial properties to the collection. * The added polyline is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a polyline, specifying all the default values. * const p = polylines.add({ * show : true, * positions : ellipsoid.cartographicArrayToCartesianArray([ * Cesium.Cartographic.fromDegrees(-75.10, 39.57), * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]), * width : 1 * }); * @param [options] - A template describing the polyline's properties as shown in Example 1. * @returns The polyline that was added to the collection. */ add(options?: any): Polyline; /** * Removes a polyline from the collection. * @example * const p = polylines.add(...); * polylines.remove(p); // Returns true * @param polyline - The polyline to remove. * @returns true if the polyline was removed; false if the polyline was not found in the collection. */ remove(polyline: Polyline): boolean; /** * Removes all polylines from the collection. * @example * polylines.add(...); * polylines.add(...); * polylines.removeAll(); */ removeAll(): void; /** * Determines if this collection contains the specified polyline. * @param polyline - The polyline to check for. * @returns true if this collection contains the polyline, false otherwise. */ contains(polyline: Polyline): boolean; /** * Returns the polyline in the collection at the specified index. Indices are zero-based * and increase as polylines are added. Removing a polyline shifts all polylines after * it to the left, changing their indices. This function is commonly used with * {@link PolylineCollection#length} to iterate over all the polylines * in the collection. * @example * // Toggle the show property of every polyline in the collection * const len = polylines.length; * for (let i = 0; i < len; ++i) { * const p = polylines.get(i); * p.show = !p.show; * } * @param index - The zero-based index of the polyline. * @returns The polyline at the specified index. */ get(index: number): Polyline; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * polylines = polylines && polylines.destroy(); */ destroy(): void; } /** * An appearance for {@link GeometryInstance} instances with color attributes and * {@link PolylineGeometry} or {@link GroundPolylineGeometry}. * This allows several geometry instances, each with a different color, to * be drawn with the same {@link Primitive}. * @example * // A solid white line segment * const 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 * }) * }); * @param [options] - Object with the following properties: * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class PolylineColorAppearance { constructor(options?: { translucent?: boolean; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * This property is part of the {@link Appearance} interface, but is not * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used. */ material: Material; /** * When true, the geometry is expected to appear translucent so * {@link PolylineColorAppearance#renderState} has alpha blending enabled. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. *

* The render state can be explicitly defined when constructing a {@link PolylineColorAppearance} * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}. *

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so * {@link PolylineColorAppearance#renderState} has backface culling enabled. * This is always false for PolylineColorAppearance. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. * A geometry can have more vertex attributes and still be compatible - at a * potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances * are compatible with. This requires only a position attribute. */ static readonly VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } /** * An appearance for {@link PolylineGeometry} that supports shading with materials. * @example * const 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') * }) * }); * @param [options] - Object with the following properties: * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. * @param [options.material = Material.ColorType] - The material used to determine the fragment color. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. * @param [options.renderState] - Optional render state to override the default render state. */ export class PolylineMaterialAppearance { constructor(options?: { translucent?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }); /** * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance} * properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** * When true, the geometry is expected to appear translucent so * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. */ translucent: boolean; /** * The GLSL source code for the vertex shader. */ readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. *

* The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance} * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent} * and {@link PolylineMaterialAppearance#closed}. *

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so * {@link PolylineMaterialAppearance#renderState} has backface culling enabled. * This is always false for PolylineMaterialAppearance. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. * A geometry can have more vertex attributes and still be compatible - at a * potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances * are compatible with. This requires position and st attributes. */ static readonly VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance}, * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; /** * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}. * @returns true if the appearance is translucent. */ isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, * it can contain a subset of render state properties identical to the render state * created in the context. * @returns The render state. */ getRenderState(): any; } /** * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage. * @example * // Simple stage to change the color * const fs =` * uniform sampler2D colorTexture; * in vec2 v_textureCoordinates; * uniform float scale; * uniform vec3 offset; * void main() { * vec4 color = texture(colorTexture, v_textureCoordinates); * out_FragColor = vec4(color.rgb * scale + offset, 1.0); * }`; * scene.postProcessStages.add(new Cesium.PostProcessStage({ * fragmentShader : fs, * uniforms : { * scale : 1.1, * offset : function() { * return new Cesium.Cartesian3(0.1, 0.2, 0.3); * } * } * })); * @example * // Simple stage to change the color of what is selected. * // If czm_selected returns true, the current fragment belongs to geometry in the selected array. * const fs =` * uniform sampler2D colorTexture; * in vec2 v_textureCoordinates; * uniform vec4 highlight; * void main() { * vec4 color = texture(colorTexture, v_textureCoordinates); * if (czm_selected()) { * vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb; * out_FragColor = vec4(highlighted, 1.0); * } else { * out_FragColor = color; * } * }`; * const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({ * fragmentShader : fs, * uniforms : { * highlight : function() { * return new Cesium.Color(1.0, 0.0, 0.0, 0.5); * } * } * })); * stage.selected = [cesium3DTileFeature]; * @param options - An object with the following properties: * @param options.fragmentShader - The fragment shader to use. The default sampler2D uniforms are colorTexture and depthTexture. The color texture is the output of rendering the scene or the previous stage. The depth texture is the output from rendering the scene. The shader should contain one or both uniforms. There is also a vec2 varying named v_textureCoordinates that can be used to sample the textures. * @param [options.uniforms] - An object whose properties will be used to set the shaders uniforms. The properties can be constant values or a function. A constant value can also be a URI, data URI, or HTML element to use as a texture. * @param [options.textureScale = 1.0] - A number in the range (0.0, 1.0] used to scale the texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport. * @param [options.forcePowerOfTwo = false] - Whether or not to force the texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to. * @param [options.scissorRectangle] - The rectangle to use for the scissor test. * @param [options.name = createGuid()] - The unique name of this post-process stage for reference by other stages in a composite. If a name is not supplied, a GUID will be generated. */ export class PostProcessStage { constructor(options: { fragmentShader: string; uniforms?: any; textureScale?: number; forcePowerOfTwo?: boolean; sampleMode?: PostProcessStageSampleMode; pixelFormat?: PixelFormat; pixelDatatype?: PixelDatatype; clearColor?: Color; scissorRectangle?: BoundingRectangle; name?: string; }); /** * Whether or not to execute this post-process stage when ready. */ enabled: boolean; /** * Determines if this post-process stage is ready to be executed. A stage is only executed when both ready * and {@link PostProcessStage#enabled} are true. A stage will not be ready while it is waiting on textures * to load. */ readonly ready: boolean; /** * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}. */ readonly name: string; /** * The fragment shader to use when execute this post-process stage. *

* The shader must contain a sampler uniform declaration for colorTexture, depthTexture, * or both. *

*

* The shader must contain a vec2 varying declaration for v_textureCoordinates for sampling * the texture uniforms. *

*/ readonly fragmentShader: string; /** * An object whose properties are used to set the uniforms of the fragment shader. *

* The object property values can be either a constant or a function. The function will be called * each frame before the post-process stage is executed. *

*

* A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement. *

*

* If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name. *

*/ readonly uniforms: any; /** * A number in the range (0.0, 1.0] used to scale the output texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport. */ readonly textureScale: number; /** * Whether or not to force the output texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions. */ readonly forcePowerOfTwo: number; /** * How to sample the input color texture. */ readonly sampleMode: PostProcessStageSampleMode; /** * The color pixel format of the output texture. */ readonly pixelFormat: PixelFormat; /** * The pixel data type of the output texture. */ readonly pixelDatatype: PixelDatatype; /** * The color to clear the output texture to. */ readonly clearColor: Color; /** * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test. */ readonly scissorRectangle: BoundingRectangle; /** * The features selected for applying the post-process. *

* In the fragment shader, use czm_selected to determine whether or not to apply the post-process * stage to that fragment. For example: * * if (czm_selected(v_textureCoordinates)) { * // apply post-process stage * } else { * out_FragColor = texture(colorTexture, v_textureCoordinates); * } * *

*/ selected: any[]; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

*/ destroy(): void; } /** * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s. *

* The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered * to by the previous stage in the collection. *

*

* If the ambient occlusion or bloom stages are enabled, they will execute before all other stages. *

*

* If the FXAA stage is enabled, it will execute after all other stages. *

*/ export class PostProcessStageCollection { constructor(); /** * Determines if all of the post-process stages in the collection are ready to be executed. */ readonly ready: boolean; /** * A post-process stage for Fast Approximate Anti-aliasing. *

* When enabled, this stage will execute after all others. *

*/ readonly fxaa: PostProcessStage; /** * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture. *

* Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the * surface receives light and regardless of the light's position. *

*

* The uniforms have the following properties: *

    *
  • intensity is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is 3.0.
  • *
  • bias is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is 0.1.
  • *
  • lengthCap is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value, * sampling stops in the current direction. The default value is 0.26.
  • *
  • directionCount is the number of directions along which the ray marching will search for occluders. The default value is 8.
  • *
  • stepCount is the number of steps the ray marching will take along each direction. The default value is 32.
  • *
  • randomTexture is a texture where the red channel is a random value in [0.0, 1.0]. The default value is undefined. This texture needs to be set.
  • *
  • ambientOcclusionOnly is a boolean value. When true, only the shadows generated are written to the output. When false, the input texture is modulated * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is false.
  • *
*

* When enabled, this stage will execute before all others. *

*/ readonly ambientOcclusion: PostProcessStageComposite; /** * A post-process stage for a bloom effect. *

* A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker. *

*

* This stage has the following uniforms: contrast, brightness, glowOnly, * delta, sigma, and stepSize. *

*
    *
  • contrast is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is 128.0.
  • * *
  • brightness is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is * added to the brightness. The default value is -0.3.
  • * *
  • glowOnly is a boolean value. When true, only the glow effect will be shown. When false, the glow will be added to the input texture. * The default value is false. This is a debug option for viewing the effects when changing the other uniform values.
  • *
*

* delta, sigma, and stepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. * The blur is applied to the shadows generated from the image to make them smoother. *

*

* When enabled, this stage will execute before all others. *

*/ readonly bloom: PostProcessStageComposite; /** * The number of post-process stages in this collection. */ readonly length: number; /** * Specifies the tonemapping algorithm used when rendering with high dynamic range. * {@link https://sandcastle.cesium.com/?id=high-dynamic-range|Sandcastle Demo} * @example * viewer.scene.postProcessStages.tonemapper = Cesium.Tonemapper.ACES; */ tonemapper: Tonemapper; /** * Control the exposure when HDR is on. Less than 1.0 makes the tonemapping darker while greater than 1.0 makes it brighter. * @example * viewer.scene.postProcessStages.exposure = 1.0; */ exposure: number; /** * Adds the post-process stage to the collection. * @param stage - The post-process stage to add to the collection. * @returns The post-process stage that was added to the collection. */ add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite; /** * Removes a post-process stage from the collection and destroys it. * @param stage - The post-process stage to remove from the collection. * @returns Whether the post-process stage was removed. */ remove(stage: PostProcessStage | PostProcessStageComposite): boolean; /** * Returns whether the collection contains a post-process stage. * @param stage - The post-process stage. * @returns Whether the collection contains the post-process stage. */ contains(stage: PostProcessStage | PostProcessStageComposite): boolean; /** * Gets the post-process stage at index. * @param index - The index of the post-process stage. * @returns The post-process stage at index. */ get(index: number): PostProcessStage | PostProcessStageComposite; /** * Removes all post-process stages from the collection and destroys them. */ removeAll(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

*/ destroy(): void; } /** * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically. *

* All stages are executed in the order of the array. The input texture changes based on the value of inputPreviousStageTexture. * If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. * If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene * or the output texture of the previous stage. *

* @example * // Example 1: separable blur filter * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage. * // The input to blurYDirection is the texture rendered to by blurXDirection. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ * stages : [blurXDirection, blurYDirection] * })); * @example * // Example 2: referencing the output of another post-process stage * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ * inputPreviousStageTexture : false, * stages : [ * // The same as Example 1. * new Cesium.PostProcessStageComposite({ * inputPreviousStageTexture : true * stages : [blurXDirection, blurYDirection], * name : 'blur' * }), * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false * new Cesium.PostProcessStage({ * fragmentShader : compositeShader, * uniforms : { * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to). * } * }) * ] * }); * @example * // Example 3: create a uniform alias * const uniforms = {}; * Cesium.defineProperties(uniforms, { * filterSize : { * get : function() { * return blurXDirection.uniforms.filterSize; * }, * set : function(value) { * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value; * } * } * }); * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ * stages : [blurXDirection, blurYDirection], * uniforms : uniforms * })); * @param options - An object with the following properties: * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order. * @param [options.inputPreviousStageTexture = true] - Whether to execute each post-process stage where the input to one stage is the output of the previous. Otherwise, the input to each contained stage is the output of the stage that executed before the composite. * @param [options.name = createGuid()] - The unique name of this post-process stage for reference by other composites. If a name is not supplied, a GUID will be generated. * @param [options.uniforms] - An alias to the uniforms of post-process stages. */ export class PostProcessStageComposite { constructor(options: { stages: any[]; inputPreviousStageTexture?: boolean; name?: string; uniforms?: any; }); /** * Determines if this post-process stage is ready to be executed. */ readonly ready: boolean; /** * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite. */ readonly name: string; /** * Whether or not to execute this post-process stage when ready. */ enabled: boolean; /** * An alias to the uniform values of the post-process stages. May be undefined; in which case, get each stage to set uniform values. */ uniforms: any; /** * All post-process stages are executed in the order of the array. The input texture changes based on the value of inputPreviousStageTexture. * If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. * If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene * or the output texture of the previous stage. */ readonly inputPreviousStageTexture: boolean; /** * The number of post-process stages in this composite. */ readonly length: number; /** * The features selected for applying the post-process. */ selected: any[]; /** * Gets the post-process stage at index * @param index - The index of the post-process stage or composite. * @returns The post-process stage or composite at index. */ get(index: number): PostProcessStage | PostProcessStageComposite; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

*/ destroy(): void; } /** * Contains functions for creating common post-process stages. */ export namespace PostProcessStageLibrary { /** * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage. *

* This stage has the following uniforms: delta, sigma, and stepSize. *

*

* delta and sigma are used to compute the weights of a Gaussian filter. The equation is exp((-0.5 * delta * delta) / (sigma * sigma)). * The default value for delta is 1.0. The default value for sigma is 2.0. * stepSize is the distance to the next texel. The default is 1.0. *

* @returns A post-process stage that applies a Gaussian blur to the input texture. */ function createBlurStage(): PostProcessStageComposite; /** * Creates a post-process stage that applies a depth of field effect. *

* Depth of field simulates camera focus. Objects in the scene that are in focus * will be clear whereas objects not in focus will be blurred. *

*

* This stage has the following uniforms: focalDistance, delta, sigma, and stepSize. *

*

* focalDistance is the distance in meters from the camera to set the camera focus. *

*

* delta, sigma, and stepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. * The blur is applied to the areas out of focus. *

* @returns A post-process stage that applies a depth of field effect. */ function createDepthOfFieldStage(): PostProcessStageComposite; /** * Whether or not a depth of field stage is supported. *

* This stage requires the WEBGL_depth_texture extension. *

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isDepthOfFieldSupported(scene: Scene): boolean; /** * Creates a post-process stage that detects edges. *

* Writes the color to the output texture with alpha set to 1.0 when it is on an edge. *

*

* This stage has the following uniforms: color and length *

*
    *
  • color is the color of the highlighted edge. The default is {@link Color#BLACK}.
  • *
  • length is the length of the edges in pixels. The default is 0.5.
  • *
*

* This stage is not supported in 2D. *

* @example * // multiple silhouette effects * const yellowEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); * yellowEdge.uniforms.color = Cesium.Color.YELLOW; * yellowEdge.selected = [feature0]; * * const greenEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); * greenEdge.uniforms.color = Cesium.Color.LIME; * greenEdge.selected = [feature1]; * * // draw edges around feature0 and feature1 * postProcessStages.add(Cesium.PostProcessStageLibrary.createSilhouetteStage([yellowEdge, greenEdge]); * @returns A post-process stage that applies an edge detection effect. */ function createEdgeDetectionStage(): PostProcessStage; /** * Whether or not an edge detection stage is supported. *

* This stage requires the WEBGL_depth_texture extension. *

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isEdgeDetectionSupported(scene: Scene): boolean; /** * Creates a post-process stage that applies a silhouette effect. *

* A silhouette effect composites the color from the edge detection pass with input color texture. *

*

* This stage has the following uniforms when edgeDetectionStages is undefined: color and length *

*

* color is the color of the highlighted edge. The default is {@link Color#BLACK}. * length is the length of the edges in pixels. The default is 0.5. *

* @param [edgeDetectionStages] - An array of edge detection post process stages. * @returns A post-process stage that applies a silhouette effect. */ function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite; /** * Whether or not a silhouette stage is supported. *

* This stage requires the WEBGL_depth_texture extension. *

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isSilhouetteSupported(scene: Scene): boolean; /** * Whether or not an ambient occlusion stage is supported. *

* This stage requires the WEBGL_depth_texture extension. *

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isAmbientOcclusionSupported(scene: Scene): boolean; /** * Creates a post-process stage that renders the input texture with black and white gradations. *

* This stage has one uniform value, gradations, which scales the luminance of each pixel. *

* @returns A post-process stage that renders the input texture with black and white gradations. */ function createBlackAndWhiteStage(): PostProcessStage; /** * Creates a post-process stage that saturates the input texture. *

* This stage has one uniform value, brightness, which scales the saturation of each pixel. *

* @returns A post-process stage that saturates the input texture. */ function createBrightnessStage(): PostProcessStage; /** * Creates a post-process stage that adds a night vision effect to the input texture. * @returns A post-process stage that adds a night vision effect to the input texture. */ function createNightVisionStage(): PostProcessStage; /** * Creates a post-process stage that applies an effect simulating light flaring a camera lens. *

* This stage has the following uniforms: dirtTexture, starTexture, intensity, distortion, ghostDispersal, * haloWidth, dirtAmount, and earthRadius. *

    *
  • dirtTexture is a texture sampled to simulate dirt on the lens.
  • *
  • starTexture is the texture sampled for the star pattern of the flare.
  • *
  • intensity is a scalar multiplied by the result of the lens flare. The default value is 2.0.
  • *
  • distortion is a scalar value that affects the chromatic effect distortion. The default value is 10.0.
  • *
  • ghostDispersal is a scalar indicating how far the halo effect is from the center of the texture. The default value is 0.4.
  • *
  • haloWidth is a scalar representing the width of the halo from the ghost dispersal. The default value is 0.4.
  • *
  • dirtAmount is a scalar representing the amount of dirt on the lens. The default value is 0.4.
  • *
  • earthRadius is the maximum radius of the earth. The default value is Ellipsoid.WGS84.maximumRadius.
  • *
*

* @returns A post-process stage for applying a lens flare effect. */ function createLensFlareStage(): PostProcessStage; } /** * Determines how input texture to a {@link PostProcessStage} is sampled. */ export enum PostProcessStageSampleMode { /** * Samples the texture by returning the closest texel. */ NEAREST = 0, /** * Samples the texture through bi-linear interpolation of the four nearest texels. */ LINEAR = 1 } /** * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link 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 {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2. *

* A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including * {@link Material} and {@link 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; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color. *

*

* {@link 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. *

* @example * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern * const 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') * }) * })); * @example * // 2. Draw different instances each with a unique color * const 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) * } * }); * const 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() * })); * @example * // 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(), * asynchronous : false * })); * @param [options] - Object with the following properties: * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render. * @param [options.appearance] - The appearance used to render the primitive. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test. * @param [options.show = true] - Determines if this primitive will be shown. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates. * @param [options.vertexCacheOptimize = false] - When true, geometry vertices are optimized for the pre and post-vertex-shader caches. * @param [options.interleave = false] - When true, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. * @param [options.compressVertices = true] - When true, the geometry vertices are compressed, which will save memory. * @param [options.releaseGeometryInstances = true] - When true, the primitive does not keep a reference to the input geometryInstances to save memory. * @param [options.allowPicking = true] - When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. * @param [options.cull = true] - When true, the renderer frustum culls and horizon culls the primitive's commands based on their bounding volume. Set this to false for a small performance gain if you are manually culling the primitive. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources. */ export class Primitive { constructor(options?: { geometryInstances?: GeometryInstance[] | GeometryInstance; appearance?: Appearance; depthFailAppearance?: Appearance; show?: boolean; modelMatrix?: Matrix4; vertexCacheOptimize?: boolean; interleave?: boolean; compressVertices?: boolean; releaseGeometryInstances?: boolean; allowPicking?: boolean; cull?: boolean; asynchronous?: boolean; debugShowBoundingVolume?: boolean; shadows?: ShadowMode; }); /** * The geometry instances rendered with this primitive. This may * be undefined if options.releaseGeometryInstances * is true when the primitive is constructed. *

* Changing this property after the primitive is rendered has no effect. *

*/ readonly geometryInstances: GeometryInstance[] | GeometryInstance; /** * The {@link Appearance} used to shade this primitive. Each geometry * instance is shaded with the same appearance. Some appearances, like * {@link PerInstanceColorAppearance} allow giving each instance unique * properties. */ appearance: Appearance; /** * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry * instance is shaded with the same appearance. Some appearances, like * {@link PerInstanceColorAppearance} allow giving each instance unique * properties. * *

* When using an appearance that requires a color attribute, like PerInstanceColorAppearance, * add a depthFailColor per-instance attribute instead. *

* *

* Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, * there may be artifacts. *

*/ depthFailAppearance: Appearance; /** * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates. * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates. * Local reference frames can be used by providing a different transformation matrix, like that returned * by {@link Transforms.eastNorthUpToFixedFrame}. * *

* This property is only supported in 3D mode. *

* @example * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ modelMatrix: Matrix4; /** * Determines if the primitive will be shown. This affects all geometry * instances in the primitive. */ show: boolean; /** * When true, the renderer frustum culls and horizon culls the primitive's commands * based on their bounding volume. Set this to false for a small performance gain * if you are manually culling the primitive. */ cull: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. *

* Draws the bounding sphere for each draw command in the primitive. *

*/ debugShowBoundingVolume: boolean; /** * Determines whether this primitive casts or receives shadows from light sources. */ shadows: ShadowMode; /** * When true, geometry vertices are optimized for the pre and post-vertex-shader caches. */ readonly vertexCacheOptimize: boolean; /** * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. */ readonly interleave: boolean; /** * When true, the primitive does not keep a reference to the input geometryInstances to save memory. */ readonly releaseGeometryInstances: boolean; /** * When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. * */ readonly allowPicking: boolean; /** * Determines if the geometry instances will be created and batched on a web worker. */ readonly asynchronous: boolean; /** * When true, geometry vertices are compressed, which will save memory. */ readonly compressVertices: boolean; /** * Determines if the primitive is complete and ready to render. If this property is * true, the primitive will be rendered the next time that {@link Primitive#update} * is called. * @example * // Wait for a primitive to become ready before accessing attributes * const removeListener = scene.postRender.addEventListener(() => { * if (!frustumPrimitive.ready) { * return; * } * * const attributes = primitive.getGeometryInstanceAttributes('an id'); * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); * * removeListener(); * }); */ readonly ready: boolean; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * const attributes = primitive.getGeometryInstanceAttributes('an id'); * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0); * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. *

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. *

* @example * e = e && e.destroy(); */ destroy(): void; } /** * A collection of primitives. This is most often used with {@link Scene#primitives}, * but PrimitiveCollection is also a primitive itself so collections can * be added to collections forming a hierarchy. * @example * const billboards = new Cesium.BillboardCollection(); * const labels = new Cesium.LabelCollection(); * * const collection = new Cesium.PrimitiveCollection(); * collection.add(billboards); * * scene.primitives.add(collection); // Add collection * scene.primitives.add(labels); // Add regular primitive * @param [options] - Object with the following properties: * @param [options.show = true] - Determines if the primitives in the collection will be shown. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed. */ export class PrimitiveCollection { constructor(options?: { show?: boolean; destroyPrimitives?: boolean; }); /** * Determines if primitives in this collection will be shown. */ show: boolean; /** * Determines if primitives in the collection are destroyed when they are removed by * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly * by {@link PrimitiveCollection#removeAll}. * @example * // Example 1. Primitives are destroyed by default. * const primitives = new Cesium.PrimitiveCollection(); * const labels = primitives.add(new Cesium.LabelCollection()); * primitives = primitives.destroy(); * const b = labels.isDestroyed(); // true * @example * // Example 2. Do not destroy primitives in a collection. * const primitives = new Cesium.PrimitiveCollection(); * primitives.destroyPrimitives = false; * const labels = primitives.add(new Cesium.LabelCollection()); * primitives = primitives.destroy(); * const b = labels.isDestroyed(); // false * labels = labels.destroy(); // explicitly destroy */ destroyPrimitives: boolean; /** * Gets the number of primitives in the collection. */ readonly length: number; /** * An event that is raised when a primitive is added to the collection. * Event handlers are passed the primitive that was added. */ readonly primitiveAdded: Event; /** * An event that is raised when a primitive is removed from the collection. * Event handlers are passed the primitive that was removed. *

* Note: Depending on the destroyPrimitives constructor option, the primitive may already be destroyed. *

*/ readonly primitiveRemoved: Event; /** * Adds a primitive to the collection. * @example * const billboards = scene.primitives.add(new Cesium.BillboardCollection()); * @param primitive - The primitive to add. * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives. * @returns The primitive added to the collection. */ add(primitive: T, index?: number): T; /** * Removes a primitive from the collection. * @example * const billboards = scene.primitives.add(new Cesium.BillboardCollection()); * scene.primitives.remove(billboards); // Returns true * @param [primitive] - The primitive to remove. * @returns true if the primitive was removed; false if the primitive is undefined or was not found in the collection. */ remove(primitive?: any): boolean; /** * Removes all primitives in the collection. */ removeAll(): void; /** * Determines if this collection contains a primitive. * @param [primitive] - The primitive to check for. * @returns true if the primitive is in the collection; false if the primitive is undefined or was not found in the collection. */ contains(primitive?: any): boolean; /** * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn * on the globe surface, this visually moves the primitive up one. * @param [primitive] - The primitive to raise. */ raise(primitive?: any): void; /** * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn * on the globe surface, this visually moves the primitive to the top. * @param [primitive] - The primitive to raise the top. */ raiseToTop(primitive?: any): void; /** * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn * on the globe surface, this visually moves the primitive down one. * @param [primitive] - The primitive to lower. */ lower(primitive?: any): void; /** * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn * on the globe surface, this visually moves the primitive to the bottom. * @param [primitive] - The primitive to lower to the bottom. */ lowerToBottom(primitive?: any): void; /** * Returns the primitive in the collection at the specified index. * @example * // Toggle the show property of every primitive in the collection. * const primitives = scene.primitives; * const length = primitives.length; * for (let i = 0; i < length; ++i) { * const p = primitives.get(i); * p.show = !p.show; * } * @param index - The zero-based index of the primitive to return. * @returns The primitive at the index. */ get(index: number): any; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this * collection allows for deterministic release of WebGL resources, instead of relying on the garbage * collector to destroy this collection. *

* Since destroying a collection destroys all the contained primitives, only destroy a collection * when you are sure no other code is still using any of the contained primitives. *

* Once this collection is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * primitives = primitives && primitives.destroy(); */ destroy(): void; } /** * Cache for resources shared across 3D Tiles and glTF. */ export namespace ResourceCache { /** * Statistics about binary data stored in the resource cache. */ var statistics: ResourceCacheStatistics; } /** * Statistics for the GPU and CPU memory used by the models loaded through the * {@link ResourceCache}. */ export class ResourceCacheStatistics { constructor(); } /** * 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 {@link CesiumWidget}. * @example * // Create scene without anisotropic texture filtering * const scene = new Cesium.Scene({ * canvas : canvas, * contextOptions : { * allowTextureFilterAnisotropic : false * } * }); * @param options - Object with the following properties: * @param options.canvas - The HTML canvas element to create the scene for. * @param [options.contextOptions] - Context and WebGL creation properties. * @param [options.creditContainer] - The HTML element in which the credits will be displayed. If not specified, a credit container will be created and added as a sibling of the canvas. * @param [options.creditViewport] - The HTML element in which to display the credit popup. If not specified, the viewport will be added as a sibling of the canvas. * @param [options.ellipsoid = Ellipsoid.default] - The default ellipsoid. If not specified, the default ellipsoid is used. * @param [options.mapProjection = new GeographicProjection(options.ellipsoid)] - The map projection to use in 2D and Columbus View modes. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View. * @param [options.shadows = false] - Determines if shadows are cast by light sources. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. * @param [options.requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. * @param [options.depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation. * @param [options.msaaSamples = 4] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets. Set to 1 to disable MSAA. */ export class Scene { constructor(options: { canvas: HTMLCanvasElement; contextOptions?: ContextOptions; creditContainer?: Element; creditViewport?: Element; ellipsoid?: Ellipsoid; mapProjection?: MapProjection; orderIndependentTranslucency?: boolean; scene3DOnly?: boolean; shadows?: boolean; mapMode2D?: MapMode2D; requestRenderMode?: boolean; maximumRenderTimeChange?: number; depthPlaneEllipsoidOffset?: number; msaaSamples?: number; }); /** * Exceptions occurring in render are always caught in order to raise the * renderError event. If this property is true, the error is rethrown * after the event is raised. If this property is false, the render function * returns normally after raising the event. */ rethrowRenderErrors: boolean; /** * Determines whether or not to instantly complete the * scene transition animation on user input. */ completeMorphOnUserInput: boolean; /** * The event fired at the beginning of a scene transition. */ morphStart: Event; /** * The event fired at the completion of a scene transition. */ morphComplete: Event; /** * The {@link SkyBox} used to draw the stars. */ skyBox: SkyBox | undefined; /** * The sky atmosphere drawn around the globe. */ skyAtmosphere: SkyAtmosphere | undefined; /** * The {@link Sun}. */ sun: Sun | undefined; /** * Uses a bloom filter on the sun when enabled. */ sunBloom: boolean; /** * The {@link Moon} */ moon: Moon | undefined; /** * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined. */ backgroundColor: Color; /** * The current morph transition time between 2D/Columbus View and 3D, * with 0.0 being 2D or Columbus View and 1.0 being 3D. */ morphTime: number; /** * The far-to-near ratio of the multi-frustum when using a normal depth buffer. *

* This value is used to create the near and far values for each frustum of the multi-frustum. It is only used * when {@link Scene#logarithmicDepthBuffer} is false. When logarithmicDepthBuffer is * true, use {@link Scene#logarithmicDepthFarToNearRatio}. *

*/ farToNearRatio: number; /** * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer. *

* This value is used to create the near and far values for each frustum of the multi-frustum. It is only used * when {@link Scene#logarithmicDepthBuffer} is true. When logarithmicDepthBuffer is * false, use {@link Scene#farToNearRatio}. *

*/ logarithmicDepthFarToNearRatio: number; /** * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface. */ nearToFarDistance2D: number; /** * The vertical exaggeration of the scene. * When set to 1.0, no exaggeration is applied. */ verticalExaggeration: number; /** * The reference height for vertical exaggeration of the scene. * When set to 0.0, the exaggeration is applied relative to the ellipsoid surface. */ verticalExaggerationRelativeHeight: number; /** * This property is for debugging only; it is not for production use. *

* A function that determines what commands are executed. As shown in the examples below, * the function receives the command's owner as an argument, and returns a boolean indicating if the * command should be executed. *

*

* The default is undefined, indicating that all commands are executed. *

* @example * // Do not execute any commands. * scene.debugCommandFilter = function(command) { * return false; * }; * * // Execute only the billboard's commands. That is, only draw the billboard. * const billboards = new Cesium.BillboardCollection(); * scene.debugCommandFilter = function(command) { * return command.owner === billboards; * }; */ debugCommandFilter: ((...params: any[]) => any) | undefined; /** * This property is for debugging only; it is not for production use. *

* When true, commands are randomly shaded. This is useful * for performance analysis to see what parts of a scene or model are * command-dense and could benefit from batching. *

*/ debugShowCommands: boolean; /** * This property is for debugging only; it is not for production use. *

* When true, commands are shaded based on the frustums they * overlap. Commands in the closest frustum are tinted red, commands in * the next closest are green, and commands in the farthest frustum are * blue. If a command overlaps more than one frustum, the color components * are combined, e.g., a command overlapping the first two frustums is tinted * yellow. *

*/ debugShowFrustums: boolean; /** * This property is for debugging only; it is not for production use. *

* Displays frames per second and time between frames. *

*/ debugShowFramesPerSecond: boolean; /** * This property is for debugging only; it is not for production use. *

* Indicates which frustum will have depth information displayed. *

*/ debugShowDepthFrustum: number; /** * This property is for debugging only; it is not for production use. *

* When true, draws outlines to show the boundaries of the camera frustums *

*/ debugShowFrustumPlanes: boolean; /** * When true, enables picking using the depth buffer. */ useDepthPicking: boolean; /** * When true, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work. * *

* There is a decrease in performance when enabled. There are extra draw calls to write depth for * translucent geometry. *

* @example * // picking the position of a translucent primitive * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { * const pickedFeature = viewer.scene.pick(movement.position); * if (!Cesium.defined(pickedFeature)) { * // nothing picked * return; * } * const worldPosition = viewer.scene.pickPosition(movement.position); * }, Cesium.ScreenSpaceEventType.LEFT_CLICK); */ pickTranslucentDepth: boolean; /** * Settings for atmosphere lighting effects affecting 3D Tiles and model rendering. This is not to be confused with * {@link Scene#skyAtmosphere} which is responsible for rendering the sky. */ atmosphere: Atmosphere; /** * 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. * * Disbaled by default if an ellipsoid other than WGS84 is used. */ fog: Fog; /** * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows. */ shadowMap: ShadowMap; /** * When false, 3D Tiles will render normally. When true, classified 3D Tile geometry will render normally and * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}. */ invertClassification: boolean; /** * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is true. *

When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.

*

Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.

*/ invertClassificationColor: Color; /** * The focal length for use when with cardboard or WebVR. */ focalLength: number; /** * The eye separation distance in meters for use with cardboard or WebVR. */ eyeSeparation: number; /** * Post processing effects applied to the final render. */ postProcessStages: PostProcessStageCollection; /** * When true, rendering a frame will only occur when needed as determined by changes within the scene. * Enabling improves performance of the application, but requires using {@link Scene#requestRender} * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes * to the scene in other parts of the API. */ requestRenderMode: boolean; /** * If {@link Scene#requestRenderMode} is true, this value defines the maximum change in * simulation time allowed before a render is requested. Lower values increase the number of frames rendered * and higher values decrease the number of frames rendered. If undefined, changes to * the simulation time will never request a render. * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates, * and animations. */ maximumRenderTimeChange: number; /** * The spherical harmonic coefficients for image-based lighting of PBR models. */ sphericalHarmonicCoefficients: Cartesian3[]; /** * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models. */ specularEnvironmentMaps: string; /** * The light source for shading. Defaults to a directional light from the Sun. */ light: Light; /** * Whether or not to enable edge visibility rendering for 3D tiles. * When enabled, creates a framebuffer with multiple render targets * for advanced edge detection and visibility techniques. */ _enableEdgeVisibility: boolean; /** * Use this to set the default value for {@link Scene#logarithmicDepthBuffer} in newly constructed Scenes * This property relies on fragmentDepth being supported. */ static defaultLogDepthBuffer: any; /** * Gets the canvas element to which this scene is bound. */ readonly canvas: HTMLCanvasElement; /** * The drawingBufferHeight of the underlying GL context. */ readonly drawingBufferHeight: number; /** * The drawingBufferWidth of the underlying GL context. */ readonly drawingBufferWidth: number; /** * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one. */ readonly maximumAliasedLineWidth: number; /** * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16. */ readonly maximumCubeMapSize: number; /** * Returns true if the {@link Scene#pickPosition} function is supported. */ readonly pickPositionSupported: boolean; /** * Returns true if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported. */ readonly sampleHeightSupported: boolean; /** * Returns true if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported. */ readonly clampToHeightSupported: boolean; /** * Returns true if the {@link Scene#invertClassification} is supported. */ readonly invertClassificationSupported: boolean; /** * Returns true if specular environment maps are supported. */ readonly specularEnvironmentMapsSupported: boolean; /** * The ellipsoid. If not specified, the default ellipsoid is used. */ readonly ellipsoid: Ellipsoid; /** * Gets or sets the depth-test ellipsoid. */ globe: Globe; /** * Gets the collection of primitives. */ readonly primitives: PrimitiveCollection; /** * Gets the collection of ground primitives. */ readonly groundPrimitives: PrimitiveCollection; /** * Gets or sets the camera. */ readonly camera: Camera; /** * Collects an array of Controller objects that can be registered with the scene to handle input events, camera animations, and other interactions. * @example * scene.screenSpaceCameraController.enableInputs = false; * scene.screenSpaceCameraController.enableCollisionDetection = false; * * const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController(); * scene.controllerHost.registerController(tiltOrbitController, scene.canvas.parentNode); */ readonly controllerHost: ControllerHost; /** * Gets the controller for camera input handling. */ readonly screenSpaceCameraController: ScreenSpaceCameraController; /** * Get the map projection to use in 2D and Columbus View modes. */ readonly mapProjection: MapProjection; /** * Gets the collection of image layers that will be rendered on the globe. */ readonly imageryLayers: ImageryLayerCollection; /** * The terrain provider providing surface geometry for the globe. */ terrainProvider: TerrainProvider; /** * Gets an event that's raised when the terrain provider is changed */ readonly terrainProviderChanged: Event; /** * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event * receive the Scene instance as the first parameter and the current time as the second parameter. */ readonly preUpdate: Event; /** * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second * parameter. */ readonly postUpdate: Event; /** * Gets the event that will be raised when an error is thrown inside the render function. * The Scene instance and the thrown error are the only two parameters passed to the event handler. * By default, errors are not rethrown after this event is raised, but that can be changed by setting * the rethrowRenderErrors property. */ readonly renderError: Event; /** * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second * parameter. */ readonly preRender: Event; /** * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event * receive the Scene instance as the first parameter and the current time as the second parameter. */ readonly postRender: Event; /** * Gets the simulation time when the scene was last rendered. Returns undefined * if the scene has not yet been rendered. */ readonly lastRenderTime: JulianDate | undefined; /** * This property is for debugging only; it is not for production use. *

* When {@link Scene.debugShowFrustums} is true, this contains * properties with statistics about the number of command execute per frustum. * totalCommands is the total number of commands executed, ignoring * overlap. commandsInFrustums is an array with the number of times * commands are executed redundantly, e.g., how many commands overlap two or * three frustums. *

*/ readonly debugFrustumStatistics: any | undefined; /** * Gets whether or not the scene is optimized for 3D only viewing. */ readonly scene3DOnly: boolean; /** * Gets whether or not the scene has order independent translucency enabled. * Note that this only reflects the original construction option, and there are * other factors that could prevent OIT from functioning on a given system configuration. */ readonly orderIndependentTranslucency: boolean; /** * Gets the unique identifier for this scene. */ readonly id: string; /** * Gets or sets the current mode of the scene. */ mode: SceneMode; /** * When true, splits the scene into two viewports with steroscopic views for the left and right eyes. * Used for cardboard and WebVR. */ useWebVR: boolean; /** * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. */ readonly mapMode2D: MapMode2D; /** * Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0. */ splitPosition: number; /** * The distance from the camera at which to disable the depth test of billboards, labels and points * to, for example, prevent clipping against terrain. When set to zero, the depth test should always * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance * property of a billboard, label or point will override this value. */ minimumDisableDepthTestDistance: number; /** * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum, * increasing performance. This property relies on fragmentDepth being supported. */ logarithmicDepthBuffer: boolean; /** * The value used for gamma correction. This is only used when rendering with high dynamic range. */ gamma: number; /** * Whether or not to use high dynamic range rendering. */ highDynamicRange: boolean; /** * Whether or not high dynamic range rendering is supported. */ readonly highDynamicRangeSupported: boolean; /** * Whether or not the camera is underneath the globe. */ readonly cameraUnderground: boolean; /** * The sample rate of multisample antialiasing (values greater than 1 enable MSAA). */ msaaSamples: number; /** * Returns true if the Scene's context supports MSAA. */ readonly msaaSupported: boolean; /** * Determines if a compressed texture format is supported. * @param format - The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc. * @returns Whether or not the format is supported. */ getCompressedTextureFormatSupported(format: string): boolean; /** * Update and render the scene. It is usually not necessary to call this function * directly because {@link CesiumWidget} will do it automatically. * @param [time] - The simulation time at which to render. */ render(time?: JulianDate): void; /** * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to true. * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}. */ requestRender(): void; /** * Returns an object with a primitive property that contains the first (top) primitive in the scene * at a particular window coordinate or undefined if nothing is at the location. Other properties may * potentially be set depending on the type of primitive and may be used to further identify the picked object. *

* When a feature of a 3D Tiles tileset is picked, pick returns a {@link Cesium3DTileFeature} object. *

* @example * // On mouse over, color the feature yellow. * handler.setInputAction(function(movement) { * const feature = scene.pick(movement.endPosition); * if (feature instanceof Cesium.Cesium3DTileFeature) { * feature.color = Cesium.Color.YELLOW; * } * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param windowPosition - Window coordinates to perform picking on. * @param [width = 3] - Width of the pick rectangle. * @param [height = 3] - Height of the pick rectangle. * @returns Object containing the picked primitive or undefined if nothing is at the location. */ pick(windowPosition: Cartesian2, width?: number, height?: number): any | undefined; /** * Returns the best snap target in a screen-space region around windowPosition. * Edges are preferred over surfaces; among hits of the same kind the one * nearest the cursor wins. Returns undefined if the region contains * no snappable geometry. *

* Only primitives rendered through the Model pipeline (e.g. 3D Tiles and glTF * models) are snappable. Snapping requires float color attachments * (WebGL2 with EXT_color_buffer_float); if unsupported, this * function returns undefined. *

* @param windowPosition - Window coordinates at the center of the search region. * @param [options] - Object with the following properties: * @param [options.width = 25] - Width of the search region in pixels. * @param [options.height = options.width] - Height of the search region in pixels. * @returns The best snap target in the region, or undefined if there is none. */ snap(windowPosition: Cartesian2, options?: { width?: number; height?: number; }): SceneSnapResult | undefined; /** * Performs the same operation as Scene.pick but asynchonosly without blocking the main render thread. * Requires WebGL2 else using fallback. * @example * // On mouse over, color the feature yellow. * handler.setInputAction(function(movement) { * const feature = scene.pickAsync(movement.endPosition).then(function(feature) { * if (feature instanceof Cesium.Cesium3DTileFeature) { * feature.color = Cesium.Color.YELLOW; * } * }); * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param windowPosition - Window coordinates to perform picking on. * @param [width = 3] - Width of the pick rectangle. * @param [height = 3] - Height of the pick rectangle. * @returns Object containing the picked primitive or undefined if nothing is at the location. */ pickAsync(windowPosition: Cartesian2, width?: number, height?: number): Promise; /** * Returns a {@link VoxelCell} for the voxel sample rendered at a particular window coordinate, * or undefined if no voxel is rendered at that position. * @example * On left click, report the value of the "color" property at that voxel sample. * handler.setInputAction(function(movement) { * const voxelCell = scene.pickVoxel(movement.position); * if (defined(voxelCell)) { * console.log(voxelCell.getProperty("color")); * } * }, Cesium.ScreenSpaceEventType.LEFT_CLICK); * @param windowPosition - Window coordinates to perform picking on. * @param [width = 3] - Width of the pick rectangle. * @param [height = 3] - Height of the pick rectangle. * @returns Information about the voxel cell rendered at the picked position or undefined if no voxel is rendered at that position. */ pickVoxel(windowPosition: Cartesian2, width?: number, height?: number): VoxelCell | undefined; /** * Pick a metadata value at the given window position. * @param windowPosition - Window coordinates to perform picking on. * @param schemaId - The ID of the metadata schema to pick values * from. If this is undefined, then it will pick the values from the object * that match the given class- and property name, regardless of the schema ID. * @param className - The name of the metadata class to pick * values from * @param propertyName - The name of the metadata property to pick * values from * @returns The metadata value, or undefined when * no matching metadata was found at the given position */ pickMetadata(windowPosition: Cartesian2, schemaId: string | undefined, className: string, propertyName: string): MetadataValue | undefined; /** * Pick the schema of the metadata of the object at the given position * @param windowPosition - Window coordinates to perform picking on. * @returns The metadata schema, or undefined if there is no object with * associated metadata at the given position. */ pickMetadataSchema(windowPosition: Cartesian2): MetadataSchema | undefined; /** * Returns the cartesian position reconstructed from the depth buffer and window position. *

* The position reconstructed from the depth buffer in 2D may be slightly different from those * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution * of depth values of perspective and orthographic projection. *

*

* Set {@link Scene#pickTranslucentDepth} to true to include the depth of * translucent primitives; otherwise, this essentially picks through translucent primitives. *

* @param windowPosition - Window coordinates to perform picking on. * @param [result] - The object on which to restore the result. * @returns The cartesian position. */ pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3; /** * Returns a list of objects, each containing a primitive property, for all primitives at * a particular window coordinate position. Other properties may also be set depending on the * type of primitive and may be used to further identify the picked object. The primitives in * the list are ordered by their visual order in the scene (front to back). * @example * const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0)); * @param windowPosition - Window coordinates to perform picking on. * @param [limit] - If supplied, stop drilling after collecting this many picks. * @param [width = 3] - Width of the pick rectangle. * @param [height = 3] - Height of the pick rectangle. * @returns Array of objects, each containing 1 picked primitives. */ drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[]; /** * Returns the height of scene geometry at the given cartographic position or undefined if there was no * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to * the globe, 3D Tiles, or primitives in the scene. *

* This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height * from all other primitives regardless of their visibility. *

* @example * const position = new Cesium.Cartographic(-1.31968, 0.698874); * const height = viewer.scene.sampleHeight(position); * console.log(height); * @param position - The cartographic position to sample height from. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from. * @param [width = 0.1] - Width of the intersection volume in meters. * @returns The height. This may be undefined if there was no scene geometry to sample height from. */ sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number | undefined; /** * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the * clamped position or undefined if there was no scene geometry to clamp to. May be used to clamp * objects to the globe, 3D Tiles, or primitives in the scene. *

* This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to * all other primitives regardless of their visibility. *

* @example * // Clamp an entity to the underlying scene geometry * const position = entity.position.getValue(Cesium.JulianDate.now()); * entity.position = viewer.scene.clampToHeight(position); * @param cartesian - The cartesian position. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to. * @param [width = 0.1] - Width of the intersection volume in meters. * @param [result] - An optional object to return the clamped position. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. This may be undefined if there was no scene geometry to clamp to. */ clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3 | undefined; /** * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored. * Returns a promise that is resolved when the query completes. Each point height is modified in place. * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs, * the height is set to undefined. * @example * const positions = [ * new Cesium.Cartographic(-1.31968, 0.69887), * new Cesium.Cartographic(-1.10489, 0.83923) * ]; * const promise = viewer.scene.sampleHeightMostDetailed(positions); * promise.then(function(updatedPosition) { * // positions[0].height and positions[1].height have been updated. * // updatedPositions is just a reference to positions. * } * @param positions - The cartographic positions to update with sampled heights. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from. * @param [width = 0.1] - Width of the intersection volume in meters. * @returns A promise that resolves to the provided list of positions when the query has completed. Positions may become undefined if the height cannot be determined. */ sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<(Cartographic | undefined)[]>; /** * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry * can be sampled at that location, or another error occurs, the element in the array is set to undefined. * @example * const cartesians = [ * entities[0].position.getValue(Cesium.JulianDate.now()), * entities[1].position.getValue(Cesium.JulianDate.now()) * ]; * const promise = viewer.scene.clampToHeightMostDetailed(cartesians); * promise.then(function(updatedCartesians) { * entities[0].position = updatedCartesians[0]; * entities[1].position = updatedCartesians[1]; * } * @param cartesians - The cartesian positions to update with clamped positions. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to. * @param [width = 0.1] - Width of the intersection volume in meters. * @returns A promise that resolves to the provided list of positions when the query has completed. Positions may become undefined if they cannot be clamped. */ clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<(Cartesian3 | undefined)[]>; /** * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an * HTML element at the same screen position as an object in the scene. * @example * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves. * const scene = widget.scene; * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); * handler.setInputAction(function(movement) { * console.log(scene.cartesianToCanvasCoordinates(position)); * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param position - The position in cartesian coordinates. * @param [result] - An optional object to return the input position transformed to canvas coordinates. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be undefined if the input position is near the center of the ellipsoid. */ cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2 | undefined; /** * Instantly completes an active transition. */ completeMorph(): void; /** * Asynchronously transitions the scene to 2D. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete. */ morphTo2D(duration?: number): void; /** * Asynchronously transitions the scene to Columbus View. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete. */ morphToColumbusView(duration?: number): void; /** * Asynchronously transitions the scene to 3D. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete. */ morphTo3D(duration?: number): void; /** * Update the terrain providing surface geometry for the globe. * @example * // Use Cesium World Terrain * scene.setTerrain(Cesium.Terrain.fromWorldTerrain()); * @example * // Use a custom terrain provider * const terrain = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl("https://myTestTerrain.com")); * scene.setTerrain(terrain); * * terrain.errorEvent.addEventListener(error => { * alert(`Encountered an error while creating terrain! ${error}`); * }); * @param terrain - The terrain provider async helper * @returns terrain The terrain provider async helper */ setTerrain(terrain: Terrain): Terrain; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * scene = scene && scene.destroy(); */ destroy(): void; } /** * The result of a snap operation. See {@link Scene#snap}. * @property object - The snapped primitive or feature. * @property position - The world-space position of the snap point, un-projected from the snap framebuffer's eye-space depth. * @property surfacePosition - The world-space position of the same object's surface fragment nearest the snap point. For a surface snap this equals position; for an edge snap it is a point on a face of the object rather than on its silhouette, or undefined if no surface fragment of the object is visible in the search region. * @property screenPosition - The window coordinates of the snap point. * @property isEdge - true if the snap point lies on an edge; false if it lies on a surface. */ export type SceneSnapResult = { object: any; position: Cartesian3; surfacePosition: Cartesian3 | undefined; screenPosition: Cartesian2; isEdge: boolean; }; /** * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view. */ export enum SceneMode { /** * Morphing between mode, e.g., 3D to 2D. */ MORPHING = 0, /** * Columbus View mode. A 2.5D perspective view where the map is laid out * flat and objects with non-zero height are drawn above it. */ COLUMBUS_VIEW = 1, /** * 2D mode. The map is viewed top-down with an orthographic projection. */ SCENE2D = 2, /** * 3D mode. A traditional 3D perspective view of the globe. */ SCENE3D = 3 } /** * Functions that do scene-dependent transforms between rendering-related coordinate systems. */ export namespace SceneTransforms { /** * Transforms a position in world (WGS84 or alternative ellipsoid) coordinates to window coordinates. This is commonly used to place an * HTML element at the same screen position as an object in the scene. * @example * // Output the window position of longitude/latitude (0, 0) every time the mouse moves. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); * handler.setInputAction(function(movement) { * console.log(Cesium.SceneTransforms.worldToWindowCoordinates(scene, position)); * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param scene - The scene. * @param position - The position in world (WGS84 or alternative ellipsoid) coordinates. * @param [result] - An optional object to return the input position transformed to window coordinates. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be undefined if the input position is near the center of the ellipsoid. */ function worldToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2 | undefined; /** * Transforms a position in world coordinates to drawing buffer coordinates. This may produce different * results from SceneTransforms.worldToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays. * @example * // Output the window position of longitude/latitude (0, 0) every time the mouse moves. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); * handler.setInputAction(function(movement) { * console.log(Cesium.SceneTransforms.worldToDrawingBufferCoordinates(scene, position)); * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param scene - The scene. * @param position - The position in world (WGS84 or alternative ellipsoid) coordinates. * @param [result] - An optional object to return the input position transformed to window coordinates. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be undefined if the input position is near the center of the ellipsoid. */ function worldToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2 | undefined; } /** * Modifies the camera position and orientation based on mouse input to a canvas. * @param scene - The scene. */ export class ScreenSpaceCameraController { constructor(scene: Scene); /** * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom, * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled. * * NOTE: This setting is for temporary use cases, such as camera flights and * drag-selection of regions (see Picking demo). It is typically set to false at the * start of such events, and set true on completion. To keep inputs disabled * past the end of camera flights, you must use the other booleans (enableTranslate, * enableZoom, enableRotate, enableTilt, and enableLook). */ enableInputs: boolean; /** * If true, allows the user to pan around the map. If false, the camera stays locked at the current position. * This flag only applies in 2D and Columbus view modes. */ enableTranslate: boolean; /** * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid. */ enableZoom: boolean; /** * If true, allows the user to rotate the world which translates the user's position. * This flag only applies in 2D and 3D. */ enableRotate: boolean; /** * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading. * This flag only applies in 3D and Columbus view. */ enableTilt: boolean; /** * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating * or rotating. This flag only applies in 3D and Columbus view modes. */ enableLook: boolean; /** * A parameter in the range [0, 1) used to determine how long * the camera will continue to spin because of inertia. * With value of zero, the camera will have no inertia. */ inertiaSpin: number; /** * A parameter in the range [0, 1) used to determine how long * the camera will continue to translate because of inertia. * With value of zero, the camera will have no inertia. */ inertiaTranslate: number; /** * A parameter in the range [0, 1) used to determine how long * the camera will continue to zoom because of inertia. * With value of zero, the camera will have no inertia. */ inertiaZoom: number; /** * A parameter in the range [0, 1) used to limit the range * of various user inputs to a percentage of the window width/height per animation frame. * This helps keep the camera under control in low-frame-rate situations. */ maximumMovementRatio: number; /** * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view. */ bounceAnimationTime: number; /** * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0. */ minimumZoomDistance: number; /** * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity. */ maximumZoomDistance: number; /** * A multiplier for the speed at which the camera will zoom. */ zoomFactor: number; /** * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes. *

* The type can be a {@link CameraEventType}, undefined, an object with eventType * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, * or an array of any of the preceding. *

*/ translateEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to zoom in/out. *

* The type can be a {@link CameraEventType}, undefined, an object with eventType * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, * or an array of any of the preceding. *

*/ zoomEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes. *

* The type can be a {@link CameraEventType}, undefined, an object with eventType * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, * or an array of any of the preceding. *

*/ rotateEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to tilt in 3D and Columbus view or twist in 2D. *

* The type can be a {@link CameraEventType}, undefined, an object with eventType * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, * or an array of any of the preceding. *

*/ tiltEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes. *

* The type can be a {@link CameraEventType}, undefined, an object with eventType * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, * or an array of any of the preceding. *

*/ lookEventTypes: CameraEventType | any[] | undefined; /** * The minimum height the camera must be before picking the terrain or scene content instead of the ellipsoid. Defaults to scene.ellipsoid.minimumRadius * 0.025 when another ellipsoid than WGS84 is used. */ minimumPickingTerrainHeight: number; /** * The minimum distance the camera must be before testing for collision with terrain when zoom with inertia. Default to scene.ellipsoid.minimumRadius * 0.00063 when another ellipsoid than WGS84 is used. */ minimumPickingTerrainDistanceWithInertia: number; /** * The minimum height the camera must be before testing for collision with terrain. Default to scene.ellipsoid.minimumRadius * 0.0025 when another ellipsoid than WGS84 is used. */ minimumCollisionTerrainHeight: number; /** * The minimum height the camera must be before switching from rotating a track ball to * free look when clicks originate on the sky or in space. Defaults to ellipsoid.minimumRadius * 1.175 when another ellipsoid than WGS84 is used. */ minimumTrackBallHeight: number; /** * When disabled, the values of maximumZoomDistance and minimumZoomDistance are ignored. * Also used in conjunction with {@link Cesium3DTileset#enableCollision} to prevent the camera from moving through or below a 3D Tileset surface. * This may also affect clamping behavior when using {@link HeightReference.CLAMP_TO_GROUND} on 3D Tiles. */ enableCollisionDetection: boolean; /** * The angle, relative to the ellipsoid normal, restricting the maximum amount that the user can tilt the camera. If undefined, the angle of the camera tilt is unrestricted. * @example * // Prevent the camera from tilting below the ellipsoid surface * viewer.scene.screenSpaceCameraController.maximumTiltAngle = Math.PI / 2.0; */ maximumTiltAngle: number | undefined; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes mouse listeners held by this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * controller = controller && controller.destroy(); */ destroy(): void; } /** * Constants used to indicated what part of the sensor volume to display. */ export enum SensorVolumePortionToDisplay { /** * 0x0000. Display the complete sensor volume. */ COMPLETE = 0, /** * 0x0001. Display the portion of the sensor volume that lies below the true horizon of the ellipsoid. */ BELOW_ELLIPSOID_HORIZON = 1, /** * 0x0002. Display the portion of the sensor volume that lies above the true horizon of the ellipsoid. */ ABOVE_ELLIPSOID_HORIZON = 2 } /** *
* Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly. *
* *

* The normalOffset bias pushes the shadows forward slightly, and may be disabled * for applications that require ultra precise shadows. *

*/ export class ShadowMap { constructor(); /** * Determines the darkness of the shadows. */ darkness: number; /** * Determines whether shadows start to fade out once the light gets closer to the horizon. */ fadingEnabled: boolean; /** * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows. */ maximumDistance: number; /** * Determines if the shadow map will be shown. */ enabled: boolean; /** * Determines if a normal bias will be applied to shadows. */ normalOffset: boolean; /** * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance. */ softShadows: boolean; /** * The width and height, in pixels, of each shadow map. */ size: number; } /** * Specifies whether the object casts or receives shadows from light sources when * shadows are enabled. */ export enum ShadowMode { /** * The object does not cast or receive shadows. */ DISABLED = 0, /** * The object casts and receives shadows. */ ENABLED = 1, /** * The object casts shadows only. */ CAST_ONLY = 2, /** * The object receives shadows only. */ RECEIVE_ONLY = 3 } export namespace SingleTileImageryProvider { /** * Initialization options for the SingleTileImageryProvider constructor * @property url - The url for the tile. * @property [tileWidth] - The width of the tile, in pixels. * @property [tileHeight] - The height of the tile, in pixels. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. */ type ConstructorOptions = { url: Resource | string; tileWidth?: number; tileHeight?: number; rectangle?: Rectangle; credit?: Credit | string; ellipsoid?: Ellipsoid; }; /** * Initialization options for the SingleTileImageryProvider constructor when using SingleTileImageryProvider.fromUrl * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. */ type fromUrlOptions = { rectangle?: Rectangle; credit?: Credit | string; ellipsoid?: Ellipsoid; }; } /** * Provides a single, top-level imagery tile. The single image is assumed to be in * the Geographic projection (i.e. WGS84 / EPSG:4326), * and will be rendered using a {@link GeographicTilingScheme}. * @param options - Object describing initialization options */ export class SingleTileImageryProvider { constructor(options: SingleTileImageryProvider.ConstructorOptions); /** * Gets the URL of the single, top-level imagery tile. */ readonly url: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Creates a provider for a single, top-level imagery tile. The single image is assumed to use a * @example * const provider = await SingleTileImageryProvider.fromUrl("https://yoururl.com/image.png"); * @param url - The url for the tile * @param [options] - Object describing initialization options. * @returns The resolved SingleTileImageryProvider. */ static fromUrl(url: Resource | string, options?: SingleTileImageryProvider.fromUrlOptions): Promise; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns The resolved image */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; } /** * An atmosphere drawn around the limb of the provided ellipsoid. Based on * {@link http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf|Display of The Earth Taking Into Account Atmospheric Scattering}. *

* This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view. *

* @example * scene.skyAtmosphere = new Cesium.SkyAtmosphere(); * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around. */ export class SkyAtmosphere { constructor(ellipsoid?: Ellipsoid); /** * Determines if the atmosphere is shown. */ show: boolean; /** * Compute atmosphere per-fragment instead of per-vertex. * This produces better looking atmosphere with a slight performance penalty. */ perFragmentAtmosphere: boolean; /** * The intensity of the light that is used for computing the sky atmosphere color. */ atmosphereLightIntensity: number; /** * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere. */ atmosphereRayleighCoefficient: Cartesian3; /** * The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere. */ atmosphereMieCoefficient: Cartesian3; /** * The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters. */ atmosphereRayleighScaleHeight: number; /** * The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters. */ atmosphereMieScaleHeight: number; /** * The anisotropy of the medium to consider for Mie scattering. *

* Valid values are between -1.0 and 1.0. *

*/ atmosphereMieAnisotropy: number; /** * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A hue shift of 1.0 indicates a complete rotation of the hues available. */ hueShift: number; /** * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A saturation shift of -1.0 is monochrome. */ saturationShift: number; /** * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). * A brightness shift of -1.0 is complete darkness, which will let space show through. */ brightnessShift: number; /** * Gets the ellipsoid the atmosphere is drawn around. */ readonly ellipsoid: Ellipsoid; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy(); */ destroy(): void; } /** * 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 {@link Scene#maximumCubeMapSize}. *

* @example * 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' * } * }); * @param options - Object with the following properties: * @param [options.sources] - The source URL or Image object for each of the six cube map faces. See the example below. * @param [options.show = true] - Determines if this primitive will be shown. */ export class SkyBox { constructor(options: { sources?: any; show?: boolean; }); /** * Gets or sets the the primitive object. */ sources: any; /** * Determines if the sky box will be shown. */ show: boolean; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * skyBox = skyBox && skyBox.destroy(); */ destroy(): void; /** * Creates a skybox instance with the default starmap for the Earth. * @example * viewer.scene.skyBox = Cesium.SkyBox.createEarthSkyBox(); * @returns The default skybox for the Earth */ static createEarthSkyBox(): SkyBox; } /** * A ParticleEmitter that emits particles within a sphere. * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere. * @param [radius = 1.0] - The radius of the sphere in meters. */ export class SphereEmitter { constructor(radius?: number); /** * The radius of the sphere in meters. */ radius: number; } /** * The direction to display a primitive or ImageryLayer relative to the {@link Scene#splitPosition}. */ export enum SplitDirection { /** * Display the primitive or ImageryLayer to the left of the {@link Scene#splitPosition}. */ LEFT = -1, /** * Always display the primitive or ImageryLayer. */ NONE = 0, /** * Display the primitive or ImageryLayer to the right of the {@link Scene#splitPosition}. */ RIGHT = 1 } /** * Determines the function used to compare stencil values for the stencil test. */ export enum StencilFunction { /** * The stencil test never passes. */ NEVER = WebGLConstants.NEVER, /** * The stencil test passes when the masked reference value is less than the masked stencil value. */ LESS = WebGLConstants.LESS, /** * The stencil test passes when the masked reference value is equal to the masked stencil value. */ EQUAL = WebGLConstants.EQUAL, /** * The stencil test passes when the masked reference value is less than or equal to the masked stencil value. */ LESS_OR_EQUAL = WebGLConstants.LEQUAL, /** * The stencil test passes when the masked reference value is greater than the masked stencil value. */ GREATER = WebGLConstants.GREATER, /** * The stencil test passes when the masked reference value is not equal to the masked stencil value. */ NOT_EQUAL = WebGLConstants.NOTEQUAL, /** * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value. */ GREATER_OR_EQUAL = WebGLConstants.GEQUAL, /** * The stencil test always passes. */ ALWAYS = WebGLConstants.ALWAYS } /** * Determines the action taken based on the result of the stencil test. */ export enum StencilOperation { /** * Sets the stencil buffer value to zero. */ ZERO = WebGLConstants.ZERO, /** * Does not change the stencil buffer. */ KEEP = WebGLConstants.KEEP, /** * Replaces the stencil buffer value with the reference value. */ REPLACE = WebGLConstants.REPLACE, /** * Increments the stencil buffer value, clamping to unsigned byte. */ INCREMENT = WebGLConstants.INCR, /** * Decrements the stencil buffer value, clamping to zero. */ DECREMENT = WebGLConstants.DECR, /** * Bitwise inverts the existing stencil buffer value. */ INVERT = WebGLConstants.INVERT, /** * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range. */ INCREMENT_WRAP = WebGLConstants.INCR_WRAP, /** * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero. */ DECREMENT_WRAP = WebGLConstants.DECR_WRAP } /** * An expression for a style applied to a {@link Cesium3DTileset}. *

* Derived classes of this interface evaluate expressions in the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}. *

*

* This type describes an interface and is not intended to be instantiated directly. *

*/ export class StyleExpression { constructor(); /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of * the expression in the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language} * is of type Boolean, Number, or String, the corresponding JavaScript * primitive type will be returned. If the result is a RegExp, a Javascript RegExp * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. * @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object onto which to store the result. * @returns The result of evaluating the expression. */ evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; /** * Evaluates the result of a Color expression, optionally using the provided feature's properties. *

* This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object. *

* @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object in which to store the result. * @returns The modified result parameter or a new Color instance if one was not provided. */ evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color; } /** * Draws a sun billboard. *

This is only supported in 3D and Columbus view.

* @example * scene.sun = new Cesium.Sun(); */ export class Sun { constructor(); /** * Determines if the sun will be shown. */ show: boolean; /** * Gets or sets a number that controls how "bright" the Sun's lens flare appears * to be. Zero shows just the Sun's disc without any flare. * Use larger values for a more pronounced flare around the Sun. */ glowFactor: number; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * sun = sun && sun.destroy(); * * */ destroy(): void; } /** * A directional light source that originates from the Sun. * @param [options] - Object with the following properties: * @param [options.color = Color.WHITE] - The light's color. * @param [options.intensity = 2.0] - The light's intensity. */ export class SunLight { constructor(options?: { color?: Color; intensity?: number; }); /** * The color of the light. */ color: Color; /** * The intensity of the light. */ intensity: number; } export namespace Terrain { /** * A function that is called when an error occurs. * @param err - An object holding details about the error that occurred. */ type ErrorEventCallback = (this: Terrain, err: Error) => void; /** * A function that is called when the provider has been created * @param provider - The created terrain provider. */ type ReadyEventCallback = (this: Terrain, provider: TerrainProvider) => void; } /** * A helper to manage async operations of a terrain provider. * @example * // Create * const viewer = new Cesium.Viewer("cesiumContainer", { * terrain: new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl("https://myTestTerrain.com")); * }); * @example * // Handle loading events * const terrain = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl("https://myTestTerrain.com")); * * scene.setTerrain(terrain); * * terrain.readyEvent.addEventListener(provider => { * scene.globe.enableLighting = true; * * terrain.provider.errorEvent.addEventListener(error => { * alert(`Encountered an error while loading terrain tiles! ${error}`); * }); * }); * * terrain.errorEvent.addEventListener(error => { * alert(`Encountered an error while creating terrain! ${error}`); * }); * @param terrainProviderPromise - A promise which resolves to a terrain provider */ export class Terrain { constructor(terrainProviderPromise: Promise); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of the thrown error. */ readonly errorEvent: Event; /** * Gets an event that is raised when the terrain provider has been successfully created. Event listeners * are passed the created instance of {@link TerrainProvider}. */ readonly readyEvent: Event; /** * Returns true when the terrain provider has been successfully created. Otherwise, returns false. */ readonly ready: boolean; /** * The terrain provider providing surface geometry to a globe. Do not use until {@link Terrain.readyEvent} is raised. */ readonly provider: TerrainProvider; /** * Creates a {@link Terrain} instance for {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. * @example * // Create Cesium World Terrain with default settings * const viewer = new Cesium.Viewer("cesiumContainer", { * terrain: Cesium.Terrain.fromWorldTerrain() * }); * @example * // Create Cesium World Terrain with water and normals. * const viewer1 = new Cesium.Viewer("cesiumContainer", { * terrain: Cesium.Terrain.fromWorldTerrain({ * requestWaterMask: true, * requestVertexNormals: true * }); * }); * @example * // Handle loading events * const terrain = Cesium.Terrain.fromWorldTerrain(); * * scene.setTerrain(terrain); * * terrain.readyEvent.addEventListener(provider => { * scene.globe.enableLighting = true; * * terrain.provider.errorEvent.addEventListener(error => { * alert(`Encountered an error while loading terrain tiles! ${error}`); * }); * }); * * terrain.errorEvent.addEventListener(error => { * alert(`Encountered an error while creating terrain! ${error}`); * }); * @param [options] - Object with the following properties: * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available. * @returns An asynchronous helper object for a CesiumTerrainProvider */ static fromWorldTerrain(options?: { requestVertexNormals?: boolean; requestWaterMask?: boolean; }): Terrain; /** * Creates a {@link Terrain} instance for {@link https://cesium.com/content/#cesium-world-bathymetry|Cesium World Bathymetry}. * @example * // Create Cesium World Bathymetry with default settings * const viewer = new Cesium.Viewer("cesiumContainer", { * terrain: Cesium.Terrain.fromWorldBathymetry) * }); * @example * // Create Cesium World Terrain with normals. * const viewer1 = new Cesium.Viewer("cesiumContainer", { * terrain: Cesium.Terrain.fromWorldBathymetry({ * requestVertexNormals: true * }); * }); * @example * // Handle loading events * const bathymetry = Cesium.Terrain.fromWorldBathymetry(); * * scene.setTerrain(bathymetry); * * bathymetry.readyEvent.addEventListener(provider => { * scene.globe.enableLighting = true; * * bathymetry.provider.errorEvent.addEventListener(error => { * alert(`Encountered an error while loading bathymetric terrain tiles! ${error}`); * }); * }); * * bathymetry.errorEvent.addEventListener(error => { * alert(`Encountered an error while creating bathymetric terrain! ${error}`); * }); * @param [options] - Object with the following properties: * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. * @returns An asynchronous helper object for a CesiumTerrainProvider */ static fromWorldBathymetry(options?: { requestVertexNormals?: boolean; }): Terrain; } export namespace TileCoordinatesImageryProvider { /** * Initialization options for the TileCoordinatesImageryProvider constructor * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. * @property [color = Color.YELLOW] - The color to draw the tile box and label. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes. */ type ConstructorOptions = { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; color?: Color; tileWidth?: number; tileHeight?: number; }; } /** * An {@link 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. * @param [options] - Object describing initialization options */ export class TileCoordinatesImageryProvider { constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions); /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage * and texture upload time. */ readonly hasAlphaChannel: boolean; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns The resolved image as a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise; /** * Picking features is not currently supported by this imagery provider, so this function simply returns * undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns Undefined since picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined; } /** * A policy for discarding tile images according to some criteria. This type describes an * interface and is not intended to be instantiated directly. */ export class TileDiscardPolicy { constructor(); /** * Determines if the discard policy is ready to process images. * @returns True if the discard policy is ready to process images; otherwise, false. */ isReady(): boolean; /** * Given a tile image, decide whether to discard that image. * @param image - An image to test. * @returns True if the image should be discarded; otherwise, false. */ shouldDiscardImage(image: HTMLImageElement): boolean; } export namespace TileMapServiceImageryProvider { /** * Initialization options for the TileMapServiceImageryProvider constructor * @property [fileExtension = 'png'] - The file extension for images on the server. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} * is used. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - Pixel width of image tiles. * @property [tileHeight = 256] - Pixel height of image tiles. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml. * @property [tileDiscardPolicy] - A policy for discarding tile images according to some criteria * Specifying this option will do the same, allowing for loading of these incorrect tilesets. */ type ConstructorOptions = { fileExtension?: string; credit?: Credit | string; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; tileWidth?: number; tileHeight?: number; flipXY?: boolean; tileDiscardPolicy?: TileDiscardPolicy; }; } /** *
* To construct a TileMapServiceImageryProvider, call {@link TileMapServiceImageryProvider.fromUrl}. Do not call the constructor directly. *
* * An imagery provider that provides tiled imagery as generated by * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc. * @example * const tms = await Cesium.TileMapServiceImageryProvider.fromUrl( * "../images/cesium_maptiler/Cesium_Logo_Color", { * fileExtension: 'png', * maximumLevel: 4, * rectangle: new Cesium.Rectangle( * Cesium.Math.toRadians(-120.0), * Cesium.Math.toRadians(20.0), * Cesium.Math.toRadians(-60.0), * Cesium.Math.toRadians(40.0)) * }); * @param [options] - Object describing initialization options */ export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider { constructor(options?: TileMapServiceImageryProvider.ConstructorOptions); /** * Creates a TileMapServiceImageryProvider from the specified url. * @example * const tms = await Cesium.TileMapServiceImageryProvider.fromUrl( * '../images/cesium_maptiler/Cesium_Logo_Color', { * fileExtension: 'png', * maximumLevel: 4, * rectangle: new Cesium.Rectangle( * Cesium.Math.toRadians(-120.0), * Cesium.Math.toRadians(20.0), * Cesium.Math.toRadians(-60.0), * Cesium.Math.toRadians(40.0)) * }); * @param url - Path to image tiles on server. * @param [options] - Object describing initialization options. * @returns A promise that resolves to the created TileMapServiceImageryProvider. */ static fromUrl(url: Resource | string, options?: TileMapServiceImageryProvider.ConstructorOptions): Promise; } /** * Provides functionality for ImageryProviders that have time dynamic imagery * @param options - Object with the following properties: * @param options.clock - A Clock instance that is used when determining the value for the time dimension. Required when options.times is specified. * @param options.times - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. * @param options.requestImageFunction - A function that will request imagery tiles. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded. */ export class TimeDynamicImagery { constructor(options: { clock: Clock; times: TimeIntervalCollection; requestImageFunction: (...params: any[]) => any; reloadFunction: (...params: any[]) => any; }); /** * Gets or sets a clock that is used to get keep the time used for time dynamic parameters. */ clock: Clock; /** * Gets or sets a time interval collection. */ times: TimeIntervalCollection; /** * Gets the current interval. */ currentInterval: TimeInterval; /** * Gets the tile from the cache if its available. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if the tile is not in the cache. */ getFromCache(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will * just add the tile to a list to preload when we approach the next interval. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. */ checkApproachingInterval(x: number, y: number, level: number, request?: Request): void; } /** * Provides playback of time-dynamic point cloud data. *

* Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed. * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently * small or the clock is sufficiently slow then no frames will be skipped. *

* @param options - Object with the following properties: * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension. * @param options.intervals - A {@link TimeIntervalCollection} with its data property being an object containing a uri to a 3D Tiles Point Cloud tile and an optional transform. * @param [options.show = true] - Determines if the point cloud will be shown. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources. * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud. * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting. * @param [options.style] - The style, defined using the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}, applied to each point in the point cloud. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud. */ export class TimeDynamicPointCloud { constructor(options: { clock: Clock; intervals: TimeIntervalCollection; show?: boolean; modelMatrix?: Matrix4; shadows?: ShadowMode; maximumMemoryUsage?: number; shading?: any; style?: Cesium3DTileStyle; clippingPlanes?: ClippingPlaneCollection; }); /** * Determines if the point cloud will be shown. */ show: boolean; /** * A 4x4 transformation matrix that transforms the point cloud. */ modelMatrix: Matrix4; /** * Determines whether the point cloud casts or receives shadows from light sources. *

* Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view. *

*

* Shadows are rendered only when {@link Viewer#shadows} is true. *

*/ shadows: ShadowMode; /** * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames. *

* Frames that are not being loaded or rendered are unloaded to enforce this. *

*

* If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. *

*/ maximumMemoryUsage: number; /** * Options for controlling point size based on geometric error and eye dome lighting. */ shading: PointCloudShading; /** * The style, defined using the * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}, * applied to each point in the point cloud. *

* Assign undefined to remove the style, which will restore the visual * appearance of the point cloud to its default when no style was applied. *

* @example * pointCloud.style = new Cesium.Cesium3DTileStyle({ * color : { * conditions : [ * ['${Classification} === 0', 'color("purple", 0.5)'], * ['${Classification} === 1', 'color("red")'], * ['true', '${COLOR}'] * ] * }, * show : '${Classification} !== 2' * }); */ style: Cesium3DTileStyle; /** * The event fired to indicate that a frame failed to load. A frame may fail to load if the * request for its uri fails or processing fails due to invalid content. *

* If there are no event listeners, error messages will be logged to the console. *

*

* The error object passed to the listener contains two properties: *

    *
  • uri: the uri of the failed frame.
  • *
  • message: the error message.
  • *
* @example * pointCloud.frameFailed.addEventListener(function(error) { * console.log(`An error occurred loading frame: ${error.uri}`); * console.log(`Error: ${error.message}`); * }); */ frameFailed: Event; /** * The event fired to indicate that a new frame was rendered. *

* The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener. *

* @example * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) { * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere); * }); */ frameChanged: Event; /** * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud. */ clippingPlanes: ClippingPlaneCollection; /** * The total amount of GPU memory in bytes used by the point cloud. */ readonly totalMemoryUsageInBytes: number; /** * The bounding sphere of the frame being rendered. Returns undefined if no frame is being rendered. */ readonly boundingSphere: BoundingSphere; /** * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all * points to re-evaluate the style in the next frame. */ makeStyleDirty(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * pointCloud = pointCloud && pointCloud.destroy(); */ destroy(): void; } /** * A tonemapping algorithm when rendering with high dynamic range. */ export enum Tonemapper { /** * Use the Reinhard tonemapping. */ REINHARD = "REINHARD", /** * Use the modified Reinhard tonemapping. */ MODIFIED_REINHARD = "MODIFIED_REINHARD", /** * Use the Filmic tonemapping. */ FILMIC = "FILMIC", /** * Use the ACES tonemapping. */ ACES = "ACES", /** * Use the PBR Neutral tonemapping {@link https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral|from Khronos}. */ PBR_NEUTRAL = "PBR_NEUTRAL" } /** * Base provider for URL-template vector sources that are rendered through a * runtime-generated 3D Tiles tileset. * @param urlTemplate - URL template containing {z}, {x}, and {y} placeholders. * @param [options] - Provider options. * @param [options.minZoom = 0] - Minimum zoom level represented in the generated tileset. * @param [options.maxZoom = 14] - Maximum zoom level represented in the generated tileset. * @param [options.extent] - Optional geographic extent in radians to constrain the generated tile tree. * @param [options.featureIdProperty] - Feature property name to use as feature ID when supported by content decoding. * @param [options.heightReference] - Drapes the vector content onto the surfaces selected by the * value. Requires options.scene. * @param [options.scene] - The scene the generated tileset is rendered in, required when * options.heightReference is a clamping value. */ export class UrlTemplate3DTilesDataProvider { constructor(urlTemplate: Resource | string, options?: { minZoom?: number; maxZoom?: number; extent?: Rectangle; featureIdProperty?: string; heightReference?: HeightReference; scene?: Scene; }); /** * Creates a provider from a URL template. * @param url - URL template containing {z}, {x}, and {y} placeholders. * @param [options] - Provider options. */ static fromUrl(url: Resource | string, options?: any): Promise; /** * URL template containing {z}/{x}/{y}. */ readonly urlTemplate: string; /** * Resource derived from the URL template. */ readonly resource: Resource; /** * Optional geographic extent in radians used to generate tile headers. */ readonly extent: Rectangle | undefined; /** * Backing 3D Tileset. */ readonly tileset: Cesium3DTileset | undefined; /** * Determines if the generated tileset is shown. */ show: boolean; protected _createRuntimeTilesetOptions(): void; protected _createTilesetLoadOptions(): any; protected _configureTileset(_tileset: Cesium3DTileset): void; /** * Subclasses must return a runtime content codec describing how to turn * a downloaded tile payload into a {@link Cesium3DTileContent}. See * {@link Cesium3DTileset#_runtimeContentCodec} for the expected shape. */ protected _createCodec(): any; } export namespace UrlTemplateImageryProvider { /** * Initialization options for the UrlTemplateImageryProvider constructor * @property url - The URL template to use to request tiles. It has the following keywords: *
    *
  • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
  • *
  • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
  • *
  • {y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.
  • *
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • *
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • *
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • *
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • *
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • *
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • *
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • *
  • {northDegrees}: The Northern edge of the tile in geodetic degrees.
  • *
  • {westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {width}: The width of each tile in pixels.
  • *
  • {height}: The height of each tile in pixels.
  • *
* @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified, * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no * features picked. The URL template supports all of the keywords supported by the url * parameter, plus the following: *
    *
  • {i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.
  • *
  • {j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.
  • *
  • {reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.
  • *
  • {reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.
  • *
  • {longitudeDegrees}: The longitude of the picked position in degrees.
  • *
  • {latitudeDegrees}: The latitude of the picked position in degrees.
  • *
  • {longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.
  • *
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • *
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • *
* @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting: * urlSchemeZeroPadding : { '{x}' : '0000'} * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. * It the passed object has the following keywords: *
    *
  • {z}: The zero padding for the level of the tile in the tiling scheme.
  • *
  • {x}: The zero padding for the tile X coordinate in the tiling scheme.
  • *
  • {y}: The zero padding for the the tile Y coordinate in the tiling scheme.
  • *
  • {reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme.
  • *
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • *
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • *
* @property [subdomains = 'abc'] - The subdomains to use for the {s} placeholder in the URL template. * If this parameter is a single string, each character in the string is a subdomain. If it is * an array, each element in the array is a subdomain. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} * is used. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - Pixel width of image tiles. * @property [tileHeight = 256] - Pixel height of image tiles. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if * present, will be ignored. If this property is true, any images without an alpha channel will * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are potentially reduced. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this * parameter is not specified, feature picking is disabled. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will * request the pickFeaturesUrl and attempt to interpret the features included in the response. If false, * {@link 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 {@link UriTemplateImageryProvider#enablePickFeatures} * property. * @property [tileDiscardPolicy] - A policy for discarding tile images according to some criteria * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. */ type ConstructorOptions = { url: Resource | string; pickFeaturesUrl?: Resource | string; urlSchemeZeroPadding?: any; subdomains?: string | string[]; credit?: Credit | string; minimumLevel?: number; maximumLevel?: number; rectangle?: Rectangle; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; tileWidth?: number; tileHeight?: number; hasAlphaChannel?: boolean; getFeatureInfoFormats?: GetFeatureInfoFormat[]; enablePickFeatures?: boolean; tileDiscardPolicy?: TileDiscardPolicy; customTags?: any; }; } /** * Provides imagery by requesting tiles using a specified URL template. * @example * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project * const tms = new Cesium.UrlTemplateImageryProvider({ * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg', * tilingScheme : new Cesium.GeographicTilingScheme(), * maximumLevel : 5 * }); * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme. * const 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. * const wms = new Cesium.UrlTemplateImageryProvider({ * url : 'https://services.ga.gov.au/gis/services/NM_Hydrology_and_Marine_Points/MapServer/WMSServer?' + * 'tiled=true&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' + * 'styles=&service=WMS&version=1.3.0&request=GetMap&' + * 'layers=Bores&crs=EPSG%3A3857&' + * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' + * 'width=256&height=256', * rectangle : Cesium.Rectangle.fromDegrees(95.0, -55.0, 170.0, -1.0) // From GetCapabilities EX_GeographicBoundingBox * }); * // Using custom tags in your template url. * const custom = new Cesium.UrlTemplateImageryProvider({ * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png', * customTags : { * Time: function(imageryProvider, x, y, level) { * return '20171231' * } * } * }); * @param options - Object describing initialization options */ export class UrlTemplateImageryProvider { constructor(options: UrlTemplateImageryProvider.ConstructorOptions); /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will * request the options.pickFeaturesUrl and attempt to interpret the features included in the response. If false, * {@link 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. */ enablePickFeatures: boolean; /** * Gets the URL template to use to request tiles. It has the following keywords: *
    *
  • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
  • *
  • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
  • *
  • {y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.
  • *
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • *
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • *
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • *
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • *
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • *
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • *
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • *
  • {northDegrees}: The Northern edge of the tile in geodetic degrees.
  • *
  • {westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.
  • *
  • {width}: The width of each tile in pixels.
  • *
  • {height}: The height of each tile in pixels.
  • *
*/ readonly url: string; /** * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on * the left with zeros to match the width of the passed string of zeros. e.g. Setting: * urlSchemeZeroPadding : { '{x}' : '0000'} * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. * It has the following keywords: *
    *
  • {z}: The zero padding for the level of the tile in the tiling scheme.
  • *
  • {x}: The zero padding for the tile X coordinate in the tiling scheme.
  • *
  • {y}: The zero padding for the the tile Y coordinate in the tiling scheme.
  • *
  • {reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme.
  • *
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • *
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • *
*/ readonly urlSchemeZeroPadding: any; /** * Gets the URL template to use to use to pick features. If this property is not specified, * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no * features picked. The URL template supports all of the keywords supported by the * {@link UrlTemplateImageryProvider#url} property, 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 {@link GetFeatureInfoFormat}.
  • *
*/ readonly pickFeaturesUrl: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * The vertical location of an origin relative to an object, e.g., a {@link Billboard} * or {@link Label}. For example, setting the vertical origin to TOP * or BOTTOM will display a billboard above or below (in screen space) * the anchor position. *

*
*
*
*/ export enum VerticalOrigin { /** * The origin is at the vertical center between BASELINE and TOP. */ CENTER = 0, /** * The origin is at the bottom of the object. */ BOTTOM = 1, /** * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object. */ BASELINE = 2, /** * The origin is at the top of the object. */ TOP = -1 } /** * A viewport aligned quad. * @example * const 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); * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad. */ export class ViewportQuad { constructor(rectangle?: BoundingRectangle, material?: Material); /** * Determines if the viewport quad primitive will be shown. */ show: boolean; /** * The BoundingRectangle defining the quad's position within the viewport. * @example * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40); */ rectangle: BoundingRectangle; /** * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. *

* The default material is Material.ColorType. *

* @example * // 1. Change the color of the default material to yellow * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); * * // 2. Change material to horizontal stripes * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType); */ material: Material; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to * get the draw commands needed to render this primitive. *

* Do not call this function directly. This is documented just to * list the exceptions that may be propagated when the scene is rendered: *

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * quad = quad && quad.destroy(); */ destroy(): void; } /** * A cell from a {@link VoxelPrimitive}. *

* Provides access to properties associated with one cell of a voxel primitive. *

*

* Do not construct this directly. Access it through picking using {@link Scene#pickVoxel}. *

* @example * // On left click, display all the properties for a voxel cell in the console log. * handler.setInputAction(function(movement) { * const voxelCell = scene.pickVoxel(movement.position); * if (voxelCell instanceof Cesium.VoxelCell) { * const propertyIds = voxelCell.getPropertyIds(); * const length = propertyIds.length; * for (let i = 0; i < length; ++i) { * const propertyId = propertyIds[i]; * console.log(`{propertyId}: ${voxelCell.getProperty(propertyId)}`); * } * } * }, Cesium.ScreenSpaceEventType.LEFT_CLICK); * @param primitive - The voxel primitive containing the cell * @param tileIndex - The index of the tile * @param sampleIndex - The index of the sample within the tile, containing metadata for this cell */ export class VoxelCell { constructor(primitive: VoxelPrimitive, tileIndex: number, sampleIndex: number); /** * All objects returned by {@link Scene#pick} have a primitive property. This returns * the VoxelPrimitive containing the cell. */ readonly primitive: VoxelPrimitive; /** * Get the sample index of the cell. */ readonly sampleIndex: number; /** * Get the index of the tile containing the cell. */ readonly tileIndex: number; /** * Get a copy of the oriented bounding box containing the cell. */ readonly orientedBoundingBox: OrientedBoundingBox; /** * Returns true if the feature contains this property. * @param name - The case-sensitive name of the property. * @returns Whether the feature contains this property. */ hasProperty(name: string): boolean; /** * Returns an array of metadata property names for the feature. * @returns The IDs of the feature's properties. */ getNames(): string[]; /** * Returns a copy of the value of the metadata in the cell with the given name. * @example * // Display all the properties for a voxel cell in the console log. * const names = voxelCell.getNames(); * for (let i = 0; i < names.length; ++i) { * const name = names[i]; * console.log(`{name}: ${voxelCell.getProperty(name)}`); * } * @param name - The case-sensitive name of the property. * @returns The value of the property or undefined if the feature does not have this property. */ getProperty(name: string): any; } /** *
* To construct a VoxelContent, call {@link VoxelContent.fromMetadataArray} or {@link VoxelContent.fromGltf}. Do not call the constructor directly. *
* An object representing voxel content for a {@link Cesium3DTilesVoxelProvider}. */ export class VoxelContent { constructor(); /** * The metadata for this voxel content. * The metadata is an array of typed arrays, one for each field. * The data for one field is a flattened 3D array ordered by X, then Y, then Z. */ readonly metadata: Int8Array[] | Uint8Array[] | Int16Array[] | Uint16Array[] | Int32Array[] | Uint32Array[] | Float32Array[] | Float64Array[]; /** * Constructs a VoxelContent from an array of metadata. * @param metadata - The metadata to use for this voxel content. * @returns A VoxelContent containing the specified metadata. */ static fromMetadataArray(metadata: Int8Array[] | Uint8Array[] | Int16Array[] | Uint16Array[] | Int32Array[] | Uint32Array[] | Float32Array[] | Float64Array[]): VoxelContent; } /** * A primitive that renders voxel data from a {@link VoxelProvider}. * @param [options] - Object with the following properties: * @param [options.provider] - The voxel provider that supplies the primitive with tile data. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix used to transform the primitive. * @param [options.customShader] - The custom shader used to style the primitive. * @param [options.clock] - The clock used to control time dynamic behavior. * @param [options.calculateStatistics] - Generate statistics for performance profile. */ export class VoxelPrimitive { constructor(options?: { provider?: VoxelProvider; modelMatrix?: Matrix4; customShader?: CustomShader; clock?: Clock; calculateStatistics?: boolean; }); /** * The event fired to indicate that a tile's content was loaded. *

* This event is fired during the tileset traversal while the frame is being rendered * so that updates to the tile take effect in the same frame. Do not create or modify * Cesium entities or primitives during the event listener. *

* @example * voxelPrimitive.tileLoad.addEventListener(function() { * console.log('A tile was loaded.'); * }); */ tileLoad: Event; /** * This event fires once for each visible tile in a frame. *

* This event is fired during the traversal while the frame is being rendered. * @example * voxelPrimitive.tileVisible.addEventListener(function() { * console.log('A tile is visible.'); * }); */ tileVisible: Event; /** * The event fired to indicate that a tile's content failed to load. * @example * voxelPrimitive.tileFailed.addEventListener(function() { * console.log('An error occurred loading tile.'); * }); */ tileFailed: Event; /** * The event fired to indicate that a tile's content was unloaded. * @example * voxelPrimitive.tileUnload.addEventListener(function() { * console.log('A tile was unloaded from the cache.'); * }); */ tileUnload: Event; /** * The event fired to indicate progress of loading new tiles. This event is fired when a new tile * is requested, when a requested tile is finished downloading, and when a downloaded tile has been * processed and is ready to render. *

* The number of pending tile requests, numberOfPendingRequests, and number of tiles * processing, numberOfTilesProcessing are passed to the event listener. *

*

* This event is fired at the end of the frame after the scene is rendered. *

* @example * voxelPrimitive.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) { * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) { * console.log('Finished loading'); * return; * } * * console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`); * }); */ loadProgress: Event; /** * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The voxel * primitive is completely loaded for this view. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * voxelPrimitive.allTilesLoaded.addEventListener(function() { * console.log('All tiles are loaded'); * }); */ allTilesLoaded: Event; /** * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event * is fired once when all tiles in the initial view are loaded. *

* This event is fired at the end of the frame after the scene is rendered. *

* @example * voxelPrimitive.initialTilesLoaded.addEventListener(function() { * console.log('Initial tiles are loaded'); * }); */ initialTilesLoaded: Event; /** * Gets a value indicating whether or not the primitive is ready for use. */ readonly ready: boolean; /** * Gets the {@link VoxelProvider} associated with this primitive. */ readonly provider: VoxelProvider; /** * Gets the bounding sphere. */ readonly boundingSphere: BoundingSphere; /** * Gets the oriented bounding box. */ readonly orientedBoundingBox: OrientedBoundingBox; /** * Gets the model matrix. */ readonly modelMatrix: Matrix4; /** * Gets the shape type. */ readonly shape: VoxelShapeType; /** * Gets the dimensions of each voxel tile, in z-up orientation. * Does not include padding. */ readonly dimensions: Cartesian3; /** * Gets the dimensions of one tile of the input voxel data, in the input orientation. * Includes padding. */ readonly inputDimensions: Cartesian3; /** * Gets the padding before the voxel data. */ readonly paddingBefore: Cartesian3; /** * Gets the padding after the voxel data. */ readonly paddingAfter: Cartesian3; /** * Gets the minimum value per channel of the voxel data. */ readonly minimumValues: number[][]; /** * Gets the maximum value per channel of the voxel data. */ readonly maximumValues: number[][]; /** * Gets or sets whether or not this primitive should be displayed. */ show: boolean; /** * Gets or sets whether or not the primitive should update when the view changes. */ disableUpdate: boolean; /** * Gets or sets whether or not to render debug visualizations. */ debugDraw: boolean; /** * Gets or sets whether or not to test against depth when rendering. */ depthTest: boolean; /** * Gets or sets the nearest sampling. */ nearestSampling: boolean; /** * Gets or sets the screen space error in pixels. If the screen space size * of a voxel is greater than the screen space error, the tile is subdivided. * Lower screen space error corresponds with higher detail rendering, but could * result in worse performance and higher memory consumption. */ screenSpaceError: number; /** * Gets or sets the step size multiplier used during raymarching. * The lower the value, the higher the rendering quality, but * also the worse the performance. */ stepSize: number; /** * Gets or sets the minimum bounds in the shape's local coordinate system. * Voxel data is stretched or squashed to fit the bounds. */ minBounds: Cartesian3; /** * Gets or sets the maximum bounds in the shape's local coordinate system. * Voxel data is stretched or squashed to fit the bounds. */ maxBounds: Cartesian3; /** * Gets or sets the minimum clipping location in the shape's local coordinate system. * Any voxel content outside the range is clipped. */ minClippingBounds: Cartesian3; /** * Gets or sets the maximum clipping location in the shape's local coordinate system. * Any voxel content outside the range is clipped. */ maxClippingBounds: Cartesian3; /** * The {@link ClippingPlaneCollection} used to selectively disable rendering the primitive. */ clippingPlanes: ClippingPlaneCollection; /** * Gets or sets the custom shader. If undefined, attempt to build a default custom shader * appropriate to the metadata type. If that fails, use {@link VoxelPrimitive.DefaultCustomShader}. */ customShader: CustomShader; /** * Gets an event that is raised whenever a custom shader is compiled. */ readonly customShaderCompilationEvent: Event; /** * Returns true if this object was destroyed; otherwise, false. *

* If this object was destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * @example * voxelPrimitive = voxelPrimitive && voxelPrimitive.destroy(); */ destroy(): void; } /** * Provides voxel data. Intended to be used with {@link VoxelPrimitive}. * This type describes an interface and is not intended to be instantiated directly. */ export class VoxelProvider { /** * Requests the data for a given tile. * @param [options] - Object with the following properties: * @param [options.tileLevel = 0] - The tile's level. * @param [options.tileX = 0] - The tile's X coordinate. * @param [options.tileY = 0] - The tile's Y coordinate. * @param [options.tileZ = 0] - The tile's Z coordinate. * @returns A promise resolving to a VoxelContent containing the data for the tile, or undefined if the request could not be scheduled this frame. */ requestData(options?: { tileLevel?: number; tileX?: number; tileY?: number; tileZ?: number; }): Promise | undefined; /** * A transform from local space to global space. */ readonly globalTransform: Matrix4; /** * A transform from shape space to local space. */ readonly shapeTransform: Matrix4; /** * Gets the {@link VoxelShapeType} */ readonly shape: VoxelShapeType; /** * Gets the minimum bounds. * If undefined, the shape's default minimum bounds will be used instead. */ readonly minBounds: Cartesian3 | undefined; /** * Gets the maximum bounds. * If undefined, the shape's default maximum bounds will be used instead. */ readonly maxBounds: Cartesian3 | undefined; /** * Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset. */ readonly dimensions: Cartesian3; /** * Gets the number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage. */ readonly paddingBefore: Cartesian3; /** * Gets the number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage. */ readonly paddingAfter: Cartesian3; /** * Gets the metadata names. */ readonly names: string[]; /** * Gets the metadata types. */ readonly types: MetadataType[]; /** * Gets the metadata component types. */ readonly componentTypes: MetadataComponentType[]; /** * Gets the metadata minimum values. */ readonly minimumValues: number[][] | undefined; /** * Gets the metadata maximum values. */ readonly maximumValues: number[][] | undefined; /** * The maximum number of tiles that exist for this provider. * This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. * If this value is not known it can be undefined. */ readonly maximumTileCount: number | undefined; /** * The number of levels of detail containing available tiles in the tileset. */ readonly availableLevels: number | undefined; } /** * An enum of voxel shapes. The shape controls how the voxel grid is mapped to 3D space. */ export enum VoxelShapeType { /** * A box shape. */ BOX = "BOX", /** * An ellipsoid shape. */ ELLIPSOID = "ELLIPSOID", /** * A cylinder shape. */ CYLINDER = "CYLINDER" } export namespace WebMapServiceImageryProvider { /** * Initialization options for the WebMapServiceImageryProvider constructor * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}. * @property layers - The layers to include, separated by commas. * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) * without communicating with the server. Set this property to false if you know your WMS server does not support * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL. * @property [getFeatureInfoUrl] - The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats * in which to try WMS GetFeatureInfo requests. Since feature info responses vary across WMS services, * you may need to supply a custom format and parsing callback; see the * {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Sandcastle example} for a complete * example of writing your own callback. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - The width of each tile in pixels. * @property [tileHeight = 256] - The height of each tile in pixels. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is * likely to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * If not specified, there is no limit. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1 * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [subdomains = 'abc'] - The subdomains to use for the {s} placeholder in the URL template. * If this parameter is a single string, each character in the string is a subdomain. If it is * an array, each element in the array is a subdomain. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. */ type ConstructorOptions = { url: Resource | string; layers: string; parameters?: any; enablePickFeatures?: boolean; getFeatureInfoParameters?: any; getFeatureInfoUrl?: Resource | string; getFeatureInfoFormats?: GetFeatureInfoFormat[]; rectangle?: Rectangle; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; tileWidth?: number; tileHeight?: number; minimumLevel?: number; maximumLevel?: number; crs?: string; srs?: string; credit?: Credit | string; subdomains?: string | string[]; clock?: Clock; times?: TimeIntervalCollection; }; } /** * Provides tiled imagery hosted by a Web Map Service (WMS) server. * @example * // WMS servers operated by the US government https://apps.nationalmap.gov/services/ * const provider = new Cesium.WebMapServiceImageryProvider({ * url : 'https://basemap.nationalmap.gov:443/arcgis/services/USGSHydroCached/MapServer/WMSServer', * layers : '0', * proxy: new Cesium.DefaultProxy('/proxy/') * }); * const imageryLayer = new Cesium.ImageryLayer(provider); * viewer.imageryLayers.add(imageryLayer); * @param options - Object describing initialization options */ export class WebMapServiceImageryProvider { constructor(options: WebMapServiceImageryProvider.ConstructorOptions); /** * Gets the URL of the WMS server. */ readonly url: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the names of the WMS layers, separated by commas. */ readonly layers: string; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will * invoke the GetFeatureInfo service on the WMS server and attempt to interpret the features included in the response. If false, * {@link WebMapServiceImageryProvider#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. */ enablePickFeatures: boolean; /** * Gets or sets a clock that is used to get keep the time used for time dynamic parameters. */ clock: Clock; /** * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each * TimeInterval is an object containing the keys and values of the properties that are used during * tile requests. */ times: TimeIntervalCollection; /** * Gets the getFeatureInfo URL of the WMS server. */ readonly getFeatureInfoUrl: Resource | string; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** * The default parameters to include in the WMS URL to obtain images. The values are as follows: * service=WMS * version=1.1.1 * request=GetMap * styles= * format=image/jpeg */ static readonly DefaultParameters: any; /** * The default parameters to include in the WMS URL to get feature information. The values are as follows: * service=WMS * version=1.1.1 * request=GetFeatureInfo */ static readonly GetFeatureInfoDefaultParameters: any; } export namespace WebMapTileServiceImageryProvider { /** * Initialization options for the WebMapTileServiceImageryProvider constructor * @property url - The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server. * @property layer - The layer name for WMTS requests. * @property style - The style name for WMTS requests. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests. * @property [enablePickFeatures] - If true, {@link WebMapTileServiceImageryProvider#pickFeatures} will invoke * the GetFeatureInfo operation on the WMTS server and return the features included in the response. If false, * {@link WebMapTileServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) * without communicating with the server. Set this property to false if you know your WMTS server does not support * GetFeatureInfo or if you don't want this provider's features to be pickable. * Defaults to true for KVP encoding. For RESTful encoding, defaults to true only when * {@link WebMapTileServiceImageryProvider.ConstructorOptions#getFeatureInfoUrl} is specified, and false otherwise. * @property [getFeatureInfoParameters] - Additional parameters to include in GetFeatureInfo requests. Keys are lowercased internally. * @property [getFeatureInfoUrl] - The GetFeatureInfo URL of the WMTS service. If not specified, the value of url is used. * @property [getFeatureInfoFormats = WebMapTileServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats * in which to try WMTS GetFeatureInfo requests. Since feature info responses vary across WMTS services, * you may need to supply a custom format and parsing callback; see the * {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Sandcastle example} for a complete * example of writing your own callback. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - The tile width in pixels. * @property [tileHeight = 256] - The tile height in pixels. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level. * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [subdomains = 'abc'] - The subdomains to use for the {s} placeholder in the URL template. * If this parameter is a single string, each character in the string is a subdomain. If it is * an array, each element in the array is a subdomain. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. * @property [dimensions] - A object containing static dimensions and their values. */ type ConstructorOptions = { url: Resource | string; format?: string; layer: string; style: string; tileMatrixSetID: string; enablePickFeatures?: boolean; getFeatureInfoParameters?: any; getFeatureInfoUrl?: Resource | string; getFeatureInfoFormats?: GetFeatureInfoFormat[]; rectangle?: Rectangle; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; tileWidth?: number; tileHeight?: number; minimumLevel?: number; maximumLevel?: number; tileMatrixLabels?: any[]; credit?: Credit | string; subdomains?: string | string[]; clock?: Clock; times?: TimeIntervalCollection; dimensions?: any; }; } /** * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding. * @example * // Example 1. USGS shaded relief tiles (KVP) * const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({ * url : 'https://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); * @example * // Example 2. USGS shaded relief tiles (RESTful) * const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({ * url : 'https://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 * // Example 3: NASA time dynamic snowpack data (RESTful) * // Define time intervals for the layer based on the capabilities XML * const times = Cesium.TimeIntervalCollection.fromIso8601({ * iso8601: '2025-01-01/2025-09-01/P5D', // Use the valid interval(s) from the Dimension section * dataCallback: function(interval, index) { * // Return an object with the Time variable used in the URL template * return { * Time: Cesium.JulianDate.toIso8601(interval.start, 0) * }; * } * }); * // Get the internal clock, set desired start, stop, and multiplier * const clock = viewer.clock; * clock.startTime = Cesium.JulianDate.fromIso8601('2025-01-01'); * clock.currentTime = Cesium.JulianDate.fromIso8601('2025-01-01'); * clock.stopTime = Cesium.JulianDate.fromIso8601('2025-09-01'); * clock.clockRange = Cesium.ClockRange.LOOP_STOP; * clock.multiplier = 1; // 1 day per second * clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER; * * viewer.timeline.zoomTo(clock.startTime, clock.stopTime); * * const weather = new Cesium.WebMapTileServiceImageryProvider({ * url: 'https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/AMSRU2_Snow_Water_Equivalent_5Day/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png', * layer: 'AMSRU2_Snow_Water_Equivalent_5Day', * style: 'default', * tileMatrixSetID: 'GoogleMapsCompatible_Level6', * format: 'image/png', * clock: clock, * times: times, * credit: new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS') * }); * viewer.imageryLayers.addImageryProvider(weather); * @example * // Example 4. Digital Earth AfricA waterbodies with GetFeatureInfo support (RESTful) * const waterbodies = new Cesium.WebMapTileServiceImageryProvider({ * url: "https://geoserver.digitalearth.africa/geoserver/gwc/service/wmts/rest/{layer}/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format={format}", * layer: "waterbodies:DEAfrica_Waterbodies", * style: "waterbodies:waterbodies_v0_0_4", * tileMatrixSetID: "EPSG:3857", * tileMatrixLabels: [ * "EPSG:3857:0", * "EPSG:3857:1", * "EPSG:3857:2", * "EPSG:3857:3", * "EPSG:3857:4", * "EPSG:3857:5", * "EPSG:3857:6", * "EPSG:3857:7", * "EPSG:3857:8", * "EPSG:3857:9", * "EPSG:3857:10", * "EPSG:3857:11", * "EPSG:3857:12", * "EPSG:3857:13", * "EPSG:3857:14", * "EPSG:3857:15", * "EPSG:3857:16", * "EPSG:3857:17", * "EPSG:3857:18", * "EPSG:3857:19", * "EPSG:3857:20", * "EPSG:3857:21", * "EPSG:3857:22", * "EPSG:3857:23", * "EPSG:3857:24", * "EPSG:3857:25", * "EPSG:3857:26", * "EPSG:3857:27", * "EPSG:3857:28", * "EPSG:3857:29", * "EPSG:3857:30", * ], * format: "image/png", * enablePickFeatures: true, * getFeatureInfoUrl: "https://geoserver.digitalearth.africa/geoserver/gwc/service/wmts/rest/{layer}/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{j}/{i}?format={format}", * }); * * viewer.imageryLayers.addImageryProvider(waterbodies); * @param options - Object describing initialization options */ export class WebMapTileServiceImageryProvider { constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions); /** * Gets the URL of the service hosting the imagery. */ readonly url: string; /** * Gets the proxy used by this provider. */ readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible * for filtering out "missing" tiles via its shouldDiscardImage function. If this function * returns undefined, no tiles are filtered. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the mime type of images returned by this imagery provider. */ readonly format: string; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit * the source of the imagery. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider * include an alpha channel. If this property is false, an alpha channel, if present, will * be ignored. If this property is true, any images without an alpha channel will be treated * as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapTileServiceImageryProvider#pickFeatures} will * invoke the GetFeatureInfo service on the WMTS server and attempt to interpret the features included in the response. If false, * {@link WebMapTileServiceImageryProvider#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. * Defaults to true for KVP encoding. For RESTful encoding, defaults to true only when * {@link WebMapTileServiceImageryProvider.ConstructorOptions#getFeatureInfoUrl} is specified, and false otherwise. */ enablePickFeatures: boolean; /** * Gets or sets a clock that is used to get keep the time used for time dynamic parameters. */ clock: Clock; /** * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each * TimeInterval is an object containing the keys and values of the properties that are used during * tile requests. */ times: TimeIntervalCollection; /** * Gets or sets an object that contains static dimensions and their values. */ dimensions: any; /** * Gets the getFeatureInfo URL of the WMTS server. */ readonly getFeatureInfoUrl: Resource | string; /** * Gets the credits to be displayed when a given tile is displayed. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level; * @returns The credits to be displayed when the tile is displayed. */ getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request should be retried later. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within * a tile. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} * instances. The array may be empty if no features are found at the given location. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** * The default parameters to include in the WMTS URL to obtain images. The values are as follows: * service=WMTS * version=1.0.0 * request=GetTile */ static readonly DefaultParameters: any; /** * The default parameters to include in the WMTS URL to get feature information. The values are as follows: * service=WMTS * version=1.0.0 * request=GetFeatureInfo */ static readonly GetFeatureInfoDefaultParameters: any; } /** * @property height - The height. * @property color - The color at this height. */ export type createElevationBandMaterialEntry = { height: number; color: Color; }; /** * @property entries - A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and extendsDownards and extendUpwards are both false, they will both be set to true. * @property [extendDownwards = false] - If true, the band's minimum elevation color will extend infinitely downwards. * @property [extendUpwards = false] - If true, the band's maximum elevation color will extend infinitely upwards. */ export type createElevationBandMaterialBand = { entries: createElevationBandMaterialEntry[]; extendDownwards?: boolean; extendUpwards?: boolean; }; /** * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights. * * The shader does a binary search over all the heights to find out which colors are above and below a given height, and * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply. * @example * scene.globe.material = Cesium.createElevationBandMaterial({ * scene : scene, * layers : [{ * entries : [{ * height : 4200.0, * color : new Cesium.Color(0.0, 0.0, 0.0, 1.0) * }, { * height : 8848.0, * color : new Cesium.Color(1.0, 1.0, 1.0, 1.0) * }], * extendDownwards : true, * extendUpwards : true, * }, { * entries : [{ * height : 7000.0, * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) * }, { * height : 7100.0, * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) * }] * }] * }); * @param options - Object with the following properties: * @param options.scene - The scene where the visualization is taking place. * @param options.layers - A list of bands ordered from lowest to highest precedence. * @returns A new {@link Material} instance. */ export function createElevationBandMaterial(options: { scene: Scene; layers: createElevationBandMaterialBand[]; }): Material; /** * Creates a {@link Cesium3DTileset} instance for the Google Photorealistic 3D * Tiles tileset. * * Google Photorealistic 3D Tiles can only be used with the Google geocoder. To * confirm that you are aware of this restriction pass * `usingOnlyWithGoogleGeocoder: true` to the apiOptions. Otherwise a one time * warning will be displayed when this function is called. * @example * const viewer = new Cesium.Viewer("cesiumContainer", { * geocoder: Cesium.IonGeocodeProviderType.GOOGLE * }); * * try { * const tileset = await Cesium.createGooglePhotorealistic3DTileset({ * onlyUsingWithGoogleGeocoder: true, * }); * viewer.scene.primitives.add(tileset)); * } catch (error) { * console.log(`Error creating tileset: ${error}`); * } * @example * // Use your own Google Maps API key * Cesium.GoogleMaps.defaultApiKey = "your-api-key"; * * const viewer = new Cesium.Viewer("cesiumContainer". { * geocoder: Cesium.IonGeocodeProviderType.GOOGLE * }); * * try { * const tileset = await Cesium.createGooglePhotorealistic3DTileset({ * onlyUsingWithGoogleGeocoder: true, * }); * viewer.scene.primitives.add(tileset)); * } catch (error) { * console.log(`Error creating tileset: ${error}`); * } * @param [apiOptions.key = GoogleMaps.defaultApiKey] - Your API key to access Google Photorealistic 3D Tiles. See {@link https://developers.google.com/maps/documentation/javascript/get-api-key} for instructions on how to create your own key. * @param [apiOptions.onlyUsingWithGoogleGeocoder] - Confirmation that this tileset will only be used with the Google geocoder. * @param [tilesetOptions] - An object describing initialization options. */ export function createGooglePhotorealistic3DTileset(apiOptions?: { key?: string; onlyUsingWithGoogleGeocoder?: true; }, tilesetOptions?: Cesium3DTileset.ConstructorOptions): Promise; /** * Creates a {@link Cesium3DTileset} instance for the * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings} * tileset. * @example * // Create Cesium OSM Buildings with default styling * const viewer = new Cesium.Viewer("cesiumContainer"); * try { * const tileset = await Cesium.createOsmBuildingsAsync(); * viewer.scene.primitives.add(tileset)); * } catch (error) { * console.log(`Error creating tileset: ${error}`); * } * @example * // Create Cesium OSM Buildings with a custom style highlighting * // schools and hospitals. * const viewer = new Cesium.Viewer("cesiumContainer"); * try { * const tileset = await Cesium.createOsmBuildingsAsync({ * style: new Cesium.Cesium3DTileStyle({ * color: { * conditions: [ * ["${feature['building']} === 'hospital'", "color('#0000FF')"], * ["${feature['building']} === 'school'", "color('#00FF00')"], * [true, "color('#ffffff')"] * ] * } * }) * }); * viewer.scene.primitives.add(tileset)); * } catch (error) { * console.log(`Error creating tileset: ${error}`); * } * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor * may be specified here. In addition to those, the following properties are supported: * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings * that do not have a color. This parameter is ignored if options.style is specified. * @param [options.style] - The style to use with the tileset. If not * specified, a default style is used which gives each building or building part a * color inferred from its OpenStreetMap tags. If no color can be inferred, * options.defaultColor is used. * @param [options.enableShowOutline = true] - If true, enable rendering outlines. This can be set to false to avoid the additional processing of geometry at load time. * @param [options.showOutline = true] - Whether to show outlines around buildings. When true, * outlines are displayed. When false, outlines are not displayed. */ export function createOsmBuildingsAsync(options?: { defaultColor?: Color; style?: Cesium3DTileStyle; enableShowOutline?: boolean; showOutline?: boolean; }): Promise; /** * Creates a {@link Primitive} to visualize well-known vector vertex attributes: * normal, tangent, and bitangent. Normal * is red; tangent is green; and bitangent is blue. If an attribute is not * present, it is not drawn. * @example * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({ * geometry : instance.geometry, * length : 100000.0, * modelMatrix : instance.modelMatrix * })); * @param options - Object with the following properties: * @param options.geometry - The Geometry instance with the attribute. * @param [options.length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates. * @returns A new Primitive instance with geometry for the vectors. */ export function createTangentSpaceDebugPrimitive(options: { geometry: Geometry; length?: number; modelMatrix?: Matrix4; }): Primitive; /** * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps. * @example * // Create a Cesium World Imagery base layer with default settings * try { * const imageryProvider = await Cesium.createWorldImageryAsync(); * } catch (error) { * console.log(`There was an error creating world imagery: ${error}`); * } * @example * // Create Cesium World Imagery with different style * try { * const imageryProvider = await Cesium.createWorldImageryAsync({ * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS * }); * } catch (error) { * console.log(`There was an error creating world imagery: ${error}`); * } * @param [options] - Object with the following properties: * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. */ export function createWorldImageryAsync(options?: { style?: IonWorldImageryStyle; }): Promise; /** * A widget containing a Cesium scene. * @example * // 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. * const widget = new Cesium.CesiumWidget("cesiumContainer"); * * // Widget with ion imagery and Cesium World Terrain. * const widget2 = new Cesium.CesiumWidget("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromWorldTerrain(), * terrain: Cesium.Terrain.fromWorldTerrain() * 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() * }); * @param container - The DOM element or ID that will contain the widget. * @param [options] - Object with the following properties: * @param [options.clock = new Clock()] - The clock to use to control current time. * @param [options.shouldAnimate = false] - true if the clock should attempt to advance simulation time by default, false otherwise. * @param [options.ellipsoid = Ellipsoid.default] - The default ellipsoid. * @param [options.baseLayer = ImageryLayer.fromWorldImagery()] - The bottommost imagery layer applied to the globe. If set to false, no imagery provider will be added. * @param [options.terrainProvider = new EllipsoidTerrainProvider(options.ellipsoid)] - The terrain provider. * @param [options.terrain] - A terrain object which handles asynchronous terrain provider. Can only specify if options.terrainProvider is undefined. * @param [options.skyBox] - The skybox used to render the stars. When undefined and the WGS84 ellipsoid used, the default stars are used. If set to false, no skyBox, Sun, or Moon will be added. * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Enabled when the default ellipsoid used. Set to false to turn it off. * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode. * @param [options.scene3DOnly = false] - When true, each geometry instance will only be rendered in 3D to save GPU memory. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency. * @param [options.mapProjection = new GeographicProjection(options.ellipsoid)] - The map projection to use in 2D and Columbus View modes. * @param [options.globe = new Globe(options.ellipsoid)] - The globe to use in the scene. If set to false, no globe will be added and the sky atmosphere will be hidden by default. * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise. * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore window.devicePixelRatio. * @param [options.targetFrameRate] - The target frame rate when using the default render loop. * @param [options.showRenderLoopErrors = true] - If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. * @param [options.automaticallyTrackDataSourceClocks = true] - If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently. * @param [options.contextOptions] - Context and WebGL creation properties passed to {@link Scene}. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added * to the bottom of the widget itself. * @param [options.creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. * @param [options.dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided, * the instance is assumed to be owned by the caller and will not be destroyed when the widget is destroyed. * @param [options.shadows = false] - Determines if shadows are cast by light sources. * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. * @param [options.blurActiveElementOnCanvasFocus = true] - If true, the active element will blur when the widget's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element. * @param [options.requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. * @param [options.msaaSamples = 4] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets. Set to 1 to disable MSAA. */ export class CesiumWidget { constructor(container: Element | string, options?: { clock?: Clock; shouldAnimate?: boolean; ellipsoid?: Ellipsoid; baseLayer?: ImageryLayer | false; terrainProvider?: TerrainProvider; terrain?: Terrain; skyBox?: SkyBox | false; skyAtmosphere?: SkyAtmosphere | false; sceneMode?: SceneMode; scene3DOnly?: boolean; orderIndependentTranslucency?: boolean; mapProjection?: MapProjection; globe?: Globe | false; useDefaultRenderLoop?: boolean; useBrowserRecommendedResolution?: boolean; targetFrameRate?: number; showRenderLoopErrors?: boolean; automaticallyTrackDataSourceClocks?: boolean; contextOptions?: ContextOptions; creditContainer?: Element | string; creditViewport?: Element | string; dataSources?: DataSourceCollection; shadows?: boolean; terrainShadows?: ShadowMode; mapMode2D?: MapMode2D; blurActiveElementOnCanvasFocus?: boolean; requestRenderMode?: boolean; maximumRenderTimeChange?: number; msaaSamples?: number; }); /** * Gets the parent container. */ readonly container: Element; /** * Gets the canvas. */ readonly canvas: HTMLCanvasElement; /** * Gets the credit container. */ readonly creditContainer: Element; /** * Gets the credit viewport */ readonly creditViewport: Element; /** * Gets the scene. */ readonly scene: Scene; /** * Gets the collection of image layers that will be rendered on the globe. */ readonly imageryLayers: ImageryLayerCollection; /** * The terrain provider providing surface geometry for the globe. */ terrainProvider: TerrainProvider; /** * Manages the list of credits to display on screen and in the lightbox. */ creditDisplay: CreditDisplay; /** * Gets the display used for {@link DataSource} visualization. */ readonly dataSourceDisplay: DataSourceDisplay; /** * Gets the collection of entities not tied to a particular data source. * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link CesiumWidget#dataSourceDisplay}. */ readonly entities: EntityCollection; /** * Gets the set of {@link DataSource} instances to be visualized. */ readonly dataSources: DataSourceCollection; /** * Gets the camera. */ readonly camera: Camera; /** * Gets the default ellipsoid for the scene. */ readonly ellipsoid: Ellipsoid; /** * Gets the clock. */ readonly clock: Clock; /** * Gets the screen space event handler. */ readonly screenSpaceEventHandler: ScreenSpaceEventHandler; /** * Gets or sets the target frame rate of the widget when useDefaultRenderLoop * is true. If undefined, the browser's requestAnimationFrame implementation * determines the frame rate. If defined, this value must be greater than 0. A value higher * than the underlying requestAnimationFrame implementation will have no effect. */ targetFrameRate: number; /** * Gets or sets whether or not this widget should control the render loop. * If true the widget will use requestAnimationFrame to * perform rendering and resizing of the widget, as well as drive the * simulation clock. If set to false, you must manually call the * resize, render methods as part of a custom * render loop. If an error occurs during rendering, {@link Scene}'s * renderError event will be raised and this property * will be set to false. It must be set back to true to continue rendering * after the error. */ useDefaultRenderLoop: boolean; /** * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve * performance on less powerful devices while values greater than 1.0 will render at a higher * resolution and then scale down, resulting in improved visual fidelity. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 * will cause the scene to be rendered at 320x240 and then scaled up while setting * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. */ resolutionScale: number; /** * Boolean flag indicating if the browser's recommended resolution is used. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead, * effectively rendering based on CSS pixels instead of device pixels. This can improve * performance on less powerful devices that have high pixel density. When false, rendering * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether * this flag is true or false. */ useBrowserRecommendedResolution: boolean; /** * Gets or sets whether or not data sources can temporarily pause * animation in order to avoid showing an incomplete picture to the user. * For example, if asynchronous primitives are being processed in the * background, the clock will not advance until the geometry is ready. */ allowDataSourcesToSuspendAnimation: boolean; /** * Gets or sets the Entity instance currently being tracked by the camera. */ trackedEntity: Entity | undefined; /** * Gets the event that is raised when the tracked entity changes. */ readonly trackedEntityChanged: Event; /** * Gets or sets the data source to track with the widget's clock. */ clockTrackedDataSource: DataSource; /** * Show an error panel to the user containing a title and a longer error message, * which can be dismissed using an OK button. This panel is displayed automatically * when a render loop error occurs, if showRenderLoopErrors was not false when the * widget was constructed. * @param title - The title to be displayed on the error panel. This string is interpreted as text. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text. */ showErrorPanel(title: string, message?: string, error?: string): void; /** * @returns true if the object has been destroyed, false otherwise. */ isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently * removing the widget from layout. */ destroy(): void; /** * Updates the canvas size, camera aspect ratio, and viewport size. * This function is called automatically as needed unless * useDefaultRenderLoop is set to false. */ resize(): void; /** * Renders the scene. This function is called automatically * unless useDefaultRenderLoop is set to false; */ render(): void; /** * Adds a controller— an implementation of the {@link Controller} interface used to handle input events, camera animations, and other interactions— to the widget's scene. * @example * widget.scene.screenSpaceCameraController.enableInputs = false; * widget.scene.screenSpaceCameraController.enableCollisionDetection = false; * * const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController(); * widget.addController(tiltOrbitController); * @param controller - An implementation of the Controller interface. */ addController(controller: Controller): void; /** * Removes a controller— an implementation of the {@link Controller} interface used to handle input events, camera animations, and other interactions— from the widget's scene. * @example * widget.removeController(tiltOrbitController); * @param controller - An implementation of the Controller interface. */ removeController(controller: Controller): void; /** * Asynchronously sets the camera to view the provided entity, entities, or data source. * If the data source is still in the process of loading or the visualization is otherwise still loading, * this method waits for the data to be ready before performing the zoom. * *

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

* *

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

* @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame. * @returns A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled. */ zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise>, offset?: HeadingPitchRange): Promise; /** * Flies the camera to the provided entity, entities, or data source. * If the data source is still in the process of loading or the visualization is otherwise still loading, * this method waits for the data to be ready before performing the flight. * *

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

* *

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

* @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types. * @param [options] - Object with the following properties: * @param [options.duration = 3.0] - The duration of the flight in seconds. * @param [options.maximumHeight] - The maximum height at the peak of the flight. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target. * @returns A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions */ flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise>, options?: { duration?: number; maximumHeight?: number; offset?: HeadingPitchRange; }): Promise; } /** * @property scene - The scene in the widget. */ export type Viewer = { scene: Scene; }; /** * Contains functions for transforming positions to various reference frames. */ export const Transforms: typeof FixedFrameTransforms & typeof _CelestialFrameTransforms; }