@ino-cesium/common 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,769 @@
1
+ import * as Cesium from 'cesium';
2
+ import { Cartesian3, Viewer, Cesium3DTileFeature, ImageryLayer, Cesium3DTileset, Cartesian2, Cartographic, SkyBox, Entity, SampledPositionProperty, JulianDate } from 'cesium';
3
+
4
+ interface ISetViewByLngLatOptions {
5
+ lng: number;
6
+ lat: number;
7
+ height?: number;
8
+ viewer: Viewer;
9
+ }
10
+ interface ISetViewByPositionOptions {
11
+ position: Cartesian3;
12
+ viewer: Viewer;
13
+ }
14
+ interface ICamearView {
15
+ destination: Cartesian3;
16
+ orientation: {
17
+ heading: number;
18
+ pitch: number;
19
+ roll: number;
20
+ };
21
+ }
22
+ interface ICesiumEventListener {
23
+ LEFT_CLICK?: (e: any) => void;
24
+ LEFT_POSITION?: (e: any) => void;
25
+ MOVE_POSITION?: (e: any) => void;
26
+ PICK_FEATURE?: (pickModel: Cesium3DTileFeature, feature: any) => void;
27
+ MOVE_PICK_FEATURE?: (pickModel: Cesium3DTileFeature, feature: any) => void;
28
+ }
29
+ type DeepPartial<T> = {
30
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
31
+ };
32
+
33
+ interface ISkyBoxSources {
34
+ positiveX: string;
35
+ negativeX: string;
36
+ positiveY: string;
37
+ negativeY: string;
38
+ positiveZ: string;
39
+ negativeZ: string;
40
+ }
41
+ interface ISkyBoxOptions {
42
+ viewer: Viewer;
43
+ sources?: ISkyBoxSources;
44
+ }
45
+ interface ISkyBoxOnGroundOptions extends ISkyBoxOptions {
46
+ height?: number;
47
+ }
48
+ interface IYawPitchRoll {
49
+ yaw: number;
50
+ pitch: number;
51
+ roll: number;
52
+ offsetYaw?: number;
53
+ }
54
+
55
+ type types_DeepPartial<T> = DeepPartial<T>;
56
+ type types_ICamearView = ICamearView;
57
+ type types_ICesiumEventListener = ICesiumEventListener;
58
+ type types_ISetViewByLngLatOptions = ISetViewByLngLatOptions;
59
+ type types_ISetViewByPositionOptions = ISetViewByPositionOptions;
60
+ type types_ISkyBoxOnGroundOptions = ISkyBoxOnGroundOptions;
61
+ type types_ISkyBoxOptions = ISkyBoxOptions;
62
+ type types_ISkyBoxSources = ISkyBoxSources;
63
+ type types_IYawPitchRoll = IYawPitchRoll;
64
+ declare namespace types {
65
+ export type { types_DeepPartial as DeepPartial, types_ICamearView as ICamearView, types_ICesiumEventListener as ICesiumEventListener, types_ISetViewByLngLatOptions as ISetViewByLngLatOptions, types_ISetViewByPositionOptions as ISetViewByPositionOptions, types_ISkyBoxOnGroundOptions as ISkyBoxOnGroundOptions, types_ISkyBoxOptions as ISkyBoxOptions, types_ISkyBoxSources as ISkyBoxSources, types_IYawPitchRoll as IYawPitchRoll };
66
+ }
67
+
68
+ /**
69
+ * 初始化Cesium
70
+ * @param eleId DOM元素ID
71
+ * @param options Viewer.ConstructorOptions
72
+ */
73
+ declare const initCesium: (eleId: string, options?: Viewer.ConstructorOptions & {
74
+ token: string;
75
+ }) => Viewer;
76
+ /**
77
+ * 修改地球透明度
78
+ * @param value 0-1
79
+ * @param viewer
80
+ */
81
+ declare const changeGlobeOpatity: (value: number, viewer: Viewer) => void;
82
+ /**
83
+ *修改地上 / 地下模式
84
+ */
85
+ declare const changeUndergroundModel: (isUnderground: boolean, viewer: Viewer) => void;
86
+
87
+ /**
88
+ * 设置中心点
89
+ * @param options.lng 精度
90
+ * @param options.lat 纬度
91
+ * @param options.height 高度
92
+ * @param options.viewer Cesium Viewer 实例
93
+ */
94
+ declare const setViewToLnglat: (options: ISetViewByLngLatOptions) => void;
95
+ /**
96
+ * 飞行至中心点
97
+ * @param options.lng 精度
98
+ * @param options.lat 纬度
99
+ * @param options.height 高度
100
+ * @param options.viewer Cesium Viewer 实例
101
+ */
102
+ declare const flyToLnglat: (options: ISetViewByLngLatOptions) => void;
103
+ /**
104
+ * 飞行至中心点
105
+ * @param options.lng 精度
106
+ * @param options.lat 纬度
107
+ * @param options.height 高度
108
+ * @param options.viewer Cesium Viewer 实例
109
+ */
110
+ declare const flyToPosition: (options: ISetViewByPositionOptions) => void;
111
+ /**
112
+ * 获取相机视图
113
+ * @param viewer
114
+ * @returns camearView
115
+ *
116
+ * camearView: {
117
+ * destination: Cartesian3,
118
+ * orientation: {
119
+ * heading: number
120
+ * pitch: number
121
+ * roll: number
122
+ * }
123
+ * }
124
+ */
125
+ declare function getCameraView(viewer: Viewer): ICamearView;
126
+ /**
127
+ *
128
+ * @param camearView
129
+ * camearView: {
130
+ * destination: Cartesian3
131
+ * orientation: {
132
+ * heading: number
133
+ * pitch: number
134
+ * roll: number
135
+ * }
136
+ * }
137
+ * @param viewer
138
+ */
139
+ declare function flyToCameraView(camearView: ICamearView, viewer: Viewer): void;
140
+ /**
141
+ * 飞行至数据源
142
+ * @param dataScourceId 数据源id
143
+ * @param viewer Cesium Viewer 实例
144
+ */
145
+ declare function flyToDataSource(dataScourceId: string, viewer: Viewer): void;
146
+ /**
147
+ * 飞行至影像图层
148
+ * @param imagery 影像图层
149
+ * @param viewer Cesium Viewer 实例
150
+ */
151
+ declare function flyToImagery(imagery: ImageryLayer, viewer: Viewer): void;
152
+ /**
153
+ * 飞行至3dtile
154
+ * @param {}tileset 3dtile
155
+ * @param viewer Cesium Viewer 实例
156
+ */
157
+ declare function flyToCesium3DTile(tileset: Cesium3DTileset, viewer: Viewer): void;
158
+ /**
159
+ * 飞行至球体
160
+ * @param sphere 球体
161
+ * @param viewer
162
+ */
163
+ declare function flyToFromSphere(sphere: number[], viewer: Viewer): void;
164
+ /**
165
+ * 闪烁模型
166
+ * @param model
167
+ */
168
+ declare function twinkleModel(model: any): void;
169
+
170
+ /**
171
+ * 初始化cesium事件
172
+ * @param viewer
173
+ * @param eventListener
174
+ */
175
+ declare const initCesiumEvent: (viewer: Viewer, eventListener: ICesiumEventListener) => void;
176
+
177
+ declare const numberId: () => string;
178
+
179
+ declare class Tooltip {
180
+ static tootlip: Tooltip | null;
181
+ private _title;
182
+ private _div;
183
+ private _message;
184
+ constructor(frameDiv: HTMLElement);
185
+ showAt(position: Cartesian2, message: string): void;
186
+ setVisible(visible: boolean): void;
187
+ static createToolTip(): Tooltip;
188
+ destroy(): void;
189
+ }
190
+
191
+ declare class Popup {
192
+ static popup: Popup | null;
193
+ private _div;
194
+ private viewer;
195
+ private offset;
196
+ private position;
197
+ constructor(viewer: Viewer, element: HTMLElement, offset?: Cartesian2);
198
+ showAt(position: Cartesian3): void;
199
+ setVisible(visible: boolean): void;
200
+ renderPosition(): void;
201
+ static createPupup(viewer: Viewer, element: HTMLElement, offset?: Cartesian2): Popup;
202
+ destroy(): void;
203
+ }
204
+
205
+ // Note: as of the RFC 7946 version of GeoJSON, Coordinate Reference Systems
206
+ // are no longer supported. (See https://tools.ietf.org/html/rfc7946#appendix-B)}
207
+
208
+
209
+
210
+ /**
211
+ * The value values for the "type" property of GeoJSON Objects.
212
+ * https://tools.ietf.org/html/rfc7946#section-1.4
213
+ */
214
+ type GeoJsonTypes = GeoJSON$1["type"];
215
+
216
+ /**
217
+ * Bounding box
218
+ * https://tools.ietf.org/html/rfc7946#section-5
219
+ */
220
+ type BBox = [number, number, number, number] | [number, number, number, number, number, number];
221
+
222
+ /**
223
+ * A Position is an array of coordinates.
224
+ * https://tools.ietf.org/html/rfc7946#section-3.1.1
225
+ * Array should contain between two and three elements.
226
+ * The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
227
+ * but the current specification only allows X, Y, and (optionally) Z to be defined.
228
+ *
229
+ * Note: the type will not be narrowed down to `[number, number] | [number, number, number]` due to
230
+ * marginal benefits and the large impact of breaking change.
231
+ *
232
+ * See previous discussions on the type narrowing:
233
+ * - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590|Nov 2017}
234
+ * - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773|Dec 2023}
235
+ * - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441| Dec 2024}
236
+ *
237
+ * One can use a
238
+ * {@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates|user-defined type guard that returns a type predicate}
239
+ * to determine if a position is a 2D or 3D position.
240
+ *
241
+ * @example
242
+ * import type { Position } from 'geojson';
243
+ *
244
+ * type StrictPosition = [x: number, y: number] | [x: number, y: number, z: number]
245
+ *
246
+ * function isStrictPosition(position: Position): position is StrictPosition {
247
+ * return position.length === 2 || position.length === 3
248
+ * };
249
+ *
250
+ * let position: Position = [-116.91, 45.54];
251
+ *
252
+ * let x: number;
253
+ * let y: number;
254
+ * let z: number | undefined;
255
+ *
256
+ * if (isStrictPosition(position)) {
257
+ * // `tsc` would throw an error if we tried to destructure a fourth parameter
258
+ * [x, y, z] = position;
259
+ * } else {
260
+ * throw new TypeError("Position is not a 2D or 3D point");
261
+ * }
262
+ */
263
+ type Position = number[];
264
+
265
+ /**
266
+ * The base GeoJSON object.
267
+ * https://tools.ietf.org/html/rfc7946#section-3
268
+ * The GeoJSON specification also allows foreign members
269
+ * (https://tools.ietf.org/html/rfc7946#section-6.1)
270
+ * Developers should use "&" type in TypeScript or extend the interface
271
+ * to add these foreign members.
272
+ */
273
+ interface GeoJsonObject {
274
+ // Don't include foreign members directly into this type def.
275
+ // in order to preserve type safety.
276
+ // [key: string]: any;
277
+ /**
278
+ * Specifies the type of GeoJSON object.
279
+ */
280
+ type: GeoJsonTypes;
281
+ /**
282
+ * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
283
+ * The value of the bbox member is an array of length 2*n where n is the number of dimensions
284
+ * represented in the contained geometries, with all axes of the most southwesterly point
285
+ * followed by all axes of the more northeasterly point.
286
+ * The axes order of a bbox follows the axes order of geometries.
287
+ * https://tools.ietf.org/html/rfc7946#section-5
288
+ */
289
+ bbox?: BBox | undefined;
290
+ }
291
+
292
+ /**
293
+ * Union of GeoJSON objects.
294
+ */
295
+ type GeoJSON$1<G extends Geometry | null = Geometry, P = GeoJsonProperties> =
296
+ | G
297
+ | Feature<G, P>
298
+ | FeatureCollection<G, P>;
299
+
300
+ /**
301
+ * Geometry object.
302
+ * https://tools.ietf.org/html/rfc7946#section-3
303
+ */
304
+ type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
305
+
306
+ /**
307
+ * Point geometry object.
308
+ * https://tools.ietf.org/html/rfc7946#section-3.1.2
309
+ */
310
+ interface Point extends GeoJsonObject {
311
+ type: "Point";
312
+ coordinates: Position;
313
+ }
314
+
315
+ /**
316
+ * MultiPoint geometry object.
317
+ * https://tools.ietf.org/html/rfc7946#section-3.1.3
318
+ */
319
+ interface MultiPoint extends GeoJsonObject {
320
+ type: "MultiPoint";
321
+ coordinates: Position[];
322
+ }
323
+
324
+ /**
325
+ * LineString geometry object.
326
+ * https://tools.ietf.org/html/rfc7946#section-3.1.4
327
+ */
328
+ interface LineString extends GeoJsonObject {
329
+ type: "LineString";
330
+ coordinates: Position[];
331
+ }
332
+
333
+ /**
334
+ * MultiLineString geometry object.
335
+ * https://tools.ietf.org/html/rfc7946#section-3.1.5
336
+ */
337
+ interface MultiLineString extends GeoJsonObject {
338
+ type: "MultiLineString";
339
+ coordinates: Position[][];
340
+ }
341
+
342
+ /**
343
+ * Polygon geometry object.
344
+ * https://tools.ietf.org/html/rfc7946#section-3.1.6
345
+ */
346
+ interface Polygon extends GeoJsonObject {
347
+ type: "Polygon";
348
+ coordinates: Position[][];
349
+ }
350
+
351
+ /**
352
+ * MultiPolygon geometry object.
353
+ * https://tools.ietf.org/html/rfc7946#section-3.1.7
354
+ */
355
+ interface MultiPolygon extends GeoJsonObject {
356
+ type: "MultiPolygon";
357
+ coordinates: Position[][][];
358
+ }
359
+
360
+ /**
361
+ * Geometry Collection
362
+ * https://tools.ietf.org/html/rfc7946#section-3.1.8
363
+ */
364
+ interface GeometryCollection<G extends Geometry = Geometry> extends GeoJsonObject {
365
+ type: "GeometryCollection";
366
+ geometries: G[];
367
+ }
368
+
369
+ type GeoJsonProperties = { [name: string]: any } | null;
370
+
371
+ /**
372
+ * A feature object which contains a geometry and associated properties.
373
+ * https://tools.ietf.org/html/rfc7946#section-3.2
374
+ */
375
+ interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
376
+ type: "Feature";
377
+ /**
378
+ * The feature's geometry
379
+ */
380
+ geometry: G;
381
+ /**
382
+ * A value that uniquely identifies this feature in a
383
+ * https://tools.ietf.org/html/rfc7946#section-3.2.
384
+ */
385
+ id?: string | number | undefined;
386
+ /**
387
+ * Properties associated with this feature.
388
+ */
389
+ properties: P;
390
+ }
391
+
392
+ /**
393
+ * A collection of feature objects.
394
+ * https://tools.ietf.org/html/rfc7946#section-3.3
395
+ */
396
+ interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
397
+ type: "FeatureCollection";
398
+ features: Array<Feature<G, P>>;
399
+ }
400
+
401
+ /**
402
+ * 生成随机点输入geojosn 格式
403
+ * @param count 点数量
404
+ * @param lngRange 精度范围
405
+ * @param latRange 纬度范围
406
+ * @returns
407
+ */
408
+ declare const randomPointToGeoJson: (count: number, lngRange?: number[], latRange?: number[]) => FeatureCollection<Point, GeoJsonProperties>;
409
+ declare function randomColor(): string;
410
+ declare const randomPolylineToGeoJson: (count: number, lngRange?: number[], latRange?: number[]) => FeatureCollection<LineString, GeoJsonProperties>;
411
+ declare const randomPolygonToGeoJson: (count: number, lngRange?: number[], latRange?: number[]) => FeatureCollection<Polygon, GeoJsonProperties>;
412
+
413
+ /**
414
+ * 创建鹰眼图
415
+ * @param eleId
416
+ * @param mainViewer
417
+ */
418
+ declare const createEagleEye: (eleId: string, mainViewer: Viewer) => {
419
+ viewer: Viewer;
420
+ open: () => void;
421
+ close: () => void;
422
+ };
423
+
424
+ /**
425
+ * 计算空间距离
426
+ * @param {Cartesian3} start - 起始点
427
+ * @param {Cartesian3} end - 结束点
428
+ * @returns {number} - 两点之间的空间距离
429
+ */
430
+ declare const calcSpaceDistance: (start: Cesium.Cartesian3, end: Cesium.Cartesian3) => number;
431
+ /**
432
+ * 计算空间距离-多点
433
+ * @param {Cartesian3[]} positions - 点集
434
+ */
435
+ declare function calcSpaceDistances(positions: Cesium.Cartesian3[]): number;
436
+ /**
437
+ * 计算贴地距离-两点
438
+ * @param {Cartesian3} start - 起始点
439
+ * @param {Cartesian3} end - 结束点
440
+ * @param {ellipsoid} Cesium.Ellipsoid
441
+ */
442
+ declare function calcGeodesicDistance(start: Cesium.Cartesian3, end: Cesium.Cartesian3, ellipsoid?: Cesium.Ellipsoid): number;
443
+ /**
444
+ * 计算贴地距离-多点
445
+ * @param {Cartesian3[]} positions - 点集
446
+ * @returns {number} - 总距离
447
+ */
448
+ declare function calcGeodesicDistances(positions: Cesium.Cartesian3[]): number;
449
+ /**
450
+ * 计算质心
451
+ * turf Centroid
452
+ * @param {Cartesian3[]} positions - 点集
453
+ * @returns {Cartesian3} - 质心点
454
+ */
455
+ declare const calcPoistionCenter: (positions: Cesium.Cartesian3[]) => Cesium.Cartesian3;
456
+ /**
457
+ * 计算面积
458
+ * @param {Cartesian3[]} positions - 点集
459
+ * @returns {number} - 面积 单位:平方米
460
+ */
461
+ declare function calcArea(positions: Array<Cesium.Cartesian3>): number;
462
+ /**
463
+ * 计算三角形面积
464
+ * @param {Cartesian3} vertexA - 三角形顶点A
465
+ * @param {Cartesian3} vertexB - 三角形顶点B
466
+ * @param {Cartesian3} vertexC - 三角形顶点C
467
+ * @returns {number} - 三角形面积
468
+ */
469
+ declare const calcTriangleArea: (vertexA: Cesium.Cartesian3, vertexB: Cesium.Cartesian3, vertexC: Cesium.Cartesian3) => number;
470
+ /**
471
+ * 计算地形高度
472
+ * @param {TerrainProvider} terrainProvider - 地形提供者
473
+ * @param {Cartesian3[]} positions - 点集
474
+ * @returns {Cartesian3[]} - 地形高度点集
475
+ */
476
+ declare const calcTerrainHeightFromPositions: (terrainProvider: Cesium.TerrainProvider, positions: Cesium.Cartesian3[]) => Promise<Cartographic[]>;
477
+ /**
478
+ * 计算抛物线点集,
479
+ * @param {Cartesian3} startPoint - 开始节点
480
+ * @param {Cartesian3} endPoint - 结束节点
481
+ * @param {number} angularityFactor - 曲率
482
+ * @param {number} numOfSingleLine - 点集数量
483
+ * @returns {Cartesian3[]} - 点集
484
+ */
485
+ declare const clacPositionsForParabola: (startPoint: Cesium.Cartesian3, endPoint: Cesium.Cartesian3, angularityFactor: number, numOfSingleLine: number) => Cesium.Cartesian3[];
486
+ /**
487
+ * 计算缩放级别,
488
+ * 把当前相机高度转为缩放级别
489
+ * @param {Camera} camera - 相机
490
+ */
491
+ declare const calcZoomFromCameraHeight: (camera: Cesium.Camera) => number;
492
+ /**
493
+ * 计算相机高度
494
+ * 把缩放级别转为相机高度
495
+ * @无效
496
+ */
497
+ declare const calcCameraHeightFromZoom: (zoom: number) => number;
498
+ /**
499
+ * 计算插值点集
500
+ * @param positions Cartesian3[]
501
+ * @param number 插值点数量
502
+ * @returns Cartesian3[]
503
+ */
504
+ declare const calcLerpPosition: (positions: Cesium.Cartesian3[], number: number) => Cesium.Cartesian3[];
505
+
506
+ declare abstract class BasePrimitive<T> {
507
+ protected _primitive: CusPrimitive;
508
+ protected _promise: Promise<T>;
509
+ protected appearance: Cesium.Appearance | undefined;
510
+ protected geometryInstance: Cesium.Appearance | undefined;
511
+ protected drawCommand: any;
512
+ needUpdate: boolean;
513
+ constructor();
514
+ update(frameState: any): void;
515
+ then(onFulfilled?: any): Promise<T>;
516
+ catch(onRejected?: any): Promise<T>;
517
+ abstract getPrimitive(): CusPrimitive;
518
+ isDestroyed(): boolean;
519
+ destroy(): void;
520
+ }
521
+ type CusPrimitive = Cesium.Primitive | Cesium.GroundPrimitive | Cesium.PointPrimitiveCollection | Cesium.GroundPolylinePrimitive | Cesium.LabelCollection | Cesium.PrimitiveCollection | undefined;
522
+
523
+ /**
524
+ * 线材质基类
525
+ */
526
+ declare abstract class BaseMaterialProperty {
527
+ protected _definitionChanged: Cesium.Event<(...args: any[]) => void>;
528
+ get definitionChanged(): Cesium.Event<(...args: any[]) => void>;
529
+ get isConstant(): boolean;
530
+ abstract getType(): string;
531
+ abstract getValue(time: Cesium.JulianDate, result: any): any;
532
+ abstract equals(other: any): boolean;
533
+ abstract init(): void;
534
+ }
535
+
536
+ /**
537
+ * 把点集合转为顺时针
538
+ */
539
+ declare const makePositionsForClockwise: (positions: Cesium.Cartesian3[]) => Cesium.Cartesian3[];
540
+ /**
541
+ * 把点集合转为逆时针
542
+ */
543
+ declare const makePositionsForAntiClockwise: (positions: Cesium.Cartesian3[]) => Cesium.Cartesian3[];
544
+ /**
545
+ * 把笛卡尔坐标数组转为经纬度数组
546
+ */
547
+ declare const makePositionsToLnglats: (positions: Cesium.Cartesian3[]) => Cesium.Cartographic[];
548
+ /**
549
+ * 把笛卡尔坐标转为经纬度
550
+ */
551
+ declare const makePositiontoLnglat: (position: Cesium.Cartesian3) => Cesium.Cartographic;
552
+ /**
553
+ * 把经纬度数组转为笛卡尔坐标数组
554
+ */
555
+ declare const makeLnglatsToPositions: (lnglats: Cesium.Cartographic[]) => Cesium.Cartesian3[];
556
+ /**
557
+ * 把经纬度转为笛卡尔坐标
558
+ */
559
+ declare const makeLnglatToPosition: (lnglat: Cesium.Cartographic) => Cesium.Cartesian3;
560
+ /**
561
+ * 点集闭合成面 首位相接
562
+ */
563
+ declare const makePositionsClose: (positions: Cesium.Cartesian3[]) => Cesium.Cartesian3[];
564
+ /**
565
+ * 把经纬度数组转为点数据的geojson集合
566
+ * @param lnglats
567
+ * @returns GeoJSON.FeatureCollection
568
+ */
569
+ declare const makeLnglatsToPointGeojson: (lnglats: Cesium.Cartographic[]) => GeoJSON.FeatureCollection;
570
+ /**
571
+ * 把经纬度数组转为线数据的geojson集合
572
+ * @param lnglats
573
+ * @returns GeoJSON.FeatureCollection
574
+ */
575
+ declare const makeLnglatsToLineGeojson: (lnglats: Cesium.Cartographic[]) => GeoJSON.FeatureCollection;
576
+ /**
577
+ * 把经纬度数组转为面数据的geojson集合
578
+ * @param lnglats
579
+ * @returns GeoJSON.FeatureCollection
580
+ */
581
+ declare const makeLnglatsToPolygonGeojson: (lnglats: Cesium.Cartographic[]) => GeoJSON.FeatureCollection;
582
+ declare const makeYawPitchRollToHeadingPitchRoll: (yawPitchRoll: IYawPitchRoll) => {
583
+ heading: number;
584
+ pitch: number;
585
+ roll: number;
586
+ };
587
+
588
+ /**
589
+ * 创建天空盒
590
+ * @param options
591
+ */
592
+ declare const createSkyBox: (options: ISkyBoxOptions) => SkyBox;
593
+ /**
594
+ * 创建近地天空盒
595
+ * @param options
596
+ */
597
+ declare const createSkyBoxOnGround: (options: ISkyBoxOnGroundOptions) => void;
598
+
599
+ /**
600
+ * 漫游控制器
601
+ * @param viewer Cesium Viewer
602
+ *
603
+ */
604
+ declare const createRoamHandler: (viewer: Viewer) => IRoamHandler;
605
+ interface IRoamOptions {
606
+ /**
607
+ * 唯一id, 默认为随机生成
608
+ */
609
+ id?: string;
610
+ /**
611
+ * 漫游路径
612
+ */
613
+ positions: Cartesian3[];
614
+ /**
615
+ * 飞行器参数
616
+ */
617
+ flyParams: {
618
+ /**
619
+ * 漫游时间数组 以时间计算飞行速度 数组长度必须与漫游路径点数组长度相同
620
+ * 与spped二者取其一 时间优先
621
+ */
622
+ times?: number[];
623
+ /**
624
+ * 漫游速度 公里/每小时
625
+ * 与times二者取其一
626
+ */
627
+ speed?: number;
628
+ /**
629
+ * 飞行器的heading pitch roll
630
+ */
631
+ hpr?: IRoamItemHPR[];
632
+ };
633
+ /**
634
+ * 漫游目标 可跟随物体和漫游路线设置
635
+ */
636
+ entity: Entity;
637
+ /**
638
+ * 是否循环
639
+ */
640
+ loop: boolean;
641
+ /**
642
+ * 漫游目标属性信息
643
+ */
644
+ attrs?: any;
645
+ }
646
+ /**
647
+ * 漫游控制器
648
+ */
649
+ interface IRoamHandler {
650
+ set: (options: IRoamOptions) => IRoamItem;
651
+ /**
652
+ * 漫游目标跟随
653
+ * @param roamItem
654
+ * @param isLock 是否锁定视角
655
+ */
656
+ tracked: (roamItem: IRoamItem, isLock: boolean) => void;
657
+ /**
658
+ * 通过entityId 设置漫游目标跟随
659
+ * @param id
660
+ * @param isLock 是否锁定视角
661
+ */
662
+ trackedByEntityId: (id: string, isLock: boolean) => void;
663
+ /**
664
+ * 停止漫游目标跟随
665
+ */
666
+ stopTracked: () => void;
667
+ remove: (roamItem: IRoamItem) => void;
668
+ frameRoam: (roamItem: IRoamItem, time: JulianDate) => void;
669
+ removeAll: () => void;
670
+ Event: IRoamEvent;
671
+ lockCameraView: (roamItem: IRoamItem) => void;
672
+ /**
673
+ * 更新漫游目标姿态
674
+ * @param roamItem
675
+ * @param flyAttitude
676
+ */
677
+ updateRoamAttitude: (roamItem: IRoamItem, flyAttitude: FlyAttitude) => void;
678
+ }
679
+ interface IRoamItem extends IRoamOptions {
680
+ /**
681
+ * 漫游路径
682
+ */
683
+ property: SampledPositionProperty;
684
+ /**
685
+ * 开始时间
686
+ */
687
+ startTime: JulianDate | undefined;
688
+ /**
689
+ * 结束时间
690
+ */
691
+ stopTime: JulianDate | undefined;
692
+ /**
693
+ * 漫游状态
694
+ */
695
+ status: RoamStatus;
696
+ }
697
+ interface IRoaming {
698
+ time: JulianDate;
699
+ position: Cartesian3 | undefined;
700
+ }
701
+ interface IRoamEvent {
702
+ /**
703
+ * 漫游开始
704
+ * @param roamItem
705
+ */
706
+ start?: (roamItem: IRoamItem) => void;
707
+ /**
708
+ * 漫游重新开始 调用reStart方法时或触发循环式触发
709
+ * @param roamItem
710
+ */
711
+ reStart?: (roamItem: IRoamItem) => void;
712
+ /**
713
+ * 漫游中
714
+ * @param roamItem
715
+ * @param roaming
716
+ */
717
+ roaming?: (roamItem: IRoamItem, roaming: IRoaming) => void;
718
+ /**
719
+ * 漫游结束
720
+ * @param roamItem
721
+ */
722
+ end?: (roamItem: IRoamItem) => void;
723
+ }
724
+ declare enum FlyAttitude {
725
+ UP = "UP",
726
+ DOWN = "DOWN",
727
+ LEFT = "left",
728
+ RIGHT = "right",
729
+ FRONT = "front",
730
+ BACK = "back"
731
+ }
732
+ declare enum RoamStatus {
733
+ END = "END",
734
+ START = "START",
735
+ ROAMING = "ROAMING"
736
+ }
737
+ interface IRoamItemHPR {
738
+ time: number;
739
+ heading: number;
740
+ pitch: number;
741
+ roll: number;
742
+ }
743
+
744
+ declare const createBottomStatusBar: (options: IBottomStatusBarOptions) => void;
745
+ interface IBottomStatusBarOptions {
746
+ viewer: Viewer;
747
+ /**
748
+ * 显示方向角、俯仰角、侧翻角
749
+ */
750
+ hpr?: boolean;
751
+ /**
752
+ * 开启点击复制
753
+ * 复制当前中心经纬度和高度,相机视角
754
+ */
755
+ clickCopy?: boolean;
756
+ }
757
+
758
+ declare const createOpenAnim: (options: IOpenAnimOptions) => Promise<unknown>;
759
+ interface IOpenAnimOptions {
760
+ viewer: Viewer;
761
+ center: {
762
+ lat: number;
763
+ lng: number;
764
+ height: number;
765
+ };
766
+ }
767
+
768
+ export { BaseMaterialProperty, BasePrimitive, types as Common, FlyAttitude, Popup, RoamStatus, Tooltip, calcArea, calcCameraHeightFromZoom, calcGeodesicDistance, calcGeodesicDistances, calcLerpPosition, calcPoistionCenter, calcSpaceDistance, calcSpaceDistances, calcTerrainHeightFromPositions, calcTriangleArea, calcZoomFromCameraHeight, changeGlobeOpatity, changeUndergroundModel, clacPositionsForParabola, createBottomStatusBar, createEagleEye, createOpenAnim, createRoamHandler, createSkyBox, createSkyBoxOnGround, flyToCameraView, flyToCesium3DTile, flyToDataSource, flyToFromSphere, flyToImagery, flyToLnglat, flyToPosition, getCameraView, initCesium, initCesiumEvent, makeLnglatToPosition, makeLnglatsToLineGeojson, makeLnglatsToPointGeojson, makeLnglatsToPolygonGeojson, makeLnglatsToPositions, makePositionsClose, makePositionsForAntiClockwise, makePositionsForClockwise, makePositionsToLnglats, makePositiontoLnglat, makeYawPitchRollToHeadingPitchRoll, numberId, randomColor, randomPointToGeoJson, randomPolygonToGeoJson, randomPolylineToGeoJson, setViewToLnglat, twinkleModel };
769
+ export type { IRoamEvent, IRoamHandler, IRoamItem, IRoamItemHPR, IRoaming };