@juun-roh/cesium-utils 0.1.3 → 0.2.0

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.
@@ -0,0 +1,524 @@
1
+ import { DataSourceCollection, EntityCollection, ImageryLayerCollection, PrimitiveCollection, Billboard, Cesium3DTileset, GroundPrimitive, Label, PointPrimitive, Polyline, Primitive, DataSource, Entity, ImageryLayer } from 'cesium';
2
+
3
+ /**
4
+ * Examine the property descriptors at runtime
5
+ * to detect properties that only have getters.
6
+ * (read-only accessor properties)
7
+ * @param o The object to examine.
8
+ * @param k The key value of the property.
9
+ */
10
+ declare function isGetterOnly(o: object, k: string | number | symbol): boolean;
11
+ /**
12
+ * Runtime type validator to identify the non-function property.
13
+ */
14
+ type NonFunction<T> = {
15
+ [K in keyof T]: T[K] extends Function ? never : K;
16
+ }[keyof T];
17
+
18
+ /**
19
+ * @class
20
+ * A wrapper class that enhances Cesium collection objects with tagging functionality.
21
+ * This class provides a consistent API for working with different types of Cesium collections
22
+ * and allows grouping and manipulating collection items by custom tags.
23
+ *
24
+ * @template C - The type of Cesium collection (e.g., EntityCollection, PrimitiveCollection)
25
+ * @template I - The type of items in the collection (e.g., Entity, Primitive)
26
+ *
27
+ * @example
28
+ * // Example 1: Managing Complex Scene with Multiple Object Types
29
+ * class SceneOrganizer {
30
+ * private entities: Collection<EntityCollection, Entity>;
31
+ * private billboards: Collection<BillboardCollection, Billboard>;
32
+ * private primitives: Collection<PrimitiveCollection, Primitive>;
33
+ *
34
+ * constructor(viewer: Viewer) {
35
+ * this.entities = new Collection({ collection: viewer.entities });
36
+ * this.billboards = new Collection({
37
+ * collection: viewer.scene.primitives.add(new BillboardCollection())
38
+ * });
39
+ * this.primitives = new Collection({
40
+ * collection: viewer.scene.primitives
41
+ * });
42
+ * }
43
+ *
44
+ * // Unified API across different collection types!
45
+ * showLayer(layerName: string) {
46
+ * this.entities.show(layerName);
47
+ * this.billboards.show(layerName);
48
+ * this.primitives.show(layerName);
49
+ * }
50
+ *
51
+ * hideLayer(layerName: string) {
52
+ * this.entities.hide(layerName);
53
+ * this.billboards.hide(layerName);
54
+ * this.primitives.hide(layerName);
55
+ * }
56
+ *
57
+ * removeLayer(layerName: string) {
58
+ * this.entities.remove(layerName);
59
+ * this.billboards.remove(layerName);
60
+ * this.primitives.remove(layerName);
61
+ * }
62
+ * }
63
+ *
64
+ * // Example 2: Extend the class for Domain-Specific Needs
65
+ * class BuildingCollection extends Collection<EntityCollection, Entity> {
66
+ * constructor(viewer: Viewer) {
67
+ * super({ collection: viewer.entities, tag: 'buildings' });
68
+ * }
69
+ *
70
+ * addBuilding(options: {
71
+ * position: Cartesian3;
72
+ * height: number;
73
+ * floors: number;
74
+ * type: 'residential' | 'commercial' | 'industrial';
75
+ * }): Entity {
76
+ * const building = new Entity({
77
+ * position: options.position,
78
+ * box: {
79
+ * dimensions: new Cartesian3(50, 50, options.height),
80
+ * material: this.getMaterialForType(options.type)
81
+ * }
82
+ * });
83
+ *
84
+ * // Tag by type AND by floor count
85
+ * this.add(building, options.type);
86
+ * this.add(building, `floors-${options.floors}`);
87
+ *
88
+ * return building;
89
+ * }
90
+ *
91
+ * getByFloorRange(min: number, max: number): Entity[] {
92
+ * const results: Entity[] = [];
93
+ * for (let i = min; i <= max; i++) {
94
+ * results.push(...this.get(`floors-${i}`));
95
+ * }
96
+ * return results;
97
+ * }
98
+ *
99
+ * private getMaterialForType(type: string): Material {
100
+ * const colors = {
101
+ * residential: Color.GREEN,
102
+ * commercial: Color.BLUE,
103
+ * industrial: Color.YELLOW
104
+ * };
105
+ * return new ColorMaterialProperty(colors[type] || Color.WHITE);
106
+ * }
107
+ * }
108
+ */
109
+ declare class Collection<C extends Collection.Base, I extends Collection.Item> {
110
+ /**
111
+ * Symbol used as a property key to store tags on collection items.
112
+ * Using a Symbol ensures no property naming conflicts with the item's own properties.
113
+ * @readonly
114
+ */
115
+ static readonly symbol: unique symbol;
116
+ /**
117
+ * Default tag used when adding items without specifying a tag.
118
+ * @protected
119
+ */
120
+ protected tag: Collection.Tag;
121
+ /**
122
+ * The underlying Cesium collection being wrapped.
123
+ * @protected
124
+ */
125
+ protected collection: C;
126
+ /**
127
+ * Cache for values array to improve performance
128
+ * @private
129
+ */
130
+ private _valuesCache;
131
+ /**
132
+ * Tag to items map for faster lookups
133
+ * @private
134
+ */
135
+ private _tagMap;
136
+ /**
137
+ * Event listeners
138
+ * @private
139
+ */
140
+ private _eventListeners;
141
+ /**
142
+ * For cleaning up the instances
143
+ * @private
144
+ */
145
+ private _eventCleanupFunctions;
146
+ /**
147
+ * Creates a new Collection instance.
148
+ *
149
+ * @param options - Configuration options
150
+ * @param options.collection - The Cesium collection to wrap
151
+ * @param options.tag - The default tag to use for items (defaults to 'default')
152
+ */
153
+ constructor({ collection, tag }: {
154
+ collection: C;
155
+ tag?: Collection.Tag;
156
+ });
157
+ /**
158
+ * Makes the collection directly iterable, allowing it to be used in `for...of` loops
159
+ * and with spread operators.
160
+ *
161
+ * @returns An iterator for the items in the collection
162
+ *
163
+ * @example
164
+ * // Iterate through all items in the collection
165
+ * for (const entity of collection) {
166
+ * console.log(entity.id);
167
+ * }
168
+ *
169
+ * // Convert collection to array using spread syntax
170
+ * const entitiesArray = [...collection];
171
+ */
172
+ [Symbol.iterator](): Iterator<I>;
173
+ /**
174
+ * Emits an event to all registered listeners.
175
+ *
176
+ * @private
177
+ * @param type - The event type
178
+ * @param data - Additional event data
179
+ */
180
+ private _emit;
181
+ /**
182
+ * Adds an item to the internal tag map for quick lookups.
183
+ *
184
+ * @private
185
+ * @param item - The item to add
186
+ * @param tag - The tag to associate with the item
187
+ */
188
+ private _addToTagMap;
189
+ /**
190
+ * Removes an item from the internal tag map.
191
+ *
192
+ * @private
193
+ * @param item - The item to remove
194
+ */
195
+ private _removeFromTagMap;
196
+ /**
197
+ * Invalidates the values cache when collection changes.
198
+ *
199
+ * @private
200
+ */
201
+ private _invalidateCache;
202
+ /**
203
+ * Sets up automatic cache invalidation by registering event listeners on the underlying Cesium collection.
204
+ *
205
+ * @private
206
+ * @param collection - The Cesium collection to monitor for changes
207
+ *
208
+ * @see {@link destroy} For cleanup of event listeners
209
+ * @see {@link _invalidateCache} For the actual cache invalidation logic
210
+ */
211
+ private _setupCacheInvalidator;
212
+ /**
213
+ * Registers an event listener for collection events.
214
+ *
215
+ * @param type - The event type to listen for
216
+ * @param handler - The callback function
217
+ * @returns The collection instance for method chaining
218
+ */
219
+ addEventListener(type: Collection.Event, handler: Collection.EventHandler<I>): this;
220
+ /**
221
+ * Removes an event listener.
222
+ *
223
+ * @param type - The event type
224
+ * @param handler - The callback function to remove
225
+ * @returns The collection instance for method chaining
226
+ */
227
+ removeEventListener(type: Collection.Event, handler: Collection.EventHandler<I>): this;
228
+ /**
229
+ * Adds a single item with a tag to the collection.
230
+ *
231
+ * @param item - The item to add to the collection
232
+ * @param tag - Tag to associate with this item (defaults to the collection's default tag)
233
+ * @param index - The index to add the item at (if supported by the collection)
234
+ * @returns The collection instance for method chaining
235
+ *
236
+ * @example
237
+ * const entity = collection.add(new Entity({ ... }), 'landmarks');
238
+ */
239
+ add(item: I, tag?: Collection.Tag, index?: number): this;
240
+ /**
241
+ * Adds multiple items with the same tag to the collection.
242
+ *
243
+ * @param items - The array of items to add to the collection
244
+ * @param tag - Tag to associate with this item (defaults to the collection's default tag)
245
+ * @returns The collection instance for method chaining
246
+ *
247
+ * @example
248
+ * // Add multiple entities with the same tag
249
+ * const entities = [new Entity({ ... }), new Entity({ ... })];
250
+ * const addedEntities = collection.add(entities, 'buildings');
251
+ */
252
+ add(items: I[], tag?: Collection.Tag): this;
253
+ /**
254
+ * Returns true if the provided item is in this collection, false otherwise.
255
+ *
256
+ * @param item - The item instance to check for
257
+ * @returns True if the item is in the collection, false otherwise
258
+ */
259
+ contains(item: I): boolean;
260
+ /**
261
+ * Checks if the collection has any items with the specified tag.
262
+ *
263
+ * @param tag - The tag to check for
264
+ * @returns True if items with the tag exist, false otherwise
265
+ *
266
+ * @example
267
+ * if (collection.contains('temporary')) {
268
+ * console.log('Temporary items exist');
269
+ * }
270
+ */
271
+ contains(tag: Collection.Tag): boolean;
272
+ /**
273
+ * Removes an item from the collection.
274
+ *
275
+ * @param item - The item to remove
276
+ * @returns The collection instance for method chaining
277
+ */
278
+ remove(item: I): this;
279
+ /**
280
+ * Removes all items with the specified tag from the collection.
281
+ *
282
+ * @param by - The tag identifying which items to remove
283
+ * @returns The collection instance for method chaining
284
+ */
285
+ remove(by: Collection.Tag): this;
286
+ /**
287
+ * Removes all items with the array of tags from the collection.
288
+ *
289
+ * @param by - The tags identifying which items to remove
290
+ * @returns The collection instance for method chaining
291
+ */
292
+ remove(by: Collection.Tag[]): this;
293
+ /**
294
+ * Removes all items from the collection.
295
+ */
296
+ removeAll(): void;
297
+ /**
298
+ * Permanently destroys this Collection instance.
299
+ * Removes all event listeners and clears internal state.
300
+ * The Collection instance should not be used after calling this method.
301
+ */
302
+ destroy(): void;
303
+ /**
304
+ * Gets all item instances in the collection.
305
+ * This array should not be modified directly.
306
+ *
307
+ * @returns An array of all items in the collection
308
+ */
309
+ get values(): I[];
310
+ /**
311
+ * Gets the number of items in the collection.
312
+ *
313
+ * @returns The item count
314
+ */
315
+ get length(): number;
316
+ /**
317
+ * Gets all items with the specified tag from the collection.
318
+ * Uses an optimized internal map for faster lookups.
319
+ *
320
+ * @param by - The tag to filter by
321
+ * @returns An array of items with the specified tag, or an empty array if none found
322
+ *
323
+ * @example
324
+ * // Get all buildings
325
+ * const buildings = collection.get('buildings');
326
+ */
327
+ get(by: Collection.Tag): I[];
328
+ /**
329
+ * Gets the first item matching the tag. More efficient than `get` when
330
+ * you only need one item, especially for large collections.
331
+ *
332
+ * @param by - The tag to search for
333
+ * @returns The first matching item or undefined if none found
334
+ *
335
+ * @example
336
+ * // Get the first building
337
+ * const firstBuilding = collection.first('buildings');
338
+ */
339
+ first(by: Collection.Tag): I | undefined;
340
+ /**
341
+ * Gets all unique tags currently in use in the collection.
342
+ *
343
+ * @returns An array of all unique tags
344
+ *
345
+ * @example
346
+ * // Get all tags
347
+ * const tags = collection.tags;
348
+ * console.log(`Collection has these tags: ${tags.join(', ')}`);
349
+ */
350
+ get tags(): Collection.Tag[];
351
+ /**
352
+ * Updates the tag for all items with the specified tag.
353
+ *
354
+ * @param from - The tag to replace
355
+ * @param to - The new tag to assign
356
+ * @returns The number of items updated
357
+ *
358
+ * @example
359
+ * // Rename a tag
360
+ * const count = collection.update('temp', 'temporary');
361
+ * console.log(`Updated ${count} items`);
362
+ */
363
+ update(from: Collection.Tag, to: Collection.Tag): number;
364
+ /**
365
+ * Makes all items with the specified tag visible.
366
+ * Only affects items that have a 'show' property.
367
+ *
368
+ * @param by - The tag identifying which items to show
369
+ * @returns The collection itself.
370
+ *
371
+ * @example
372
+ * // Show all buildings
373
+ * collection.show('buildings');
374
+ */
375
+ show(by: Collection.Tag): this;
376
+ /**
377
+ * Hides all items with the specified tag.
378
+ * Only affects items that have a 'show' property.
379
+ *
380
+ * @param by - The tag identifying which items to hide
381
+ * @returns The collection itself.
382
+ *
383
+ * @example
384
+ * // Hide all buildings
385
+ * collection.hide('buildings');
386
+ */
387
+ hide(by: Collection.Tag): this;
388
+ /**
389
+ * Toggles visibility of all items with the specified tag.
390
+ * Only affects items that have a 'show' property.
391
+ *
392
+ * @param by - The tag identifying which items to toggle
393
+ * @returns The collection itself.
394
+ *
395
+ * @example
396
+ * // Toggle visibility of all buildings
397
+ * collection.toggle('buildings');
398
+ */
399
+ toggle(by: Collection.Tag): this;
400
+ /**
401
+ * Sets a property value on all items with the specified tag.
402
+ *
403
+ * @template K - A type
404
+ *
405
+ * @param by - The tag identifying which items to update
406
+ * @param property - The property name to set
407
+ * @param value - The value to set
408
+ * @returns The collection itself.
409
+ *
410
+ * @example
411
+ * // Change color of all buildings to red
412
+ * collection.setProperty('buildings', 'color', Color.RED);
413
+ */
414
+ setProperty<K extends NonFunction<I>>(property: K, value: I[K], by?: Collection.Tag): this;
415
+ /**
416
+ * Filters items in the collection based on a predicate function.
417
+ * Optionally only filters items with a specific tag.
418
+ *
419
+ * @param predicate - Function that tests each item
420
+ * @param by - Optional tag to filter by before applying the predicate
421
+ * @returns Array of items that pass the test
422
+ *
423
+ * @example
424
+ * // Get all buildings taller than 100 meters
425
+ * const tallBuildings = collection.filter(
426
+ * entity => entity.properties?.height?.getValue() > 100,
427
+ * 'buildings'
428
+ * );
429
+ */
430
+ filter(predicate: (item: I) => boolean, by?: Collection.Tag): I[];
431
+ /**
432
+ * Executes a callback function for each item in the collection.
433
+ * Optionally filters items by tag before execution.
434
+ *
435
+ * @param callback - Function to execute for each item
436
+ * @param by - Optional tag to filter items (if not provided, processes all items)
437
+ *
438
+ * @example
439
+ * // Highlight all buildings
440
+ * collection.forEach((entity) => {
441
+ * if (entity.polygon) {
442
+ * entity.polygon.material = new ColorMaterialProperty(Color.YELLOW);
443
+ * }
444
+ * }, 'buildings');
445
+ */
446
+ forEach(callback: (value: I, index: number) => void, by?: Collection.Tag): void;
447
+ /**
448
+ * Creates a new array with the results of calling a provided function on every element
449
+ * in the collection. Optionally filters by tag before mapping.
450
+ *
451
+ * @param callbackfn - Function that produces an element of the new array
452
+ * @param by - Optional tag to filter items by before mapping
453
+ * @returns A new array with each element being the result of the callback function
454
+ *
455
+ * @example
456
+ * // Get all entity IDs
457
+ * const entityIds = collection.map(entity => entity.id);
458
+ *
459
+ * // Get positions of all buildings
460
+ * const buildingPositions = collection.map(
461
+ * entity => entity.position.getValue(Cesium.JulianDate.now()),
462
+ * 'buildings'
463
+ * );
464
+ */
465
+ map<R>(callbackfn: (value: I, index: number) => R, by?: Collection.Tag): R[];
466
+ /**
467
+ * Returns the first element in the collection that satisfies the provided testing function.
468
+ * Optionally filters by tag before searching.
469
+ *
470
+ * @param predicate - Function to test each element
471
+ * @param by - Optional tag to filter items by before searching
472
+ * @returns The first element that passes the test, or undefined if no elements pass
473
+ *
474
+ * @example
475
+ * // Find the first entity with a specific name
476
+ * const namedEntity = collection.find(entity => entity.name === 'Target');
477
+ *
478
+ * // Find the first building taller than 100 meters
479
+ * const tallBuilding = collection.find(
480
+ * entity => entity.properties?.height?.getValue() > 100,
481
+ * 'buildings'
482
+ * );
483
+ */
484
+ find(predicate: (value: I) => boolean, by?: Collection.Tag): I | undefined;
485
+ }
486
+ /**
487
+ * @namespace
488
+ */
489
+ declare namespace Collection {
490
+ /**
491
+ * The underlying Cesium collection type being wrapped.
492
+ */
493
+ export type Base = DataSourceCollection | EntityCollection | ImageryLayerCollection | PrimitiveCollection;
494
+ /**
495
+ * The item types that can be added to the `PrimitiveCollection` instance.
496
+ */
497
+ type Primitives = Billboard | Cesium3DTileset | GroundPrimitive | Label | PointPrimitive | Polyline | Primitive;
498
+ /**
499
+ * Cesium item type that can be added to the {@link Collection.Base} instance.
500
+ */
501
+ export type Item = DataSource | Entity | ImageryLayer | Primitives;
502
+ /**
503
+ * Collection tag type.
504
+ */
505
+ export type Tag = string | number;
506
+ export interface WithTag {
507
+ [key: symbol]: Tag;
508
+ }
509
+ /**
510
+ * Collection event types
511
+ */
512
+ export type Event = "add" | "remove" | "update" | "clear";
513
+ /**
514
+ * Event handler function type
515
+ */
516
+ export type EventHandler<I> = (event: {
517
+ type: Event;
518
+ items?: I[];
519
+ tag?: Collection.Tag;
520
+ }) => void;
521
+ export { };
522
+ }
523
+
524
+ export { Collection as C, type NonFunction as N, isGetterOnly as i };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var H=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var $=(n,e)=>{for(var t in e)H(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&&H(n,r,{get:()=>e[r],enumerable:!(i=W(e,r))||i.enumerable});return n};var J=n=>K(H({},"__esModule",{value:!0}),n);var Q={};$(Q,{Collection:()=>C,Highlight:()=>b,HybridTerrainProvider:()=>E,SilhouetteHighlight:()=>_,SurfaceHighlight:()=>y,TerrainArea:()=>v,TerrainAreaCollection:()=>p,TerrainVisualizer:()=>T,cloneViewer:()=>k,computeRectangle:()=>w,isGetterOnly:()=>P,syncCamera:()=>A});module.exports=J(Q);var m=require("cesium");var h=require("cesium");var T=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 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 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(l=>{this._collection.add(l.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),a=i.positionToTileXY(h.Rectangle.southeast(e),t);if(!r||!a)throw new Error("Failed to calculate tile bounds");return{start:r,end:a}}_generateVisibleTiles(e,t,i){let r=[],l=Math.min(e.end.x-e.start.x+1,100),s=Math.min(e.end.y-e.start.y+1,100);for(let d=e.start.x;d<e.start.x+l;d++)for(let g=e.start.y;g<e.start.y+s;g++)try{let f=this._createTileEntity(d,g,t,i);f&&r.push({entity:f})}catch(f){console.warn(`Error creating tile (${d}, ${g}, ${t}):`,f)}return r}_createTileEntity(e,t,i,r){let a=r.tileXYToRectangle(e,t,i);if(!this._isValidRectangle(a))return null;let l=this._getTileColor(e,t,i),s=n.createRectangle(a,l.withAlpha(.3));return s.properties?.addProperty("tileX",e),s.properties?.addProperty("tileY",t),s.properties?.addProperty("tileLevel",i),s}_getTileColor(e,t,i){if(!this._terrainProvider)return this._colors.get("fallback")||h.Color.TRANSPARENT;for(let r of this._terrainProvider.terrainAreas)if(r.contains(e,t,i))return r.isCustom?this._colors.get("custom")||h.Color.RED:this._colors.get("default")||h.Color.BLUE;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){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,a){return new h.Entity({rectangle:{coordinates:r,material:a,heightReference:h.HeightReference.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,a,l){let s=l?.tag||"terrain_area_visualization",d=l?.color||h.Color.RED,g=l?.maxTilesToShow||100,f=l?.show??!0,R=l?.alpha||.7,O=l?.tileAlpha||.2,I=new C({collection:a.entities,tag:s}),{rectangle:q}=r;if(I.add(i.createRectangle(q,d.withAlpha(R)),s),f&&r.tileRanges.size>0){let{tilingScheme:z}=r.terrainProvider,x=0;r.tileRanges.forEach((S,B)=>{for(let L=S.start.x;L<=S.end.x&&x<g;L++)for(let M=S.start.y;M<=S.end.y&&x<g;M++){let Y=z.tileXYToRectangle(L,M,B);I.add(e(Y,d.withAlpha(O)),`${s}_tile`),x++}})}return I}i.visualize=t})(T||={});function P(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 V=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(a=>a(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 m.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof m.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 m.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 m.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 m.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,m.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,m.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,m.defined)(i.show)&&(i.show=!i.show);return this}setProperty(e,t,i=this.tag){let r=this.get(i);for(let a of r)if(e in a&&typeof a[e]!="function"){if(P(a,e))throw Error(`Cannot set read-only property '${String(e)}' on ${a.constructor.name}`);a[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,a)=>e(r,a))}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=V;var u=require("cesium");var c=require("cesium"),_=class{_color=c.Color.RED;_silhouette;_composite;_stages;_entity;_currentObject;_currentOptions;constructor(e){this._stages=e.scene.postProcessStages,this._silhouette=c.PostProcessStageLibrary.createEdgeDetectionStage(),this._silhouette.uniforms.color=this._color,this._silhouette.uniforms.length=.01,this._silhouette.selected=[],this._composite=c.PostProcessStageLibrary.createSilhouetteStage([this._silhouette]),this._stages.add(this._composite)}show(e,t){if((0,c.defined)(e)&&!(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))){this._clearHighlights();try{if(e instanceof c.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 c.ConstantProperty(t?.width||2),e.model.silhouetteColor=new c.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&&c.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 c.ConstantProperty(c.Color.TRANSPARENT),this._entity.model.silhouetteSize=new c.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 o=require("cesium"),y=class{_color=o.Color.RED;_entity;_entities;_currentObject;_currentOptions;constructor(e){this._entities=e.entities,this._entity=this._entities.add(new o.Entity({id:`highlight-entity-${Math.random().toString(36).substring(2)}`,show:!1}))}show(e,t){if(!(!(0,o.defined)(e)||!this._entity)){if(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))return this._entity;this._clearGeometries();try{if(e instanceof o.Entity&&(e.polygon||e.polyline||e.rectangle))this._update(e,t);else if(e instanceof o.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&&o.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 o.Entity){if(e.polygon)if(t.outline){let i=e.polygon.hierarchy?.getValue();if(i&&i.positions){let r;i.positions.length>0&&!o.Cartesian3.equals(i.positions[0],i.positions[i.positions.length-1])?r=[...i.positions,i.positions[0]]:r=i.positions,this._entity.polyline=new o.PolylineGraphics({positions:r,material:t.color,width:t.width||2,clampToGround:!0})}}else{let i=e.polygon.hierarchy?.getValue();i&&(this._entity.polygon=new o.PolygonGraphics({hierarchy:i,material:t.color,heightReference:o.HeightReference.CLAMP_TO_GROUND,classificationType:e.polygon.classificationType?.getValue()||o.ClassificationType.BOTH}))}else if(e.polyline){let i=e.polyline.positions?.getValue();if(i){let r=e.polyline.width?.getValue();this._entity.polyline=new o.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=[o.Cartesian3.fromRadians(i.west,i.north),o.Cartesian3.fromRadians(i.east,i.north),o.Cartesian3.fromRadians(i.east,i.south),o.Cartesian3.fromRadians(i.west,i.south),o.Cartesian3.fromRadians(i.west,i.north)];this._entity.polyline=new o.PolylineGraphics({positions:r,material:t.color,width:t.width||2,clampToGround:!0})}}else{let i=e.rectangle.coordinates?.getValue();i&&(this._entity.rectangle=new o.RectangleGraphics({coordinates:i,material:t.color,heightReference:o.HeightReference.CLAMP_TO_GROUND}))}}else if(e instanceof o.GroundPrimitive){let i=e.geometryInstances,r=Array.isArray(i)?i[0]:i;if(!r.geometry.attributes.position)return;let a=r.geometry.attributes.position.values,l=[];for(let s=0;s<a.length;s+=3)l.push(new o.Cartesian3(a[s],a[s+1],a[s+2]));t.outline?this._entity.polyline=new o.PolylineGraphics({positions:l,material:t.color,width:t.width||2,clampToGround:!0}):this._entity.polygon=new o.PolygonGraphics({hierarchy:new o.PolygonHierarchy(l),material:t.color,heightReference:o.HeightReference.CLAMP_TO_GROUND,classificationType:o.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 b=class n{static instances=new WeakMap;_surface;_silhouette;_color=u.Color.RED;constructor(e){this._surface=new y(e),this._silhouette=new _(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,u.defined)(i))return i instanceof u.Cesium3DTileFeature?this._silhouette.show(i,t):i instanceof u.Entity&&i.model?this._silhouette.show(i,t):this._surface.show(i,t)}_getObject(e){if((0,u.defined)(e)){if(e instanceof u.Entity||e instanceof u.Cesium3DTileFeature||e instanceof u.GroundPrimitive)return e;if(e.id instanceof u.Entity)return e.id;if(e.primitive instanceof u.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}};var N=require("cesium");var F=require("cesium");var G=require("cesium");function w(n,e){if(e.size===0)return new G.Rectangle;let t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Array.from(e.keys()),s=Math.min(...l),d=e.get(s);if(d){let{start:g,end:f}=d,R=n.tileXYToRectangle(g.x,g.y,s),O=n.tileXYToRectangle(f.x,f.y,s);t=Math.min(R.west,t),i=Math.min(O.south,i),r=Math.max(O.east,r),a=Math.max(R.north,a)}return new G.Rectangle(t,i,r,a)}var v=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=w(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}};(e=>{async function n(t,i,r){let a=r?.credit||"custom",l=await F.CesiumTerrainProvider.fromUrl(t,{...r,credit:a});return new e({terrainProvider:l,tileRanges:i,credit:a})}e.fromUrl=n})(v||={});var p=class extends Array{add(e){if(Array.isArray(e)){for(let i of e)this.add(i);return this}let t;return e instanceof v?t=e:t=new v(e),this.push(t),this}remove(e){if(Array.isArray(e))return e.forEach(i=>this.remove(i)),this;let t=this.indexOf(e);return t>=0&&this.splice(t,1),this}removeAll(){this.length=0}};var E=class{_terrainAreas=new p;_terrainProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._terrainProvider=e.terrainProvider,this._fallbackProvider=e.fallbackProvider||new N.EllipsoidTerrainProvider,this._tilingScheme=e.terrainProvider.tilingScheme,this._terrainAreas=new p(...e.terrainAreas),this._availability=e.terrainProvider.availability,this._ready=!0}get ready(){return this._ready}get tilingScheme(){return this._tilingScheme}get availability(){return this._availability}get terrainAreas(){return[...this._terrainAreas]}get defaultProvider(){return this._terrainProvider}get fallbackProvider(){return this._fallbackProvider}get credit(){return this._terrainProvider?.credit}get errorEvent(){return this._terrainProvider.errorEvent}get hasWaterMask(){return this._terrainProvider.hasWaterMask}get hasVertexNormals(){return this._terrainProvider.hasVertexNormals}loadTileDataAvailability(e,t,i){return this._terrainProvider.loadTileDataAvailability(e,t,i)}getLevelMaximumGeometricError(e){return this._terrainProvider.getLevelMaximumGeometricError(e)}requestTileGeometry(e,t,i,r){if(this._ready){for(let a of this._terrainAreas)if(a.contains(e,t,i))return a.requestTileGeometry(e,t,i,r);return this._terrainProvider.getTileDataAvailable(e,t,i)?this._terrainProvider.requestTileGeometry(e,t,i,r):this._fallbackProvider.requestTileGeometry(e,t,i,r)}}getTileDataAvailable(e,t,i){for(let r of this._terrainAreas)if(r.contains(e,t,i))return r.getTileDataAvailable(e,t,i);return this._terrainProvider.getTileDataAvailable(e,t,i)}};var j=require("cesium");var D=require("cesium");function A(n,e){if((0,D.defined)(n)&&(0,D.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 k(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 j.Viewer(e,{...i,...t});A(n,r);let a=n.imageryLayers;r.imageryLayers.removeAll();for(let d=0;d<a.length;d++){let g=a.get(d);r.imageryLayers.addImageryProvider(g.imageryProvider,d)}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 l=n.scene.screenSpaceCameraController.tiltEventTypes;l&&(r.scene.screenSpaceCameraController.tiltEventTypes=Array.isArray(l)?[...l]:l);let s=n.scene.screenSpaceCameraController.zoomEventTypes;return s&&(r.scene.screenSpaceCameraController.zoomEventTypes=Array.isArray(s)?[...s]:s),r}
1
+ "use strict";var V=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var $=(n,e)=>{for(var t in e)V(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&&V(n,r,{get:()=>e[r],enumerable:!(i=W(e,r))||i.enumerable});return n};var J=n=>K(V({},"__esModule",{value:!0}),n);var Q={};$(Q,{Collection:()=>T,Highlight:()=>k,HybridTerrainProvider:()=>w,SilhouetteHighlight:()=>f,SurfaceHighlight:()=>p,TerrainArea:()=>P,TerrainVisualizer:()=>_,cloneViewer:()=>N,isGetterOnly:()=>C,syncCamera:()=>R});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 T({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 d=e.start.x;d<e.start.x+s;d++)for(let m=e.start.y;m<e.start.y+l;m++)try{let v=this._createTileEntity(d,m,t,i);v&&r.push({entity:v})}catch(v){console.warn(`Error creating tile (${d}, ${m}, ${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.terrainAreas)if(r.contains(e,t,i))return r.isCustom?this._colors.get("custom")||c.Color.RED:this._colors.get("default")||c.Color.BLUE;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",d=s?.color||c.Color.RED,m=s?.maxTilesToShow||100,v=s?.show??!0,O=s?.alpha||.7,x=s?.tileAlpha||.2,y=new T({collection:o.entities,tag:l}),{rectangle:S}=r;if(y.add(i.createRectangle(S,d.withAlpha(O)),l),v&&r.tileRanges.size>0){let{tilingScheme:q}=r.terrainProvider,I=0;r.tileRanges.forEach((L,z)=>{for(let M=L.start.x;M<=L.end.x&&I<m;M++)for(let H=L.start.y;H<=L.end.y&&I<m;H++){let Y=q.tileXYToRectangle(M,H,z);y.add(e(Y,d.withAlpha(x)),`${l}_tile`),I++}})}return y}i.visualize=t})(_||={});function C(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 G=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(C(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)}},T=G;var u=require("cesium");var h=require("cesium"),f=class{_color=h.Color.RED;_silhouette;_composite;_stages;_entity;_currentObject;_currentOptions;constructor(e){this._stages=e.scene.postProcessStages,this._silhouette=h.PostProcessStageLibrary.createEdgeDetectionStage(),this._silhouette.uniforms.color=this._color,this._silhouette.uniforms.length=.01,this._silhouette.selected=[],this._composite=h.PostProcessStageLibrary.createSilhouetteStage([this._silhouette]),this._stages.add(this._composite)}show(e,t){if((0,h.defined)(e)&&!(this._currentObject===e&&this._optionsEqual(this._currentOptions,t))){this._clearHighlights();try{if(e instanceof h.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 h.ConstantProperty(t?.width||2),e.model.silhouetteColor=new h.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&&h.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 h.ConstantProperty(h.Color.TRANSPARENT),this._entity.model.silhouetteSize=new h.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 D=class n{static instances=new WeakMap;_surface;_silhouette;_color=u.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,u.defined)(i))return i instanceof u.Cesium3DTileFeature?this._silhouette.show(i,t):i instanceof u.Entity&&i.model?this._silhouette.show(i,t):this._surface.show(i,t)}_getObject(e){if((0,u.defined)(e)){if(e instanceof u.Entity||e instanceof u.Cesium3DTileFeature||e instanceof u.GroundPrimitive)return e;if(e.id instanceof u.Entity)return e.id;if(e.primitive instanceof u.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}},k=D;var E=require("cesium");var B=require("cesium");var b=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=w.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})(b||={});var P=b;var A=class{_terrainAreas;_terrainProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._terrainProvider=e.terrainProvider,this._fallbackProvider=e.fallbackProvider||new E.EllipsoidTerrainProvider,this._tilingScheme=e.terrainProvider.tilingScheme,this._terrainAreas=new P.Collection(...e.terrainAreas),this._availability=e.terrainProvider.availability,this._ready=!0}get ready(){return this._ready}get tilingScheme(){return this._tilingScheme}get availability(){return this._availability}get terrainAreas(){return[...this._terrainAreas]}get defaultProvider(){return this._terrainProvider}get fallbackProvider(){return this._fallbackProvider}get credit(){return this._terrainProvider?.credit}get errorEvent(){return this._terrainProvider.errorEvent}get hasWaterMask(){return this._terrainProvider.hasWaterMask}get hasVertexNormals(){return this._terrainProvider.hasVertexNormals}loadTileDataAvailability(e,t,i){return this._terrainProvider.loadTileDataAvailability(e,t,i)}getLevelMaximumGeometricError(e){return this._terrainProvider.getLevelMaximumGeometricError(e)}requestTileGeometry(e,t,i,r){if(this._ready){for(let o of this._terrainAreas)if(o.contains(e,t,i))return o.requestTileGeometry(e,t,i,r);return this._terrainProvider.getTileDataAvailable(e,t,i)?this._terrainProvider.requestTileGeometry(e,t,i,r):this._fallbackProvider.requestTileGeometry(e,t,i,r)}}getTileDataAvailable(e,t,i){for(let r of this._terrainAreas)if(r.contains(e,t,i))return r.getTileDataAvailable(e,t,i);return this._terrainProvider.getTileDataAvailable(e,t,i)}};(e=>{function n(t,i){if(i.size===0)return new E.Rectangle;let r=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,d=Array.from(i.keys()),m=Math.min(...d),v=i.get(m);if(v){let{start:O,end:x}=v,y=t.tileXYToRectangle(O.x,O.y,m),S=t.tileXYToRectangle(x.x,x.y,m);r=Math.min(y.west,r),o=Math.min(S.south,o),s=Math.max(S.east,s),l=Math.max(y.north,l)}return new E.Rectangle(r,o,s,l)}e.computeRectangle=n})(A||={});var w=A;var j=require("cesium");var F=require("cesium");function R(n,e){if((0,F.defined)(n)&&(0,F.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 N(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 j.Viewer(e,{...i,...t});R(n,r);let o=n.imageryLayers;r.imageryLayers.removeAll();for(let d=0;d<o.length;d++){let m=o.get(d);r.imageryLayers.addImageryProvider(m.imageryProvider,d)}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,7 +1,6 @@
1
- export { CesiumCollection, CesiumCollectionItem, Collection, CollectionEventType, EventHandler, NonFunction, Tag, WithTag } from './collection/index.cjs';
2
- export { Highlight, HighlightOptions, IHighlight, Picked, PickedObject, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.cjs';
3
- export { H as HybridTerrainProvider, T as TerrainArea, a as TileRange } from './hybrid-terrain-provider-C4b9z5pv.cjs';
4
- export { TerrainAreaCollection, computeRectangle } from './terrain/index.cjs';
5
- export { TerrainVisualizer, isGetterOnly } from './utils/index.cjs';
1
+ export { C as Collection, N as NonFunction, i as isGetterOnly } from './index-Bd_-DTWl.cjs';
2
+ export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.cjs';
3
+ export { HybridTerrainProvider, TerrainArea } from './terrain/index.cjs';
4
+ export { TerrainVisualizer } from './utils/index.cjs';
6
5
  export { cloneViewer, syncCamera } from './viewer/index.cjs';
7
6
  import 'cesium';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- export { CesiumCollection, CesiumCollectionItem, Collection, CollectionEventType, EventHandler, NonFunction, Tag, WithTag } from './collection/index.js';
2
- export { Highlight, HighlightOptions, IHighlight, Picked, PickedObject, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.js';
3
- export { H as HybridTerrainProvider, T as TerrainArea, a as TileRange } from './hybrid-terrain-provider-C4b9z5pv.js';
4
- export { TerrainAreaCollection, computeRectangle } from './terrain/index.js';
5
- export { TerrainVisualizer, isGetterOnly } from './utils/index.js';
1
+ export { C as Collection, N as NonFunction, i as isGetterOnly } from './index-Bd_-DTWl.js';
2
+ export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.js';
3
+ export { HybridTerrainProvider, TerrainArea } from './terrain/index.js';
4
+ export { TerrainVisualizer } from './utils/index.js';
6
5
  export { cloneViewer, syncCamera } from './viewer/index.js';
7
6
  import 'cesium';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-RXMNSDKR.js";import{a as i,b as o,c as l}from"./chunk-VMZ2PVXH.js";import{a as p,b as m,c as n,d as a}from"./chunk-4EI5BBVR.js";import{a as r,b as e,c as t}from"./chunk-ZV7FKRP6.js";import{a as h,b as c}from"./chunk-2JNRK7SN.js";export{t as Collection,l as Highlight,a as HybridTerrainProvider,i as SilhouetteHighlight,o as SurfaceHighlight,m as TerrainArea,n as TerrainAreaCollection,r as TerrainVisualizer,c as cloneViewer,p as computeRectangle,e as isGetterOnly,h as syncCamera};
1
+ import"./chunk-RXMNSDKR.js";import{a as o,b as t,c as m}from"./chunk-RZ3PTU3G.js";import{a as l,b as p}from"./chunk-BXU5HNPI.js";import{a as r,b as i,c as e}from"./chunk-4HY6RL6I.js";import{a,b as h}from"./chunk-2JNRK7SN.js";export{e as Collection,m as Highlight,p as HybridTerrainProvider,o as SilhouetteHighlight,t as SurfaceHighlight,l as TerrainArea,r as TerrainVisualizer,h as cloneViewer,i as isGetterOnly,a as syncCamera};