@juun-roh/cesium-utils 0.3.0 → 0.3.2
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 +7 -4
- package/dist/chunk-6I4THOWX.js +1 -0
- package/dist/chunk-EGWUHR3C.js +1 -0
- package/dist/chunk-PSCNWZUR.js +1 -0
- 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 -1
- package/dist/dev/index.d.cts +3 -3
- package/dist/dev/index.d.ts +3 -3
- package/dist/dev/index.js +1 -1
- package/dist/experimental/index.cjs +1 -1
- package/dist/experimental/index.d.cts +8 -5
- package/dist/experimental/index.d.ts +8 -5
- package/dist/experimental/index.js +1 -1
- package/dist/highlight/index.cjs +1 -1
- package/dist/highlight/index.d.cts +32 -32
- package/dist/highlight/index.d.ts +32 -32
- package/dist/highlight/index.js +1 -1
- package/dist/{hybrid-terrain-provider-C2V-igd9.d.cts → hybrid-terrain-provider-CzdhZJyg.d.cts} +1 -21
- package/dist/{hybrid-terrain-provider-C2V-igd9.d.ts → hybrid-terrain-provider-CzdhZJyg.d.ts} +1 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/terrain/index.cjs +1 -1
- package/dist/terrain/index.d.cts +1 -1
- package/dist/terrain/index.d.ts +1 -1
- package/dist/terrain/index.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-OUTUX3ZP.js +0 -1
- package/dist/chunk-RZ3PTU3G.js +0 -1
- package/dist/chunk-TC3IX3JL.js +0 -1
- package/dist/chunk-WVFPGF7U.js +0 -1
- package/dist/{index-Bfd24d9-.d.cts → index-iIlou-Sq.d.cts} +59 -59
- package/dist/{index-Bfd24d9-.d.ts → index-iIlou-Sq.d.ts} +59 -59
package/dist/{hybrid-terrain-provider-C2V-igd9.d.cts → hybrid-terrain-provider-CzdhZJyg.d.cts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData
|
|
1
|
+
import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData } from 'cesium';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @class
|
|
@@ -150,8 +150,6 @@ declare namespace HybridTerrainProvider {
|
|
|
150
150
|
interface TerrainRegion {
|
|
151
151
|
/** The terrain provider for this region. */
|
|
152
152
|
provider: TerrainProvider;
|
|
153
|
-
/** Rectangle-based geographic bounds (simpler). */
|
|
154
|
-
bounds?: Rectangle;
|
|
155
153
|
/**
|
|
156
154
|
* Tile-coordinate based bounds (precise control).
|
|
157
155
|
* Map of level to tile coordinate ranges for that level.
|
|
@@ -165,17 +163,6 @@ declare namespace HybridTerrainProvider {
|
|
|
165
163
|
/** Optional level constraints. If specified, region only applies to these levels. */
|
|
166
164
|
levels?: number[];
|
|
167
165
|
}
|
|
168
|
-
/**
|
|
169
|
-
* Creates a HybridTerrainProvider from rectangle-based regions.
|
|
170
|
-
* @param regions Array of regions with rectangle bounds
|
|
171
|
-
* @param defaultProvider Default terrain provider
|
|
172
|
-
* @param fallbackProvider Optional fallback provider
|
|
173
|
-
*/
|
|
174
|
-
function fromRectangles(regions: Array<{
|
|
175
|
-
provider: TerrainProvider;
|
|
176
|
-
bounds: Rectangle;
|
|
177
|
-
levels?: number[];
|
|
178
|
-
}>, defaultProvider: TerrainProvider, fallbackProvider?: TerrainProvider): HybridTerrainProvider;
|
|
179
166
|
/**
|
|
180
167
|
* Creates a HybridTerrainProvider from tile-coordinate based regions.
|
|
181
168
|
* @param regions Array of regions with tile-coordinate bounds
|
|
@@ -190,13 +177,6 @@ declare namespace HybridTerrainProvider {
|
|
|
190
177
|
}>;
|
|
191
178
|
levels?: number[];
|
|
192
179
|
}>, defaultProvider: TerrainProvider, fallbackProvider?: TerrainProvider): HybridTerrainProvider;
|
|
193
|
-
/**
|
|
194
|
-
* @deprecated Use Rectangle.fromDegrees() instead. This method is maintained for backward compatibility.
|
|
195
|
-
* Calculates a bounding rectangle that encompasses all the specified tile ranges.
|
|
196
|
-
* @param tilingScheme The tiling scheme to use for calculation.
|
|
197
|
-
* @param from Tile ranges to calculate from.
|
|
198
|
-
*/
|
|
199
|
-
function computeRectangle(tilingScheme: TilingScheme, from: Map<number, any>): Rectangle;
|
|
200
180
|
}
|
|
201
181
|
|
|
202
182
|
export { HybridTerrainProvider as H };
|
package/dist/{hybrid-terrain-provider-C2V-igd9.d.ts → hybrid-terrain-provider-CzdhZJyg.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData
|
|
1
|
+
import { TerrainProvider, TilingScheme, TileAvailability, Credit, Request, TerrainData } from 'cesium';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @class
|
|
@@ -150,8 +150,6 @@ declare namespace HybridTerrainProvider {
|
|
|
150
150
|
interface TerrainRegion {
|
|
151
151
|
/** The terrain provider for this region. */
|
|
152
152
|
provider: TerrainProvider;
|
|
153
|
-
/** Rectangle-based geographic bounds (simpler). */
|
|
154
|
-
bounds?: Rectangle;
|
|
155
153
|
/**
|
|
156
154
|
* Tile-coordinate based bounds (precise control).
|
|
157
155
|
* Map of level to tile coordinate ranges for that level.
|
|
@@ -165,17 +163,6 @@ declare namespace HybridTerrainProvider {
|
|
|
165
163
|
/** Optional level constraints. If specified, region only applies to these levels. */
|
|
166
164
|
levels?: number[];
|
|
167
165
|
}
|
|
168
|
-
/**
|
|
169
|
-
* Creates a HybridTerrainProvider from rectangle-based regions.
|
|
170
|
-
* @param regions Array of regions with rectangle bounds
|
|
171
|
-
* @param defaultProvider Default terrain provider
|
|
172
|
-
* @param fallbackProvider Optional fallback provider
|
|
173
|
-
*/
|
|
174
|
-
function fromRectangles(regions: Array<{
|
|
175
|
-
provider: TerrainProvider;
|
|
176
|
-
bounds: Rectangle;
|
|
177
|
-
levels?: number[];
|
|
178
|
-
}>, defaultProvider: TerrainProvider, fallbackProvider?: TerrainProvider): HybridTerrainProvider;
|
|
179
166
|
/**
|
|
180
167
|
* Creates a HybridTerrainProvider from tile-coordinate based regions.
|
|
181
168
|
* @param regions Array of regions with tile-coordinate bounds
|
|
@@ -190,13 +177,6 @@ declare namespace HybridTerrainProvider {
|
|
|
190
177
|
}>;
|
|
191
178
|
levels?: number[];
|
|
192
179
|
}>, defaultProvider: TerrainProvider, fallbackProvider?: TerrainProvider): HybridTerrainProvider;
|
|
193
|
-
/**
|
|
194
|
-
* @deprecated Use Rectangle.fromDegrees() instead. This method is maintained for backward compatibility.
|
|
195
|
-
* Calculates a bounding rectangle that encompasses all the specified tile ranges.
|
|
196
|
-
* @param tilingScheme The tiling scheme to use for calculation.
|
|
197
|
-
* @param from Tile ranges to calculate from.
|
|
198
|
-
*/
|
|
199
|
-
function computeRectangle(tilingScheme: TilingScheme, from: Map<number, any>): Rectangle;
|
|
200
180
|
}
|
|
201
181
|
|
|
202
182
|
export { HybridTerrainProvider as H };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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:()=>C,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 T=`${p} ${c}`;y&&(T+=` This feature will be removed in ${y}.`),typeof console<"u"&&console.warn&&(_?(console.warn(T),console.trace("Deprecation stack trace:")):console.warn(T)),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 x=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 T=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=T.tileXYToRectangle(I,A,W);y.add(e(Y,c.withAlpha(_)),`${l}_tile`),P++}})}return y}i.visualize=t})(x||={});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"),C=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 C(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 O=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)&&r.provider.getTileDataAvailable(e,t,i))return!0;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:T}=_,P=r.tileXYToRectangle(y.x,y.y,p),f=r.tileXYToRectangle(T.x,T.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})(O||={});var G=O;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}
|
|
1
|
+
"use strict";var L=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var K=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},X=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Y(e))!U.call(n,r)&&r!==t&&L(n,r,{get:()=>e[r],enumerable:!(i=$(e,r))||i.enumerable});return n};var J=n=>X(L({},"__esModule",{value:!0}),n);var Q={};K(Q,{Collection:()=>_,Highlight:()=>M,HybridTerrainProvider:()=>D,SilhouetteHighlight:()=>p,SurfaceHighlight:()=>y,cloneViewer:()=>G,syncCamera:()=>O});module.exports=J(Q);var v=require("cesium");var B;(l=>{let n=new Set,e=typeof process<"u"?process.env.CESIUM_UTILS_DISABLE_DEPRECATION_WARNINGS!=="true":!0;function t(c,u={}){if(!e)return;let{once:g=!0,prefix:C="[DEPRECATED]",includeStack:T=!0,removeInVersion:b}=u;if(g&&n.has(c))return;let P=`${C} ${c}`;b&&(P+=` This feature will be removed in ${b}.`),typeof console<"u"&&console.warn&&(T?(console.warn(P),console.trace("Deprecation stack trace:")):console.warn(P)),g&&n.add(c)}l.warn=t;function i(c,u,g={}){let C=((...T)=>(t(u,g),c(...T)));return Object.defineProperty(C,"name",{value:c.name,configurable:!0}),C}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})(B||={});var j=B;var h=require("cesium");var w=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 _({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 u=e.start.y;u<e.start.y+l;u++)try{let g=this._createTileEntity(c,u,t,i);g&&r.push({entity:g})}catch(g){console.warn(`Error creating tile (${c}, ${u}, ${t}):`,g)}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,u=s?.maxTilesToShow||100,g=s?.show??!0,C=s?.alpha||.7,T=s?.tileAlpha||.2,b=new _({collection:o.entities,tag:l});if(g&&r.tiles&&r.tiles.size>0){let P=r.provider.tilingScheme,x=0;r.tiles.forEach((f,z)=>{let k=Array.isArray(f.x)?f.x:[f.x,f.x],F=Array.isArray(f.y)?f.y:[f.y,f.y];for(let S=k[0];S<=k[1]&&x<u;S++)for(let R=F[0];R<=F[1]&&x<u;R++){let q=P.tileXYToRectangle(S,R,z);b.add(e(q,c.withAlpha(T)),`${l}_tile`),x++}})}return b}i.visualize=t})(w||={});function A(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=j.deprecate;var I=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]()}get values(){if(this._valuesCache!==null)return this._valuesCache;let e;if(this.collection instanceof v.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 tags(){return Array.from(this._tagMap.keys())}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(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}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,v.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,v.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,v.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(A(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)}_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 v.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof v.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 v.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 v.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)))}},_=I;var m=require("cesium");var d=require("cesium"),p=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)}get color(){return this._color}set color(e){this._color=e}get currentObject(){return this._currentObject}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}}}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}_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)}};var a=require("cesium"),y=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}))}get color(){return this._color}set color(e){this._color=e}get entity(){return this._entity}get currentObject(){return this._currentObject}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}}}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}_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})}}};var H=class n{static instances=new WeakMap;_surface;_silhouette;_color=m.Color.RED;constructor(e){this._surface=new y(e),this._silhouette=new p(e),this._surface.color=this._color,this._silhouette.color=this._color}get color(){return this._color}set color(e){this._color=e,this._surface.color=e,this._silhouette.color=e}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()}},M=H;var N=require("cesium"),E=class{_regions;_defaultProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._defaultProvider=e.defaultProvider,this._fallbackProvider=e.fallbackProvider||new N.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)&&r.provider.getTileDataAvailable(e,t,i))return!0;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,u]=Array.isArray(o.y)?o.y:[o.y,o.y];return t>=s&&t<=l&&i>=c&&i<=u}return!1}};(e=>{function n(t,i,r){return new e({regions:t.map(o=>({...o})),defaultProvider:i,fallbackProvider:r})}e.fromTileRanges=n})(E||={});var D=E;var W=require("cesium");var V=require("cesium");function O(n,e){if((0,V.defined)(n)&&(0,V.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 G(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 W.Viewer(e,{...i,...t});O(n,r);let o=n.imageryLayers;r.imageryLayers.removeAll();for(let c=0;c<o.length;c++){let u=o.get(c);r.imageryLayers.addImageryProvider(u.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,5 +1,5 @@
|
|
|
1
|
-
export { C as Collection } from './index-
|
|
1
|
+
export { C as Collection } from './index-iIlou-Sq.cjs';
|
|
2
2
|
export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.cjs';
|
|
3
|
-
export { H as HybridTerrainProvider } from './hybrid-terrain-provider-
|
|
3
|
+
export { H as HybridTerrainProvider } from './hybrid-terrain-provider-CzdhZJyg.cjs';
|
|
4
4
|
export { cloneViewer, syncCamera } from './viewer/index.cjs';
|
|
5
5
|
import 'cesium';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as Collection } from './index-
|
|
1
|
+
export { C as Collection } from './index-iIlou-Sq.js';
|
|
2
2
|
export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.js';
|
|
3
|
-
export { H as HybridTerrainProvider } from './hybrid-terrain-provider-
|
|
3
|
+
export { H as HybridTerrainProvider } from './hybrid-terrain-provider-CzdhZJyg.js';
|
|
4
4
|
export { cloneViewer, syncCamera } from './viewer/index.js';
|
|
5
5
|
import 'cesium';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-RXMNSDKR.js";import{
|
|
1
|
+
import"./chunk-RXMNSDKR.js";import{e as r}from"./chunk-EGWUHR3C.js";import{a as i,b as o,c as e}from"./chunk-PSCNWZUR.js";import{a as t}from"./chunk-6I4THOWX.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 l=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var g=(n,r)=>{for(var e in r)l(n,e,{get:r[e],enumerable:!0})},h=(n,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of T(r))!P.call(n,a)&&a!==e&&l(n,a,{get:()=>r[a],enumerable:!(i=f(r,a))||i.enumerable});return n};var y=n=>h(l({},"__esModule",{value:!0}),n);var c={};g(c,{HybridTerrainProvider:()=>u});module.exports=y(c);var d=require("cesium"),o=class{_regions;_defaultProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(r){this._defaultProvider=r.defaultProvider,this._fallbackProvider=r.fallbackProvider||new d.EllipsoidTerrainProvider,this._tilingScheme=r.defaultProvider.tilingScheme,this._regions=r.regions||[],this._availability=r.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(r,e,i){return this._defaultProvider.loadTileDataAvailability(r,e,i)}getLevelMaximumGeometricError(r){return this._defaultProvider.getLevelMaximumGeometricError(r)}requestTileGeometry(r,e,i,a){if(this._ready){for(let t of this._regions)if(this._regionContains(t,r,e,i))return t.provider.requestTileGeometry(r,e,i,a);return this._defaultProvider.getTileDataAvailable(r,e,i)?this._defaultProvider.requestTileGeometry(r,e,i,a):this._fallbackProvider.requestTileGeometry(r,e,i,a)}}getTileDataAvailable(r,e,i){for(let a of this._regions)if(this._regionContains(a,r,e,i)&&a.provider.getTileDataAvailable(r,e,i))return!0;return this._defaultProvider.getTileDataAvailable(r,e,i)}_regionContains(r,e,i,a){if(r.levels&&!r.levels.includes(a))return!1;if(r.tiles){let t=r.tiles.get(a);if(!t)return!1;let[s,v]=Array.isArray(t.x)?t.x:[t.x,t.x],[b,m]=Array.isArray(t.y)?t.y:[t.y,t.y];return e>=s&&e<=v&&i>=b&&i<=m}return!1}};(r=>{function n(e,i,a){return new r({regions:e.map(t=>({...t})),defaultProvider:i,fallbackProvider:a})}r.fromTileRanges=n})(o||={});var u=o;
|
package/dist/terrain/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-
|
|
1
|
+
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-CzdhZJyg.cjs';
|
|
2
2
|
import 'cesium';
|
|
3
3
|
|
|
4
4
|
type TerrainTiles = NonNullable<HybridTerrainProvider.TerrainRegion["tiles"]>;
|
package/dist/terrain/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-
|
|
1
|
+
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-CzdhZJyg.js';
|
|
2
2
|
import 'cesium';
|
|
3
3
|
|
|
4
4
|
type TerrainTiles = NonNullable<HybridTerrainProvider.TerrainRegion["tiles"]>;
|
package/dist/terrain/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-6I4THOWX.js";export{a as HybridTerrainProvider};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juun-roh/cesium-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Solve common Cesium.js challenges: combine multiple terrain sources, tag and filter entity collections, and add visual highlights.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cesium",
|
|
@@ -98,13 +98,13 @@
|
|
|
98
98
|
"@commitlint/cz-commitlint": "^19.8.1",
|
|
99
99
|
"@commitlint/format": "^19.8.1",
|
|
100
100
|
"@commitlint/types": "^19.8.1",
|
|
101
|
-
"@eslint/js": "^9.
|
|
101
|
+
"@eslint/js": "^9.34.0",
|
|
102
102
|
"@types/node": "^24.3.0",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
104
|
-
"@typescript-eslint/parser": "^8.
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^8.41.0",
|
|
104
|
+
"@typescript-eslint/parser": "^8.41.0",
|
|
105
105
|
"@vitest/coverage-v8": "^3.2.4",
|
|
106
106
|
"cesium": "^1.132.0",
|
|
107
|
-
"eslint": "^9.
|
|
107
|
+
"eslint": "^9.34.0",
|
|
108
108
|
"eslint-plugin-jsdoc": "^54.1.1",
|
|
109
109
|
"eslint-plugin-prettier": "^5.5.4",
|
|
110
110
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"jsdom": "^26.1.0",
|
|
114
114
|
"rimraf": "^6.0.1",
|
|
115
115
|
"tsup": "^8.5.0",
|
|
116
|
-
"typedoc": "^0.28.
|
|
116
|
+
"typedoc": "^0.28.11",
|
|
117
117
|
"typescript": "^5.9.2",
|
|
118
118
|
"vite": "^7.1.3",
|
|
119
119
|
"vitest": "^3.2.4"
|
package/dist/chunk-OUTUX3ZP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as L}from"./chunk-TC3IX3JL.js";import{Color as l,Entity as D,HeightReference as V,Rectangle as I,TileCoordinatesImageryProvider as j}from"cesium";import{DataSourceCollection as M,defined as f,EntityCollection as w,ImageryLayerCollection as O,PrimitiveCollection as F}from"cesium";var C=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 w?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof F?(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?(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 O&&(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 w)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)f(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)f(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)f(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(_(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=C;var u=class n{_viewer;_collection;_terrainProvider;_visible=!1;_level=15;_tileCoordinatesLayer;_colors=new Map([["custom",l.RED],["default",l.BLUE],["fallback",l.GRAY],["grid",l.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 j({tilingScheme:this._terrainProvider.tilingScheme,color:l.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(a=>{this._collection.add(a.entity,n.tag.grid)})}catch(r){console.error("Error displaying tile grid:",r)}}_calculateTileBounds(e,t,i){let r=i.positionToTileXY(I.northwest(e),t),o=i.positionToTileXY(I.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=[],a=Math.min(e.end.x-e.start.x+1,100),s=Math.min(e.end.y-e.start.y+1,100);for(let h=e.start.x;h<e.start.x+a;h++)for(let d=e.start.y;d<e.start.y+s;d++)try{let v=this._createTileEntity(h,d,t,i);v&&r.push({entity:v})}catch(v){console.warn(`Error creating tile (${h}, ${d}, ${t}):`,v)}return r}_createTileEntity(e,t,i,r){let o=r.tileXYToRectangle(e,t,i);if(!this._isValidRectangle(o))return null;let a=this._getTileColor(e,t,i),s=n.createRectangle(o,a.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")||l.TRANSPARENT;for(let r of this._terrainProvider.regions)if(this._terrainProvider._regionContains(r,e,t,i))return this._colors.get("custom")||l.RED;return this._terrainProvider.getTileDataAvailable(e,t,i)?this._colors.get("default")||l.BLUE:this._colors.get("fallback")||l.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 D({rectangle:{coordinates:r,material:o,heightReference:V.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,o,a){let s=a?.tag||"terrain_region_visualization",h=a?.color||l.RED,d=a?.maxTilesToShow||100,v=a?.show??!0,P=a?.alpha||.7,x=a?.tileAlpha||.2,m=new T({collection:o.entities,tag:s});if(r.bounds&&m.add(i.createRectangle(r.bounds,h.withAlpha(P)),s),v&&r.tiles&&r.tiles.size>0){let R=r.provider.tilingScheme,g=0;r.tiles.forEach((c,S)=>{let b=Array.isArray(c.x)?c.x:[c.x,c.x],E=Array.isArray(c.y)?c.y:[c.y,c.y];for(let p=b[0];p<=b[1]&&g<d;p++)for(let y=E[0];y<=E[1]&&g<d;y++){let A=R.tileXYToRectangle(p,y,S);m.add(e(A,h.withAlpha(x)),`${s}_tile`),g++}})}return m}i.visualize=t})(u||={});function _(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 Q=L.deprecate;export{u as a,_ as b,Q as c,T as d};
|
package/dist/chunk-RZ3PTU3G.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Cesium3DTileFeature as P,Color as R,defined as H,Entity as p,GroundPrimitive as E}from"cesium";import{Cesium3DTileFeature as T,Color as f,ConstantProperty as u,defined as G,PostProcessStageLibrary as m}from"cesium";var s=class{_color=f.RED;_silhouette;_composite;_stages;_entity;_currentObject;_currentOptions;constructor(t){this._stages=t.scene.postProcessStages,this._silhouette=m.createEdgeDetectionStage(),this._silhouette.uniforms.color=this._color,this._silhouette.uniforms.length=.01,this._silhouette.selected=[],this._composite=m.createSilhouetteStage([this._silhouette]),this._stages.add(this._composite)}show(t,i){if(G(t)&&!(this._currentObject===t&&this._optionsEqual(this._currentOptions,i))){this._clearHighlights();try{if(t instanceof T)this._silhouette.uniforms.color=i?.color||this._color,this._silhouette.selected.push(t);else{if(!t.model)return;this._entity=t,t.model.silhouetteSize=new u(i?.width||2),t.model.silhouetteColor=new u(i?.color||this._color)}this._currentObject=t,this._currentOptions=i?{...i}:void 0}catch(e){console.error("Failed to highlight object:",e),this._currentObject=void 0,this._currentOptions=void 0}}}_optionsEqual(t,i){return!t&&!i?!0:!t||!i?!1:t.outline===i.outline&&t.width===i.width&&f.equals(t.color||this._color,i.color||this._color)}_clearHighlights(){this._silhouette.selected.length>0&&(this._silhouette.selected=[]),this._entity?.model&&(this._entity.model.silhouetteColor=new u(f.TRANSPARENT),this._entity.model.silhouetteSize=new u(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(t){this._color=t}get currentObject(){return this._currentObject}};import{Cartesian3 as o,ClassificationType as v,Color as O,defined as S,Entity as g,GroundPrimitive as w,HeightReference as _,PolygonGraphics as C,PolygonHierarchy as b,PolylineGraphics as a,RectangleGraphics as D}from"cesium";var l=class{_color=O.RED;_entity;_entities;_currentObject;_currentOptions;constructor(t){this._entities=t.entities,this._entity=this._entities.add(new g({id:`highlight-entity-${Math.random().toString(36).substring(2)}`,show:!1}))}show(t,i){if(!(!S(t)||!this._entity)){if(this._currentObject===t&&this._optionsEqual(this._currentOptions,i))return this._entity;this._clearGeometries();try{if(t instanceof g&&(t.polygon||t.polyline||t.rectangle))this._update(t,i);else if(t instanceof w)this._update(t,i);else{this._currentObject=void 0,this._currentOptions=void 0;return}return this._currentObject=t,this._currentOptions=i?{...i}:void 0,this._entity.show=!0,this._entity}catch(e){console.error("Failed to highlight object:",e),this._currentObject=void 0,this._currentOptions=void 0;return}}}_optionsEqual(t,i){return!t&&!i?!0:!t||!i?!1:t.outline===i.outline&&t.width===i.width&&O.equals(t.color||this._color,i.color||this._color)}_clearGeometries(){this._entity.polygon=void 0,this._entity.polyline=void 0,this._entity.rectangle=void 0}_update(t,i={color:this._color,outline:!1,width:2}){if(t instanceof g){if(t.polygon)if(i.outline){let e=t.polygon.hierarchy?.getValue();if(e&&e.positions){let r;e.positions.length>0&&!o.equals(e.positions[0],e.positions[e.positions.length-1])?r=[...e.positions,e.positions[0]]:r=e.positions,this._entity.polyline=new a({positions:r,material:i.color,width:i.width||2,clampToGround:!0})}}else{let e=t.polygon.hierarchy?.getValue();e&&(this._entity.polygon=new C({hierarchy:e,material:i.color,heightReference:_.CLAMP_TO_GROUND,classificationType:t.polygon.classificationType?.getValue()||v.BOTH}))}else if(t.polyline){let e=t.polyline.positions?.getValue();if(e){let r=t.polyline.width?.getValue();this._entity.polyline=new a({positions:e,material:i.color,width:r+(i.width||2),clampToGround:!0})}}else if(t.rectangle)if(i.outline){let e=t.rectangle.coordinates?.getValue();if(e){let r=[o.fromRadians(e.west,e.north),o.fromRadians(e.east,e.north),o.fromRadians(e.east,e.south),o.fromRadians(e.west,e.south),o.fromRadians(e.west,e.north)];this._entity.polyline=new a({positions:r,material:i.color,width:i.width||2,clampToGround:!0})}}else{let e=t.rectangle.coordinates?.getValue();e&&(this._entity.rectangle=new D({coordinates:e,material:i.color,heightReference:_.CLAMP_TO_GROUND}))}}else if(t instanceof w){let e=t.geometryInstances,r=Array.isArray(e)?e[0]:e;if(!r.geometry.attributes.position)return;let c=r.geometry.attributes.position.values,d=[];for(let h=0;h<c.length;h+=3)d.push(new o(c[h],c[h+1],c[h+2]));i.outline?this._entity.polyline=new a({positions:d,material:i.color,width:i.width||2,clampToGround:!0}):this._entity.polygon=new C({hierarchy:new b(d),material:i.color,heightReference:_.CLAMP_TO_GROUND,classificationType:v.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(t){this._color=t}get entity(){return this._entity}get currentObject(){return this._currentObject}};var y=class n{static instances=new WeakMap;_surface;_silhouette;_color=R.RED;constructor(t){this._surface=new l(t),this._silhouette=new s(t),this._surface.color=this._color,this._silhouette.color=this._color}static getInstance(t){let i=t.container;return n.instances.has(i)||n.instances.set(i,new n(t)),n.instances.get(i)}static releaseInstance(t){let i=t.container,e=n.instances.get(i);e&&(e.hide(),e._surface&&e._surface.destroy(),e._silhouette&&e._silhouette.destroy(),n.instances.delete(i))}show(t,i={color:this._color}){let e=this._getObject(t);if(H(e))return e instanceof P?this._silhouette.show(e,i):e instanceof p&&e.model?this._silhouette.show(e,i):this._surface.show(e,i)}_getObject(t){if(H(t)){if(t instanceof p||t instanceof P||t instanceof E)return t;if(t.id instanceof p)return t.id;if(t.primitive instanceof E)return t.primitive}}hide(){this._surface.hide(),this._silhouette.hide()}get color(){return this._color}set color(t){this._color=t,this._surface.color=t,this._silhouette.color=t}},V=y;export{s as a,l as b,V as c};
|
package/dist/chunk-TC3IX3JL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c;(w=>{let n=new Set,u=typeof process<"u"?process.env.CESIUM_UTILS_DISABLE_DEPRECATION_WARNINGS!=="true":!0;function f(e,o={}){if(!u)return;let{once:r=!0,prefix:t="[DEPRECATED]",includeStack:i=!0,removeInVersion:s}=o;if(r&&n.has(e))return;let a=`${t} ${e}`;s&&(a+=` This feature will be removed in ${s}.`),typeof console<"u"&&console.warn&&(i?(console.warn(a),console.trace("Deprecation stack trace:")):console.warn(a)),r&&n.add(e)}w.warn=f;function l(e,o,r={}){let t=((...i)=>(f(o,r),e(...i)));return Object.defineProperty(t,"name",{value:e.name,configurable:!0}),t}w.deprecate=l;function p(){n.clear()}w.clear=p;function d(){return n.size}w.getWarningCount=d;function g(e){return n.has(e)}w.hasShown=g})(c||={});var x=c;export{x as a};
|
package/dist/chunk-WVFPGF7U.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-TC3IX3JL.js";import{EllipsoidTerrainProvider as y,Rectangle as m}from"cesium";var d=class{_regions;_defaultProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(e){this._defaultProvider=e.defaultProvider,this._fallbackProvider=e.fallbackProvider||new y,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,n,i){return this._defaultProvider.loadTileDataAvailability(e,n,i)}getLevelMaximumGeometricError(e){return this._defaultProvider.getLevelMaximumGeometricError(e)}requestTileGeometry(e,n,i,t){if(this._ready){for(let r of this._regions)if(this._regionContains(r,e,n,i))return r.provider.requestTileGeometry(e,n,i,t);return this._defaultProvider.getTileDataAvailable(e,n,i)?this._defaultProvider.requestTileGeometry(e,n,i,t):this._fallbackProvider.requestTileGeometry(e,n,i,t)}}getTileDataAvailable(e,n,i){for(let t of this._regions)if(this._regionContains(t,e,n,i)&&t.provider.getTileDataAvailable(e,n,i))return!0;return this._defaultProvider.getTileDataAvailable(e,n,i)}_regionContains(e,n,i,t){if(e.levels&&!e.levels.includes(t))return!1;if(e.tiles){let r=e.tiles.get(t);if(!r)return!1;let[a,o]=Array.isArray(r.x)?r.x:[r.x,r.x],[l,s]=Array.isArray(r.y)?r.y:[r.y,r.y];return n>=a&&n<=o&&i>=l&&i<=s}if(e.bounds){let r=this._tilingScheme.tileXYToRectangle(n,i,t);return m.intersection(r,e.bounds)!==void 0}return!1}};(i=>{function P(t,r,a){return new i({regions:t.map(o=>({...o})),defaultProvider:r,fallbackProvider:a})}i.fromRectangles=P;function e(t,r,a){return new i({regions:t.map(o=>({...o})),defaultProvider:r,fallbackProvider:a})}i.fromTileRanges=e;function n(t,r){if(g.warn("computeRectangle() is deprecated. Use Rectangle.fromDegrees() instead.",{removeInVersion:"v0.3.0"}),r.size===0)return new m;let a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,h=Array.from(r.keys()),u=Math.min(...h),v=r.get(u);if(v){let{start:b,end:T}=v,c=t.tileXYToRectangle(b.x,b.y,u),f=t.tileXYToRectangle(T.x,T.y,u);a=Math.min(c.west,a),o=Math.min(f.south,o),l=Math.max(f.east,l),s=Math.max(c.north,s)}return new m(a,o,l,s)}i.computeRectangle=n})(d||={});var p=d;export{p as a};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { DataSourceCollection, EntityCollection, ImageryLayerCollection, PrimitiveCollection, Billboard, Cesium3DTileset, GroundPrimitive, Label, PointPrimitive, Polyline, Primitive, DataSource, Entity, ImageryLayer } from 'cesium';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Runtime type validator to identify the non-function property.
|
|
5
|
+
*/
|
|
6
|
+
type NonFunction<T> = {
|
|
7
|
+
[K in keyof T]: T[K] extends Function ? never : K;
|
|
8
|
+
}[keyof T];
|
|
3
9
|
/**
|
|
4
10
|
* Examine the property descriptors at runtime
|
|
5
11
|
* to detect properties that only have getters.
|
|
@@ -8,12 +14,6 @@ import { DataSourceCollection, EntityCollection, ImageryLayerCollection, Primiti
|
|
|
8
14
|
* @param k The key value of the property.
|
|
9
15
|
*/
|
|
10
16
|
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
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @class
|
|
@@ -171,44 +171,29 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
|
|
|
171
171
|
*/
|
|
172
172
|
[Symbol.iterator](): Iterator<I>;
|
|
173
173
|
/**
|
|
174
|
-
*
|
|
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.
|
|
174
|
+
* Gets all item instances in the collection.
|
|
175
|
+
* This array should not be modified directly.
|
|
191
176
|
*
|
|
192
|
-
* @
|
|
193
|
-
* @param item - The item to remove
|
|
177
|
+
* @returns An array of all items in the collection
|
|
194
178
|
*/
|
|
195
|
-
|
|
179
|
+
get values(): I[];
|
|
196
180
|
/**
|
|
197
|
-
*
|
|
181
|
+
* Gets the number of items in the collection.
|
|
198
182
|
*
|
|
199
|
-
* @
|
|
183
|
+
* @returns The item count
|
|
200
184
|
*/
|
|
201
|
-
|
|
185
|
+
get length(): number;
|
|
202
186
|
/**
|
|
203
|
-
*
|
|
187
|
+
* Gets all unique tags currently in use in the collection.
|
|
204
188
|
*
|
|
205
|
-
* @
|
|
206
|
-
* @param collection - The Cesium collection to monitor for changes
|
|
189
|
+
* @returns An array of all unique tags
|
|
207
190
|
*
|
|
208
|
-
* @
|
|
209
|
-
*
|
|
191
|
+
* @example
|
|
192
|
+
* // Get all tags
|
|
193
|
+
* const tags = collection.tags;
|
|
194
|
+
* console.log(`Collection has these tags: ${tags.join(', ')}`);
|
|
210
195
|
*/
|
|
211
|
-
|
|
196
|
+
get tags(): Collection.Tag[];
|
|
212
197
|
/**
|
|
213
198
|
* Registers an event listener for collection events.
|
|
214
199
|
*
|
|
@@ -300,19 +285,6 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
|
|
|
300
285
|
* The Collection instance should not be used after calling this method.
|
|
301
286
|
*/
|
|
302
287
|
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
288
|
/**
|
|
317
289
|
* Gets all items with the specified tag from the collection.
|
|
318
290
|
* Uses an optimized internal map for faster lookups.
|
|
@@ -337,17 +309,6 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
|
|
|
337
309
|
* const firstBuilding = collection.first('buildings');
|
|
338
310
|
*/
|
|
339
311
|
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
312
|
/**
|
|
352
313
|
* Updates the tag for all items with the specified tag.
|
|
353
314
|
*
|
|
@@ -482,6 +443,45 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
|
|
|
482
443
|
* );
|
|
483
444
|
*/
|
|
484
445
|
find(predicate: (value: I) => boolean, by?: Collection.Tag): I | undefined;
|
|
446
|
+
/**
|
|
447
|
+
* Emits an event to all registered listeners.
|
|
448
|
+
*
|
|
449
|
+
* @private
|
|
450
|
+
* @param type - The event type
|
|
451
|
+
* @param data - Additional event data
|
|
452
|
+
*/
|
|
453
|
+
private _emit;
|
|
454
|
+
/**
|
|
455
|
+
* Adds an item to the internal tag map for quick lookups.
|
|
456
|
+
*
|
|
457
|
+
* @private
|
|
458
|
+
* @param item - The item to add
|
|
459
|
+
* @param tag - The tag to associate with the item
|
|
460
|
+
*/
|
|
461
|
+
private _addToTagMap;
|
|
462
|
+
/**
|
|
463
|
+
* Removes an item from the internal tag map.
|
|
464
|
+
*
|
|
465
|
+
* @private
|
|
466
|
+
* @param item - The item to remove
|
|
467
|
+
*/
|
|
468
|
+
private _removeFromTagMap;
|
|
469
|
+
/**
|
|
470
|
+
* Invalidates the values cache when collection changes.
|
|
471
|
+
*
|
|
472
|
+
* @private
|
|
473
|
+
*/
|
|
474
|
+
private _invalidateCache;
|
|
475
|
+
/**
|
|
476
|
+
* Sets up automatic cache invalidation by registering event listeners on the underlying Cesium collection.
|
|
477
|
+
*
|
|
478
|
+
* @private
|
|
479
|
+
* @param collection - The Cesium collection to monitor for changes
|
|
480
|
+
*
|
|
481
|
+
* @see {@link destroy} For cleanup of event listeners
|
|
482
|
+
* @see {@link _invalidateCache} For the actual cache invalidation logic
|
|
483
|
+
*/
|
|
484
|
+
private _setupCacheInvalidator;
|
|
485
485
|
}
|
|
486
486
|
/**
|
|
487
487
|
* @namespace
|