@juun-roh/cesium-utils 0.2.1 → 0.2.3
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.
- package/README.md +115 -21
- package/dist/chunk-DGHCIGKJ.js +1 -0
- package/dist/chunk-N24M6GYI.js +1 -0
- package/dist/chunk-TUJQL7MC.js +1 -0
- package/dist/{chunk-2JNRK7SN.js → chunk-Z2COOTT4.js} +1 -1
- package/dist/collection/index.cjs +1 -1
- package/dist/collection/index.d.cts +1 -1
- package/dist/collection/index.d.ts +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/dev/index.cjs +1 -0
- package/dist/{utils → dev}/index.d.cts +108 -11
- package/dist/{utils → dev}/index.d.ts +108 -11
- package/dist/dev/index.js +1 -0
- package/dist/{hybrid-terrain-provider-C7Ks0pK6.d.ts → hybrid-terrain-provider-C2V-igd9.d.cts} +2 -150
- package/dist/{hybrid-terrain-provider-C7Ks0pK6.d.cts → hybrid-terrain-provider-C2V-igd9.d.ts} +2 -150
- package/dist/{index-Bd_-DTWl.d.cts → index-C7kPHG5S.d.cts} +5 -1
- package/dist/{index-Bd_-DTWl.d.ts → index-C7kPHG5S.d.ts} +5 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/terrain/index.cjs +1 -1
- package/dist/terrain/index.d.cts +1 -2
- package/dist/terrain/index.d.ts +1 -2
- package/dist/terrain/index.js +1 -1
- package/dist/viewer/index.cjs +1 -1
- package/dist/viewer/index.js +1 -1
- package/package.json +29 -23
- package/dist/chunk-64HXTGRV.js +0 -1
- package/dist/chunk-NO7SO2WH.js +0 -1
- package/dist/utils/index.cjs +0 -1
- package/dist/utils/index.js +0 -1
package/dist/{hybrid-terrain-provider-C7Ks0pK6.d.ts → hybrid-terrain-provider-C2V-igd9.d.cts}
RENAMED
|
@@ -1,152 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @class
|
|
5
|
-
* @deprecated Use HybridTerrainProvider.TerrainRegion instead.
|
|
6
|
-
* This class is maintained for backward compatibility but will be removed in a future version.
|
|
7
|
-
*
|
|
8
|
-
* For migration:
|
|
9
|
-
* - Replace TerrainArea with HybridTerrainProvider.TerrainRegion
|
|
10
|
-
* - Use Rectangle.fromDegrees() for bounds instead of tile ranges
|
|
11
|
-
* - Simplify HybridTerrainProvider constructor to use regions directly
|
|
12
|
-
*
|
|
13
|
-
* Represents a geographic area with a specific terrain provider.
|
|
14
|
-
* `TerrainArea` pairs a provider with geographic bounds and level constraints.
|
|
15
|
-
*/
|
|
16
|
-
declare class TerrainArea {
|
|
17
|
-
private _terrainProvider;
|
|
18
|
-
private _rectangle;
|
|
19
|
-
private _tileRanges;
|
|
20
|
-
private _ready;
|
|
21
|
-
private _credit;
|
|
22
|
-
private _isCustom;
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new instance of `TerrainArea`.
|
|
25
|
-
* @param options Object describing initialization options
|
|
26
|
-
*/
|
|
27
|
-
constructor(options: TerrainArea.ConstructorOptions);
|
|
28
|
-
/**
|
|
29
|
-
* Checks if the specified tile coordinates are within the bounds.
|
|
30
|
-
* @param x The tile X coordinate.
|
|
31
|
-
* @param y The tile Y coordinate.
|
|
32
|
-
* @param level The tile level.
|
|
33
|
-
* @returns `true` if the tile is within bounds, `false` otherwise.
|
|
34
|
-
*/
|
|
35
|
-
contains(x: number, y: number, level: number): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Requests the geometry for a given tile. The result must include terrain data and
|
|
38
|
-
* may optionally include a water mask and an indication of which child tiles are available.
|
|
39
|
-
* @param x - The X coordinate of the tile for which to request geometry.
|
|
40
|
-
* @param y - The Y coordinate of the tile for which to request geometry.
|
|
41
|
-
* @param level - The level of the tile for which to request geometry.
|
|
42
|
-
* @param [request] - The request object. Intended for internal use only.
|
|
43
|
-
* @returns A promise for the requested geometry. If this method
|
|
44
|
-
* returns undefined instead of a promise, it is an indication that too many requests are already
|
|
45
|
-
* pending and the request will be retried later.
|
|
46
|
-
*/
|
|
47
|
-
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<Awaited<TerrainData>> | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Determines whether data for a tile is available to be loaded.
|
|
50
|
-
* @param x - The X coordinate of the tile for which to request geometry.
|
|
51
|
-
* @param y - The Y coordinate of the tile for which to request geometry.
|
|
52
|
-
* @param level - The level of the tile for which to request geometry.
|
|
53
|
-
* @returns Undefined if not supported by the terrain provider, otherwise true or false.
|
|
54
|
-
* @see {@link TerrainProvider.getTileDataAvailable} */
|
|
55
|
-
getTileDataAvailable(x: number, y: number, level: number): boolean;
|
|
56
|
-
/** Checks if this terrain provider is marked as a custom provider. */
|
|
57
|
-
get isCustom(): boolean;
|
|
58
|
-
/** Gets the credit associated with this terrain area. */
|
|
59
|
-
get credit(): string | Credit;
|
|
60
|
-
/** Gets the terrain provider for this terrain area. */
|
|
61
|
-
get terrainProvider(): TerrainProvider;
|
|
62
|
-
/** Gets available tile ranges with zoom levels set with this terrain area. */
|
|
63
|
-
get tileRanges(): Map<number, TerrainArea.TileRange>;
|
|
64
|
-
/** Gets the rectangle representing this terrain area. */
|
|
65
|
-
get rectangle(): Rectangle;
|
|
66
|
-
/** Gets if this terrain area is ready. */
|
|
67
|
-
get ready(): boolean;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @namespace
|
|
71
|
-
* Contains types and factory methods for creating `TerrainArea` instances.
|
|
72
|
-
*/
|
|
73
|
-
declare namespace TerrainArea {
|
|
74
|
-
/** Initialization options for `TerrainArea` constructor. */
|
|
75
|
-
interface ConstructorOptions {
|
|
76
|
-
/** The terrain provider for this area or a URL to create one from. */
|
|
77
|
-
terrainProvider: TerrainProvider;
|
|
78
|
-
/**
|
|
79
|
-
* Tile ranges by level when using tileRange type.
|
|
80
|
-
* Keys are zoom levels, values define the range of tiles at that level.
|
|
81
|
-
*/
|
|
82
|
-
tileRanges: Map<number, TileRange>;
|
|
83
|
-
/**
|
|
84
|
-
* Credit to associate with this terrain provider.
|
|
85
|
-
* Used to identify custom terrain providers.
|
|
86
|
-
* @default custom
|
|
87
|
-
*/
|
|
88
|
-
credit?: string | Credit;
|
|
89
|
-
/**
|
|
90
|
-
* Whether this is a custom terrain provider.
|
|
91
|
-
* @default true
|
|
92
|
-
*/
|
|
93
|
-
isCustom?: boolean;
|
|
94
|
-
}
|
|
95
|
-
/** A range of tiles from `start` to `end` */
|
|
96
|
-
type TileRange = {
|
|
97
|
-
/** Top Left tile coordinates */
|
|
98
|
-
start: {
|
|
99
|
-
x: number;
|
|
100
|
-
y: number;
|
|
101
|
-
};
|
|
102
|
-
/** Bottom Right tile coordinates */
|
|
103
|
-
end: {
|
|
104
|
-
x: number;
|
|
105
|
-
y: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Creates a `TerrainArea` from a URL and tile ranges.
|
|
110
|
-
* @param url The URL to create the terrain provider from.
|
|
111
|
-
* @param tileRanges Tile ranges by level.
|
|
112
|
-
* @param options: Constructor options for CesiumTerrainProvider.
|
|
113
|
-
* @returns A promise resolving to a new `TerrainArea`
|
|
114
|
-
*/
|
|
115
|
-
function fromUrl(url: string, tileRanges: Map<number, TileRange>, options?: CesiumTerrainProvider.ConstructorOptions): Promise<Awaited<TerrainArea>>;
|
|
116
|
-
/**
|
|
117
|
-
* @extends Array
|
|
118
|
-
* @class
|
|
119
|
-
* Collection-like Extended Array Class of `TerrainArea`.
|
|
120
|
-
*/
|
|
121
|
-
class Collection extends Array<TerrainArea> {
|
|
122
|
-
/**
|
|
123
|
-
* Adds a new terrain area to the collection.
|
|
124
|
-
* @param area A TerrainArea instance or constructor options
|
|
125
|
-
* @returns The index of the added item
|
|
126
|
-
*/
|
|
127
|
-
add(area: TerrainArea | TerrainArea.ConstructorOptions): this;
|
|
128
|
-
/**
|
|
129
|
-
* Adds terrain areas to the collection.
|
|
130
|
-
* @param areas An array of TerrainArea instance or constructor options
|
|
131
|
-
* @returns The index of the added item
|
|
132
|
-
*/
|
|
133
|
-
add(areas: (TerrainArea | TerrainArea.ConstructorOptions)[]): this;
|
|
134
|
-
/**
|
|
135
|
-
* Removes a terrain area from the collection.
|
|
136
|
-
* @param area The terrain area to remove.
|
|
137
|
-
*/
|
|
138
|
-
remove(area: TerrainArea): this;
|
|
139
|
-
/**
|
|
140
|
-
* Removes multiple terrain areas from the collection.
|
|
141
|
-
* @param areas The terrain areas to remove.
|
|
142
|
-
*/
|
|
143
|
-
remove(areas: TerrainArea[]): this;
|
|
144
|
-
/**
|
|
145
|
-
* Clears all terrain areas.
|
|
146
|
-
*/
|
|
147
|
-
removeAll(): void;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
1
|
+
import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData, Rectangle } from 'cesium';
|
|
150
2
|
|
|
151
3
|
/**
|
|
152
4
|
* @class
|
|
@@ -347,4 +199,4 @@ declare namespace HybridTerrainProvider {
|
|
|
347
199
|
function computeRectangle(tilingScheme: TilingScheme, from: Map<number, any>): Rectangle;
|
|
348
200
|
}
|
|
349
201
|
|
|
350
|
-
export { HybridTerrainProvider as H
|
|
202
|
+
export { HybridTerrainProvider as H };
|
package/dist/{hybrid-terrain-provider-C7Ks0pK6.d.cts → hybrid-terrain-provider-C2V-igd9.d.ts}
RENAMED
|
@@ -1,152 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @class
|
|
5
|
-
* @deprecated Use HybridTerrainProvider.TerrainRegion instead.
|
|
6
|
-
* This class is maintained for backward compatibility but will be removed in a future version.
|
|
7
|
-
*
|
|
8
|
-
* For migration:
|
|
9
|
-
* - Replace TerrainArea with HybridTerrainProvider.TerrainRegion
|
|
10
|
-
* - Use Rectangle.fromDegrees() for bounds instead of tile ranges
|
|
11
|
-
* - Simplify HybridTerrainProvider constructor to use regions directly
|
|
12
|
-
*
|
|
13
|
-
* Represents a geographic area with a specific terrain provider.
|
|
14
|
-
* `TerrainArea` pairs a provider with geographic bounds and level constraints.
|
|
15
|
-
*/
|
|
16
|
-
declare class TerrainArea {
|
|
17
|
-
private _terrainProvider;
|
|
18
|
-
private _rectangle;
|
|
19
|
-
private _tileRanges;
|
|
20
|
-
private _ready;
|
|
21
|
-
private _credit;
|
|
22
|
-
private _isCustom;
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new instance of `TerrainArea`.
|
|
25
|
-
* @param options Object describing initialization options
|
|
26
|
-
*/
|
|
27
|
-
constructor(options: TerrainArea.ConstructorOptions);
|
|
28
|
-
/**
|
|
29
|
-
* Checks if the specified tile coordinates are within the bounds.
|
|
30
|
-
* @param x The tile X coordinate.
|
|
31
|
-
* @param y The tile Y coordinate.
|
|
32
|
-
* @param level The tile level.
|
|
33
|
-
* @returns `true` if the tile is within bounds, `false` otherwise.
|
|
34
|
-
*/
|
|
35
|
-
contains(x: number, y: number, level: number): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Requests the geometry for a given tile. The result must include terrain data and
|
|
38
|
-
* may optionally include a water mask and an indication of which child tiles are available.
|
|
39
|
-
* @param x - The X coordinate of the tile for which to request geometry.
|
|
40
|
-
* @param y - The Y coordinate of the tile for which to request geometry.
|
|
41
|
-
* @param level - The level of the tile for which to request geometry.
|
|
42
|
-
* @param [request] - The request object. Intended for internal use only.
|
|
43
|
-
* @returns A promise for the requested geometry. If this method
|
|
44
|
-
* returns undefined instead of a promise, it is an indication that too many requests are already
|
|
45
|
-
* pending and the request will be retried later.
|
|
46
|
-
*/
|
|
47
|
-
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<Awaited<TerrainData>> | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Determines whether data for a tile is available to be loaded.
|
|
50
|
-
* @param x - The X coordinate of the tile for which to request geometry.
|
|
51
|
-
* @param y - The Y coordinate of the tile for which to request geometry.
|
|
52
|
-
* @param level - The level of the tile for which to request geometry.
|
|
53
|
-
* @returns Undefined if not supported by the terrain provider, otherwise true or false.
|
|
54
|
-
* @see {@link TerrainProvider.getTileDataAvailable} */
|
|
55
|
-
getTileDataAvailable(x: number, y: number, level: number): boolean;
|
|
56
|
-
/** Checks if this terrain provider is marked as a custom provider. */
|
|
57
|
-
get isCustom(): boolean;
|
|
58
|
-
/** Gets the credit associated with this terrain area. */
|
|
59
|
-
get credit(): string | Credit;
|
|
60
|
-
/** Gets the terrain provider for this terrain area. */
|
|
61
|
-
get terrainProvider(): TerrainProvider;
|
|
62
|
-
/** Gets available tile ranges with zoom levels set with this terrain area. */
|
|
63
|
-
get tileRanges(): Map<number, TerrainArea.TileRange>;
|
|
64
|
-
/** Gets the rectangle representing this terrain area. */
|
|
65
|
-
get rectangle(): Rectangle;
|
|
66
|
-
/** Gets if this terrain area is ready. */
|
|
67
|
-
get ready(): boolean;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @namespace
|
|
71
|
-
* Contains types and factory methods for creating `TerrainArea` instances.
|
|
72
|
-
*/
|
|
73
|
-
declare namespace TerrainArea {
|
|
74
|
-
/** Initialization options for `TerrainArea` constructor. */
|
|
75
|
-
interface ConstructorOptions {
|
|
76
|
-
/** The terrain provider for this area or a URL to create one from. */
|
|
77
|
-
terrainProvider: TerrainProvider;
|
|
78
|
-
/**
|
|
79
|
-
* Tile ranges by level when using tileRange type.
|
|
80
|
-
* Keys are zoom levels, values define the range of tiles at that level.
|
|
81
|
-
*/
|
|
82
|
-
tileRanges: Map<number, TileRange>;
|
|
83
|
-
/**
|
|
84
|
-
* Credit to associate with this terrain provider.
|
|
85
|
-
* Used to identify custom terrain providers.
|
|
86
|
-
* @default custom
|
|
87
|
-
*/
|
|
88
|
-
credit?: string | Credit;
|
|
89
|
-
/**
|
|
90
|
-
* Whether this is a custom terrain provider.
|
|
91
|
-
* @default true
|
|
92
|
-
*/
|
|
93
|
-
isCustom?: boolean;
|
|
94
|
-
}
|
|
95
|
-
/** A range of tiles from `start` to `end` */
|
|
96
|
-
type TileRange = {
|
|
97
|
-
/** Top Left tile coordinates */
|
|
98
|
-
start: {
|
|
99
|
-
x: number;
|
|
100
|
-
y: number;
|
|
101
|
-
};
|
|
102
|
-
/** Bottom Right tile coordinates */
|
|
103
|
-
end: {
|
|
104
|
-
x: number;
|
|
105
|
-
y: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Creates a `TerrainArea` from a URL and tile ranges.
|
|
110
|
-
* @param url The URL to create the terrain provider from.
|
|
111
|
-
* @param tileRanges Tile ranges by level.
|
|
112
|
-
* @param options: Constructor options for CesiumTerrainProvider.
|
|
113
|
-
* @returns A promise resolving to a new `TerrainArea`
|
|
114
|
-
*/
|
|
115
|
-
function fromUrl(url: string, tileRanges: Map<number, TileRange>, options?: CesiumTerrainProvider.ConstructorOptions): Promise<Awaited<TerrainArea>>;
|
|
116
|
-
/**
|
|
117
|
-
* @extends Array
|
|
118
|
-
* @class
|
|
119
|
-
* Collection-like Extended Array Class of `TerrainArea`.
|
|
120
|
-
*/
|
|
121
|
-
class Collection extends Array<TerrainArea> {
|
|
122
|
-
/**
|
|
123
|
-
* Adds a new terrain area to the collection.
|
|
124
|
-
* @param area A TerrainArea instance or constructor options
|
|
125
|
-
* @returns The index of the added item
|
|
126
|
-
*/
|
|
127
|
-
add(area: TerrainArea | TerrainArea.ConstructorOptions): this;
|
|
128
|
-
/**
|
|
129
|
-
* Adds terrain areas to the collection.
|
|
130
|
-
* @param areas An array of TerrainArea instance or constructor options
|
|
131
|
-
* @returns The index of the added item
|
|
132
|
-
*/
|
|
133
|
-
add(areas: (TerrainArea | TerrainArea.ConstructorOptions)[]): this;
|
|
134
|
-
/**
|
|
135
|
-
* Removes a terrain area from the collection.
|
|
136
|
-
* @param area The terrain area to remove.
|
|
137
|
-
*/
|
|
138
|
-
remove(area: TerrainArea): this;
|
|
139
|
-
/**
|
|
140
|
-
* Removes multiple terrain areas from the collection.
|
|
141
|
-
* @param areas The terrain areas to remove.
|
|
142
|
-
*/
|
|
143
|
-
remove(areas: TerrainArea[]): this;
|
|
144
|
-
/**
|
|
145
|
-
* Clears all terrain areas.
|
|
146
|
-
*/
|
|
147
|
-
removeAll(): void;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
1
|
+
import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData, Rectangle } from 'cesium';
|
|
150
2
|
|
|
151
3
|
/**
|
|
152
4
|
* @class
|
|
@@ -347,4 +199,4 @@ declare namespace HybridTerrainProvider {
|
|
|
347
199
|
function computeRectangle(tilingScheme: TilingScheme, from: Map<number, any>): Rectangle;
|
|
348
200
|
}
|
|
349
201
|
|
|
350
|
-
export { HybridTerrainProvider as H
|
|
202
|
+
export { HybridTerrainProvider as H };
|
|
@@ -106,7 +106,7 @@ type NonFunction<T> = {
|
|
|
106
106
|
* }
|
|
107
107
|
* }
|
|
108
108
|
*/
|
|
109
|
-
declare class Collection<C extends Collection.Base, I extends Collection.
|
|
109
|
+
declare class Collection<C extends Collection.Base, I extends Collection.ItemFor<C>> {
|
|
110
110
|
/**
|
|
111
111
|
* Symbol used as a property key to store tags on collection items.
|
|
112
112
|
* Using a Symbol ensures no property naming conflicts with the item's own properties.
|
|
@@ -499,6 +499,10 @@ declare namespace Collection {
|
|
|
499
499
|
* Cesium item type that can be added to the {@link Collection.Base} instance.
|
|
500
500
|
*/
|
|
501
501
|
export type Item = DataSource | Entity | ImageryLayer | Primitives;
|
|
502
|
+
/**
|
|
503
|
+
* Gets the item type for a given collection type
|
|
504
|
+
*/
|
|
505
|
+
export type ItemFor<C extends Base> = C extends DataSourceCollection ? DataSource : C extends EntityCollection ? Entity : C extends ImageryLayerCollection ? ImageryLayer : C extends PrimitiveCollection ? Primitives : never;
|
|
502
506
|
/**
|
|
503
507
|
* Collection tag type.
|
|
504
508
|
*/
|
|
@@ -106,7 +106,7 @@ type NonFunction<T> = {
|
|
|
106
106
|
* }
|
|
107
107
|
* }
|
|
108
108
|
*/
|
|
109
|
-
declare class Collection<C extends Collection.Base, I extends Collection.
|
|
109
|
+
declare class Collection<C extends Collection.Base, I extends Collection.ItemFor<C>> {
|
|
110
110
|
/**
|
|
111
111
|
* Symbol used as a property key to store tags on collection items.
|
|
112
112
|
* Using a Symbol ensures no property naming conflicts with the item's own properties.
|
|
@@ -499,6 +499,10 @@ declare namespace Collection {
|
|
|
499
499
|
* Cesium item type that can be added to the {@link Collection.Base} instance.
|
|
500
500
|
*/
|
|
501
501
|
export type Item = DataSource | Entity | ImageryLayer | Primitives;
|
|
502
|
+
/**
|
|
503
|
+
* Gets the item type for a given collection type
|
|
504
|
+
*/
|
|
505
|
+
export type ItemFor<C extends Base> = C extends DataSourceCollection ? DataSource : C extends EntityCollection ? Entity : C extends ImageryLayerCollection ? ImageryLayer : C extends PrimitiveCollection ? Primitives : never;
|
|
502
506
|
/**
|
|
503
507
|
* Collection tag type.
|
|
504
508
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var G=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var $=(n,e)=>{for(var t in e)G(n,t,{get:e[t],enumerable:!0})},K=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of U(e))!X.call(n,r)&&r!==t&&G(n,r,{get:()=>e[r],enumerable:!(i=W(e,r))||i.enumerable});return n};var J=n=>K(G({},"__esModule",{value:!0}),n);var Q={};$(Q,{Collection:()=>C,Highlight:()=>F,HybridTerrainProvider:()=>R,SilhouetteHighlight:()=>f,SurfaceHighlight:()=>p,TerrainArea:()=>M,TerrainVisualizer:()=>_,cloneViewer:()=>j,isGetterOnly:()=>w,syncCamera:()=>O});module.exports=J(Q);var g=require("cesium");var c=require("cesium");var _=class n{_viewer;_collection;_terrainProvider;_visible=!1;_level=15;_tileCoordinatesLayer;_colors=new Map([["custom",c.Color.RED],["default",c.Color.BLUE],["fallback",c.Color.GRAY],["grid",c.Color.YELLOW]]);constructor(e,t){this._viewer=e,this._collection=new C({collection:e.entities,tag:n.tag.default}),t&&(t.colors&&Object.entries(t.colors).forEach(([i,r])=>{this._colors.set(i,r)}),t.tile!==void 0&&(this._visible=t.tile),t.activeLevel!==void 0&&(this._level=t.activeLevel),t.terrainProvider&&this.setTerrainProvider(t.terrainProvider))}setTerrainProvider(e){this._terrainProvider=e,this.update()}update(){this.clear(),this._visible&&this.show(this._level)}clear(){this._collection.remove(this._collection.tags)}show(e=15){if(!this._terrainProvider)return;this._collection.remove(n.tag.grid),this._level=e,this._ensureTileCoordinatesLayer();let t=this._getVisibleRectangle();if(!t||!this._isValidRectangle(t)){console.warn("Invalid visible rectangle detected, skipping grid display");return}this._displayTileGrid(t,e),this._visible=!0}_ensureTileCoordinatesLayer(){this._tileCoordinatesLayer||(this._tileCoordinatesLayer=this._viewer.imageryLayers.addImageryProvider(new c.TileCoordinatesImageryProvider({tilingScheme:this._terrainProvider.tilingScheme,color:c.Color.YELLOW})))}_isValidRectangle(e){return e&&Number.isFinite(e.west)&&Number.isFinite(e.south)&&Number.isFinite(e.east)&&Number.isFinite(e.north)&&e.west<=e.east&&e.south<=e.north}_displayTileGrid(e,t){let i=this._terrainProvider.tilingScheme;try{let r=this._calculateTileBounds(e,t,i);this._generateVisibleTiles(r,t,i).forEach(s=>{this._collection.add(s.entity,n.tag.grid)})}catch(r){console.error("Error displaying tile grid:",r)}}_calculateTileBounds(e,t,i){let r=i.positionToTileXY(c.Rectangle.northwest(e),t),o=i.positionToTileXY(c.Rectangle.southeast(e),t);if(!r||!o)throw new Error("Failed to calculate tile bounds");return{start:r,end:o}}_generateVisibleTiles(e,t,i){let r=[],s=Math.min(e.end.x-e.start.x+1,100),l=Math.min(e.end.y-e.start.y+1,100);for(let h=e.start.x;h<e.start.x+s;h++)for(let u=e.start.y;u<e.start.y+l;u++)try{let v=this._createTileEntity(h,u,t,i);v&&r.push({entity:v})}catch(v){console.warn(`Error creating tile (${h}, ${u}, ${t}):`,v)}return r}_createTileEntity(e,t,i,r){let o=r.tileXYToRectangle(e,t,i);if(!this._isValidRectangle(o))return null;let s=this._getTileColor(e,t,i),l=n.createRectangle(o,s.withAlpha(.3));return l.properties?.addProperty("tileX",e),l.properties?.addProperty("tileY",t),l.properties?.addProperty("tileLevel",i),l}_getTileColor(e,t,i){if(!this._terrainProvider)return this._colors.get("fallback")||c.Color.TRANSPARENT;for(let r of this._terrainProvider.regions)if(this._terrainProvider._regionContains(r,e,t,i))return this._colors.get("custom")||c.Color.RED;return this._terrainProvider.getTileDataAvailable(e,t,i)?this._colors.get("default")||c.Color.BLUE:this._colors.get("fallback")||c.Color.GRAY}hide(){this._collection.remove(n.tag.grid),this._tileCoordinatesLayer&&(this._viewer.imageryLayers.remove(this._tileCoordinatesLayer),this._tileCoordinatesLayer=void 0),this._visible=!1}setColors(e){Object.entries(e).forEach(([t,i])=>{this._colors.set(t,i)}),this.update()}flyTo(e,t){let{rectangle:i}=e;this._viewer.camera.flyTo({destination:i,...t,complete:()=>{this._visible&&this.update()}})}_getVisibleRectangle(){return this._viewer.camera.computeViewRectangle()}get level(){return this._level}set level(e){this._level=e,this._visible&&this.update()}get visible(){return this._visible}get collection(){return this._collection}get viewer(){return this._viewer}get colors(){return this._colors}get terrainProvider(){return this._terrainProvider}};(i=>{i.tag={default:"Terrain Visualizer",boundary:"Terrain Visualizer Boundary",grid:"Terrain Visualizer Tile Grid"};function e(r,o){return new c.Entity({rectangle:{coordinates:r,material:o,heightReference:c.HeightReference.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,o,s){let l=s?.tag||"terrain_area_visualization",h=s?.color||c.Color.RED,u=s?.maxTilesToShow||100,v=s?.show??!0,P=s?.alpha||.7,x=s?.tileAlpha||.2,y=new C({collection:o.entities,tag:l}),{rectangle:S}=r;if(y.add(i.createRectangle(S,h.withAlpha(P)),l),v&&r.tileRanges.size>0){let{tilingScheme:L}=r.terrainProvider,T=0;r.tileRanges.forEach((I,z)=>{for(let H=I.start.x;H<=I.end.x&&T<u;H++)for(let V=I.start.y;V<=I.end.y&&T<u;V++){let Y=L.tileXYToRectangle(H,V,z);y.add(e(Y,h.withAlpha(x)),`${l}_tile`),T++}})}return y}i.visualize=t})(_||={});function w(n,e){let t=!1,i=Object.getOwnPropertyDescriptor(n,e);if(!i){let r=Object.getPrototypeOf(n);for(;r&&!i;)i=Object.getOwnPropertyDescriptor(r,e),r=Object.getPrototypeOf(r)}return i&&i.get&&!i.set&&(t=!0),t}var D=class n{static symbol=Symbol("cesium-item-tag");tag;collection;_valuesCache=null;_tagMap=new Map;_eventListeners=new Map;_eventCleanupFunctions=[];constructor({collection:e,tag:t}){this.tag=t||"default",this.collection=e,this._setupCacheInvalidator(e)}[Symbol.iterator](){return this.values[Symbol.iterator]()}_emit(e,t){let i=this._eventListeners.get(e);if(i){let r={type:e,...t};i.forEach(o=>o(r))}}_addToTagMap(e,t){this._tagMap.has(t)||this._tagMap.set(t,new Set),this._tagMap.get(t)?.add(e)}_removeFromTagMap(e){let t=e[n.symbol],i=this._tagMap.get(t);i&&(i.delete(e),i.size===0&&this._tagMap.delete(t))}_invalidateCache=()=>{this._valuesCache=null};_setupCacheInvalidator(e){e instanceof g.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof g.PrimitiveCollection?(e.primitiveAdded.addEventListener(this._invalidateCache),e.primitiveRemoved.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.primitiveAdded.removeEventListener(this._invalidateCache),()=>e.primitiveRemoved.removeEventListener(this._invalidateCache))):e instanceof g.DataSourceCollection?(e.dataSourceAdded.addEventListener(this._invalidateCache),e.dataSourceMoved.addEventListener(this._invalidateCache),e.dataSourceRemoved.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.dataSourceAdded.removeEventListener(this._invalidateCache),()=>e.dataSourceMoved.removeEventListener(this._invalidateCache),()=>e.dataSourceRemoved.removeEventListener(this._invalidateCache))):e instanceof g.ImageryLayerCollection&&(e.layerAdded.addEventListener(this._invalidateCache),e.layerMoved.addEventListener(this._invalidateCache),e.layerRemoved.addEventListener(this._invalidateCache),e.layerShownOrHidden.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.layerAdded.removeEventListener(this._invalidateCache),()=>e.layerMoved.removeEventListener(this._invalidateCache),()=>e.layerRemoved.removeEventListener(this._invalidateCache),()=>e.layerShownOrHidden.removeEventListener(this._invalidateCache)))}addEventListener(e,t){return this._eventListeners.has(e)||this._eventListeners.set(e,new Set),this._eventListeners.get(e)?.add(t),this}removeEventListener(e,t){return this._eventListeners.get(e)?.delete(t),this}add(e,t=this.tag,i){return Array.isArray(e)?e.forEach(r=>{this.add(r,t)}):(Object.defineProperty(e,n.symbol,{value:t,enumerable:!1,writable:!0,configurable:!0}),this.collection.add(e,i),this._addToTagMap(e,t),this._invalidateCache(),this._emit("add",{items:[e],tag:t})),this}contains(e){if(typeof e=="object")return this.collection.contains(e);let t=this._tagMap.get(e);return!!t&&t.size>0}remove(e){if(typeof e=="object"&&!Array.isArray(e)&&this.collection.remove(e)&&(this._removeFromTagMap(e),this._invalidateCache(),this._emit("remove",{items:[e]})),Array.isArray(e)){if(e.length===0)return this;for(let i of e)this.remove(i)}let t=this.get(e);if(t.length===0)return this;for(let i of t)this.remove(i);return this}removeAll(){this._tagMap.clear(),this.collection.removeAll(),this._invalidateCache(),this._emit("clear")}destroy(){this._eventCleanupFunctions.forEach(e=>e()),this._eventCleanupFunctions=[],this._tagMap.clear(),this._eventListeners.clear(),this._valuesCache=null}get values(){if(this._valuesCache!==null)return this._valuesCache;let e;if(this.collection instanceof g.EntityCollection)e=this.collection.values;else{e=[];for(let t=0;t<this.collection.length;t++)e.push(this.collection.get(t))}return this._valuesCache=e,e}get length(){return this.values?.length||0}get(e){let t=this._tagMap.get(e);return t?Array.from(t):[]}first(e){let t=this._tagMap.get(e);if(t&&t.size>0)return t.values().next().value}get tags(){return Array.from(this._tagMap.keys())}update(e,t){let i=this.get(e);for(let r of i)this._removeFromTagMap(r),Object.defineProperty(r,n.symbol,{value:t,enumerable:!1,writable:!0,configurable:!0}),this._addToTagMap(r,t);return i.length>0&&this._emit("update",{items:i,tag:t}),i.length}show(e){let t=this.get(e);for(let i of t)(0,g.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,g.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,g.defined)(i.show)&&(i.show=!i.show);return this}setProperty(e,t,i=this.tag){let r=this.get(i);for(let o of r)if(e in o&&typeof o[e]!="function"){if(w(o,e))throw Error(`Cannot set read-only property '${String(e)}' on ${o.constructor.name}`);o[e]=t}return this}filter(e,t){return(t?this.get(t):this.values).filter(e)}forEach(e,t){(t?this.get(t):this.values).forEach((r,o)=>e(r,o))}map(e,t){return(t?this.get(t):this.values).map(e)}find(e,t){return(t?this.get(t):this.values).find(e)}},C=D;var m=require("cesium");var d=require("cesium"),f=class{_color=d.Color.RED;_silhouette;_composite;_stages;_entity;_currentObject;_currentOptions;constructor(e){this._stages=e.scene.postProcessStages,this._silhouette=d.PostProcessStageLibrary.createEdgeDetectionStage(),this._silhouette.uniforms.color=this._color,this._silhouette.uniforms.length=.01,this._silhouette.selected=[],this._composite=d.PostProcessStageLibrary.createSilhouetteStage([this._silhouette]),this._stages.add(this._composite)}show(e,t){if((0,d.defined)(e)&&!(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))){this._clearHighlights();try{if(e instanceof d.Cesium3DTileFeature)this._silhouette.uniforms.color=t?.color||this._color,this._silhouette.selected.push(e);else{if(!e.model)return;this._entity=e,e.model.silhouetteSize=new d.ConstantProperty(t?.width||2),e.model.silhouetteColor=new d.ConstantProperty(t?.color||this._color)}this._currentObject=e,this._currentOptions=t?{...t}:void 0}catch(i){console.error("Failed to highlight object:",i),this._currentObject=void 0,this._currentOptions=void 0}}}_optionsEqual(e,t){return!e&&!t?!0:!e||!t?!1:e.outline===t.outline&&e.width===t.width&&d.Color.equals(e.color||this._color,t.color||this._color)}_clearHighlights(){this._silhouette.selected.length>0&&(this._silhouette.selected=[]),this._entity?.model&&(this._entity.model.silhouetteColor=new d.ConstantProperty(d.Color.TRANSPARENT),this._entity.model.silhouetteSize=new d.ConstantProperty(0),this._entity=void 0)}hide(){this._clearHighlights(),this._currentObject=void 0,this._currentOptions=void 0}destroy(){this.hide(),this._composite&&this._stages.remove(this._composite),this._currentObject=void 0,this._currentOptions=void 0}get color(){return this._color}set color(e){this._color=e}get currentObject(){return this._currentObject}};var a=require("cesium"),p=class{_color=a.Color.RED;_entity;_entities;_currentObject;_currentOptions;constructor(e){this._entities=e.entities,this._entity=this._entities.add(new a.Entity({id:`highlight-entity-${Math.random().toString(36).substring(2)}`,show:!1}))}show(e,t){if(!(!(0,a.defined)(e)||!this._entity)){if(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))return this._entity;this._clearGeometries();try{if(e instanceof a.Entity&&(e.polygon||e.polyline||e.rectangle))this._update(e,t);else if(e instanceof a.GroundPrimitive)this._update(e,t);else{this._currentObject=void 0,this._currentOptions=void 0;return}return this._currentObject=e,this._currentOptions=t?{...t}:void 0,this._entity.show=!0,this._entity}catch(i){console.error("Failed to highlight object:",i),this._currentObject=void 0,this._currentOptions=void 0;return}}}_optionsEqual(e,t){return!e&&!t?!0:!e||!t?!1:e.outline===t.outline&&e.width===t.width&&a.Color.equals(e.color||this._color,t.color||this._color)}_clearGeometries(){this._entity.polygon=void 0,this._entity.polyline=void 0,this._entity.rectangle=void 0}_update(e,t={color:this._color,outline:!1,width:2}){if(e instanceof a.Entity){if(e.polygon)if(t.outline){let i=e.polygon.hierarchy?.getValue();if(i&&i.positions){let r;i.positions.length>0&&!a.Cartesian3.equals(i.positions[0],i.positions[i.positions.length-1])?r=[...i.positions,i.positions[0]]:r=i.positions,this._entity.polyline=new a.PolylineGraphics({positions:r,material:t.color,width:t.width||2,clampToGround:!0})}}else{let i=e.polygon.hierarchy?.getValue();i&&(this._entity.polygon=new a.PolygonGraphics({hierarchy:i,material:t.color,heightReference:a.HeightReference.CLAMP_TO_GROUND,classificationType:e.polygon.classificationType?.getValue()||a.ClassificationType.BOTH}))}else if(e.polyline){let i=e.polyline.positions?.getValue();if(i){let r=e.polyline.width?.getValue();this._entity.polyline=new a.PolylineGraphics({positions:i,material:t.color,width:r+(t.width||2),clampToGround:!0})}}else if(e.rectangle)if(t.outline){let i=e.rectangle.coordinates?.getValue();if(i){let r=[a.Cartesian3.fromRadians(i.west,i.north),a.Cartesian3.fromRadians(i.east,i.north),a.Cartesian3.fromRadians(i.east,i.south),a.Cartesian3.fromRadians(i.west,i.south),a.Cartesian3.fromRadians(i.west,i.north)];this._entity.polyline=new a.PolylineGraphics({positions:r,material:t.color,width:t.width||2,clampToGround:!0})}}else{let i=e.rectangle.coordinates?.getValue();i&&(this._entity.rectangle=new a.RectangleGraphics({coordinates:i,material:t.color,heightReference:a.HeightReference.CLAMP_TO_GROUND}))}}else if(e instanceof a.GroundPrimitive){let i=e.geometryInstances,r=Array.isArray(i)?i[0]:i;if(!r.geometry.attributes.position)return;let o=r.geometry.attributes.position.values,s=[];for(let l=0;l<o.length;l+=3)s.push(new a.Cartesian3(o[l],o[l+1],o[l+2]));t.outline?this._entity.polyline=new a.PolylineGraphics({positions:s,material:t.color,width:t.width||2,clampToGround:!0}):this._entity.polygon=new a.PolygonGraphics({hierarchy:new a.PolygonHierarchy(s),material:t.color,heightReference:a.HeightReference.CLAMP_TO_GROUND,classificationType:a.ClassificationType.BOTH})}}hide(){this._entity&&(this._entity.show=!1),this._currentObject=void 0,this._currentOptions=void 0}destroy(){this._entities.contains(this._entity)&&this._entities.remove(this._entity),this._currentObject=void 0,this._currentOptions=void 0}get color(){return this._color}set color(e){this._color=e}get entity(){return this._entity}get currentObject(){return this._currentObject}};var k=class n{static instances=new WeakMap;_surface;_silhouette;_color=m.Color.RED;constructor(e){this._surface=new p(e),this._silhouette=new f(e),this._surface.color=this._color,this._silhouette.color=this._color}static getInstance(e){let t=e.container;return n.instances.has(t)||n.instances.set(t,new n(e)),n.instances.get(t)}static releaseInstance(e){let t=e.container,i=n.instances.get(t);i&&(i.hide(),i._surface&&i._surface.destroy(),i._silhouette&&i._silhouette.destroy(),n.instances.delete(t))}show(e,t={color:this._color}){let i=this._getObject(e);if((0,m.defined)(i))return i instanceof m.Cesium3DTileFeature?this._silhouette.show(i,t):i instanceof m.Entity&&i.model?this._silhouette.show(i,t):this._surface.show(i,t)}_getObject(e){if((0,m.defined)(e)){if(e instanceof m.Entity||e instanceof m.Cesium3DTileFeature||e instanceof m.GroundPrimitive)return e;if(e.id instanceof m.Entity)return e.id;if(e.primitive instanceof m.GroundPrimitive)return e.primitive}}hide(){this._surface.hide(),this._silhouette.hide()}get color(){return this._color}set color(e){this._color=e,this._surface.color=e,this._silhouette.color=e}},F=k;var b=require("cesium");var B=require("cesium");var E=class{_terrainProvider;_rectangle;_tileRanges;_ready=!1;_credit;_isCustom;constructor(e){this._terrainProvider=e.terrainProvider,this._tileRanges=e.tileRanges,this._credit=e.credit||"custom",this._isCustom=e.isCustom!==void 0?e.isCustom:!0,this._rectangle=R.computeRectangle(e.terrainProvider.tilingScheme,e.tileRanges),e.tileRanges.forEach((t,i)=>{this._terrainProvider.availability?.addAvailableTileRange(i,t.start.x,t.start.y,t.end.x,t.end.y)}),this._ready=!0}contains(e,t,i){if(this._tileRanges.size===0||!this._tileRanges.has(i))return!1;let r=this._tileRanges.get(i);return e>=r.start.x&&e<=r.end.x&&t>=r.start.y&&t<=r.end.y}requestTileGeometry(e,t,i,r){if(!(!this._ready||!this.contains(e,t,i)))return this._terrainProvider.requestTileGeometry(e,t,i,r)}getTileDataAvailable(e,t,i){if(this._tileRanges.size===0||!this._tileRanges.has(i))return!1;let r=this._tileRanges.get(i);return e>=r.start.x&&e<=r.end.x&&t>=r.start.y&&t<=r.end.y}get isCustom(){return this._isCustom}get credit(){return this._credit}get terrainProvider(){return this._terrainProvider}get tileRanges(){return this._tileRanges}get rectangle(){return this._rectangle}get ready(){return this._ready}};(t=>{async function n(i,r,o){let s=o?.credit||"custom",l=await B.CesiumTerrainProvider.fromUrl(i,{...o,credit:s});return new t({terrainProvider:l,tileRanges:r,credit:s})}t.fromUrl=n;class e extends Array{add(r){if(Array.isArray(r)){for(let s of r)this.add(s);return this}let o;return r instanceof t?o=r:o=new t(r),this.push(o),this}remove(r){if(Array.isArray(r))return r.forEach(s=>this.remove(s)),this;let o=this.indexOf(r);return o>=0&&this.splice(o,1),this}removeAll(){this.length=0}}t.Collection=e})(E||={});var M=E;var A=class{_regions;_defaultProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._defaultProvider=e.defaultProvider,this._fallbackProvider=e.fallbackProvider||new b.EllipsoidTerrainProvider,this._tilingScheme=e.defaultProvider.tilingScheme,this._regions=e.regions||[],this._availability=e.defaultProvider.availability,this._ready=!0}get ready(){return this._ready}get tilingScheme(){return this._tilingScheme}get availability(){return this._availability}get regions(){return[...this._regions]}get defaultProvider(){return this._defaultProvider}get fallbackProvider(){return this._fallbackProvider}get credit(){return this._defaultProvider?.credit}get errorEvent(){return this._defaultProvider.errorEvent}get hasWaterMask(){return this._defaultProvider.hasWaterMask}get hasVertexNormals(){return this._defaultProvider.hasVertexNormals}loadTileDataAvailability(e,t,i){return this._defaultProvider.loadTileDataAvailability(e,t,i)}getLevelMaximumGeometricError(e){return this._defaultProvider.getLevelMaximumGeometricError(e)}requestTileGeometry(e,t,i,r){if(this._ready){for(let o of this._regions)if(this._regionContains(o,e,t,i))return o.provider.requestTileGeometry(e,t,i,r);return this._defaultProvider.getTileDataAvailable(e,t,i)?this._defaultProvider.requestTileGeometry(e,t,i,r):this._fallbackProvider.requestTileGeometry(e,t,i,r)}}getTileDataAvailable(e,t,i){for(let r of this._regions)if(this._regionContains(r,e,t,i))return r.provider.getTileDataAvailable(e,t,i);return this._defaultProvider.getTileDataAvailable(e,t,i)}_regionContains(e,t,i,r){if(e.levels&&!e.levels.includes(r))return!1;if(e.tiles){let o=e.tiles.get(r);if(!o)return!1;let[s,l]=Array.isArray(o.x)?o.x:[o.x,o.x],[h,u]=Array.isArray(o.y)?o.y:[o.y,o.y];return t>=s&&t<=l&&i>=h&&i<=u}if(e.bounds){let o=this._tilingScheme.tileXYToRectangle(t,i,r);return b.Rectangle.intersection(o,e.bounds)!==void 0}return!1}};(i=>{function n(r,o,s){return new i({regions:r.map(l=>({...l})),defaultProvider:o,fallbackProvider:s})}i.fromRectangles=n;function e(r,o,s){return new i({regions:r.map(l=>({...l})),defaultProvider:o,fallbackProvider:s})}i.fromTileRanges=e;function t(r,o){if(o.size===0)return new b.Rectangle;let s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY,v=Array.from(o.keys()),P=Math.min(...v),x=o.get(P);if(x){let{start:y,end:S}=x,L=r.tileXYToRectangle(y.x,y.y,P),T=r.tileXYToRectangle(S.x,S.y,P);s=Math.min(L.west,s),l=Math.min(T.south,l),h=Math.max(T.east,h),u=Math.max(L.north,u)}return new b.Rectangle(s,l,h,u)}i.computeRectangle=t})(A||={});var R=A;var q=require("cesium");var N=require("cesium");function O(n,e){if((0,N.defined)(n)&&(0,N.defined)(e)){let{camera:t}=n;e.camera.position=t.positionWC.clone(),e.camera.direction=t.directionWC.clone(),e.camera.up=t.upWC.clone()}}function j(n,e,t){let i={baseLayerPicker:n.baseLayerPicker!==void 0,geocoder:n.geocoder!==void 0,homeButton:n.homeButton!==void 0,sceneModePicker:n.sceneModePicker!==void 0,timeline:n.timeline!==void 0,navigationHelpButton:n.navigationHelpButton!==void 0,animation:n.animation!==void 0,fullscreenButton:n.fullscreenButton!==void 0,shouldAnimate:n.clock.shouldAnimate,terrainProvider:n.terrainProvider,requestRenderMode:n.scene.requestRenderMode,infoBox:n.infoBox!==void 0},r=new q.Viewer(e,{...i,...t});O(n,r);let o=n.imageryLayers;r.imageryLayers.removeAll();for(let h=0;h<o.length;h++){let u=o.get(h);r.imageryLayers.addImageryProvider(u.imageryProvider,h)}r.clock.startTime=n.clock.startTime.clone(),r.clock.stopTime=n.clock.stopTime.clone(),r.clock.currentTime=n.clock.currentTime.clone(),r.clock.multiplier=n.clock.multiplier,r.clock.clockStep=n.clock.clockStep,r.clock.clockRange=n.clock.clockRange,r.clock.shouldAnimate=n.clock.shouldAnimate,r.scene.globe.enableLighting=n.scene.globe.enableLighting,r.scene.globe.depthTestAgainstTerrain=n.scene.globe.depthTestAgainstTerrain,r.scene.screenSpaceCameraController.enableCollisionDetection=n.scene.screenSpaceCameraController.enableCollisionDetection;let s=n.scene.screenSpaceCameraController.tiltEventTypes;s&&(r.scene.screenSpaceCameraController.tiltEventTypes=Array.isArray(s)?[...s]:s);let l=n.scene.screenSpaceCameraController.zoomEventTypes;return l&&(r.scene.screenSpaceCameraController.zoomEventTypes=Array.isArray(l)?[...l]:l),r}
|
|
1
|
+
"use strict";var L=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var X=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},K=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $(e))!U.call(n,r)&&r!==t&&L(n,r,{get:()=>e[r],enumerable:!(i=q(e,r))||i.enumerable});return n};var J=n=>K(L({},"__esModule",{value:!0}),n);var Q={};X(Q,{Collection:()=>w,Highlight:()=>V,HybridTerrainProvider:()=>G,SilhouetteHighlight:()=>T,SurfaceHighlight:()=>b,cloneViewer:()=>F,syncCamera:()=>R});module.exports=J(Q);var g=require("cesium");var j;(l=>{let n=new Set,e=typeof process<"u"?process.env.CESIUM_UTILS_DISABLE_DEPRECATION_WARNINGS!=="true":!0;function t(c,d={}){if(!e)return;let{once:v=!0,prefix:p="[DEPRECATED]",includeStack:_=!0,removeInVersion:y}=d;if(v&&n.has(c))return;let C=`${p} ${c}`;y&&(C+=` This feature will be removed in ${y}.`),typeof console<"u"&&console.warn&&(_?(console.warn(C),console.trace("Deprecation stack trace:")):console.warn(C)),v&&n.add(c)}l.warn=t;function i(c,d,v={}){let p=(..._)=>(t(d,v),c(..._));return Object.defineProperty(p,"name",{value:c.name,configurable:!0}),p}l.deprecate=i;function r(){n.clear()}l.clear=r;function o(){return n.size}l.getWarningCount=o;function s(c){return n.has(c)}l.hasShown=s})(j||={});var S=j;var h=require("cesium");var O=class n{_viewer;_collection;_terrainProvider;_visible=!1;_level=15;_tileCoordinatesLayer;_colors=new Map([["custom",h.Color.RED],["default",h.Color.BLUE],["fallback",h.Color.GRAY],["grid",h.Color.YELLOW]]);constructor(e,t){this._viewer=e,this._collection=new w({collection:e.entities,tag:n.tag.default}),t&&(t.colors&&Object.entries(t.colors).forEach(([i,r])=>{this._colors.set(i,r)}),t.tile!==void 0&&(this._visible=t.tile),t.activeLevel!==void 0&&(this._level=t.activeLevel),t.terrainProvider&&this.setTerrainProvider(t.terrainProvider))}setTerrainProvider(e){this._terrainProvider=e,this.update()}update(){this.clear(),this._visible&&this.show(this._level)}clear(){this._collection.remove(this._collection.tags)}show(e=15){if(!this._terrainProvider)return;this._collection.remove(n.tag.grid),this._level=e,this._ensureTileCoordinatesLayer();let t=this._getVisibleRectangle();if(!t||!this._isValidRectangle(t)){console.warn("Invalid visible rectangle detected, skipping grid display");return}this._displayTileGrid(t,e),this._visible=!0}_ensureTileCoordinatesLayer(){this._tileCoordinatesLayer||(this._tileCoordinatesLayer=this._viewer.imageryLayers.addImageryProvider(new h.TileCoordinatesImageryProvider({tilingScheme:this._terrainProvider.tilingScheme,color:h.Color.YELLOW})))}_isValidRectangle(e){return e&&Number.isFinite(e.west)&&Number.isFinite(e.south)&&Number.isFinite(e.east)&&Number.isFinite(e.north)&&e.west<=e.east&&e.south<=e.north}_displayTileGrid(e,t){let i=this._terrainProvider.tilingScheme;try{let r=this._calculateTileBounds(e,t,i);this._generateVisibleTiles(r,t,i).forEach(s=>{this._collection.add(s.entity,n.tag.grid)})}catch(r){console.error("Error displaying tile grid:",r)}}_calculateTileBounds(e,t,i){let r=i.positionToTileXY(h.Rectangle.northwest(e),t),o=i.positionToTileXY(h.Rectangle.southeast(e),t);if(!r||!o)throw new Error("Failed to calculate tile bounds");return{start:r,end:o}}_generateVisibleTiles(e,t,i){let r=[],s=Math.min(e.end.x-e.start.x+1,100),l=Math.min(e.end.y-e.start.y+1,100);for(let c=e.start.x;c<e.start.x+s;c++)for(let d=e.start.y;d<e.start.y+l;d++)try{let v=this._createTileEntity(c,d,t,i);v&&r.push({entity:v})}catch(v){console.warn(`Error creating tile (${c}, ${d}, ${t}):`,v)}return r}_createTileEntity(e,t,i,r){let o=r.tileXYToRectangle(e,t,i);if(!this._isValidRectangle(o))return null;let s=this._getTileColor(e,t,i),l=n.createRectangle(o,s.withAlpha(.3));return l.properties?.addProperty("tileX",e),l.properties?.addProperty("tileY",t),l.properties?.addProperty("tileLevel",i),l}_getTileColor(e,t,i){if(!this._terrainProvider)return this._colors.get("fallback")||h.Color.TRANSPARENT;for(let r of this._terrainProvider.regions)if(this._terrainProvider._regionContains(r,e,t,i))return this._colors.get("custom")||h.Color.RED;return this._terrainProvider.getTileDataAvailable(e,t,i)?this._colors.get("default")||h.Color.BLUE:this._colors.get("fallback")||h.Color.GRAY}hide(){this._collection.remove(n.tag.grid),this._tileCoordinatesLayer&&(this._viewer.imageryLayers.remove(this._tileCoordinatesLayer),this._tileCoordinatesLayer=void 0),this._visible=!1}setColors(e){Object.entries(e).forEach(([t,i])=>{this._colors.set(t,i)}),this.update()}flyTo(e,t){this._viewer.camera.flyTo({destination:e,...t,complete:()=>{this._visible&&this.update()}})}_getVisibleRectangle(){return this._viewer.camera.computeViewRectangle()}get level(){return this._level}set level(e){this._level=e,this._visible&&this.update()}get visible(){return this._visible}get collection(){return this._collection}get viewer(){return this._viewer}get colors(){return this._colors}get terrainProvider(){return this._terrainProvider}};(i=>{i.tag={default:"Terrain Visualizer",boundary:"Terrain Visualizer Boundary",grid:"Terrain Visualizer Tile Grid"};function e(r,o){return new h.Entity({rectangle:{coordinates:r,material:o,heightReference:h.HeightReference.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,o,s){let l=s?.tag||"terrain_region_visualization",c=s?.color||h.Color.RED,d=s?.maxTilesToShow||100,v=s?.show??!0,p=s?.alpha||.7,_=s?.tileAlpha||.2,y=new w({collection:o.entities,tag:l});if(r.bounds&&y.add(i.createRectangle(r.bounds,c.withAlpha(p)),l),v&&r.tiles&&r.tiles.size>0){let C=r.provider.tilingScheme,P=0;r.tiles.forEach((f,W)=>{let N=Array.isArray(f.x)?f.x:[f.x,f.x],B=Array.isArray(f.y)?f.y:[f.y,f.y];for(let I=N[0];I<=N[1]&&P<d;I++)for(let A=B[0];A<=B[1]&&P<d;A++){let Y=C.tileXYToRectangle(I,A,W);y.add(e(Y,c.withAlpha(_)),`${l}_tile`),P++}})}return y}i.visualize=t})(O||={});function H(n,e){let t=!1,i=Object.getOwnPropertyDescriptor(n,e);if(!i){let r=Object.getPrototypeOf(n);for(;r&&!i;)i=Object.getOwnPropertyDescriptor(r,e),r=Object.getPrototypeOf(r)}return i&&i.get&&!i.set&&(t=!0),t}var de=S.deprecate;var M=class n{static symbol=Symbol("cesium-item-tag");tag;collection;_valuesCache=null;_tagMap=new Map;_eventListeners=new Map;_eventCleanupFunctions=[];constructor({collection:e,tag:t}){this.tag=t||"default",this.collection=e,this._setupCacheInvalidator(e)}[Symbol.iterator](){return this.values[Symbol.iterator]()}_emit(e,t){let i=this._eventListeners.get(e);if(i){let r={type:e,...t};i.forEach(o=>o(r))}}_addToTagMap(e,t){this._tagMap.has(t)||this._tagMap.set(t,new Set),this._tagMap.get(t)?.add(e)}_removeFromTagMap(e){let t=e[n.symbol],i=this._tagMap.get(t);i&&(i.delete(e),i.size===0&&this._tagMap.delete(t))}_invalidateCache=()=>{this._valuesCache=null};_setupCacheInvalidator(e){e instanceof g.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof g.PrimitiveCollection?(e.primitiveAdded.addEventListener(this._invalidateCache),e.primitiveRemoved.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.primitiveAdded.removeEventListener(this._invalidateCache),()=>e.primitiveRemoved.removeEventListener(this._invalidateCache))):e instanceof g.DataSourceCollection?(e.dataSourceAdded.addEventListener(this._invalidateCache),e.dataSourceMoved.addEventListener(this._invalidateCache),e.dataSourceRemoved.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.dataSourceAdded.removeEventListener(this._invalidateCache),()=>e.dataSourceMoved.removeEventListener(this._invalidateCache),()=>e.dataSourceRemoved.removeEventListener(this._invalidateCache))):e instanceof g.ImageryLayerCollection&&(e.layerAdded.addEventListener(this._invalidateCache),e.layerMoved.addEventListener(this._invalidateCache),e.layerRemoved.addEventListener(this._invalidateCache),e.layerShownOrHidden.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.layerAdded.removeEventListener(this._invalidateCache),()=>e.layerMoved.removeEventListener(this._invalidateCache),()=>e.layerRemoved.removeEventListener(this._invalidateCache),()=>e.layerShownOrHidden.removeEventListener(this._invalidateCache)))}addEventListener(e,t){return this._eventListeners.has(e)||this._eventListeners.set(e,new Set),this._eventListeners.get(e)?.add(t),this}removeEventListener(e,t){return this._eventListeners.get(e)?.delete(t),this}add(e,t=this.tag,i){return Array.isArray(e)?e.forEach(r=>{this.add(r,t)}):(Object.defineProperty(e,n.symbol,{value:t,enumerable:!1,writable:!0,configurable:!0}),this.collection.add(e,i),this._addToTagMap(e,t),this._invalidateCache(),this._emit("add",{items:[e],tag:t})),this}contains(e){if(typeof e=="object")return this.collection.contains(e);let t=this._tagMap.get(e);return!!t&&t.size>0}remove(e){if(typeof e=="object"&&!Array.isArray(e)&&this.collection.remove(e)&&(this._removeFromTagMap(e),this._invalidateCache(),this._emit("remove",{items:[e]})),Array.isArray(e)){if(e.length===0)return this;for(let i of e)this.remove(i)}let t=this.get(e);if(t.length===0)return this;for(let i of t)this.remove(i);return this}removeAll(){this._tagMap.clear(),this.collection.removeAll(),this._invalidateCache(),this._emit("clear")}destroy(){this._eventCleanupFunctions.forEach(e=>e()),this._eventCleanupFunctions=[],this._tagMap.clear(),this._eventListeners.clear(),this._valuesCache=null}get values(){if(this._valuesCache!==null)return this._valuesCache;let e;if(this.collection instanceof g.EntityCollection)e=this.collection.values;else{e=[];for(let t=0;t<this.collection.length;t++)e.push(this.collection.get(t))}return this._valuesCache=e,e}get length(){return this.values?.length||0}get(e){let t=this._tagMap.get(e);return t?Array.from(t):[]}first(e){let t=this._tagMap.get(e);if(t&&t.size>0)return t.values().next().value}get tags(){return Array.from(this._tagMap.keys())}update(e,t){let i=this.get(e);for(let r of i)this._removeFromTagMap(r),Object.defineProperty(r,n.symbol,{value:t,enumerable:!1,writable:!0,configurable:!0}),this._addToTagMap(r,t);return i.length>0&&this._emit("update",{items:i,tag:t}),i.length}show(e){let t=this.get(e);for(let i of t)(0,g.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,g.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,g.defined)(i.show)&&(i.show=!i.show);return this}setProperty(e,t,i=this.tag){let r=this.get(i);for(let o of r)if(e in o&&typeof o[e]!="function"){if(H(o,e))throw Error(`Cannot set read-only property '${String(e)}' on ${o.constructor.name}`);o[e]=t}return this}filter(e,t){return(t?this.get(t):this.values).filter(e)}forEach(e,t){(t?this.get(t):this.values).forEach((r,o)=>e(r,o))}map(e,t){return(t?this.get(t):this.values).map(e)}find(e,t){return(t?this.get(t):this.values).find(e)}},w=M;var m=require("cesium");var u=require("cesium"),T=class{_color=u.Color.RED;_silhouette;_composite;_stages;_entity;_currentObject;_currentOptions;constructor(e){this._stages=e.scene.postProcessStages,this._silhouette=u.PostProcessStageLibrary.createEdgeDetectionStage(),this._silhouette.uniforms.color=this._color,this._silhouette.uniforms.length=.01,this._silhouette.selected=[],this._composite=u.PostProcessStageLibrary.createSilhouetteStage([this._silhouette]),this._stages.add(this._composite)}show(e,t){if((0,u.defined)(e)&&!(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))){this._clearHighlights();try{if(e instanceof u.Cesium3DTileFeature)this._silhouette.uniforms.color=t?.color||this._color,this._silhouette.selected.push(e);else{if(!e.model)return;this._entity=e,e.model.silhouetteSize=new u.ConstantProperty(t?.width||2),e.model.silhouetteColor=new u.ConstantProperty(t?.color||this._color)}this._currentObject=e,this._currentOptions=t?{...t}:void 0}catch(i){console.error("Failed to highlight object:",i),this._currentObject=void 0,this._currentOptions=void 0}}}_optionsEqual(e,t){return!e&&!t?!0:!e||!t?!1:e.outline===t.outline&&e.width===t.width&&u.Color.equals(e.color||this._color,t.color||this._color)}_clearHighlights(){this._silhouette.selected.length>0&&(this._silhouette.selected=[]),this._entity?.model&&(this._entity.model.silhouetteColor=new u.ConstantProperty(u.Color.TRANSPARENT),this._entity.model.silhouetteSize=new u.ConstantProperty(0),this._entity=void 0)}hide(){this._clearHighlights(),this._currentObject=void 0,this._currentOptions=void 0}destroy(){this.hide(),this._composite&&this._stages.remove(this._composite),this._currentObject=void 0,this._currentOptions=void 0}get color(){return this._color}set color(e){this._color=e}get currentObject(){return this._currentObject}};var a=require("cesium"),b=class{_color=a.Color.RED;_entity;_entities;_currentObject;_currentOptions;constructor(e){this._entities=e.entities,this._entity=this._entities.add(new a.Entity({id:`highlight-entity-${Math.random().toString(36).substring(2)}`,show:!1}))}show(e,t){if(!(!(0,a.defined)(e)||!this._entity)){if(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))return this._entity;this._clearGeometries();try{if(e instanceof a.Entity&&(e.polygon||e.polyline||e.rectangle))this._update(e,t);else if(e instanceof a.GroundPrimitive)this._update(e,t);else{this._currentObject=void 0,this._currentOptions=void 0;return}return this._currentObject=e,this._currentOptions=t?{...t}:void 0,this._entity.show=!0,this._entity}catch(i){console.error("Failed to highlight object:",i),this._currentObject=void 0,this._currentOptions=void 0;return}}}_optionsEqual(e,t){return!e&&!t?!0:!e||!t?!1:e.outline===t.outline&&e.width===t.width&&a.Color.equals(e.color||this._color,t.color||this._color)}_clearGeometries(){this._entity.polygon=void 0,this._entity.polyline=void 0,this._entity.rectangle=void 0}_update(e,t={color:this._color,outline:!1,width:2}){if(e instanceof a.Entity){if(e.polygon)if(t.outline){let i=e.polygon.hierarchy?.getValue();if(i&&i.positions){let r;i.positions.length>0&&!a.Cartesian3.equals(i.positions[0],i.positions[i.positions.length-1])?r=[...i.positions,i.positions[0]]:r=i.positions,this._entity.polyline=new a.PolylineGraphics({positions:r,material:t.color,width:t.width||2,clampToGround:!0})}}else{let i=e.polygon.hierarchy?.getValue();i&&(this._entity.polygon=new a.PolygonGraphics({hierarchy:i,material:t.color,heightReference:a.HeightReference.CLAMP_TO_GROUND,classificationType:e.polygon.classificationType?.getValue()||a.ClassificationType.BOTH}))}else if(e.polyline){let i=e.polyline.positions?.getValue();if(i){let r=e.polyline.width?.getValue();this._entity.polyline=new a.PolylineGraphics({positions:i,material:t.color,width:r+(t.width||2),clampToGround:!0})}}else if(e.rectangle)if(t.outline){let i=e.rectangle.coordinates?.getValue();if(i){let r=[a.Cartesian3.fromRadians(i.west,i.north),a.Cartesian3.fromRadians(i.east,i.north),a.Cartesian3.fromRadians(i.east,i.south),a.Cartesian3.fromRadians(i.west,i.south),a.Cartesian3.fromRadians(i.west,i.north)];this._entity.polyline=new a.PolylineGraphics({positions:r,material:t.color,width:t.width||2,clampToGround:!0})}}else{let i=e.rectangle.coordinates?.getValue();i&&(this._entity.rectangle=new a.RectangleGraphics({coordinates:i,material:t.color,heightReference:a.HeightReference.CLAMP_TO_GROUND}))}}else if(e instanceof a.GroundPrimitive){let i=e.geometryInstances,r=Array.isArray(i)?i[0]:i;if(!r.geometry.attributes.position)return;let o=r.geometry.attributes.position.values,s=[];for(let l=0;l<o.length;l+=3)s.push(new a.Cartesian3(o[l],o[l+1],o[l+2]));t.outline?this._entity.polyline=new a.PolylineGraphics({positions:s,material:t.color,width:t.width||2,clampToGround:!0}):this._entity.polygon=new a.PolygonGraphics({hierarchy:new a.PolygonHierarchy(s),material:t.color,heightReference:a.HeightReference.CLAMP_TO_GROUND,classificationType:a.ClassificationType.BOTH})}}hide(){this._entity&&(this._entity.show=!1),this._currentObject=void 0,this._currentOptions=void 0}destroy(){this._entities.contains(this._entity)&&this._entities.remove(this._entity),this._currentObject=void 0,this._currentOptions=void 0}get color(){return this._color}set color(e){this._color=e}get entity(){return this._entity}get currentObject(){return this._currentObject}};var D=class n{static instances=new WeakMap;_surface;_silhouette;_color=m.Color.RED;constructor(e){this._surface=new b(e),this._silhouette=new T(e),this._surface.color=this._color,this._silhouette.color=this._color}static getInstance(e){let t=e.container;return n.instances.has(t)||n.instances.set(t,new n(e)),n.instances.get(t)}static releaseInstance(e){let t=e.container,i=n.instances.get(t);i&&(i.hide(),i._surface&&i._surface.destroy(),i._silhouette&&i._silhouette.destroy(),n.instances.delete(t))}show(e,t={color:this._color}){let i=this._getObject(e);if((0,m.defined)(i))return i instanceof m.Cesium3DTileFeature?this._silhouette.show(i,t):i instanceof m.Entity&&i.model?this._silhouette.show(i,t):this._surface.show(i,t)}_getObject(e){if((0,m.defined)(e)){if(e instanceof m.Entity||e instanceof m.Cesium3DTileFeature||e instanceof m.GroundPrimitive)return e;if(e.id instanceof m.Entity)return e.id;if(e.primitive instanceof m.GroundPrimitive)return e.primitive}}hide(){this._surface.hide(),this._silhouette.hide()}get color(){return this._color}set color(e){this._color=e,this._surface.color=e,this._silhouette.color=e}},V=D;var E=require("cesium");var x=class{_regions;_defaultProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._defaultProvider=e.defaultProvider,this._fallbackProvider=e.fallbackProvider||new E.EllipsoidTerrainProvider,this._tilingScheme=e.defaultProvider.tilingScheme,this._regions=e.regions||[],this._availability=e.defaultProvider.availability,this._ready=!0}get ready(){return this._ready}get tilingScheme(){return this._tilingScheme}get availability(){return this._availability}get regions(){return[...this._regions]}get defaultProvider(){return this._defaultProvider}get fallbackProvider(){return this._fallbackProvider}get credit(){return this._defaultProvider?.credit}get errorEvent(){return this._defaultProvider.errorEvent}get hasWaterMask(){return this._defaultProvider.hasWaterMask}get hasVertexNormals(){return this._defaultProvider.hasVertexNormals}loadTileDataAvailability(e,t,i){return this._defaultProvider.loadTileDataAvailability(e,t,i)}getLevelMaximumGeometricError(e){return this._defaultProvider.getLevelMaximumGeometricError(e)}requestTileGeometry(e,t,i,r){if(this._ready){for(let o of this._regions)if(this._regionContains(o,e,t,i))return o.provider.requestTileGeometry(e,t,i,r);return this._defaultProvider.getTileDataAvailable(e,t,i)?this._defaultProvider.requestTileGeometry(e,t,i,r):this._fallbackProvider.requestTileGeometry(e,t,i,r)}}getTileDataAvailable(e,t,i){for(let r of this._regions)if(this._regionContains(r,e,t,i))return r.provider.getTileDataAvailable(e,t,i);return this._defaultProvider.getTileDataAvailable(e,t,i)}_regionContains(e,t,i,r){if(e.levels&&!e.levels.includes(r))return!1;if(e.tiles){let o=e.tiles.get(r);if(!o)return!1;let[s,l]=Array.isArray(o.x)?o.x:[o.x,o.x],[c,d]=Array.isArray(o.y)?o.y:[o.y,o.y];return t>=s&&t<=l&&i>=c&&i<=d}if(e.bounds){let o=this._tilingScheme.tileXYToRectangle(t,i,r);return E.Rectangle.intersection(o,e.bounds)!==void 0}return!1}};(i=>{function n(r,o,s){return new i({regions:r.map(l=>({...l})),defaultProvider:o,fallbackProvider:s})}i.fromRectangles=n;function e(r,o,s){return new i({regions:r.map(l=>({...l})),defaultProvider:o,fallbackProvider:s})}i.fromTileRanges=e;function t(r,o){if(S.warn("computeRectangle() is deprecated. Use Rectangle.fromDegrees() instead.",{removeInVersion:"v0.3.0"}),o.size===0)return new E.Rectangle;let s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,v=Array.from(o.keys()),p=Math.min(...v),_=o.get(p);if(_){let{start:y,end:C}=_,P=r.tileXYToRectangle(y.x,y.y,p),f=r.tileXYToRectangle(C.x,C.y,p);s=Math.min(P.west,s),l=Math.min(f.south,l),c=Math.max(f.east,c),d=Math.max(P.north,d)}return new E.Rectangle(s,l,c,d)}i.computeRectangle=t})(x||={});var G=x;var z=require("cesium");var k=require("cesium");function R(n,e){if((0,k.defined)(n)&&(0,k.defined)(e)){let{camera:t}=n;e.camera.position=t.positionWC.clone(),e.camera.direction=t.directionWC.clone(),e.camera.up=t.upWC.clone()}}function F(n,e,t){let i={baseLayerPicker:n.baseLayerPicker!==void 0,geocoder:n.geocoder!==void 0,homeButton:n.homeButton!==void 0,sceneModePicker:n.sceneModePicker!==void 0,timeline:n.timeline!==void 0,navigationHelpButton:n.navigationHelpButton!==void 0,animation:n.animation!==void 0,fullscreenButton:n.fullscreenButton!==void 0,shouldAnimate:n.clock.shouldAnimate,terrainProvider:n.terrainProvider,requestRenderMode:n.scene.requestRenderMode,infoBox:n.infoBox!==void 0},r=new z.Viewer(e,{...i,...t});R(n,r);let o=n.imageryLayers;r.imageryLayers.removeAll();for(let c=0;c<o.length;c++){let d=o.get(c);r.imageryLayers.addImageryProvider(d.imageryProvider,c)}r.clock.startTime=n.clock.startTime.clone(),r.clock.stopTime=n.clock.stopTime.clone(),r.clock.currentTime=n.clock.currentTime.clone(),r.clock.multiplier=n.clock.multiplier,r.clock.clockStep=n.clock.clockStep,r.clock.clockRange=n.clock.clockRange,r.clock.shouldAnimate=n.clock.shouldAnimate,r.scene.globe.enableLighting=n.scene.globe.enableLighting,r.scene.globe.depthTestAgainstTerrain=n.scene.globe.depthTestAgainstTerrain,r.scene.screenSpaceCameraController.enableCollisionDetection=n.scene.screenSpaceCameraController.enableCollisionDetection;let s=n.scene.screenSpaceCameraController.tiltEventTypes;s&&(r.scene.screenSpaceCameraController.tiltEventTypes=Array.isArray(s)?[...s]:s);let l=n.scene.screenSpaceCameraController.zoomEventTypes;return l&&(r.scene.screenSpaceCameraController.zoomEventTypes=Array.isArray(l)?[...l]:l),r}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { C as Collection
|
|
1
|
+
export { C as Collection } from './index-C7kPHG5S.cjs';
|
|
2
2
|
export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.cjs';
|
|
3
|
-
export { H as HybridTerrainProvider
|
|
4
|
-
export { TerrainVisualizer } from './utils/index.cjs';
|
|
3
|
+
export { H as HybridTerrainProvider } from './hybrid-terrain-provider-C2V-igd9.cjs';
|
|
5
4
|
export { cloneViewer, syncCamera } from './viewer/index.cjs';
|
|
6
5
|
import 'cesium';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { C as Collection
|
|
1
|
+
export { C as Collection } from './index-C7kPHG5S.js';
|
|
2
2
|
export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.js';
|
|
3
|
-
export { H as HybridTerrainProvider
|
|
4
|
-
export { TerrainVisualizer } from './utils/index.js';
|
|
3
|
+
export { H as HybridTerrainProvider } from './hybrid-terrain-provider-C2V-igd9.js';
|
|
5
4
|
export { cloneViewer, syncCamera } from './viewer/index.js';
|
|
6
5
|
import 'cesium';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-RXMNSDKR.js";import{
|
|
1
|
+
import"./chunk-RXMNSDKR.js";import{d as r}from"./chunk-N24M6GYI.js";import{a as i,b as o,c as e}from"./chunk-RZ3PTU3G.js";import{a as t}from"./chunk-DGHCIGKJ.js";import"./chunk-TUJQL7MC.js";import{a as m,b as h}from"./chunk-Z2COOTT4.js";export{r as Collection,e as Highlight,t as HybridTerrainProvider,i as SilhouetteHighlight,o as SurfaceHighlight,h as cloneViewer,m as syncCamera};
|
package/dist/terrain/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var A=(a,e)=>{for(var i in e)g(a,i,{get:e[i],enumerable:!0})},w=(a,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of R(e))!I.call(a,r)&&r!==i&&g(a,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return a};var E=a=>w(g({},"__esModule",{value:!0}),a);var N={};A(N,{HybridTerrainProvider:()=>_});module.exports=E(N);var b=require("cesium");var P;(l=>{let a=new Set,e=typeof process<"u"?process.env.CESIUM_UTILS_DISABLE_DEPRECATION_WARNINGS!=="true":!0;function i(o,u={}){if(!e)return;let{once:c=!0,prefix:d="[DEPRECATED]",includeStack:m=!0,removeInVersion:f}=u;if(c&&a.has(o))return;let v=`${d} ${o}`;f&&(v+=` This feature will be removed in ${f}.`),typeof console<"u"&&console.warn&&(m?(console.warn(v),console.trace("Deprecation stack trace:")):console.warn(v)),c&&a.add(o)}l.warn=i;function n(o,u,c={}){let d=(...m)=>(i(u,c),o(...m));return Object.defineProperty(d,"name",{value:o.name,configurable:!0}),d}l.deprecate=n;function r(){a.clear()}l.clear=r;function t(){return a.size}l.getWarningCount=t;function s(o){return a.has(o)}l.hasShown=s})(P||={});var y=P;var T=class{_regions;_defaultProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._defaultProvider=e.defaultProvider,this._fallbackProvider=e.fallbackProvider||new b.EllipsoidTerrainProvider,this._tilingScheme=e.defaultProvider.tilingScheme,this._regions=e.regions||[],this._availability=e.defaultProvider.availability,this._ready=!0}get ready(){return this._ready}get tilingScheme(){return this._tilingScheme}get availability(){return this._availability}get regions(){return[...this._regions]}get defaultProvider(){return this._defaultProvider}get fallbackProvider(){return this._fallbackProvider}get credit(){return this._defaultProvider?.credit}get errorEvent(){return this._defaultProvider.errorEvent}get hasWaterMask(){return this._defaultProvider.hasWaterMask}get hasVertexNormals(){return this._defaultProvider.hasVertexNormals}loadTileDataAvailability(e,i,n){return this._defaultProvider.loadTileDataAvailability(e,i,n)}getLevelMaximumGeometricError(e){return this._defaultProvider.getLevelMaximumGeometricError(e)}requestTileGeometry(e,i,n,r){if(this._ready){for(let t of this._regions)if(this._regionContains(t,e,i,n))return t.provider.requestTileGeometry(e,i,n,r);return this._defaultProvider.getTileDataAvailable(e,i,n)?this._defaultProvider.requestTileGeometry(e,i,n,r):this._fallbackProvider.requestTileGeometry(e,i,n,r)}}getTileDataAvailable(e,i,n){for(let r of this._regions)if(this._regionContains(r,e,i,n))return r.provider.getTileDataAvailable(e,i,n);return this._defaultProvider.getTileDataAvailable(e,i,n)}_regionContains(e,i,n,r){if(e.levels&&!e.levels.includes(r))return!1;if(e.tiles){let t=e.tiles.get(r);if(!t)return!1;let[s,l]=Array.isArray(t.x)?t.x:[t.x,t.x],[o,u]=Array.isArray(t.y)?t.y:[t.y,t.y];return i>=s&&i<=l&&n>=o&&n<=u}if(e.bounds){let t=this._tilingScheme.tileXYToRectangle(i,n,r);return b.Rectangle.intersection(t,e.bounds)!==void 0}return!1}};(n=>{function a(r,t,s){return new n({regions:r.map(l=>({...l})),defaultProvider:t,fallbackProvider:s})}n.fromRectangles=a;function e(r,t,s){return new n({regions:r.map(l=>({...l})),defaultProvider:t,fallbackProvider:s})}n.fromTileRanges=e;function i(r,t){if(y.warn("computeRectangle() is deprecated. Use Rectangle.fromDegrees() instead.",{removeInVersion:"v0.3.0"}),t.size===0)return new b.Rectangle;let s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Array.from(t.keys()),d=Math.min(...c),m=t.get(d);if(m){let{start:f,end:v}=m,p=r.tileXYToRectangle(f.x,f.y,d),h=r.tileXYToRectangle(v.x,v.y,d);s=Math.min(p.west,s),l=Math.min(h.south,l),o=Math.max(h.east,o),u=Math.max(p.north,u)}return new b.Rectangle(s,l,o,u)}n.computeRectangle=i})(T||={});var _=T;
|
package/dist/terrain/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-
|
|
2
|
-
export { T as TerrainArea } from '../hybrid-terrain-provider-C7Ks0pK6.cjs';
|
|
1
|
+
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-C2V-igd9.cjs';
|
|
3
2
|
import 'cesium';
|
|
4
3
|
|
|
5
4
|
type TerrainRegion = HybridTerrainProvider.TerrainRegion;
|
package/dist/terrain/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-
|
|
2
|
-
export { T as TerrainArea } from '../hybrid-terrain-provider-C7Ks0pK6.js';
|
|
1
|
+
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-C2V-igd9.js';
|
|
3
2
|
import 'cesium';
|
|
4
3
|
|
|
5
4
|
type TerrainRegion = HybridTerrainProvider.TerrainRegion;
|
package/dist/terrain/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"../chunk-DGHCIGKJ.js";import"../chunk-TUJQL7MC.js";export{a as HybridTerrainProvider};
|
package/dist/viewer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var T=(e,i)=>{for(var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var T=(e,i)=>{for(var t in i)m(e,t,{get:i[t],enumerable:!0})},v=(e,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of k(i))!C.call(e,n)&&n!==t&&m(e,n,{get:()=>i[n],enumerable:!(o=g(i,n))||o.enumerable});return e};var b=e=>v(m({},"__esModule",{value:!0}),e);var h={};T(h,{cloneViewer:()=>y,syncCamera:()=>l});module.exports=b(h);var p=require("cesium");var d=require("cesium");function l(e,i){if((0,d.defined)(e)&&(0,d.defined)(i)){let{camera:t}=e;i.camera.position=t.positionWC.clone(),i.camera.direction=t.directionWC.clone(),i.camera.up=t.upWC.clone()}}function y(e,i,t){let o={baseLayerPicker:e.baseLayerPicker!==void 0,geocoder:e.geocoder!==void 0,homeButton:e.homeButton!==void 0,sceneModePicker:e.sceneModePicker!==void 0,timeline:e.timeline!==void 0,navigationHelpButton:e.navigationHelpButton!==void 0,animation:e.animation!==void 0,fullscreenButton:e.fullscreenButton!==void 0,shouldAnimate:e.clock.shouldAnimate,terrainProvider:e.terrainProvider,requestRenderMode:e.scene.requestRenderMode,infoBox:e.infoBox!==void 0},n=new p.Viewer(i,{...o,...t});l(e,n);let s=e.imageryLayers;n.imageryLayers.removeAll();for(let c=0;c<s.length;c++){let f=s.get(c);n.imageryLayers.addImageryProvider(f.imageryProvider,c)}n.clock.startTime=e.clock.startTime.clone(),n.clock.stopTime=e.clock.stopTime.clone(),n.clock.currentTime=e.clock.currentTime.clone(),n.clock.multiplier=e.clock.multiplier,n.clock.clockStep=e.clock.clockStep,n.clock.clockRange=e.clock.clockRange,n.clock.shouldAnimate=e.clock.shouldAnimate,n.scene.globe.enableLighting=e.scene.globe.enableLighting,n.scene.globe.depthTestAgainstTerrain=e.scene.globe.depthTestAgainstTerrain,n.scene.screenSpaceCameraController.enableCollisionDetection=e.scene.screenSpaceCameraController.enableCollisionDetection;let r=e.scene.screenSpaceCameraController.tiltEventTypes;r&&(n.scene.screenSpaceCameraController.tiltEventTypes=Array.isArray(r)?[...r]:r);let a=e.scene.screenSpaceCameraController.zoomEventTypes;return a&&(n.scene.screenSpaceCameraController.zoomEventTypes=Array.isArray(a)?[...a]:a),n}
|
package/dist/viewer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-Z2COOTT4.js";export{b as cloneViewer,a as syncCamera};
|