@juun-roh/cesium-utils 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,180 +0,0 @@
1
- import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData } from 'cesium';
2
-
3
- /**
4
- * @class
5
- * Provides terrain by delegating requests to different terrain providers
6
- * based on geographic regions and zoom levels. This allows combining
7
- * multiple terrain sources into a single seamless terrain.
8
- *
9
- * @example
10
- * ``` typescript
11
- * // Tile-coordinate based for precise control (multiple levels)
12
- * const customTiles: TerrainTiles = new Map();
13
- * customTiles.set(15, { x: [55852, 55871], y: [9556, 9575] });
14
- * customTiles.set(16, { x: [111704, 111742], y: [19112, 19150] });
15
- *
16
- * const hybridTerrain = new HybridTerrainProvider({
17
- * regions: [
18
- * {
19
- * provider: customProvider,
20
- * tiles: customTiles,
21
- * }
22
- * ],
23
- * defaultProvider: worldTerrain
24
- * });
25
- *
26
- * viewer.terrainProvider = hybridTerrain;
27
- * ```
28
- */
29
- declare class HybridTerrainProvider implements TerrainProvider {
30
- private _regions;
31
- private _defaultProvider;
32
- private _fallbackProvider;
33
- private _tilingScheme;
34
- private _ready;
35
- private _availability?;
36
- /**
37
- * Creates a new `HybridTerrainProvider` instance.
38
- * @param options {@link HybridTerrainProvider.ConstructorOptions}
39
- * @returns A new `HybridTerrainProvider` instance.
40
- */
41
- constructor(options: HybridTerrainProvider.ConstructorOptions);
42
- /**
43
- * Gets a value indicating whether or not the provider is ready for use,
44
- * or a promise that resolves when the provider becomes ready.
45
- */
46
- get ready(): boolean;
47
- /**
48
- * Gets the tiling scheme used by this provider.
49
- */
50
- get tilingScheme(): TilingScheme;
51
- /**
52
- * Gets an object that can be used to determine availability of terrain from this provider.
53
- */
54
- get availability(): TileAvailability | undefined;
55
- /**
56
- * Gets the list of terrain regions managed by this provider.
57
- */
58
- get regions(): readonly HybridTerrainProvider.TerrainRegion[];
59
- /**
60
- * Gets the default terrain provider.
61
- */
62
- get defaultProvider(): TerrainProvider;
63
- /**
64
- * Gets the fallback terrain provider.
65
- */
66
- get fallbackProvider(): TerrainProvider;
67
- /**
68
- * Gets the credit to display when this terrain provider is active. Typically this is used to credit
69
- * the source of the terrain.
70
- */
71
- get credit(): Credit;
72
- /**
73
- * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
74
- * to the event, you will be notified of the error and can potentially recover from it. Event listeners
75
- * are passed an instance of `TileProviderError`.
76
- */
77
- get errorEvent(): any;
78
- /**
79
- * Gets a value indicating whether or not the provider includes a water mask. The water mask
80
- * indicates which areas of the globe are water rather than land, so they can be rendered
81
- * as a reflective surface with animated waves.
82
- */
83
- get hasWaterMask(): boolean;
84
- /** Gets a value indicating whether or not the requested tiles include vertex normals. */
85
- get hasVertexNormals(): boolean;
86
- /**
87
- * Makes sure we load availability data for a tile
88
- * @param x - The X coordinate of the tile for which to request geometry.
89
- * @param y - The Y coordinate of the tile for which to request geometry.
90
- * @param level - The level of the tile for which to request geometry.
91
- * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
92
- */
93
- loadTileDataAvailability(x: number, y: number, level: number): Promise<void> | undefined;
94
- /**
95
- * Gets the maximum geometric error allowed in a tile at a given level.
96
- * @param level - The tile level for which to get the maximum geometric error.
97
- * @returns The maximum geometric error.
98
- */
99
- getLevelMaximumGeometricError(level: number): number;
100
- /**
101
- * Requests the terrain for a given tile coordinate.
102
- * @param x The X coordinate of the tile.
103
- * @param y The Y coordinate of the tile.
104
- * @param level The zoom level of the tile.
105
- * @param request The request.
106
- * @returns A promise for the requested terrain.
107
- */
108
- requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
109
- /**
110
- * Determines whether data for a tile is available to be loaded. Checks the specified terrain regions first.
111
- * @param x - The X coordinate of the tile for which to request geometry.
112
- * @param y - The Y coordinate of the tile for which to request geometry.
113
- * @param level - The level of the tile for which to request geometry.
114
- * @returns Undefined if not supported by the terrain provider, otherwise true or false.
115
- */
116
- getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
117
- }
118
- /**
119
- * @namespace
120
- * Contains types and factory methods for `HybridTerrainProvider` instance.
121
- */
122
- declare namespace HybridTerrainProvider {
123
- /** Initialization options for `HybridTerrainProvider` constructor. */
124
- interface ConstructorOptions {
125
- /** An array of terrain regions to include in the hybrid terrain. */
126
- regions?: TerrainRegion[];
127
- /** Default provider to use outside of specified terrain regions. */
128
- defaultProvider: TerrainProvider;
129
- /** Optional fallback provider when data is not available from default provider. @default EllipsoidTerrainProvider */
130
- fallbackProvider?: TerrainProvider;
131
- }
132
- /**
133
- * A factory function which creates a HybridTerrainProvider from tile-coordinate based regions.
134
- * @param regions Array of regions with tile-coordinate bounds
135
- * @param defaultProvider Default terrain provider
136
- * @param fallbackProvider Optional fallback provider
137
- */
138
- function fromTileRanges(regions: Array<{
139
- provider: TerrainProvider;
140
- tiles: Map<number, {
141
- x: number | [number, number];
142
- y: number | [number, number];
143
- }>;
144
- levels?: number[];
145
- }>, defaultProvider: TerrainProvider, fallbackProvider?: TerrainProvider): HybridTerrainProvider;
146
- /** Represents a terrain region with provider and geographic bounds. */
147
- interface TerrainRegion {
148
- /** The terrain provider for this region. */
149
- provider: TerrainProvider;
150
- /**
151
- * Tile-coordinate based bounds (precise control).
152
- * Map of level to tile coordinate ranges for that level.
153
- */
154
- tiles?: Map<number, {
155
- /** X tile coordinate range [min, max] or single value. */
156
- x: number | [number, number];
157
- /** Y tile coordinate range [min, max] or single value. */
158
- y: number | [number, number];
159
- }>;
160
- /** Optional level constraints. If specified, region only applies to these levels. */
161
- levels?: number[];
162
- }
163
- /**
164
- * @namespace
165
- * Utility functions for working with TerrainRegion objects.
166
- */
167
- namespace TerrainRegion {
168
- /**
169
- * Checks if a terrain region contains the specified tile.
170
- * @param region The terrain region to check
171
- * @param x The X coordinate of the tile
172
- * @param y The Y coordinate of the tile
173
- * @param level The zoom level of the tile
174
- * @returns True if the region contains the tile, false otherwise
175
- */
176
- function contains(region: HybridTerrainProvider.TerrainRegion, x: number, y: number, level: number): boolean;
177
- }
178
- }
179
-
180
- export { HybridTerrainProvider as H };
@@ -1,8 +0,0 @@
1
- import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-Th8n2hZ1.cjs';
2
- import 'cesium';
3
-
4
- type TerrainTiles = NonNullable<HybridTerrainProvider.TerrainRegion["tiles"]>;
5
- type TerrainRegion = HybridTerrainProvider.TerrainRegion;
6
- type TerrainOptions = HybridTerrainProvider.ConstructorOptions;
7
-
8
- export { HybridTerrainProvider, type TerrainOptions, type TerrainRegion, type TerrainTiles };
@@ -1,8 +0,0 @@
1
- import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-Th8n2hZ1.js';
2
- import 'cesium';
3
-
4
- type TerrainTiles = NonNullable<HybridTerrainProvider.TerrainRegion["tiles"]>;
5
- type TerrainRegion = HybridTerrainProvider.TerrainRegion;
6
- type TerrainOptions = HybridTerrainProvider.ConstructorOptions;
7
-
8
- export { HybridTerrainProvider, type TerrainOptions, type TerrainRegion, type TerrainTiles };
@@ -1,19 +0,0 @@
1
- import { Viewer } from 'cesium';
2
-
3
- /**
4
- * Copies configuration and state from one Cesium Viewer to another.
5
- * @param source - The source viewer to copy properties from
6
- * @param container - DOM element ID or element for the new viewer
7
- * @param options - Optional override options for the new viewer
8
- * @returns A new Viewer instance with copied properties
9
- */
10
- declare function cloneViewer(source: Viewer, container: Element | string, options?: Viewer.ConstructorOptions): Viewer;
11
-
12
- /**
13
- * Copies camera state from source viewer to destination viewer.
14
- * @param source The source viewer to copy camera states from.
15
- * @param dest The destination viewer to apply camera properties from the source.
16
- */
17
- declare function syncCamera(source: Viewer, dest: Viewer): void;
18
-
19
- export { cloneViewer, syncCamera };
@@ -1,19 +0,0 @@
1
- import { Viewer } from 'cesium';
2
-
3
- /**
4
- * Copies configuration and state from one Cesium Viewer to another.
5
- * @param source - The source viewer to copy properties from
6
- * @param container - DOM element ID or element for the new viewer
7
- * @param options - Optional override options for the new viewer
8
- * @returns A new Viewer instance with copied properties
9
- */
10
- declare function cloneViewer(source: Viewer, container: Element | string, options?: Viewer.ConstructorOptions): Viewer;
11
-
12
- /**
13
- * Copies camera state from source viewer to destination viewer.
14
- * @param source The source viewer to copy camera states from.
15
- * @param dest The destination viewer to apply camera properties from the source.
16
- */
17
- declare function syncCamera(source: Viewer, dest: Viewer): void;
18
-
19
- export { cloneViewer, syncCamera };