Skip to content

Commit 4090852

Browse files
committed
refactor(vue-cesium): ♻️ update
1 parent b1aa4e4 commit 4090852

File tree

1 file changed

+75
-32
lines changed

1 file changed

+75
-32
lines changed

typings/Cesium.d.ts

Lines changed: 75 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7831,15 +7831,14 @@ declare namespace Cesium {
78317831
/**
78327832
* Default settings for accessing the Google Maps API.
78337833
* <br/>
7834-
* An API key is only required if you are using any Google Maps APIs, such as {@link createGooglePhotorealistic3DTileset}.
7835-
* A default key is provided for evaluation purposes only.
7834+
* An API key is only required if you are directly using any Google Maps APIs, such as through {@link createGooglePhotorealistic3DTileset}.
78367835
* Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}
78377836
*/
78387837
export namespace GoogleMaps {
78397838
/**
78407839
* Gets or sets the default Google Maps API key.
78417840
*/
7842-
var defaultApiKey: string
7841+
var defaultApiKey: undefined | string
78437842
/**
78447843
* Gets or sets the default Google Map Tiles API endpoint.
78457844
*/
@@ -13184,6 +13183,15 @@ declare namespace Cesium {
1318413183
* @param [result] - The object into which to store the result.
1318513184
*/
1318613185
static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void
13186+
/**
13187+
* Computes a rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles.
13188+
* @param positions - A linear ring defining the outer boundary of the polygon.
13189+
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
13190+
* @param [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
13191+
* @param [result] - An object in which to store the result.
13192+
* @returns The result rectangle
13193+
*/
13194+
static computeRectangleFromPositions(positions: Cartesian3[], ellipsoid?: Ellipsoid, arcType?: ArcType, result?: Rectangle): Rectangle
1318713195
/**
1318813196
* Returns the bounding rectangle given the provided options
1318913197
* @param options - Object with the following properties:
@@ -16404,6 +16412,15 @@ declare namespace Cesium {
1640416412
evaluate(time: number, result?: Cartesian3 | Quaternion): number | Cartesian3 | Quaternion
1640516413
}
1640616414

16415+
/**
16416+
* Represents a point in stereographic coordinates, which can be obtained by projecting a cartesian coordinate from one pole onto a tangent plane at the other pole.
16417+
* The stereographic projection faithfully represents the relative directions of all great circles passing through its center point.
16418+
* To faithfully represents angles everywhere, this is a conformal projection, which means points are projected onto an arbrary sphere.
16419+
* @param [position] - The steroegraphic coordinates.
16420+
* @param [tangentPlane] - The tangent plane onto which the point was projected.
16421+
*/
16422+
export function Stereographic(position?: Cartesian2, tangentPlane?: EllipseGeometry): void
16423+
1640716424
/**
1640816425
* A wrapper around a web worker that allows scheduling tasks for a given worker,
1640916426
* returning results asynchronously via a promise.
@@ -18718,12 +18735,25 @@ declare namespace Cesium {
1871818735
* const updatedPositions = await Cesium.sampleTerrain(terrainProvider, 11, positions);
1871918736
* // positions[0].height and positions[1].height have been updated.
1872018737
* // updatedPositions is just a reference to positions.
18738+
*
18739+
* // To handle tile errors, pass true for the rejectOnTileFail parameter.
18740+
* try {
18741+
* const updatedPositions = await Cesium.sampleTerrain(terrainProvider, 11, positions, true);
18742+
* } catch (error) {
18743+
* // A tile request error occurred.
18744+
* }
1872118745
* @param terrainProvider - The terrain provider from which to query heights.
1872218746
* @param level - The terrain level-of-detail from which to query terrain heights.
1872318747
* @param positions - The positions to update with terrain heights.
18748+
* @param [rejectOnTileFail = false] - If true, for a failed terrain tile request the promise will be rejected. If false, returned heights will be undefined.
1872418749
* @returns A promise that resolves to the provided list of positions when terrain the query has completed.
1872518750
*/
18726-
export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>
18751+
export function sampleTerrain(
18752+
terrainProvider: TerrainProvider,
18753+
level: number,
18754+
positions: Cartographic[],
18755+
rejectOnTileFail?: boolean
18756+
): Promise<Cartographic[]>
1872718757

1872818758
/**
1872918759
* Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
@@ -18737,12 +18767,24 @@ declare namespace Cesium {
1873718767
* const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
1873818768
* // positions[0].height and positions[1].height have been updated.
1873918769
* // updatedPositions is just a reference to positions.
18770+
*
18771+
* // To handle tile errors, pass true for the rejectOnTileFail parameter.
18772+
* try {
18773+
* const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions, true);
18774+
* } catch (error) {
18775+
* // A tile request error occurred.
18776+
* }
1874018777
* @param terrainProvider - The terrain provider from which to query heights.
1874118778
* @param positions - The positions to update with terrain heights.
18779+
* @param [rejectOnTileFail = false] - If true, for a failed terrain tile request the promise will be rejected. If false, returned heights will be undefined.
1874218780
* @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
1874318781
* promise will reject if the terrain provider's `availability` property is undefined.
1874418782
*/
18745-
export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>
18783+
export function sampleTerrainMostDetailed(
18784+
terrainProvider: TerrainProvider,
18785+
positions: Cartographic[],
18786+
rejectOnTileFail?: boolean
18787+
): Promise<Cartographic[]>
1874618788

1874718789
/**
1874818790
* Subdivides an array into a number of smaller, equal sized arrays.
@@ -28959,7 +29001,6 @@ declare namespace Cesium {
2895929001
* @property [modelForwardAxis = Axis.X] - Which axis is considered forward when loading models for tile contents.
2896029002
* @property [shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources.
2896129003
* @property [maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement.
28962-
* @property [maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset. Deprecated.
2896329004
* @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.
2896429005
* @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.
2896529006
* @property [cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes.
@@ -29021,7 +29062,6 @@ declare namespace Cesium {
2902129062
modelForwardAxis?: Axis
2902229063
shadows?: ShadowMode
2902329064
maximumScreenSpaceError?: number
29024-
maximumMemoryUsage?: number
2902529065
cacheBytes?: number
2902629066
maximumCacheOverflowBytes?: number
2902729067
cullWithChildrenBounds?: boolean
@@ -29620,26 +29660,6 @@ declare namespace Cesium {
2962029660
* </p>
2962129661
*/
2962229662
maximumScreenSpaceError: number
29623-
/**
29624-
* The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from
29625-
* geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
29626-
* includes per-point metadata.
29627-
* <p>
29628-
* Tiles not in view are unloaded to enforce this.
29629-
* </p>
29630-
* <p>
29631-
* If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
29632-
* </p>
29633-
* <p>
29634-
* If tiles sized more than <code>maximumMemoryUsage</code> are needed
29635-
* to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},
29636-
* for the current view, then the memory usage of the tiles loaded will exceed
29637-
* <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but
29638-
* 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When
29639-
* these tiles go out of view, they will be unloaded.
29640-
* </p>
29641-
*/
29642-
maximumMemoryUsage: number
2964329663
/**
2964429664
* The amount of GPU memory (in bytes) used to cache tiles. This memory usage is estimated from
2964529665
* geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
@@ -38883,16 +38903,16 @@ declare namespace Cesium {
3888338903
* </p>
3888438904
* @example
3888538905
* // multiple silhouette effects
38886-
* const yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
38906+
* const yellowEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
3888738907
* yellowEdge.uniforms.color = Cesium.Color.YELLOW;
3888838908
* yellowEdge.selected = [feature0];
3888938909
*
38890-
* const greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
38910+
* const greenEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
3889138911
* greenEdge.uniforms.color = Cesium.Color.LIME;
3889238912
* greenEdge.selected = [feature1];
3889338913
*
3889438914
* // draw edges around feature0 and feature1
38895-
* postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
38915+
* postProcessStages.add(Cesium.PostProcessStageLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
3889638916
* @returns A post-process stage that applies an edge detection effect.
3889738917
*/
3889838918
function createEdgeDetectionStage(): PostProcessStage
@@ -39314,6 +39334,19 @@ declare namespace Cesium {
3931439334
* Gets the number of primitives in the collection.
3931539335
*/
3931639336
readonly length: number
39337+
/**
39338+
* An event that is raised when a primitive is added to the collection.
39339+
* Event handlers are passed the primitive that was added.
39340+
*/
39341+
readonly primitiveAdded: Event
39342+
/**
39343+
* An event that is raised when a primitive is removed from the collection.
39344+
* Event handlers are passed the primitive that was removed.
39345+
* <p>
39346+
* Note: Depending on the destroyPrimitives constructor option, the primitive may already be destroyed.
39347+
* </p>
39348+
*/
39349+
readonly primitiveRemoved: Event
3931739350
/**
3931839351
* Adds a primitive to the collection.
3931939352
* @example
@@ -42489,6 +42522,16 @@ declare namespace Cesium {
4248942522
/**
4249042523
* Creates a {@link Cesium3DTileset} instance for the Google Photorealistic 3D Tiles tileset.
4249142524
* @example
42525+
* const viewer = new Cesium.Viewer("cesiumContainer");
42526+
*
42527+
* try {
42528+
* const tileset = await Cesium.createGooglePhotorealistic3DTileset();
42529+
* viewer.scene.primitives.add(tileset));
42530+
* } catch (error) {
42531+
* console.log(`Error creating tileset: ${error}`);
42532+
* }
42533+
* @example
42534+
* // Use your own Google Maps API key
4249242535
* Cesium.GoogleMaps.defaultApiKey = "your-api-key";
4249342536
*
4249442537
* const viewer = new Cesium.Viewer("cesiumContainer");
@@ -42637,7 +42680,7 @@ declare namespace Cesium {
4263742680
* @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
4263842681
* @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
4263942682
* @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
42640-
* @param [options.globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
42683+
* @param [options.globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added and the sky atmosphere will be hidden by default.
4264142684
* @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
4264242685
* @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
4264342686
* @param [options.targetFrameRate] - The target frame rate when using the default render loop.
@@ -44801,7 +44844,7 @@ declare namespace Cesium {
4480144844
* @property [contextOptions] - Context and WebGL creation properties passed to {@link Scene}.
4480244845
* @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
4480344846
* @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
44804-
* @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
44847+
* @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added and the sky atmosphere will be hidden by default.
4480544848
* @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
4480644849
* @property [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.
4480744850
* @property [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.

0 commit comments

Comments
 (0)