@juun-roh/cesium-utils 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/chunk-4HY6RL6I.js +1 -0
- package/dist/chunk-BXU5HNPI.js +1 -0
- package/dist/chunk-RZ3PTU3G.js +1 -0
- package/dist/collection/index.cjs +1 -1
- package/dist/collection/index.d.cts +2 -493
- package/dist/collection/index.d.ts +2 -493
- package/dist/collection/index.js +1 -1
- package/dist/highlight/index.cjs +1 -0
- package/dist/highlight/index.d.cts +245 -0
- package/dist/highlight/index.d.ts +245 -0
- package/dist/highlight/index.js +1 -0
- package/dist/index-Bd_-DTWl.d.cts +524 -0
- package/dist/index-Bd_-DTWl.d.ts +524 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -224
- package/dist/index.d.ts +5 -224
- package/dist/index.js +1 -1
- package/dist/terrain/index.cjs +1 -1
- package/dist/terrain/index.d.cts +257 -27
- package/dist/terrain/index.d.ts +257 -27
- package/dist/terrain/index.js +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +4 -12
- package/dist/utils/index.d.ts +4 -12
- package/dist/utils/index.js +1 -1
- package/package.json +9 -9
- package/dist/chunk-D2H7O3WV.js +0 -1
- package/dist/chunk-I53ZQ7WC.js +0 -1
- package/dist/hybrid-terrain-provider-C4b9z5pv.d.cts +0 -238
- package/dist/hybrid-terrain-provider-C4b9z5pv.d.ts +0 -238
package/dist/index.d.cts
CHANGED
|
@@ -1,225 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { TerrainVisualizer, isGetterOnly } from './utils/index.cjs';
|
|
1
|
+
export { C as Collection, N as NonFunction, i as isGetterOnly } from './index-Bd_-DTWl.cjs';
|
|
2
|
+
export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.cjs';
|
|
3
|
+
export { HybridTerrainProvider, TerrainArea } from './terrain/index.cjs';
|
|
4
|
+
export { TerrainVisualizer } from './utils/index.cjs';
|
|
6
5
|
export { cloneViewer, syncCamera } from './viewer/index.cjs';
|
|
7
|
-
|
|
8
|
-
interface IHighlight {
|
|
9
|
-
show(object: any, options?: HighlightOptions): void;
|
|
10
|
-
hide(): void;
|
|
11
|
-
destroy(): void;
|
|
12
|
-
color: Color;
|
|
13
|
-
}
|
|
14
|
-
interface HighlightOptions {
|
|
15
|
-
/** Color of the highlight */
|
|
16
|
-
color?: Color;
|
|
17
|
-
/** To apply outline style for the highlight */
|
|
18
|
-
outline?: boolean;
|
|
19
|
-
/** Outline width */
|
|
20
|
-
width?: number;
|
|
21
|
-
}
|
|
22
|
-
type PickedObject = {
|
|
23
|
-
id?: Entity;
|
|
24
|
-
primitive?: Primitive | GroundPrimitive | Model | Cesium3DTileset;
|
|
25
|
-
tileset?: Cesium3DTileset;
|
|
26
|
-
detail?: {
|
|
27
|
-
model?: Model;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
type Picked = Entity | Cesium3DTileFeature | GroundPrimitive | PickedObject;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @class
|
|
34
|
-
* Lightweight multiton highlight manager for Cesium using flyweight pattern.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```
|
|
38
|
-
* // Setup
|
|
39
|
-
* const viewer1 = new Viewer('cesiumContainer1');
|
|
40
|
-
* const viewer2 = new Viewer('cesiumContainer2');
|
|
41
|
-
*
|
|
42
|
-
* const highlighter1 = Highlight.getInstance(viewer1);
|
|
43
|
-
* const highlighter2 = Highlight.getInstance(viewer2);
|
|
44
|
-
*
|
|
45
|
-
* // This highlight only affects viewer1
|
|
46
|
-
* highlighter1.show(someEntity, { color: Color.RED });
|
|
47
|
-
*
|
|
48
|
-
* // This highlight only affects viewer2
|
|
49
|
-
* highlighter2.show(someEntity, { color: Color.BLUE });
|
|
50
|
-
*
|
|
51
|
-
* // When done with viewers
|
|
52
|
-
* Highlight.releaseInstance(viewer1);
|
|
53
|
-
* Highlight.releaseInstance(viewer2);
|
|
54
|
-
* viewer1.destroy();
|
|
55
|
-
* viewer2.destroy();
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
declare class Highlight {
|
|
59
|
-
private static instances;
|
|
60
|
-
private _surface;
|
|
61
|
-
private _silhouette;
|
|
62
|
-
private _color;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a new `Highlight` instance.
|
|
65
|
-
* @private Use {@link getInstance `Highlight.getInstance()`}
|
|
66
|
-
* @param viewer A viewer to create highlight entity in
|
|
67
|
-
*/
|
|
68
|
-
private constructor();
|
|
69
|
-
/**
|
|
70
|
-
* Gets or creates highlight instance from a viewer.
|
|
71
|
-
* @param viewer The viewer to get or create a new instance from.
|
|
72
|
-
*/
|
|
73
|
-
static getInstance(viewer: Viewer): Highlight;
|
|
74
|
-
/**
|
|
75
|
-
* Releases the highlight instance associated with a viewer.
|
|
76
|
-
* @param viewer The viewer whose highlight instance should be released.
|
|
77
|
-
*/
|
|
78
|
-
static releaseInstance(viewer: Viewer): void;
|
|
79
|
-
/**
|
|
80
|
-
* Highlights a picked object or a direct instance.
|
|
81
|
-
* @param picked The result of `Scene.pick()` or direct instance to be highlighted.
|
|
82
|
-
* @param options Optional style for the highlight.
|
|
83
|
-
* @see {@link HighlightOptions}
|
|
84
|
-
*/
|
|
85
|
-
show(picked: Picked, options?: HighlightOptions): void | Entity;
|
|
86
|
-
private _getObject;
|
|
87
|
-
/**
|
|
88
|
-
* Clears the current highlight effects.
|
|
89
|
-
*/
|
|
90
|
-
hide(): void;
|
|
91
|
-
/** Gets the highlight color. */
|
|
92
|
-
get color(): Color;
|
|
93
|
-
/**
|
|
94
|
-
* Sets the highlight color.
|
|
95
|
-
* @param color The new color for highlights
|
|
96
|
-
*/
|
|
97
|
-
set color(color: Color);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @class
|
|
102
|
-
* An implementation for highlighting 3D objects in Cesium.
|
|
103
|
-
*
|
|
104
|
-
* **Supported Object Types:**
|
|
105
|
-
* - `Entity` with model graphics. (adjustable outline width)
|
|
106
|
-
* - `Cesium3DTileset` instances. (fixed outline width)
|
|
107
|
-
*
|
|
108
|
-
* Currently supports outline style only.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```typescript
|
|
112
|
-
* const viewer = new Viewer("cesiumContainer");
|
|
113
|
-
* const silhouetteHighlight = new SilhouetteHighlight(viewer);
|
|
114
|
-
*
|
|
115
|
-
* // Highlight an object
|
|
116
|
-
* const entity = viewer.entities.add(new Entity({
|
|
117
|
-
* model: new ModelGraphics(),
|
|
118
|
-
* }));
|
|
119
|
-
* silhouetteHighlight.show(entity);
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
declare class SilhouetteHighlight implements IHighlight {
|
|
123
|
-
private _color;
|
|
124
|
-
private _silhouette;
|
|
125
|
-
private _composite;
|
|
126
|
-
private _stages;
|
|
127
|
-
private _entity?;
|
|
128
|
-
/**
|
|
129
|
-
* Creates a new `Silhouette` instance.
|
|
130
|
-
* @param viewer A viewer to create highlight silhouette in
|
|
131
|
-
*/
|
|
132
|
-
constructor(viewer: Viewer);
|
|
133
|
-
/**
|
|
134
|
-
* Highlights a picked `Cesium3DTileset` by updating silhouette composite.
|
|
135
|
-
* @param object The object to be highlighted.
|
|
136
|
-
* @param options Optional style for the highlight.
|
|
137
|
-
*/
|
|
138
|
-
show(object: Cesium3DTileFeature, options?: HighlightOptions): void;
|
|
139
|
-
/**
|
|
140
|
-
* Highlights a picked `Entity` by updating the model properties.
|
|
141
|
-
* @param object The object to be highlighted.
|
|
142
|
-
* @param options Optional style for the highlight.
|
|
143
|
-
*/
|
|
144
|
-
show(object: Entity, options?: HighlightOptions): void;
|
|
145
|
-
/** Clears the current highlight */
|
|
146
|
-
hide(): void;
|
|
147
|
-
/** Clean up the instances */
|
|
148
|
-
destroy(): void;
|
|
149
|
-
/** Gets the highlight color. */
|
|
150
|
-
get color(): Color;
|
|
151
|
-
/** Sets the highlight color. */
|
|
152
|
-
set color(color: Color);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @class
|
|
157
|
-
* A flyweight implementation for highlighting 2D surface objects in Cesium.
|
|
158
|
-
*
|
|
159
|
-
* This class provides highlighting for ground-clamped geometries (polygons, polylines, rectangles)
|
|
160
|
-
*
|
|
161
|
-
* **Supported Geometry Types:**
|
|
162
|
-
* - `Entity` with polygon, polyline, or rectangle graphics
|
|
163
|
-
* - `GroundPrimitive` instances
|
|
164
|
-
*
|
|
165
|
-
* **Highlighting Modes:**
|
|
166
|
-
* - **Fill mode** (default): Creates a filled geometry using the original shape
|
|
167
|
-
* - **Outline mode**: Creates a polyline outline of the original geometry
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```typescript
|
|
171
|
-
* // Basic usage
|
|
172
|
-
* const viewer = new Viewer('cesiumContainer');
|
|
173
|
-
* const surfaceHighlight = new SurfaceHighlight(viewer);
|
|
174
|
-
*
|
|
175
|
-
* // Highlight an entity with default red fill
|
|
176
|
-
* const entity = viewer.entities.add(new Entity({
|
|
177
|
-
* polygon: {
|
|
178
|
-
* hierarchy: Cartesian3.fromDegreesArray([-75, 35, -74, 35, -74, 36, -75, 36]),
|
|
179
|
-
* material: Color.BLUE
|
|
180
|
-
* }
|
|
181
|
-
* }));
|
|
182
|
-
* surfaceHighlight.show(entity);
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
declare class SurfaceHighlight implements IHighlight {
|
|
186
|
-
private _color;
|
|
187
|
-
private _entity;
|
|
188
|
-
private _entities;
|
|
189
|
-
/**
|
|
190
|
-
* Creates a new `SurfaceHighlight` instance.
|
|
191
|
-
* @param viewer A viewer to create highlight entity in
|
|
192
|
-
*/
|
|
193
|
-
constructor(viewer: Viewer);
|
|
194
|
-
/**
|
|
195
|
-
* Highlights a picked object by updating the reusable entity
|
|
196
|
-
* @param object The object to be highlighted.
|
|
197
|
-
* @param options Optional style for the highlight.
|
|
198
|
-
* @see {@link HighlightOptions}
|
|
199
|
-
*/
|
|
200
|
-
show(object: Entity | GroundPrimitive, options?: HighlightOptions): Entity | undefined;
|
|
201
|
-
/**
|
|
202
|
-
* Removes all geometry properties from the highlight entity
|
|
203
|
-
* @private
|
|
204
|
-
*/
|
|
205
|
-
private _clearGeometries;
|
|
206
|
-
/**
|
|
207
|
-
* Updates the highlight entity from an Entity object
|
|
208
|
-
* @private
|
|
209
|
-
*/
|
|
210
|
-
private _update;
|
|
211
|
-
/**
|
|
212
|
-
* Clears the current highlight
|
|
213
|
-
*/
|
|
214
|
-
hide(): void;
|
|
215
|
-
/** Clean up the instances */
|
|
216
|
-
destroy(): void;
|
|
217
|
-
/** Gets the highlight color. */
|
|
218
|
-
get color(): Color;
|
|
219
|
-
/** Sets the highlight color. */
|
|
220
|
-
set color(color: Color);
|
|
221
|
-
/** Gets the highlight entity */
|
|
222
|
-
get entity(): Entity;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export { Highlight, type HighlightOptions, type IHighlight, type Picked, type PickedObject, SilhouetteHighlight, SurfaceHighlight };
|
|
6
|
+
import 'cesium';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,225 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { TerrainVisualizer, isGetterOnly } from './utils/index.js';
|
|
1
|
+
export { C as Collection, N as NonFunction, i as isGetterOnly } from './index-Bd_-DTWl.js';
|
|
2
|
+
export { Highlight, SilhouetteHighlight, SurfaceHighlight } from './highlight/index.js';
|
|
3
|
+
export { HybridTerrainProvider, TerrainArea } from './terrain/index.js';
|
|
4
|
+
export { TerrainVisualizer } from './utils/index.js';
|
|
6
5
|
export { cloneViewer, syncCamera } from './viewer/index.js';
|
|
7
|
-
|
|
8
|
-
interface IHighlight {
|
|
9
|
-
show(object: any, options?: HighlightOptions): void;
|
|
10
|
-
hide(): void;
|
|
11
|
-
destroy(): void;
|
|
12
|
-
color: Color;
|
|
13
|
-
}
|
|
14
|
-
interface HighlightOptions {
|
|
15
|
-
/** Color of the highlight */
|
|
16
|
-
color?: Color;
|
|
17
|
-
/** To apply outline style for the highlight */
|
|
18
|
-
outline?: boolean;
|
|
19
|
-
/** Outline width */
|
|
20
|
-
width?: number;
|
|
21
|
-
}
|
|
22
|
-
type PickedObject = {
|
|
23
|
-
id?: Entity;
|
|
24
|
-
primitive?: Primitive | GroundPrimitive | Model | Cesium3DTileset;
|
|
25
|
-
tileset?: Cesium3DTileset;
|
|
26
|
-
detail?: {
|
|
27
|
-
model?: Model;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
type Picked = Entity | Cesium3DTileFeature | GroundPrimitive | PickedObject;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @class
|
|
34
|
-
* Lightweight multiton highlight manager for Cesium using flyweight pattern.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```
|
|
38
|
-
* // Setup
|
|
39
|
-
* const viewer1 = new Viewer('cesiumContainer1');
|
|
40
|
-
* const viewer2 = new Viewer('cesiumContainer2');
|
|
41
|
-
*
|
|
42
|
-
* const highlighter1 = Highlight.getInstance(viewer1);
|
|
43
|
-
* const highlighter2 = Highlight.getInstance(viewer2);
|
|
44
|
-
*
|
|
45
|
-
* // This highlight only affects viewer1
|
|
46
|
-
* highlighter1.show(someEntity, { color: Color.RED });
|
|
47
|
-
*
|
|
48
|
-
* // This highlight only affects viewer2
|
|
49
|
-
* highlighter2.show(someEntity, { color: Color.BLUE });
|
|
50
|
-
*
|
|
51
|
-
* // When done with viewers
|
|
52
|
-
* Highlight.releaseInstance(viewer1);
|
|
53
|
-
* Highlight.releaseInstance(viewer2);
|
|
54
|
-
* viewer1.destroy();
|
|
55
|
-
* viewer2.destroy();
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
declare class Highlight {
|
|
59
|
-
private static instances;
|
|
60
|
-
private _surface;
|
|
61
|
-
private _silhouette;
|
|
62
|
-
private _color;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a new `Highlight` instance.
|
|
65
|
-
* @private Use {@link getInstance `Highlight.getInstance()`}
|
|
66
|
-
* @param viewer A viewer to create highlight entity in
|
|
67
|
-
*/
|
|
68
|
-
private constructor();
|
|
69
|
-
/**
|
|
70
|
-
* Gets or creates highlight instance from a viewer.
|
|
71
|
-
* @param viewer The viewer to get or create a new instance from.
|
|
72
|
-
*/
|
|
73
|
-
static getInstance(viewer: Viewer): Highlight;
|
|
74
|
-
/**
|
|
75
|
-
* Releases the highlight instance associated with a viewer.
|
|
76
|
-
* @param viewer The viewer whose highlight instance should be released.
|
|
77
|
-
*/
|
|
78
|
-
static releaseInstance(viewer: Viewer): void;
|
|
79
|
-
/**
|
|
80
|
-
* Highlights a picked object or a direct instance.
|
|
81
|
-
* @param picked The result of `Scene.pick()` or direct instance to be highlighted.
|
|
82
|
-
* @param options Optional style for the highlight.
|
|
83
|
-
* @see {@link HighlightOptions}
|
|
84
|
-
*/
|
|
85
|
-
show(picked: Picked, options?: HighlightOptions): void | Entity;
|
|
86
|
-
private _getObject;
|
|
87
|
-
/**
|
|
88
|
-
* Clears the current highlight effects.
|
|
89
|
-
*/
|
|
90
|
-
hide(): void;
|
|
91
|
-
/** Gets the highlight color. */
|
|
92
|
-
get color(): Color;
|
|
93
|
-
/**
|
|
94
|
-
* Sets the highlight color.
|
|
95
|
-
* @param color The new color for highlights
|
|
96
|
-
*/
|
|
97
|
-
set color(color: Color);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @class
|
|
102
|
-
* An implementation for highlighting 3D objects in Cesium.
|
|
103
|
-
*
|
|
104
|
-
* **Supported Object Types:**
|
|
105
|
-
* - `Entity` with model graphics. (adjustable outline width)
|
|
106
|
-
* - `Cesium3DTileset` instances. (fixed outline width)
|
|
107
|
-
*
|
|
108
|
-
* Currently supports outline style only.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```typescript
|
|
112
|
-
* const viewer = new Viewer("cesiumContainer");
|
|
113
|
-
* const silhouetteHighlight = new SilhouetteHighlight(viewer);
|
|
114
|
-
*
|
|
115
|
-
* // Highlight an object
|
|
116
|
-
* const entity = viewer.entities.add(new Entity({
|
|
117
|
-
* model: new ModelGraphics(),
|
|
118
|
-
* }));
|
|
119
|
-
* silhouetteHighlight.show(entity);
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
declare class SilhouetteHighlight implements IHighlight {
|
|
123
|
-
private _color;
|
|
124
|
-
private _silhouette;
|
|
125
|
-
private _composite;
|
|
126
|
-
private _stages;
|
|
127
|
-
private _entity?;
|
|
128
|
-
/**
|
|
129
|
-
* Creates a new `Silhouette` instance.
|
|
130
|
-
* @param viewer A viewer to create highlight silhouette in
|
|
131
|
-
*/
|
|
132
|
-
constructor(viewer: Viewer);
|
|
133
|
-
/**
|
|
134
|
-
* Highlights a picked `Cesium3DTileset` by updating silhouette composite.
|
|
135
|
-
* @param object The object to be highlighted.
|
|
136
|
-
* @param options Optional style for the highlight.
|
|
137
|
-
*/
|
|
138
|
-
show(object: Cesium3DTileFeature, options?: HighlightOptions): void;
|
|
139
|
-
/**
|
|
140
|
-
* Highlights a picked `Entity` by updating the model properties.
|
|
141
|
-
* @param object The object to be highlighted.
|
|
142
|
-
* @param options Optional style for the highlight.
|
|
143
|
-
*/
|
|
144
|
-
show(object: Entity, options?: HighlightOptions): void;
|
|
145
|
-
/** Clears the current highlight */
|
|
146
|
-
hide(): void;
|
|
147
|
-
/** Clean up the instances */
|
|
148
|
-
destroy(): void;
|
|
149
|
-
/** Gets the highlight color. */
|
|
150
|
-
get color(): Color;
|
|
151
|
-
/** Sets the highlight color. */
|
|
152
|
-
set color(color: Color);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @class
|
|
157
|
-
* A flyweight implementation for highlighting 2D surface objects in Cesium.
|
|
158
|
-
*
|
|
159
|
-
* This class provides highlighting for ground-clamped geometries (polygons, polylines, rectangles)
|
|
160
|
-
*
|
|
161
|
-
* **Supported Geometry Types:**
|
|
162
|
-
* - `Entity` with polygon, polyline, or rectangle graphics
|
|
163
|
-
* - `GroundPrimitive` instances
|
|
164
|
-
*
|
|
165
|
-
* **Highlighting Modes:**
|
|
166
|
-
* - **Fill mode** (default): Creates a filled geometry using the original shape
|
|
167
|
-
* - **Outline mode**: Creates a polyline outline of the original geometry
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```typescript
|
|
171
|
-
* // Basic usage
|
|
172
|
-
* const viewer = new Viewer('cesiumContainer');
|
|
173
|
-
* const surfaceHighlight = new SurfaceHighlight(viewer);
|
|
174
|
-
*
|
|
175
|
-
* // Highlight an entity with default red fill
|
|
176
|
-
* const entity = viewer.entities.add(new Entity({
|
|
177
|
-
* polygon: {
|
|
178
|
-
* hierarchy: Cartesian3.fromDegreesArray([-75, 35, -74, 35, -74, 36, -75, 36]),
|
|
179
|
-
* material: Color.BLUE
|
|
180
|
-
* }
|
|
181
|
-
* }));
|
|
182
|
-
* surfaceHighlight.show(entity);
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
declare class SurfaceHighlight implements IHighlight {
|
|
186
|
-
private _color;
|
|
187
|
-
private _entity;
|
|
188
|
-
private _entities;
|
|
189
|
-
/**
|
|
190
|
-
* Creates a new `SurfaceHighlight` instance.
|
|
191
|
-
* @param viewer A viewer to create highlight entity in
|
|
192
|
-
*/
|
|
193
|
-
constructor(viewer: Viewer);
|
|
194
|
-
/**
|
|
195
|
-
* Highlights a picked object by updating the reusable entity
|
|
196
|
-
* @param object The object to be highlighted.
|
|
197
|
-
* @param options Optional style for the highlight.
|
|
198
|
-
* @see {@link HighlightOptions}
|
|
199
|
-
*/
|
|
200
|
-
show(object: Entity | GroundPrimitive, options?: HighlightOptions): Entity | undefined;
|
|
201
|
-
/**
|
|
202
|
-
* Removes all geometry properties from the highlight entity
|
|
203
|
-
* @private
|
|
204
|
-
*/
|
|
205
|
-
private _clearGeometries;
|
|
206
|
-
/**
|
|
207
|
-
* Updates the highlight entity from an Entity object
|
|
208
|
-
* @private
|
|
209
|
-
*/
|
|
210
|
-
private _update;
|
|
211
|
-
/**
|
|
212
|
-
* Clears the current highlight
|
|
213
|
-
*/
|
|
214
|
-
hide(): void;
|
|
215
|
-
/** Clean up the instances */
|
|
216
|
-
destroy(): void;
|
|
217
|
-
/** Gets the highlight color. */
|
|
218
|
-
get color(): Color;
|
|
219
|
-
/** Sets the highlight color. */
|
|
220
|
-
set color(color: Color);
|
|
221
|
-
/** Gets the highlight entity */
|
|
222
|
-
get entity(): Entity;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export { Highlight, type HighlightOptions, type IHighlight, type Picked, type PickedObject, SilhouetteHighlight, SurfaceHighlight };
|
|
6
|
+
import 'cesium';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-RXMNSDKR.js";import{a as
|
|
1
|
+
import"./chunk-RXMNSDKR.js";import{a as o,b as t,c as m}from"./chunk-RZ3PTU3G.js";import{a as l,b as p}from"./chunk-BXU5HNPI.js";import{a as r,b as i,c as e}from"./chunk-4HY6RL6I.js";import{a,b as h}from"./chunk-2JNRK7SN.js";export{e as Collection,m as Highlight,p as HybridTerrainProvider,o as SilhouetteHighlight,t as SurfaceHighlight,l as TerrainArea,r as TerrainVisualizer,h as cloneViewer,i as isGetterOnly,a as syncCamera};
|
package/dist/terrain/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var C=(n,r)=>{for(var i in r)v(n,i,{get:r[i],enumerable:!0})},x=(n,r,i,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of y(r))!R.call(n,e)&&e!==i&&v(n,e,{get:()=>r[e],enumerable:!(t=p(r,e))||t.enumerable});return n};var I=n=>x(v({},"__esModule",{value:!0}),n);var N={};C(N,{HybridTerrainProvider:()=>c,TerrainArea:()=>m});module.exports=I(N);var d=require("cesium");var P=require("cesium");var l=class{_terrainProvider;_rectangle;_tileRanges;_ready=!1;_credit;_isCustom;constructor(r){this._terrainProvider=r.terrainProvider,this._tileRanges=r.tileRanges,this._credit=r.credit||"custom",this._isCustom=r.isCustom!==void 0?r.isCustom:!0,this._rectangle=c.computeRectangle(r.terrainProvider.tilingScheme,r.tileRanges),r.tileRanges.forEach((i,t)=>{this._terrainProvider.availability?.addAvailableTileRange(t,i.start.x,i.start.y,i.end.x,i.end.y)}),this._ready=!0}contains(r,i,t){if(this._tileRanges.size===0||!this._tileRanges.has(t))return!1;let e=this._tileRanges.get(t);return r>=e.start.x&&r<=e.end.x&&i>=e.start.y&&i<=e.end.y}requestTileGeometry(r,i,t,e){if(!(!this._ready||!this.contains(r,i,t)))return this._terrainProvider.requestTileGeometry(r,i,t,e)}getTileDataAvailable(r,i,t){if(this._tileRanges.size===0||!this._tileRanges.has(t))return!1;let e=this._tileRanges.get(t);return r>=e.start.x&&r<=e.end.x&&i>=e.start.y&&i<=e.end.y}get isCustom(){return this._isCustom}get credit(){return this._credit}get terrainProvider(){return this._terrainProvider}get tileRanges(){return this._tileRanges}get rectangle(){return this._rectangle}get ready(){return this._ready}};(i=>{async function n(t,e,a){let s=a?.credit||"custom",o=await P.CesiumTerrainProvider.fromUrl(t,{...a,credit:s});return new i({terrainProvider:o,tileRanges:e,credit:s})}i.fromUrl=n;class r extends Array{add(e){if(Array.isArray(e)){for(let s of e)this.add(s);return this}let a;return e instanceof i?a=e:a=new i(e),this.push(a),this}remove(e){if(Array.isArray(e))return e.forEach(s=>this.remove(s)),this;let a=this.indexOf(e);return a>=0&&this.splice(a,1),this}removeAll(){this.length=0}}i.Collection=r})(l||={});var m=l;var u=class{_terrainAreas;_terrainProvider;_fallbackProvider;_tilingScheme;_ready=!1;_availability;constructor(r){this._terrainProvider=r.terrainProvider,this._fallbackProvider=r.fallbackProvider||new d.EllipsoidTerrainProvider,this._tilingScheme=r.terrainProvider.tilingScheme,this._terrainAreas=new m.Collection(...r.terrainAreas),this._availability=r.terrainProvider.availability,this._ready=!0}get ready(){return this._ready}get tilingScheme(){return this._tilingScheme}get availability(){return this._availability}get terrainAreas(){return[...this._terrainAreas]}get defaultProvider(){return this._terrainProvider}get fallbackProvider(){return this._fallbackProvider}get credit(){return this._terrainProvider?.credit}get errorEvent(){return this._terrainProvider.errorEvent}get hasWaterMask(){return this._terrainProvider.hasWaterMask}get hasVertexNormals(){return this._terrainProvider.hasVertexNormals}loadTileDataAvailability(r,i,t){return this._terrainProvider.loadTileDataAvailability(r,i,t)}getLevelMaximumGeometricError(r){return this._terrainProvider.getLevelMaximumGeometricError(r)}requestTileGeometry(r,i,t,e){if(this._ready){for(let a of this._terrainAreas)if(a.contains(r,i,t))return a.requestTileGeometry(r,i,t,e);return this._terrainProvider.getTileDataAvailable(r,i,t)?this._terrainProvider.requestTileGeometry(r,i,t,e):this._fallbackProvider.requestTileGeometry(r,i,t,e)}}getTileDataAvailable(r,i,t){for(let e of this._terrainAreas)if(e.contains(r,i,t))return e.getTileDataAvailable(r,i,t);return this._terrainProvider.getTileDataAvailable(r,i,t)}};(r=>{function n(i,t){if(t.size===0)return new d.Rectangle;let e=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,T=Array.from(t.keys()),h=Math.min(...T),b=t.get(h);if(b){let{start:g,end:f}=b,_=i.tileXYToRectangle(g.x,g.y,h),A=i.tileXYToRectangle(f.x,f.y,h);e=Math.min(_.west,e),a=Math.min(A.south,a),s=Math.max(A.east,s),o=Math.max(_.north,o)}return new d.Rectangle(e,a,s,o)}r.computeRectangle=n})(u||={});var c=u;
|