@juun-roh/cesium-utils 0.2.0 → 0.2.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 +15 -2
- package/dist/chunk-DGHCIGKJ.js +1 -0
- package/dist/chunk-N24M6GYI.js +1 -0
- package/dist/chunk-TUJQL7MC.js +1 -0
- package/dist/{chunk-2JNRK7SN.js → chunk-Z2COOTT4.js} +1 -1
- package/dist/collection/index.cjs +1 -1
- package/dist/collection/index.d.cts +1 -1
- package/dist/collection/index.d.ts +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/dev/index.cjs +1 -0
- package/dist/{utils → dev}/index.d.cts +108 -11
- package/dist/{utils → dev}/index.d.ts +108 -11
- package/dist/dev/index.js +1 -0
- package/dist/hybrid-terrain-provider-C2V-igd9.d.cts +202 -0
- package/dist/hybrid-terrain-provider-C2V-igd9.d.ts +202 -0
- package/dist/{index-Bd_-DTWl.d.ts → index-C7kPHG5S.d.cts} +5 -1
- package/dist/{index-Bd_-DTWl.d.cts → index-C7kPHG5S.d.ts} +5 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/terrain/index.cjs +1 -1
- package/dist/terrain/index.d.cts +5 -274
- package/dist/terrain/index.d.ts +5 -274
- package/dist/terrain/index.js +1 -1
- package/dist/viewer/index.cjs +1 -1
- package/dist/viewer/index.js +1 -1
- package/package.json +15 -14
- package/dist/chunk-4HY6RL6I.js +0 -1
- package/dist/chunk-BXU5HNPI.js +0 -1
- package/dist/utils/index.cjs +0 -1
- package/dist/utils/index.js +0 -1
package/README.md
CHANGED
|
@@ -37,15 +37,28 @@ This library supports modular exports, enabling you to import only the functiona
|
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
39
|
// Import everything from the main package
|
|
40
|
-
import { Collection, Highlight,
|
|
40
|
+
import { Collection, Highlight, HybridTerrainProvider } from "@juun-roh/cesium-utils";
|
|
41
41
|
|
|
42
42
|
// Or import specific modules to minimize bundle size
|
|
43
43
|
import { Collection } from "@juun-roh/cesium-utils/collection";
|
|
44
44
|
import { Highlight } from "@juun-roh/cesium-utils/highlight";
|
|
45
|
-
import {
|
|
45
|
+
import { HybridTerrainProvider } from "@juun-roh/cesium-utils/terrain";
|
|
46
46
|
import { cloneViewer, syncCamera } from "@juun-roh/cesium-utils/viewer";
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
## Development Utilities
|
|
50
|
+
|
|
51
|
+
For development and testing purposes, this library provides additional utilities through the `/utils` module. These utilities include deprecation warnings, terrain visualization helpers, and type checking functions.
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// Import development utilities (not part of main API)
|
|
55
|
+
import { Deprecate, TerrainVisualizer, isGetterOnly } from "@juun-roh/cesium-utils/utils";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Note**: These utilities are intentionally not exported from the main package as they are primarily intended for development, testing, and advanced terrain configuration.
|
|
59
|
+
|
|
60
|
+
For detailed usage and examples, see [Development Utilities Documentation](src/utils/README.md).
|
|
61
|
+
|
|
49
62
|
## Development
|
|
50
63
|
|
|
51
64
|
### Building
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g}from"./chunk-TUJQL7MC.js";import{EllipsoidTerrainProvider as y,Rectangle as m}from"cesium";var s=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))return t.provider.getTileDataAvailable(e,n,i);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,d]=Array.isArray(r.y)?r.y:[r.y,r.y];return n>=a&&n<=o&&i>=l&&i<=d}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,d=Number.NEGATIVE_INFINITY,h=Array.from(r.keys()),u=Math.min(...h),v=r.get(u);if(v){let{start:b,end:c}=v,T=t.tileXYToRectangle(b.x,b.y,u),f=t.tileXYToRectangle(c.x,c.y,u);a=Math.min(T.west,a),o=Math.min(f.south,o),l=Math.max(f.east,l),d=Math.max(T.north,d)}return new m(a,o,l,d)}i.computeRectangle=n})(s||={});var p=s;export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as L}from"./chunk-TUJQL7MC.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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Viewer as p}from"cesium";import{defined as m}from"cesium";function c(e,i){if(m(e)&&m(i)){let{camera:
|
|
1
|
+
import{Viewer as p}from"cesium";import{defined as m}from"cesium";function c(e,i){if(m(e)&&m(i)){let{camera:t}=e;i.camera.position=t.positionWC.clone(),i.camera.direction=t.directionWC.clone(),i.camera.up=t.upWC.clone()}}function y(e,i,t){let d={baseLayerPicker:e.baseLayerPicker!==void 0,geocoder:e.geocoder!==void 0,homeButton:e.homeButton!==void 0,sceneModePicker:e.sceneModePicker!==void 0,timeline:e.timeline!==void 0,navigationHelpButton:e.navigationHelpButton!==void 0,animation:e.animation!==void 0,fullscreenButton:e.fullscreenButton!==void 0,shouldAnimate:e.clock.shouldAnimate,terrainProvider:e.terrainProvider,requestRenderMode:e.scene.requestRenderMode,infoBox:e.infoBox!==void 0},n=new p(i,{...d,...t});c(e,n);let l=e.imageryLayers;n.imageryLayers.removeAll();for(let a=0;a<l.length;a++){let s=l.get(a);n.imageryLayers.addImageryProvider(s.imageryProvider,a)}n.clock.startTime=e.clock.startTime.clone(),n.clock.stopTime=e.clock.stopTime.clone(),n.clock.currentTime=e.clock.currentTime.clone(),n.clock.multiplier=e.clock.multiplier,n.clock.clockStep=e.clock.clockStep,n.clock.clockRange=e.clock.clockRange,n.clock.shouldAnimate=e.clock.shouldAnimate,n.scene.globe.enableLighting=e.scene.globe.enableLighting,n.scene.globe.depthTestAgainstTerrain=e.scene.globe.depthTestAgainstTerrain,n.scene.screenSpaceCameraController.enableCollisionDetection=e.scene.screenSpaceCameraController.enableCollisionDetection;let o=e.scene.screenSpaceCameraController.tiltEventTypes;o&&(n.scene.screenSpaceCameraController.tiltEventTypes=Array.isArray(o)?[...o]:o);let r=e.scene.screenSpaceCameraController.zoomEventTypes;return r&&(n.scene.screenSpaceCameraController.zoomEventTypes=Array.isArray(r)?[...r]:r),n}export{c as a,y as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var C=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var M=(n,e)=>{for(var t in e)C(n,t,{get:e[t],enumerable:!0})},O=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of A(e))!S.call(n,r)&&r!==t&&C(n,r,{get:()=>e[r],enumerable:!(i=x(e,r))||i.enumerable});return n};var F=n=>O(C({},"__esModule",{value:!0}),n);var V={};M(V,{Collection:()=>m});module.exports=F(V);var s=require("cesium");var a=require("cesium");var u=class n{_viewer;_collection;_terrainProvider;_visible=!1;_level=15;_tileCoordinatesLayer;_colors=new Map([["custom",a.Color.RED],["default",a.Color.BLUE],["fallback",a.Color.GRAY],["grid",a.Color.YELLOW]]);constructor(e,t){this._viewer=e,this._collection=new m({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 a.TileCoordinatesImageryProvider({tilingScheme:this._terrainProvider.tilingScheme,color:a.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(a.Rectangle.northwest(e),t),o=i.positionToTileXY(a.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=[],l=Math.min(e.end.x-e.start.x+1,100),c=Math.min(e.end.y-e.start.y+1,100);for(let h=e.start.x;h<e.start.x+l;h++)for(let d=e.start.y;d<e.start.y+c;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 l=this._getTileColor(e,t,i),c=n.createRectangle(o,l.withAlpha(.3));return c.properties?.addProperty("tileX",e),c.properties?.addProperty("tileY",t),c.properties?.addProperty("tileLevel",i),c}_getTileColor(e,t,i){if(!this._terrainProvider)return this._colors.get("fallback")||a.Color.TRANSPARENT;for(let r of this._terrainProvider.terrainAreas)if(r.contains(e,t,i))return r.isCustom?this._colors.get("custom")||a.Color.RED:this._colors.get("default")||a.Color.BLUE;return this._terrainProvider.getTileDataAvailable(e,t,i)?this._colors.get("default")||a.Color.BLUE:this._colors.get("fallback")||a.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 a.Entity({rectangle:{coordinates:r,material:o,heightReference:a.HeightReference.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,o,l){let c=l?.tag||"terrain_area_visualization",h=l?.color||a.Color.RED,d=l?.maxTilesToShow||100,v=l?.show??!0,E=l?.alpha||.7,w=l?.tileAlpha||.2,f=new m({collection:o.entities,tag:c}),{rectangle:L}=r;if(f.add(i.createRectangle(L,h.withAlpha(E)),c),v&&r.tileRanges.size>0){let{tilingScheme:I}=r.terrainProvider,p=0;r.tileRanges.forEach((g,P)=>{for(let _=g.start.x;_<=g.end.x&&p<d;_++)for(let y=g.start.y;y<=g.end.y&&p<d;y++){let R=I.tileXYToRectangle(_,y,P);f.add(e(R,h.withAlpha(w)),`${c}_tile`),p++}})}return f}i.visualize=t})(u||={});function T(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 b=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 s.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof s.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 s.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 s.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 s.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,s.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,s.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,s.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(T(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)}},m=b;
|
|
1
|
+
"use strict";var E=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)E(n,t,{get:e[t],enumerable:!0})},V=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of O(e))!F.call(n,r)&&r!==t&&E(n,r,{get:()=>e[r],enumerable:!(i=M(e,r))||i.enumerable});return n};var N=n=>V(E({},"__esModule",{value:!0}),n);var j={};D(j,{Collection:()=>C});module.exports=N(j);var c=require("cesium");var P;(h=>{let n=new Set,e=typeof process<"u"?process.env.CESIUM_UTILS_DISABLE_DEPRECATION_WARNINGS!=="true":!0;function t(s,d={}){if(!e)return;let{once:v=!0,prefix:m="[DEPRECATED]",includeStack:p=!0,removeInVersion:g}=d;if(v&&n.has(s))return;let f=`${m} ${s}`;g&&(f+=` This feature will be removed in ${g}.`),typeof console<"u"&&console.warn&&(p?(console.warn(f),console.trace("Deprecation stack trace:")):console.warn(f)),v&&n.add(s)}h.warn=t;function i(s,d,v={}){let m=(...p)=>(t(d,v),s(...p));return Object.defineProperty(m,"name",{value:s.name,configurable:!0}),m}h.deprecate=i;function r(){n.clear()}h.clear=r;function o(){return n.size}h.getWarningCount=o;function l(s){return n.has(s)}h.hasShown=l})(P||={});var S=P;var a=require("cesium");var y=class n{_viewer;_collection;_terrainProvider;_visible=!1;_level=15;_tileCoordinatesLayer;_colors=new Map([["custom",a.Color.RED],["default",a.Color.BLUE],["fallback",a.Color.GRAY],["grid",a.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 a.TileCoordinatesImageryProvider({tilingScheme:this._terrainProvider.tilingScheme,color:a.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(a.Rectangle.northwest(e),t),o=i.positionToTileXY(a.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=[],l=Math.min(e.end.x-e.start.x+1,100),h=Math.min(e.end.y-e.start.y+1,100);for(let s=e.start.x;s<e.start.x+l;s++)for(let d=e.start.y;d<e.start.y+h;d++)try{let v=this._createTileEntity(s,d,t,i);v&&r.push({entity:v})}catch(v){console.warn(`Error creating tile (${s}, ${d}, ${t}):`,v)}return r}_createTileEntity(e,t,i,r){let o=r.tileXYToRectangle(e,t,i);if(!this._isValidRectangle(o))return null;let l=this._getTileColor(e,t,i),h=n.createRectangle(o,l.withAlpha(.3));return h.properties?.addProperty("tileX",e),h.properties?.addProperty("tileY",t),h.properties?.addProperty("tileLevel",i),h}_getTileColor(e,t,i){if(!this._terrainProvider)return this._colors.get("fallback")||a.Color.TRANSPARENT;for(let r of this._terrainProvider.regions)if(this._terrainProvider._regionContains(r,e,t,i))return this._colors.get("custom")||a.Color.RED;return this._terrainProvider.getTileDataAvailable(e,t,i)?this._colors.get("default")||a.Color.BLUE:this._colors.get("fallback")||a.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 a.Entity({rectangle:{coordinates:r,material:o,heightReference:a.HeightReference.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,o,l){let h=l?.tag||"terrain_region_visualization",s=l?.color||a.Color.RED,d=l?.maxTilesToShow||100,v=l?.show??!0,m=l?.alpha||.7,p=l?.tileAlpha||.2,g=new C({collection:o.entities,tag:h});if(r.bounds&&g.add(i.createRectangle(r.bounds,s.withAlpha(m)),h),v&&r.tiles&&r.tiles.size>0){let f=r.provider.tilingScheme,_=0;r.tiles.forEach((u,R)=>{let x=Array.isArray(u.x)?u.x:[u.x,u.x],I=Array.isArray(u.y)?u.y:[u.y,u.y];for(let T=x[0];T<=x[1]&&_<d;T++)for(let b=I[0];b<=I[1]&&_<d;b++){let A=f.tileXYToRectangle(T,b,R);g.add(e(A,s.withAlpha(p)),`${h}_tile`),_++}})}return g}i.visualize=t})(y||={});function w(n,e){let t=!1,i=Object.getOwnPropertyDescriptor(n,e);if(!i){let r=Object.getPrototypeOf(n);for(;r&&!i;)i=Object.getOwnPropertyDescriptor(r,e),r=Object.getPrototypeOf(r)}return i&&i.get&&!i.set&&(t=!0),t}var J=S.deprecate;var L=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 c.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof c.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 c.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 c.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 c.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,c.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,c.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,c.defined)(i.show)&&(i.show=!i.show);return this}setProperty(e,t,i=this.tag){let r=this.get(i);for(let o of r)if(e in o&&typeof o[e]!="function"){if(w(o,e))throw Error(`Cannot set read-only property '${String(e)}' on ${o.constructor.name}`);o[e]=t}return this}filter(e,t){return(t?this.get(t):this.values).filter(e)}forEach(e,t){(t?this.get(t):this.values).forEach((r,o)=>e(r,o))}map(e,t){return(t?this.get(t):this.values).map(e)}find(e,t){return(t?this.get(t):this.values).find(e)}},C=L;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as Collection } from '../index-
|
|
1
|
+
export { C as Collection } from '../index-C7kPHG5S.cjs';
|
|
2
2
|
import 'cesium';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as Collection } from '../index-
|
|
1
|
+
export { C as Collection } from '../index-C7kPHG5S.js';
|
|
2
2
|
import 'cesium';
|
package/dist/collection/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-RXMNSDKR.js";import{
|
|
1
|
+
import"../chunk-RXMNSDKR.js";import{d as a}from"../chunk-N24M6GYI.js";import"../chunk-TUJQL7MC.js";export{a as Collection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var E=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)E(n,t,{get:e[t],enumerable:!0})},V=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of O(e))!F.call(n,r)&&r!==t&&E(n,r,{get:()=>e[r],enumerable:!(i=M(e,r))||i.enumerable});return n};var N=n=>V(E({},"__esModule",{value:!0}),n);var G={};D(G,{Deprecate:()=>w,TerrainVisualizer:()=>p,deprecate:()=>j,isGetterOnly:()=>C});module.exports=N(G);var S;(h=>{let n=new Set,e=typeof process<"u"?process.env.CESIUM_UTILS_DISABLE_DEPRECATION_WARNINGS!=="true":!0;function t(s,d={}){if(!e)return;let{once:v=!0,prefix:m="[DEPRECATED]",includeStack:f=!0,removeInVersion:g}=d;if(v&&n.has(s))return;let y=`${m} ${s}`;g&&(y+=` This feature will be removed in ${g}.`),typeof console<"u"&&console.warn&&(f?(console.warn(y),console.trace("Deprecation stack trace:")):console.warn(y)),v&&n.add(s)}h.warn=t;function i(s,d,v={}){let m=(...f)=>(t(d,v),s(...f));return Object.defineProperty(m,"name",{value:s.name,configurable:!0}),m}h.deprecate=i;function r(){n.clear()}h.clear=r;function o(){return n.size}h.getWarningCount=o;function l(s){return n.has(s)}h.hasShown=l})(S||={});var w=S;var a=require("cesium");var c=require("cesium");var L=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 c.EntityCollection?(e.collectionChanged.addEventListener(this._invalidateCache),this._eventCleanupFunctions.push(()=>e.collectionChanged.removeEventListener(this._invalidateCache))):e instanceof c.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 c.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 c.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 c.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,c.defined)(i.show)&&(i.show=!0);return this}hide(e){let t=this.get(e);for(let i of t)(0,c.defined)(i.show)&&(i.show=!1);return this}toggle(e){let t=this.get(e);for(let i of t)(0,c.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)}},x=L;var p=class n{_viewer;_collection;_terrainProvider;_visible=!1;_level=15;_tileCoordinatesLayer;_colors=new Map([["custom",a.Color.RED],["default",a.Color.BLUE],["fallback",a.Color.GRAY],["grid",a.Color.YELLOW]]);constructor(e,t){this._viewer=e,this._collection=new x({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 a.TileCoordinatesImageryProvider({tilingScheme:this._terrainProvider.tilingScheme,color:a.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(a.Rectangle.northwest(e),t),o=i.positionToTileXY(a.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=[],l=Math.min(e.end.x-e.start.x+1,100),h=Math.min(e.end.y-e.start.y+1,100);for(let s=e.start.x;s<e.start.x+l;s++)for(let d=e.start.y;d<e.start.y+h;d++)try{let v=this._createTileEntity(s,d,t,i);v&&r.push({entity:v})}catch(v){console.warn(`Error creating tile (${s}, ${d}, ${t}):`,v)}return r}_createTileEntity(e,t,i,r){let o=r.tileXYToRectangle(e,t,i);if(!this._isValidRectangle(o))return null;let l=this._getTileColor(e,t,i),h=n.createRectangle(o,l.withAlpha(.3));return h.properties?.addProperty("tileX",e),h.properties?.addProperty("tileY",t),h.properties?.addProperty("tileLevel",i),h}_getTileColor(e,t,i){if(!this._terrainProvider)return this._colors.get("fallback")||a.Color.TRANSPARENT;for(let r of this._terrainProvider.regions)if(this._terrainProvider._regionContains(r,e,t,i))return this._colors.get("custom")||a.Color.RED;return this._terrainProvider.getTileDataAvailable(e,t,i)?this._colors.get("default")||a.Color.BLUE:this._colors.get("fallback")||a.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 a.Entity({rectangle:{coordinates:r,material:o,heightReference:a.HeightReference.CLAMP_TO_GROUND}})}i.createRectangle=e;function t(r,o,l){let h=l?.tag||"terrain_region_visualization",s=l?.color||a.Color.RED,d=l?.maxTilesToShow||100,v=l?.show??!0,m=l?.alpha||.7,f=l?.tileAlpha||.2,g=new x({collection:o.entities,tag:h});if(r.bounds&&g.add(i.createRectangle(r.bounds,s.withAlpha(m)),h),v&&r.tiles&&r.tiles.size>0){let y=r.provider.tilingScheme,_=0;r.tiles.forEach((u,R)=>{let I=Array.isArray(u.x)?u.x:[u.x,u.x],P=Array.isArray(u.y)?u.y:[u.y,u.y];for(let T=I[0];T<=I[1]&&_<d;T++)for(let b=P[0];b<=P[1]&&_<d;b++){let A=y.tileXYToRectangle(T,b,R);g.add(e(A,s.withAlpha(f)),`${h}_tile`),_++}})}return g}i.visualize=t})(p||={});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 j=w.deprecate;
|
|
@@ -1,7 +1,102 @@
|
|
|
1
|
-
import { Viewer, Color, EntityCollection, Entity
|
|
2
|
-
import { C as Collection } from '../index-
|
|
3
|
-
export { N as NonFunction, i as isGetterOnly } from '../index-
|
|
4
|
-
import { HybridTerrainProvider
|
|
1
|
+
import { Viewer, Color, Rectangle, EntityCollection, Entity } from 'cesium';
|
|
2
|
+
import { C as Collection } from '../index-C7kPHG5S.cjs';
|
|
3
|
+
export { N as NonFunction, i as isGetterOnly } from '../index-C7kPHG5S.cjs';
|
|
4
|
+
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-C2V-igd9.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Utility for managing deprecation warnings in the cesium-utils library.
|
|
8
|
+
* Provides runtime warnings to help developers identify deprecated API usage.
|
|
9
|
+
*/
|
|
10
|
+
declare namespace Deprecate {
|
|
11
|
+
/**
|
|
12
|
+
* Configuration options for deprecation warnings.
|
|
13
|
+
*/
|
|
14
|
+
interface Options {
|
|
15
|
+
/**
|
|
16
|
+
* Whether to show the warning only once per deprecation message.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
once?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Custom prefix for the warning message.
|
|
22
|
+
* @default "[DEPRECATED]"
|
|
23
|
+
*/
|
|
24
|
+
prefix?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to include a stack trace in the warning.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
includeStack?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Version when the feature will be removed.
|
|
32
|
+
*/
|
|
33
|
+
removeInVersion?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Displays a deprecation warning message.
|
|
37
|
+
*
|
|
38
|
+
* @param message - The deprecation message to display
|
|
39
|
+
* @param options - Configuration options for the warning
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* // Basic usage
|
|
44
|
+
* deprecationWarning("oldFunction() is deprecated. Use newFunction() instead.");
|
|
45
|
+
*
|
|
46
|
+
* // With removal version
|
|
47
|
+
* deprecationWarning("TerrainArea is deprecated.", {
|
|
48
|
+
* removeInVersion: "v0.3.0"
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Allow multiple warnings
|
|
52
|
+
* deprecationWarning("Repeated warning", { once: false });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
function warn(message: string, options?: Options): void;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a deprecation wrapper function that shows a warning when called.
|
|
58
|
+
*
|
|
59
|
+
* @param fn - The function to wrap
|
|
60
|
+
* @param message - The deprecation message
|
|
61
|
+
* @param options - Configuration options for the warning
|
|
62
|
+
* @returns A wrapped function that shows a deprecation warning when called
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const oldFunction = deprecate(
|
|
67
|
+
* () => console.log("old implementation"),
|
|
68
|
+
* "oldFunction() is deprecated. Use newFunction() instead."
|
|
69
|
+
* );
|
|
70
|
+
*
|
|
71
|
+
* oldFunction(); // Shows warning and executes function
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
function deprecate<T extends (...args: any[]) => any>(fn: T, message: string, options?: Options): T;
|
|
75
|
+
/**
|
|
76
|
+
* Clears all shown warning messages.
|
|
77
|
+
* Useful for testing or when you want to reset the warning state.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* clearDeprecationWarnings();
|
|
82
|
+
* deprecationWarning("This will show again");
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
function clear(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the count of unique deprecation warnings that have been shown.
|
|
88
|
+
*
|
|
89
|
+
* @returns The number of unique deprecation warnings shown
|
|
90
|
+
*/
|
|
91
|
+
function getWarningCount(): number;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if a specific deprecation warning has been shown.
|
|
94
|
+
*
|
|
95
|
+
* @param message - The deprecation message to check
|
|
96
|
+
* @returns True if the warning has been shown, false otherwise
|
|
97
|
+
*/
|
|
98
|
+
function hasShown(message: string): boolean;
|
|
99
|
+
}
|
|
5
100
|
|
|
6
101
|
/**
|
|
7
102
|
* @class
|
|
@@ -56,11 +151,11 @@ declare class TerrainVisualizer {
|
|
|
56
151
|
*/
|
|
57
152
|
setColors(colors: Record<string, Color>): void;
|
|
58
153
|
/**
|
|
59
|
-
* Flies the camera to focus on a
|
|
60
|
-
* @param
|
|
154
|
+
* Flies the camera to focus on a rectangle.
|
|
155
|
+
* @param rectangle The rectangle to focus on.
|
|
61
156
|
* @param options {@link Viewer.flyTo}
|
|
62
157
|
*/
|
|
63
|
-
flyTo(
|
|
158
|
+
flyTo(rectangle: Rectangle, options?: {
|
|
64
159
|
duration?: number;
|
|
65
160
|
}): void;
|
|
66
161
|
/**
|
|
@@ -124,13 +219,15 @@ declare namespace TerrainVisualizer {
|
|
|
124
219
|
tileAlpha?: number;
|
|
125
220
|
}
|
|
126
221
|
/**
|
|
127
|
-
* Visualizes a
|
|
128
|
-
* @param
|
|
222
|
+
* Visualizes a terrain region in a viewer.
|
|
223
|
+
* @param region The terrain region to visualize.
|
|
129
224
|
* @param viewer The Cesium viewer.
|
|
130
225
|
* @param options Visualization options.
|
|
131
226
|
* @returns Collection of created entities.
|
|
132
227
|
*/
|
|
133
|
-
function visualize(
|
|
228
|
+
function visualize(region: HybridTerrainProvider.TerrainRegion, viewer: Viewer, options?: Options): Collection<EntityCollection, Entity>;
|
|
134
229
|
}
|
|
135
230
|
|
|
136
|
-
|
|
231
|
+
declare const deprecate: typeof Deprecate.deprecate;
|
|
232
|
+
|
|
233
|
+
export { Deprecate, TerrainVisualizer, deprecate };
|
|
@@ -1,7 +1,102 @@
|
|
|
1
|
-
import { Viewer, Color, EntityCollection, Entity
|
|
2
|
-
import { C as Collection } from '../index-
|
|
3
|
-
export { N as NonFunction, i as isGetterOnly } from '../index-
|
|
4
|
-
import { HybridTerrainProvider
|
|
1
|
+
import { Viewer, Color, Rectangle, EntityCollection, Entity } from 'cesium';
|
|
2
|
+
import { C as Collection } from '../index-C7kPHG5S.js';
|
|
3
|
+
export { N as NonFunction, i as isGetterOnly } from '../index-C7kPHG5S.js';
|
|
4
|
+
import { H as HybridTerrainProvider } from '../hybrid-terrain-provider-C2V-igd9.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Utility for managing deprecation warnings in the cesium-utils library.
|
|
8
|
+
* Provides runtime warnings to help developers identify deprecated API usage.
|
|
9
|
+
*/
|
|
10
|
+
declare namespace Deprecate {
|
|
11
|
+
/**
|
|
12
|
+
* Configuration options for deprecation warnings.
|
|
13
|
+
*/
|
|
14
|
+
interface Options {
|
|
15
|
+
/**
|
|
16
|
+
* Whether to show the warning only once per deprecation message.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
once?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Custom prefix for the warning message.
|
|
22
|
+
* @default "[DEPRECATED]"
|
|
23
|
+
*/
|
|
24
|
+
prefix?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to include a stack trace in the warning.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
includeStack?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Version when the feature will be removed.
|
|
32
|
+
*/
|
|
33
|
+
removeInVersion?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Displays a deprecation warning message.
|
|
37
|
+
*
|
|
38
|
+
* @param message - The deprecation message to display
|
|
39
|
+
* @param options - Configuration options for the warning
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* // Basic usage
|
|
44
|
+
* deprecationWarning("oldFunction() is deprecated. Use newFunction() instead.");
|
|
45
|
+
*
|
|
46
|
+
* // With removal version
|
|
47
|
+
* deprecationWarning("TerrainArea is deprecated.", {
|
|
48
|
+
* removeInVersion: "v0.3.0"
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Allow multiple warnings
|
|
52
|
+
* deprecationWarning("Repeated warning", { once: false });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
function warn(message: string, options?: Options): void;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a deprecation wrapper function that shows a warning when called.
|
|
58
|
+
*
|
|
59
|
+
* @param fn - The function to wrap
|
|
60
|
+
* @param message - The deprecation message
|
|
61
|
+
* @param options - Configuration options for the warning
|
|
62
|
+
* @returns A wrapped function that shows a deprecation warning when called
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const oldFunction = deprecate(
|
|
67
|
+
* () => console.log("old implementation"),
|
|
68
|
+
* "oldFunction() is deprecated. Use newFunction() instead."
|
|
69
|
+
* );
|
|
70
|
+
*
|
|
71
|
+
* oldFunction(); // Shows warning and executes function
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
function deprecate<T extends (...args: any[]) => any>(fn: T, message: string, options?: Options): T;
|
|
75
|
+
/**
|
|
76
|
+
* Clears all shown warning messages.
|
|
77
|
+
* Useful for testing or when you want to reset the warning state.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* clearDeprecationWarnings();
|
|
82
|
+
* deprecationWarning("This will show again");
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
function clear(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the count of unique deprecation warnings that have been shown.
|
|
88
|
+
*
|
|
89
|
+
* @returns The number of unique deprecation warnings shown
|
|
90
|
+
*/
|
|
91
|
+
function getWarningCount(): number;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if a specific deprecation warning has been shown.
|
|
94
|
+
*
|
|
95
|
+
* @param message - The deprecation message to check
|
|
96
|
+
* @returns True if the warning has been shown, false otherwise
|
|
97
|
+
*/
|
|
98
|
+
function hasShown(message: string): boolean;
|
|
99
|
+
}
|
|
5
100
|
|
|
6
101
|
/**
|
|
7
102
|
* @class
|
|
@@ -56,11 +151,11 @@ declare class TerrainVisualizer {
|
|
|
56
151
|
*/
|
|
57
152
|
setColors(colors: Record<string, Color>): void;
|
|
58
153
|
/**
|
|
59
|
-
* Flies the camera to focus on a
|
|
60
|
-
* @param
|
|
154
|
+
* Flies the camera to focus on a rectangle.
|
|
155
|
+
* @param rectangle The rectangle to focus on.
|
|
61
156
|
* @param options {@link Viewer.flyTo}
|
|
62
157
|
*/
|
|
63
|
-
flyTo(
|
|
158
|
+
flyTo(rectangle: Rectangle, options?: {
|
|
64
159
|
duration?: number;
|
|
65
160
|
}): void;
|
|
66
161
|
/**
|
|
@@ -124,13 +219,15 @@ declare namespace TerrainVisualizer {
|
|
|
124
219
|
tileAlpha?: number;
|
|
125
220
|
}
|
|
126
221
|
/**
|
|
127
|
-
* Visualizes a
|
|
128
|
-
* @param
|
|
222
|
+
* Visualizes a terrain region in a viewer.
|
|
223
|
+
* @param region The terrain region to visualize.
|
|
129
224
|
* @param viewer The Cesium viewer.
|
|
130
225
|
* @param options Visualization options.
|
|
131
226
|
* @returns Collection of created entities.
|
|
132
227
|
*/
|
|
133
|
-
function visualize(
|
|
228
|
+
function visualize(region: HybridTerrainProvider.TerrainRegion, viewer: Viewer, options?: Options): Collection<EntityCollection, Entity>;
|
|
134
229
|
}
|
|
135
230
|
|
|
136
|
-
|
|
231
|
+
declare const deprecate: typeof Deprecate.deprecate;
|
|
232
|
+
|
|
233
|
+
export { Deprecate, TerrainVisualizer, deprecate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,b as c,c as d}from"../chunk-N24M6GYI.js";import{a}from"../chunk-TUJQL7MC.js";export{a as Deprecate,b as TerrainVisualizer,d as deprecate,c as isGetterOnly};
|