cesium_dev_kit 1.1.21 → 1.1.23

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +293 -291
  3. package/README.zh-CN.md +274 -0
  4. package/SECURITY.md +21 -0
  5. package/dist/Analysis-BLpVrGfg.d.mts +143 -0
  6. package/dist/Analysis-DmO1gtgS.d.ts +143 -0
  7. package/dist/Base-DH8H9suE.d.mts +635 -0
  8. package/dist/Base-DH8H9suE.d.ts +635 -0
  9. package/dist/Base-_BOXyMdS.d.ts +43 -0
  10. package/dist/Base-skqjcPfo.d.mts +43 -0
  11. package/dist/Control-B7AMFmHe.d.ts +98 -0
  12. package/dist/Control-BrpRU7RP.d.mts +98 -0
  13. package/dist/CustomCesiumPlugin-BqgAvlhi.d.ts +29 -0
  14. package/dist/CustomCesiumPlugin-CKYQ-7i9.d.mts +29 -0
  15. package/dist/Draw-1NhPP8z3.d.mts +490 -0
  16. package/dist/Draw-DRh7yNzc.d.ts +490 -0
  17. package/dist/Graphics-CuFNsQ3b.d.ts +1565 -0
  18. package/dist/Graphics-QE3Gb43w.d.mts +1565 -0
  19. package/dist/Material-CeZ4l-tY.d.mts +165 -0
  20. package/dist/Material-Cqbyf2Pn.d.ts +165 -0
  21. package/dist/Math3d-0nO-vFbT.d.mts +179 -0
  22. package/dist/Math3d-t635PYzU.d.ts +179 -0
  23. package/dist/PassEffect-DEFyytQZ.d.ts +41 -0
  24. package/dist/PassEffect-DEgElnVk.d.mts +41 -0
  25. package/dist/Plugin-BPCX0zTu.d.mts +197 -0
  26. package/dist/Plugin-DnYT0bue.d.ts +197 -0
  27. package/dist/Primitive-BNXp-9_6.d.mts +199 -0
  28. package/dist/Primitive-UEAuUimH.d.ts +199 -0
  29. package/dist/ThreeJs-BAlEWxa1.d.mts +44 -0
  30. package/dist/ThreeJs-DpAcw_qf.d.ts +44 -0
  31. package/dist/analysis.cjs +145 -0
  32. package/dist/analysis.cjs.map +1 -0
  33. package/dist/analysis.d.mts +6 -0
  34. package/dist/analysis.d.ts +6 -0
  35. package/dist/analysis.mjs +145 -0
  36. package/dist/analysis.mjs.map +1 -0
  37. package/dist/control.cjs +140 -0
  38. package/dist/control.cjs.map +1 -0
  39. package/dist/control.d.mts +4 -0
  40. package/dist/control.d.ts +4 -0
  41. package/dist/control.mjs +140 -0
  42. package/dist/control.mjs.map +1 -0
  43. package/dist/custom-cesium-plugin.cjs +507 -0
  44. package/dist/custom-cesium-plugin.cjs.map +1 -0
  45. package/dist/custom-cesium-plugin.d.mts +4 -0
  46. package/dist/custom-cesium-plugin.d.ts +4 -0
  47. package/dist/custom-cesium-plugin.mjs +507 -0
  48. package/dist/custom-cesium-plugin.mjs.map +1 -0
  49. package/dist/default-static.cjs +3 -0
  50. package/dist/default-static.cjs.map +1 -0
  51. package/dist/default-static.d.mts +37 -0
  52. package/dist/default-static.d.ts +37 -0
  53. package/dist/default-static.mjs +3 -0
  54. package/dist/default-static.mjs.map +1 -0
  55. package/dist/draw.cjs +140 -0
  56. package/dist/draw.cjs.map +1 -0
  57. package/dist/draw.d.mts +6 -0
  58. package/dist/draw.d.ts +6 -0
  59. package/dist/draw.mjs +140 -0
  60. package/dist/draw.mjs.map +1 -0
  61. package/dist/graphics.cjs +140 -0
  62. package/dist/graphics.cjs.map +1 -0
  63. package/dist/graphics.d.mts +19 -0
  64. package/dist/graphics.d.ts +19 -0
  65. package/dist/graphics.mjs +140 -0
  66. package/dist/graphics.mjs.map +1 -0
  67. package/dist/index.cjs +1030 -0
  68. package/dist/index.cjs.map +1 -0
  69. package/dist/index.d.mts +338 -0
  70. package/dist/index.d.ts +338 -0
  71. package/dist/index.mjs +1030 -0
  72. package/dist/index.mjs.map +1 -0
  73. package/dist/material.cjs +391 -0
  74. package/dist/material.cjs.map +1 -0
  75. package/dist/material.d.mts +4 -0
  76. package/dist/material.d.ts +4 -0
  77. package/dist/material.mjs +391 -0
  78. package/dist/material.mjs.map +1 -0
  79. package/dist/pass-effect.cjs +416 -0
  80. package/dist/pass-effect.cjs.map +1 -0
  81. package/dist/pass-effect.d.mts +4 -0
  82. package/dist/pass-effect.d.ts +4 -0
  83. package/dist/pass-effect.mjs +416 -0
  84. package/dist/pass-effect.mjs.map +1 -0
  85. package/dist/plugin.cjs +141 -0
  86. package/dist/plugin.cjs.map +1 -0
  87. package/dist/plugin.d.mts +4 -0
  88. package/dist/plugin.d.ts +4 -0
  89. package/dist/plugin.mjs +141 -0
  90. package/dist/plugin.mjs.map +1 -0
  91. package/dist/primitive.cjs +370 -0
  92. package/dist/primitive.cjs.map +1 -0
  93. package/dist/primitive.d.mts +4 -0
  94. package/dist/primitive.d.ts +4 -0
  95. package/dist/primitive.mjs +370 -0
  96. package/dist/primitive.mjs.map +1 -0
  97. package/dist/three.cjs +140 -0
  98. package/dist/three.cjs.map +1 -0
  99. package/dist/three.d.mts +4 -0
  100. package/dist/three.d.ts +4 -0
  101. package/dist/three.mjs +140 -0
  102. package/dist/three.mjs.map +1 -0
  103. package/package.json +289 -46
  104. package/dist/index.js +0 -1
  105. package/dist/index.min.js +0 -1
  106. package/dist/index.umd.js +0 -1
  107. package/index.js +0 -37
@@ -0,0 +1,635 @@
1
+ import { Viewer as Viewer$1 } from 'cesium';
2
+
3
+ /** cesium Viewer 实例类型(来自 `cesium` 包,仅类型引用,不影响打包体积) */
4
+ type Viewer = Viewer$1;
5
+ /** cesium 全局对象类型(宽松:具体成员类型由使用方传入的 cesiumGlobal 决定) */
6
+ type CesiumGlobal = Record<string, any>;
7
+ /** 模块内部持有的 cesium 全局对象 */
8
+ /** 静态资源(defaultStatic)配置 */
9
+ interface StaticResourceConf {
10
+ /** 静态资源服务前缀 */
11
+ baseService: string;
12
+ /** 天空盒 / 图标等资源的分组配置 */
13
+ skyBox?: Record<string, Record<string, string>>;
14
+ /** 其它静态资源分组 */
15
+ [group: string]: unknown;
16
+ }
17
+ /** 84 坐标信息 */
18
+ interface WGS84Type {
19
+ lng: number;
20
+ lat: number;
21
+ alt?: number;
22
+ lon?: number;
23
+ }
24
+ /** 屏幕事件回调收到的 movement 数据 */
25
+ type ScreenSpaceEventMovement = any;
26
+ /** 鼠标事件回调 */
27
+ type MouseEventHandler = (event: ScreenSpaceEventMovement, handlers: any) => void;
28
+ /** bindHandleEvent 支持注册的鼠标事件 */
29
+ interface BindHandleEventOptions {
30
+ leftClick?: MouseEventHandler;
31
+ mouseMove?: MouseEventHandler;
32
+ doubleClick?: MouseEventHandler;
33
+ leftDown?: MouseEventHandler;
34
+ mouseWheel?: MouseEventHandler;
35
+ leftUp?: MouseEventHandler;
36
+ }
37
+ declare const Base: {
38
+ new (viewer?: any, cesiumGlobal?: CesiumGlobal, defaultStatic?: StaticResourceConf): {
39
+ _viewer: any;
40
+ _drawLayer: any;
41
+ /** 模块标识,如 'base' */
42
+ type: string;
43
+ /** 模块标识(与 {@link type} 相同) */
44
+ id: string;
45
+ /** @deprecated 拼写无意义,请使用 {@link type} / {@link id} */
46
+ myname: string;
47
+ /** 释放当前模块持有的监听器 / DataSource(幂等) */
48
+ destroy: () => void;
49
+ /**
50
+ * 创建一个Graphics实体
51
+ * @function
52
+ * @returns {Entity} Entity
53
+ * @example
54
+ * import { Base } from 'cesium_dev_kit'
55
+ * const baseObj = new Base({
56
+ * cesiumGlobal: Cesium,
57
+ * containerId: 'cesiumContainer'
58
+ * })
59
+ * const entity = baseObj.base.createGraphics()
60
+ */
61
+ createGraphics(): any;
62
+ /**
63
+ * 判断对象是否有某个属性
64
+ * @private
65
+ * @param {object} obj 对象
66
+ * @param {string} field 属性字段
67
+ * @param {string} defVal 默认返回
68
+ * @returns {string}
69
+ */
70
+ _objHasOwnProperty(obj: any, field: any, defVal: any): any;
71
+ getDfSt(attrArr: any): any;
72
+ /**
73
+ * 天空盒
74
+ * @function
75
+ * @returns {SkyBox} SkyBox
76
+ * @example
77
+ * import { Base } from 'cesium_dev_kit'
78
+ * const baseObj = new Base({
79
+ * cesiumGlobal: Cesium,
80
+ * containerId: 'cesiumContainer'
81
+ * })
82
+ * baseObj.base.setOneSkyBox()
83
+ */
84
+ setOneSkyBox(): any;
85
+ /**
86
+ * 天空盒2
87
+ * @function
88
+ * @returns {SkyBox} SkyBox
89
+ * @example
90
+ * import { Base } from 'cesium_dev_kit'
91
+ * const baseObj = new Base({
92
+ * cesiumGlobal: Cesium,
93
+ * containerId: 'cesiumContainer'
94
+ * })
95
+ * baseObj.base.setTwoSkyBox()
96
+ */
97
+ setTwoSkyBox(): any;
98
+ /**
99
+ * 天空盒3
100
+ * @function
101
+ * @returns {SkyBox} SkyBox
102
+ * @example
103
+ * import { Base } from 'cesium_dev_kit'
104
+ * const baseObj = new Base({
105
+ * cesiumGlobal: Cesium,
106
+ * containerId: 'cesiumContainer'
107
+ * })
108
+ * baseObj.base.setThreeSkyBox()
109
+ */
110
+ setThreeSkyBox(): any;
111
+ /**
112
+ * 近景天空盒
113
+ * @function
114
+ * @returns {GroundSkyBox} SkyBox
115
+ * @see {@link module:Base#SkyBoxOnGround|SkyBoxOnGround}
116
+ * @example
117
+ * import { Base } from 'cesium_dev_kit'
118
+ * const baseObj = new Base({
119
+ * cesiumGlobal: Cesium,
120
+ * containerId: 'cesiumContainer'
121
+ * })
122
+ * baseObj.base.setOneGroundSkyBox()
123
+ */
124
+ setOneGroundSkyBox(): any;
125
+ /**
126
+ * 近景天空盒2
127
+ * @function
128
+ * @returns {GroundSkyBox} SkyBox
129
+ * @see {@link module:Base#SkyBoxOnGround|SkyBoxOnGround}
130
+ * @example
131
+ * import { Base } from 'cesium_dev_kit'
132
+ * const baseObj = new Base({
133
+ * cesiumGlobal: Cesium,
134
+ * containerId: 'cesiumContainer'
135
+ * })
136
+ * baseObj.base.setTwoGroundSkyBox()
137
+ */
138
+ setTwoGroundSkyBox(): any;
139
+ /**
140
+ * 近景天空盒3
141
+ * @function
142
+ * @returns {GroundSkyBox} SkyBox
143
+ * @see {@link module:Base#SkyBoxOnGround|SkyBoxOnGround}
144
+ * @example
145
+ * import { Base } from 'cesium_dev_kit'
146
+ * const baseObj = new Base({
147
+ * cesiumGlobal: Cesium,
148
+ * containerId: 'cesiumContainer'
149
+ * })
150
+ * baseObj.base.setThreeGroundSkyBox()
151
+ */
152
+ setThreeGroundSkyBox(): any;
153
+ /**
154
+ * 黑夜特效
155
+ * @function
156
+ * @param {object} options
157
+ * @param {Cartesian3} options.offset - 偏移
158
+ * @example
159
+ * import { Base } from 'cesium_dev_kit'
160
+ * const baseObj = new Base({
161
+ * cesiumGlobal: Cesium,
162
+ * containerId: 'cesiumContainer'
163
+ * })
164
+ * baseObj.base.setDarkEffect({offset:new Cesium.Cartesian3(0.1, 0.2, 0.3)})
165
+ * @returns {postProcessStages} postProcessStages 实例
166
+ */
167
+ setDarkEffect(options: any): any;
168
+ /**
169
+ * 场景蓝光
170
+ * @function
171
+ * @param {object} options
172
+ * @param {number} options.width - 曝光区域宽度
173
+ * @param {number} options.height - 曝光区域高度
174
+ * @example
175
+ * import { Base } from 'cesium_dev_kit'
176
+ * const baseObj = new Base({
177
+ * cesiumGlobal: Cesium,
178
+ * containerId: 'cesiumContainer'
179
+ * })
180
+ * baseObj.base.setBlurBloom({width:80,height:97})
181
+ * @returns {postProcessStages} postProcessStages 实例
182
+ */
183
+ setBlurBloom(options: any): any;
184
+ /**
185
+ * 雨天特效
186
+ * @function
187
+ * @example
188
+ * import { Base } from 'cesium_dev_kit'
189
+ * const baseObj = new Base({
190
+ * cesiumGlobal: Cesium,
191
+ * containerId: 'cesiumContainer'
192
+ * })
193
+ * baseObj.base.setRainEffect()
194
+ * @returns {postProcessStages} postProcessStages 实例
195
+ */
196
+ setRainEffect(): any;
197
+ /**
198
+ * 雪天特效
199
+ * @function
200
+ * @example
201
+ * import { Base } from 'cesium_dev_kit'
202
+ * const baseObj = new Base({
203
+ * cesiumGlobal: Cesium,
204
+ * containerId: 'cesiumContainer'
205
+ * })
206
+ * baseObj.base.setSnowEffect()
207
+ * @returns {postProcessStages} postProcessStages 实例
208
+ */
209
+ setSnowEffect(): any;
210
+ /**
211
+ * 雾天
212
+ * @function
213
+ * @example
214
+ * import { Base } from 'cesium_dev_kit'
215
+ * const baseObj = new Base({
216
+ * cesiumGlobal: Cesium,
217
+ * containerId: 'cesiumContainer'
218
+ * })
219
+ * baseObj.base.setFogEffect()
220
+ * @returns {postProcessStages} postProcessStages 实例
221
+ */
222
+ setFogEffect(): any;
223
+ /**
224
+ * 默认场景配置
225
+ * @function
226
+ * @example
227
+ * import { Base } from 'cesium_dev_kit'
228
+ * const baseObj = new Base({
229
+ * cesiumGlobal: Cesium,
230
+ * containerId: 'cesiumContainer'
231
+ * })
232
+ * baseObj.base.setDefSceneConfig()
233
+ */
234
+ setDefSceneConfig(): void;
235
+ /**
236
+ * 场景泛光
237
+ * @function
238
+ * @example
239
+ * import { Base } from 'cesium_dev_kit'
240
+ * const baseObj = new Base({
241
+ * cesiumGlobal: Cesium,
242
+ * containerId: 'cesiumContainer'
243
+ * })
244
+ * baseObj.base.setBloomLightScene()
245
+ */
246
+ setBloomLightScene(): void;
247
+ /**
248
+ * 删除后置效果
249
+ * @function
250
+ * @param {Array} stage -后置场景对象数组
251
+ */
252
+ removePostProcessStage(stage: any): void;
253
+ /**
254
+ * 相机定位
255
+ * @function
256
+ * @param {object} options
257
+ * @param {Cartesian3} options.position - 目标位置数组
258
+ * @param {number} options.distance - 距离
259
+ * @param {object} options.orientation - 方位,包含[朝向|倾斜角|翻滚角]
260
+ * @example
261
+ * import { Base } from 'cesium_dev_kit'
262
+ * const baseObj = new Base({
263
+ * cesiumGlobal: Cesium,
264
+ * containerId: 'cesiumContainer'
265
+ * })
266
+ * baseObj.base.setView({
267
+ position: new Cesium.Cartesian3(-1337035.7496454942, 5285202.940044943, 3305373.990594733),
268
+ orientation: {
269
+ heading: 6.108097731064569,
270
+ pitch: -0.15254104473396812,
271
+ roll: 6.283157460498558,
272
+ },
273
+ });
274
+ */
275
+ setView(options: any): void;
276
+ /**
277
+ * 相机飞行
278
+ * @param {object} options
279
+ * @param {Cartesian3} options.position - 目标位置数组
280
+ * @param {number} options.distance - 距离
281
+ * @param {number} options.duration - 过度时长(秒为单位)
282
+ * @param {object} options.orientation - 方位,包含[朝向|倾斜角|翻滚角]
283
+ * @param {object} options.easingFunction - 飞行中在duration时间内插值方式
284
+ * @param {Function} options.callback - 操作完成后的回调
285
+ * @example
286
+ * import { Base } from 'cesium_dev_kit'
287
+ * const baseObj = new Base({
288
+ * cesiumGlobal: Cesium,
289
+ * containerId: 'cesiumContainer'
290
+ * })
291
+ * baseObj.base.flyTo({
292
+ position: { x: -1337132.0092982147, y: 5330611.474631115, z: 3228680.029449292 },
293
+ orientation: {
294
+ heading: Cesium.Math.toRadians(1.0114629015290062),
295
+ pitch: Cesium.Math.toRadians(-23.53661660731824),
296
+ roll: Cesium.Math.toRadians(0.00324596311071617)
297
+ },,
298
+ distance:300,
299
+ duration:3
300
+ })
301
+ */
302
+ flyTo(options: any): void;
303
+ /**
304
+ *笛卡尔转坐标WGS84
305
+ * @param {Cartesian3} cartesian - 笛卡尔积坐标数组
306
+ * @example
307
+ * import { Base } from 'cesium_dev_kit'
308
+ * const baseObj = new Base({
309
+ * cesiumGlobal: Cesium,
310
+ * containerId: 'cesiumContainer'
311
+ * })
312
+ * baseObj.base.transformCartesianToWGS84(Cesium.Cartesian3.fromDegrees(110.16018735617934, 31.036076859828338))
313
+ * @returns {WGS84Type} 转换后wgs84坐标对象
314
+ *
315
+ */
316
+ transformCartesianToWGS84(cartesian: any): {
317
+ lng: any;
318
+ lat: any;
319
+ alt: any;
320
+ } | undefined;
321
+ /**
322
+ * 坐标数组转换 笛卡尔转84
323
+ * @function
324
+ * @param {Array<WGS84Type>} WSG84Arr -WSG84Arr坐标数组
325
+ * @param {number} alt - z轴高层
326
+ * @see {@link module:Base#transformWGS84ToCartesian|transformWGS84ToCartesian}
327
+ * @example
328
+ * import { Base } from 'cesium_dev_kit'
329
+ * const baseObj = new Base({
330
+ * cesiumGlobal: Cesium,
331
+ * containerId: 'cesiumContainer'
332
+ * })
333
+ * baseObj.base.transformWGS84ArrayToCartesianArray([{lng:110.16018735617934, lat:31.036076859828338, alt:0 }])
334
+ * @returns {Array<Cartesian3>} 转换后的笛卡尔积数组
335
+ */
336
+ transformWGS84ArrayToCartesianArray(WSG84Arr: any, alt: any): any;
337
+ /**
338
+ * 坐标转换 84转笛卡尔
339
+ * @function
340
+ * @param {WGS84Type} position 坐标数组
341
+ * @param {number} position.lng - 经度
342
+ * @param {number} position.lon - 纬度
343
+ * @param {number} position.lat - z轴
344
+ * @param {number} alt - 高层
345
+ * @example
346
+ * import { Base } from 'cesium_dev_kit'
347
+ * const baseObj = new Base({
348
+ * cesiumGlobal: Cesium,
349
+ * containerId: 'cesiumContainer'
350
+ * })
351
+ * baseObj.base.transformWGS84ToCartesian({lng:110.16018735617934, lat:31.036076859828338, alt:0 },30)
352
+ * @returns {Cartesian3} 转换后的笛卡尔积数组
353
+ */
354
+ transformWGS84ToCartesian(position: any, alt?: any): any;
355
+ /**
356
+ * 笛卡尔积坐标数组转换 84地理坐标
357
+ * @param {Array<Cartesian3>} cartesianArr
358
+ * @see {@link module:Base#transformCartesianToWGS84|transformCartesianToWGS84}
359
+ * @example
360
+ * import { Base } from 'cesium_dev_kit'
361
+ * const baseObj = new Base({
362
+ * cesiumGlobal: Cesium,
363
+ * containerId: 'cesiumContainer'
364
+ * })
365
+ * baseObj.base.transformCartesianArrayToWGS84Array(Cesium.Cartesian3.fromDegreesArray( 110.16018735617934, 31.036076859828338, 110.17845812703679,31.033686527335444))
366
+ * @returns {Array<WGS84Type>} 转换后的笛卡尔积数组
367
+ */
368
+ transformCartesianArrayToWGS84Array(cartesianArr: any): any;
369
+ /**
370
+ * wgs84坐标转地图坐标
371
+ * @param {object<WGS84Type>} position
372
+ * @param {number} position.lng - 经度
373
+ * @param {number} position.lon - 经度
374
+ * @param {number} position.lat - 纬度
375
+ * @param {number} position.alt - z轴
376
+ * @see {@link module:Base#transformCartesianToWGS84|transformCartesianToWGS84}
377
+ * @example
378
+ * import { Base } from 'cesium_dev_kit'
379
+ * const baseObj = new Base({
380
+ * cesiumGlobal: Cesium,
381
+ * containerId: 'cesiumContainer'
382
+ * })
383
+ * const wgs84 = baseObj.base.transformCartesianToWGS84(Cesium.Cartesian3.fromDegrees(110.16018735617934, 31.036076859828338));
384
+ * const cartographic = baseObj.base.transformWGS84ToCartographic(wgs84)
385
+ * // or
386
+ * const cartographic2 = baseObj.base.transformWGS84ToCartographic({lng:110.16018735617934, lat:31.036076859828338, alt:0 });
387
+ * @returns {CartographicType} 地理坐标
388
+ *
389
+ */
390
+ transformWGS84ToCartographic(position: any): any;
391
+ /**
392
+ * 经纬度坐标数组转笛卡尔积世界坐标数组
393
+ * @param {Array[]} lnglats - 经纬度坐标数组
394
+ * @example
395
+ * import { Base } from 'cesium_dev_kit'
396
+ * const baseObj = new Base({
397
+ * cesiumGlobal: Cesium,
398
+ * containerId: 'cesiumContainer'
399
+ * })
400
+ * baseObj.base.lnglatArrayToCartesians([[117,40],[118.41]])
401
+ * @returns {Cartesian3[]} cartesians - 笛卡尔积世界坐标数组
402
+ */
403
+ lnglatArrayToCartesians(lnglats: any): any[];
404
+ /**
405
+ * 相机绕点旋转
406
+ * @function
407
+ * @param {object} options
408
+ * @param {number} options.lng - 经度
409
+ * @param {number} options.lat - 纬度
410
+ * @param {number} options.height - z轴高度
411
+ * @example
412
+ * import { Base } from 'cesium_dev_kit'
413
+ * const BaseObj = new Base({
414
+ * cesiumGlobal: Cesium,
415
+ containerId: 'cesiumContainer'
416
+ })
417
+ * BaseObj.base.setCameraEotateHeading({
418
+ lng: 117.1423291616,
419
+ lat: 39.0645831633,
420
+ height: 15.8
421
+ })
422
+ */
423
+ setCameraEotateHeading(options: any): void;
424
+ /**
425
+ * 拾取位置点
426
+ * @param {Cartesian2} px - 屏幕二维坐标
427
+ * @see {@link module:Base#transformWGS84ToCartesian|transformWGS84ToCartesian}
428
+ * @see {@link module:Base#transformCartesianToWGS84|transformCartesianToWGS84}
429
+ * @example
430
+ * import { Base } from 'cesium_dev_kit'
431
+ * const {viewer,base} = new Base({
432
+ * cesiumGlobal: Cesium,
433
+ * containerId: 'cesiumContainer'
434
+ * })
435
+ * const _handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
436
+ * _handler.setInputAction(function (movement: any) {
437
+ var cartesian = base.getCatesian3FromPX(movement.endPosition);
438
+ console.log(cartesian)
439
+ }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
440
+ * @returns {boolean|Cartesian3}
441
+ */
442
+ getCatesian3FromPX(px: any): any;
443
+ /**
444
+ * 获取相机位置
445
+ * @function
446
+ * @returns {cameraPosType} 相机位置信息
447
+ * @example
448
+ * import { Base } from 'cesium_dev_kit'
449
+ * const {base} = new Base({
450
+ * cesiumGlobal: Cesium,
451
+ * containerId: 'cesiumContainer'
452
+ * })
453
+ *
454
+ * base.bindHandleEvent({
455
+ * leftClick: function click (event, _handlers) {
456
+ * const pos = base.getCameraPosition();
457
+ * console.log(pos);
458
+ * }
459
+ * })
460
+ */
461
+ getCameraPosition(): {
462
+ lon: number;
463
+ lat: number;
464
+ height: any;
465
+ heading: any;
466
+ pitch: any;
467
+ roll: any;
468
+ position: any;
469
+ cameraHeading: any;
470
+ cameraPitch: any;
471
+ cameraRoll: any;
472
+ center: {
473
+ x: number;
474
+ y: number;
475
+ };
476
+ direction: any;
477
+ } | undefined;
478
+ /**
479
+ * 通过点击屏幕Cartesian2二维坐标,获取鼠标点击后的xy值;
480
+ * 根据xy判断当前目标对象是3dtiles、地形、模型、地球等通过不同方式获取对应位置信息
481
+ * @function
482
+ * @param {Cesium.Event} e - 监听的事件对象
483
+ * @example
484
+ * import { Base } from 'cesium_dev_kit'
485
+ * const {base} = new Base({
486
+ * cesiumGlobal: Cesium,
487
+ * containerId: 'cesiumContainer'
488
+ * })
489
+ *
490
+ * base.bindHandleEvent({
491
+ * leftClick: function click (event, _handlers) {
492
+ * const cartesian3 = base.pickUpPosition(event);
493
+ * console.log(cartesian3);
494
+ * }
495
+ * })
496
+ * @returns {boolean|Cartesian3}
497
+ */
498
+ pickUpPosition(e: any): any;
499
+ /**
500
+ * 获取鼠标点击后的位置信息
501
+ * @function
502
+ * @param {Cesium.Event} e - 监听的事件对象
503
+ * @example
504
+ * import { Base } from 'cesium_dev_kit'
505
+ * const {base} = new Base({
506
+ * cesiumGlobal: Cesium,
507
+ * containerId: 'cesiumContainer'
508
+ * })
509
+ *
510
+ * base.bindHandleEvent({
511
+ * leftClick: function click (event, _handlers) {
512
+ * const { wgs84Coor, graphicCoor, cameraPosition } = base.getHandlerClickPosition(event);
513
+ * console.log(wgs84Coor, graphicCoor, cameraPosition);
514
+ * }
515
+ * })
516
+ * @returns {clickPositionType}
517
+ */
518
+ getHandlerClickPosition(e: any): {
519
+ wgs84Coor: {
520
+ alt: any;
521
+ lat: any;
522
+ lon: any;
523
+ };
524
+ graphicCoor: {
525
+ height: any;
526
+ latitude: any;
527
+ longitude: any;
528
+ };
529
+ cameraPosition: {
530
+ cameraPosistion: any;
531
+ heading: any;
532
+ pitch: any;
533
+ roll: any;
534
+ };
535
+ } | undefined;
536
+ updateCameraState(flag: any): void;
537
+ /**
538
+ * 鼠标事件注册
539
+ * @function
540
+ * @param {object} options
541
+ * @param {string} options.leftClick - 左键点击
542
+ * @param {object} options.mouseMove - 移动
543
+ * @param {object} options.dubleClick - 双击
544
+ * @param {object} options.leftDown - 左键按下
545
+ * @param {object} options.mouseWheel - 鼠标滚动
546
+ * @param {object} options.leftUp - 左键弹起
547
+ * @example
548
+ * import { Base } from 'cesium_dev_kit'
549
+ * const {base} = new Base({
550
+ * cesiumGlobal: Cesium,
551
+ * containerId: 'cesiumContainer'
552
+ * })
553
+ * base.bindHandleEvent({
554
+ leftClick: function click(event, _handlers) {
555
+ todo something...
556
+ },
557
+ mouseMove: function move(event) {
558
+ todo something...
559
+ },
560
+ });
561
+ */
562
+ bindHandleEvent({ leftClick: _mouseLeftClickHandler, mouseMove: _mouseMoveHandler, doubleClick: _mouseDbClickHandler, leftDown: _mouseLeftDownHandler, mouseWheel: _mouseWheelHandler, leftUp: _mouseLeftUpHandler }: any): void;
563
+ /**
564
+ * @deprecated 拼写有误,请使用 {@link bindHandleEvent}
565
+ */
566
+ bindHandelEvent(options?: BindHandleEventOptions): void;
567
+ /**
568
+ * 获取鼠标信息
569
+ * @param {function} callback
570
+ * @example
571
+ * import { Base } from 'cesium_dev_kit'
572
+ * const {base} = new Base({
573
+ * cesiumGlobal: Cesium,
574
+ * containerId: 'cesiumContainer'
575
+ * })
576
+ * base.getHandlePosition(res=>{console.log(res)})
577
+ */
578
+ getHandlePosition(callback: any): void;
579
+ /**
580
+ * @deprecated 拼写有误,请使用 {@link getHandlePosition}
581
+ */
582
+ getHandelPosition(callback: any): void;
583
+ /**
584
+ * 保存当前场景png
585
+ * @example
586
+ * import { Base } from 'cesium_dev_kit'
587
+ * const {base} = new Base({
588
+ * cesiumGlobal: Cesium,
589
+ * containerId: 'cesiumContainer'
590
+ * })
591
+ * base.saveSceneImages()
592
+ */
593
+ saveSceneImages(): void;
594
+ /**
595
+ * amap
596
+ * @private
597
+ *
598
+ */
599
+ _installAmapImageryProvider(): void;
600
+ /**
601
+ * 天地图
602
+ * @private
603
+ */
604
+ _installTdtImageryProvider(): void;
605
+ /**
606
+ * 腾讯
607
+ * @private
608
+ */
609
+ _installTencentImageryProvider(): void;
610
+ /**
611
+ * google
612
+ * @private
613
+ */
614
+ _installGoogleImageryProvider(): void;
615
+ /**
616
+ * @deprecated 拼写有误,请使用 {@link _installGoogleImageryProvider}(该方法同时是幂等的)
617
+ */
618
+ _installGooGleImageryProvider(): void;
619
+ /**
620
+ * 百度影像拓展
621
+ * @private
622
+ */
623
+ _installBaiduImageryProvider(): void;
624
+ _installGroundSkyBox(): void;
625
+ /**
626
+ * 移除绑定的handler事件
627
+ *@function
628
+ * @param {Array} eventNameArr handler名称数组,如['LEFT_CLICK','MOUSE_MOVE']
629
+ */
630
+ removeHandlerByName(eventNameArr?: any): void;
631
+ };
632
+ };
633
+ type BaseInstance = InstanceType<typeof Base>;
634
+
635
+ export type { BaseInstance as B, CesiumGlobal as C, StaticResourceConf as S, Viewer as V, WGS84Type as W, BindHandleEventOptions as a };
@@ -0,0 +1,43 @@
1
+ import { C as CesiumGlobal, V as Viewer } from './Base-DH8H9suE.js';
2
+
3
+ /**
4
+ * singleImport 下各模块的构造参数
5
+ */
6
+ interface SingleImportOptions {
7
+ /** 全局 Cesium 对象(必传) */
8
+ cesiumGlobal?: CesiumGlobal;
9
+ /** 全局 THREE 对象(使用 three 相关模块时传入) */
10
+ threeGlobal?: any;
11
+ /** 挂载 viewer 的 dom id 或 dom 元素 */
12
+ containerId?: string | HTMLElement;
13
+ /** 挂载 three 的 dom id */
14
+ threeContainerId?: string | HTMLElement;
15
+ /** cesium viewer 配置 */
16
+ viewerConfig?: Record<string, any>;
17
+ /** 其它额外配置 */
18
+ extraConfig?: Record<string, any>;
19
+ /** 需要加载的影像图层配置 */
20
+ MapImageryList?: any[];
21
+ /** 静态资源配置 */
22
+ defaultStatic?: any;
23
+ /** 外部传入已经实例化的 viewer */
24
+ viewer?: Viewer;
25
+ /** 其它扩展参数 */
26
+ [key: string]: any;
27
+ }
28
+ /** 可释放资源的最小接口(kit 自己创建的 viewer 会被销毁) */
29
+ interface Disposable {
30
+ dispose: () => void;
31
+ /** 销毁当前模块持有的监听器 / DataSource(由 dispose 自动调用) */
32
+ destroy?: () => void;
33
+ }
34
+ /**
35
+ * singleImport 模块构造函数类型
36
+ * @template T - new 之后返回的实例结构
37
+ */
38
+ interface SingleImportConstructor<T> {
39
+ new (options: SingleImportOptions): T & Disposable;
40
+ prototype: T;
41
+ }
42
+
43
+ export type { SingleImportConstructor as S };