@ino-cesium/common 0.0.12 → 0.0.14

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/dist/index.d.ts CHANGED
@@ -1,19 +1,18 @@
1
1
  import * as Cesium from 'cesium';
2
- import { Cartesian3, Viewer, ImageryLayer, Cesium3DTileset, Cartesian2, Cartographic, SkyBox, Entity, SampledPositionProperty, JulianDate } from 'cesium';
3
2
  import { FeatureCollection, Point, GeoJsonProperties, LineString, Polygon } from 'geojson';
4
3
 
5
4
  interface ISetViewByLngLatOptions {
6
5
  lng: number;
7
6
  lat: number;
8
7
  height?: number;
9
- viewer: Viewer;
8
+ viewer: Cesium.Viewer;
10
9
  }
11
10
  interface ISetViewByPositionOptions {
12
- position: Cartesian3;
13
- viewer: Viewer;
11
+ position: Cesium.Cartesian3;
12
+ viewer: Cesium.Viewer;
14
13
  }
15
14
  interface ICamearView {
16
- destination: Cartesian3;
15
+ destination: Cesium.Cartesian3;
17
16
  orientation: {
18
17
  heading: number;
19
18
  pitch: number;
@@ -40,7 +39,7 @@ interface ISkyBoxSources {
40
39
  negativeZ: string;
41
40
  }
42
41
  interface ISkyBoxOptions {
43
- viewer: Viewer;
42
+ viewer: Cesium.Viewer;
44
43
  sources?: ISkyBoxSources;
45
44
  }
46
45
  interface ISkyBoxOnGroundOptions extends ISkyBoxOptions {
@@ -71,18 +70,18 @@ declare namespace types {
71
70
  * @param eleId DOM元素ID
72
71
  * @param options Viewer.ConstructorOptions
73
72
  */
74
- declare const initCesium: (eleId: string, options?: Viewer.ConstructorOptions & {
75
- token: string;
76
- }) => Viewer;
73
+ declare const initCesium: (eleId: string, options?: Cesium.Viewer.ConstructorOptions & {
74
+ token?: string;
75
+ }) => Cesium.Viewer;
77
76
  /**
78
77
  * 修改地球透明度
79
78
  * @param value 0-1
80
79
  * @param viewer
81
80
  */
82
- declare const setGlobeOpatity: (value: number, viewer: Viewer) => void;
81
+ declare const setGlobeOpatity: (value: number, viewer: Cesium.Viewer) => void;
83
82
  declare const setCesiumForAutoFitScale: (value: number) => void;
84
83
  declare const getCesiumForAutoFitScale: () => number;
85
- declare const DefaultViewerOptions: Viewer.ConstructorOptions;
84
+ declare const DefaultViewerOptions: Cesium.Viewer.ConstructorOptions;
86
85
 
87
86
  /**
88
87
  * 设置中心点
@@ -122,7 +121,7 @@ declare const flyToPosition: (options: ISetViewByPositionOptions) => void;
122
121
  * }
123
122
  * }
124
123
  */
125
- declare function getCameraView(viewer: Viewer): ICamearView;
124
+ declare function getCameraView(viewer: Cesium.Viewer): ICamearView;
126
125
  /**
127
126
  *
128
127
  * @param camearView
@@ -136,31 +135,31 @@ declare function getCameraView(viewer: Viewer): ICamearView;
136
135
  * }
137
136
  * @param viewer
138
137
  */
139
- declare function flyToCameraView(camearView: ICamearView, viewer: Viewer): void;
138
+ declare function flyToCameraView(camearView: ICamearView, viewer: Cesium.Viewer): void;
140
139
  /**
141
140
  * 飞行至数据源
142
141
  * @param dataScourceId 数据源id
143
142
  * @param viewer Cesium Viewer 实例
144
143
  */
145
- declare function flyToDataSource(dataScourceId: string, viewer: Viewer): void;
144
+ declare function flyToDataSource(dataScourceId: string, viewer: Cesium.Viewer): void;
146
145
  /**
147
146
  * 飞行至影像图层
148
147
  * @param imagery 影像图层
149
148
  * @param viewer Cesium Viewer 实例
150
149
  */
151
- declare function flyToImagery(imagery: ImageryLayer, viewer: Viewer): void;
150
+ declare function flyToImagery(imagery: Cesium.ImageryLayer, viewer: Cesium.Viewer): void;
152
151
  /**
153
152
  * 飞行至3dtile
154
153
  * @param {}tileset 3dtile
155
154
  * @param viewer Cesium Viewer 实例
156
155
  */
157
- declare function flyToCesium3DTile(tileset: Cesium3DTileset, viewer: Viewer): void;
156
+ declare function flyToCesium3DTile(tileset: Cesium.Cesium3DTileset, viewer: Cesium.Viewer): void;
158
157
  /**
159
158
  * 飞行至球体
160
159
  * @param sphere 球体
161
160
  * @param viewer
162
161
  */
163
- declare function flyToFromSphere(sphere: number[], viewer: Viewer): void;
162
+ declare function flyToFromSphere(sphere: number[], viewer: Cesium.Viewer): void;
164
163
  /**
165
164
  * 闪烁模型
166
165
  * @param model
@@ -172,19 +171,21 @@ declare function twinkleModel(model: any): void;
172
171
  * @param viewer
173
172
  * @param eventListener
174
173
  */
175
- declare const initCesiumEvent: (viewer: Viewer, eventListener: ICesiumEventListener) => void;
174
+ declare const initCesiumEvent: (viewer: Cesium.Viewer, eventListener: ICesiumEventListener) => void;
176
175
 
177
176
  declare const numberId: () => string;
177
+ declare const setInoCesiumBaseUrl: (url: string) => void;
178
+ declare const getInoCesiumBaseUrl: () => string;
178
179
 
179
180
  declare class Tooltip {
180
181
  static tooltip: Tooltip | null;
181
182
  private _title;
182
183
  private _div;
183
184
  private _message;
184
- constructor(viewer: Viewer);
185
- showAt(position: Cartesian2, message: string): void;
185
+ constructor(viewer: Cesium.Viewer);
186
+ showAt(position: Cesium.Cartesian2, message: string): void;
186
187
  setVisible(visible: boolean): void;
187
- static createToolTip(viewer: Viewer): Tooltip;
188
+ static createToolTip(viewer: Cesium.Viewer): Tooltip;
188
189
  destroy(): void;
189
190
  }
190
191
 
@@ -194,11 +195,11 @@ declare class Popup {
194
195
  private viewer;
195
196
  private offset;
196
197
  private position;
197
- constructor(viewer: Viewer, element: HTMLElement, offset?: Cartesian2);
198
- showAt(position: Cartesian3): void;
198
+ constructor(viewer: Cesium.Viewer, element: HTMLElement, offset?: Cesium.Cartesian2);
199
+ showAt(position: Cesium.Cartesian3): void;
199
200
  setVisible(visible: boolean): void;
200
201
  renderPosition(): void;
201
- static createPupup(viewer: Viewer, element: HTMLElement, offset?: Cartesian2): Popup;
202
+ static createPupup(viewer: Cesium.Viewer, element: HTMLElement, offset?: Cesium.Cartesian2): Popup;
202
203
  destroy(): void;
203
204
  }
204
205
 
@@ -219,8 +220,8 @@ declare const randomPolygonToGeoJson: (count: number, lngRange?: number[], latRa
219
220
  * @param eleId
220
221
  * @param mainViewer
221
222
  */
222
- declare const createEagleEye: (eleId: string, mainViewer: Viewer) => {
223
- viewer: Viewer;
223
+ declare const createEagleEye: (eleId: string, mainViewer: Cesium.Viewer) => {
224
+ viewer: Cesium.Viewer;
224
225
  open: () => void;
225
226
  close: () => void;
226
227
  };
@@ -277,7 +278,7 @@ declare const calcTriangleArea: (vertexA: Cesium.Cartesian3, vertexB: Cesium.Car
277
278
  * @param {Cartesian3[]} positions - 点集
278
279
  * @returns {Cartesian3[]} - 地形高度点集
279
280
  */
280
- declare const calcTerrainHeightFromPositions: (terrainProvider: Cesium.TerrainProvider, positions: Cesium.Cartesian3[]) => Promise<Cartographic[]>;
281
+ declare const calcTerrainHeightFromPositions: (terrainProvider: Cesium.TerrainProvider, positions: Cesium.Cartesian3[]) => Promise<Cesium.Cartographic[]>;
281
282
  /**
282
283
  * 计算场景高度
283
284
  * @param {TerrainProvider} viewer
@@ -313,16 +314,6 @@ declare const calcCameraHeightFromZoom: (zoom: number) => number;
313
314
  * @returns Cartesian3[]
314
315
  */
315
316
  declare const calcLerpPosition: (positions: Cesium.Cartesian3[], number: number) => Cesium.Cartesian3[];
316
- /**
317
- * @deprecated 气泡无需自适应
318
- * @param viewer
319
- * @param position
320
- * @param offSet
321
- */
322
- declare const calcScreenPositionFromPosition: (viewer: Cesium.Viewer, position: Cesium.Cartesian3, offSet?: Cartesian2) => {
323
- x: string;
324
- y: string;
325
- };
326
317
 
327
318
  declare abstract class BasePrimitive<T> {
328
319
  protected _primitive: CusPrimitive;
@@ -415,7 +406,7 @@ declare const makeYawPitchRollToHeadingPitchRoll: (yawPitchRoll: IYawPitchRoll)
415
406
  * 创建天空盒
416
407
  * @param options
417
408
  */
418
- declare const createSkyBox: (options: ISkyBoxOptions) => SkyBox;
409
+ declare const createSkyBox: (options: ISkyBoxOptions) => Cesium.SkyBox;
419
410
  /**
420
411
  * 创建近地天空盒
421
412
  * @param options
@@ -427,7 +418,7 @@ declare const createSkyBoxOnGround: (options: ISkyBoxOnGroundOptions) => void;
427
418
  * @param viewer Cesium Viewer
428
419
  *
429
420
  */
430
- declare const createRoamHandler: (viewer: Viewer) => IRoamHandler;
421
+ declare const createRoamHandler: (viewer: Cesium.Viewer) => IRoamHandler;
431
422
  interface IRoamOptions {
432
423
  /**
433
424
  * 唯一id, 默认为随机生成
@@ -436,7 +427,7 @@ interface IRoamOptions {
436
427
  /**
437
428
  * 漫游路径
438
429
  */
439
- positions: Cartesian3[];
430
+ positions: Cesium.Cartesian3[];
440
431
  /**
441
432
  * 飞行器参数
442
433
  */
@@ -459,7 +450,7 @@ interface IRoamOptions {
459
450
  /**
460
451
  * 漫游目标 可跟随物体和漫游路线设置
461
452
  */
462
- entity: Entity;
453
+ entity: Cesium.Entity;
463
454
  /**
464
455
  * 是否循环
465
456
  */
@@ -491,7 +482,7 @@ interface IRoamHandler {
491
482
  */
492
483
  stopTracked: () => void;
493
484
  remove: (roamItem: IRoamItem) => void;
494
- frameRoam: (roamItem: IRoamItem, time: JulianDate) => void;
485
+ frameRoam: (roamItem: IRoamItem, time: Cesium.JulianDate) => void;
495
486
  removeAll: () => void;
496
487
  Event: IRoamEvent;
497
488
  lockCameraView: (roamItem: IRoamItem) => void;
@@ -506,23 +497,23 @@ interface IRoamItem extends IRoamOptions {
506
497
  /**
507
498
  * 漫游路径
508
499
  */
509
- property: SampledPositionProperty;
500
+ property: Cesium.SampledPositionProperty;
510
501
  /**
511
502
  * 开始时间
512
503
  */
513
- startTime: JulianDate | undefined;
504
+ startTime: Cesium.JulianDate | undefined;
514
505
  /**
515
506
  * 结束时间
516
507
  */
517
- stopTime: JulianDate | undefined;
508
+ stopTime: Cesium.JulianDate | undefined;
518
509
  /**
519
510
  * 漫游状态
520
511
  */
521
512
  status: RoamStatus;
522
513
  }
523
514
  interface IRoaming {
524
- time: JulianDate;
525
- position: Cartesian3 | undefined;
515
+ time: Cesium.JulianDate;
516
+ position: Cesium.Cartesian3 | undefined;
526
517
  }
527
518
  interface IRoamEvent {
528
519
  /**
@@ -569,7 +560,7 @@ interface IRoamItemHPR {
569
560
 
570
561
  declare const createBottomStatusBar: (options: IBottomStatusBarOptions) => void;
571
562
  interface IBottomStatusBarOptions {
572
- viewer: Viewer;
563
+ viewer: Cesium.Viewer;
573
564
  /**
574
565
  * 显示方向角、俯仰角、侧翻角
575
566
  */
@@ -583,7 +574,7 @@ interface IBottomStatusBarOptions {
583
574
 
584
575
  declare const createOpenAnim: (options: IOpenAnimOptions) => Promise<unknown>;
585
576
  interface IOpenAnimOptions {
586
- viewer: Viewer;
577
+ viewer: Cesium.Viewer;
587
578
  center: {
588
579
  lat: number;
589
580
  lng: number;
@@ -610,7 +601,7 @@ declare const makeGridToInstanceForLine: (cartesianVertices: any, color: Cesium.
610
601
  * @param maxPoint
611
602
  * @param minPoint
612
603
  */
613
- declare const makeGridFromElevationExtrema: (maxPoint: Cartographic, minPoint: Cartographic) => Cartesian3[];
604
+ declare const makeGridFromElevationExtrema: (maxPoint: Cesium.Cartographic, minPoint: Cesium.Cartographic) => Cesium.Cartesian3[];
614
605
  /**
615
606
  * 使用底面和高度创建网格
616
607
  * @param topLeft
@@ -620,7 +611,7 @@ declare const makeGridFromElevationExtrema: (maxPoint: Cartographic, minPoint: C
620
611
  * @param minHeight
621
612
  * @param maxHeight
622
613
  */
623
- declare const mekeGridPolygonAndHeight: (topLeft: number, topRight: number, bottomRight: number, bottomLeft: number, minHeight: number, maxHeight: number) => Cartesian3[];
614
+ declare const mekeGridPolygonAndHeight: (topLeft: number, topRight: number, bottomRight: number, bottomLeft: number, minHeight: number, maxHeight: number) => Cesium.Cartesian3[];
624
615
 
625
616
  /**
626
617
  * 坐标转换工具库 - 实现了WGS84、GCJ02(火星坐标)和BD09(百度坐标)之间的相互转换
@@ -674,5 +665,5 @@ declare class CoordinateTransformer {
674
665
  static wgs84ToBd09(point: CoordinatePoint): CoordinatePoint;
675
666
  }
676
667
 
677
- export { BaseMaterialProperty, BasePrimitive, types as Common, CoordinateTransformer, DefaultViewerOptions, FlyAttitude, Popup, RoamStatus, Tooltip, calcArea, calcCameraHeightFromZoom, calcGeodesicDistance, calcGeodesicDistances, calcLerpPosition, calcPoistionCenter, calcSceneHeightFromPositions, calcScreenPositionFromPosition, calcSpaceDistance, calcSpaceDistances, calcTerrainHeightFromPositions, calcTriangleArea, calcZoomFromCameraHeight, clacPositionsForParabola, createBottomStatusBar, createEagleEye, createOpenAnim, createRoamHandler, createSkyBox, createSkyBoxOnGround, flyToCameraView, flyToCesium3DTile, flyToDataSource, flyToFromSphere, flyToImagery, flyToLnglat, flyToPosition, getCameraView, getCesiumForAutoFitScale, initCesium, initCesiumEvent, makeGridFromElevationExtrema, makeGridToInstanceForBox, makeGridToInstanceForLine, makeLnglatToPosition, makeLnglatsToLineGeojson, makeLnglatsToPointGeojson, makeLnglatsToPolygonGeojson, makeLnglatsToPositions, makePositionsClose, makePositionsForAntiClockwise, makePositionsForClockwise, makePositionsToLnglats, makePositiontoLnglat, makeYawPitchRollToHeadingPitchRoll, mekeGridPolygonAndHeight, numberId, randomColor, randomPointToGeoJson, randomPolygonToGeoJson, randomPolylineToGeoJson, setCesiumForAutoFitScale, setGlobeOpatity, setViewToLnglat, twinkleModel };
678
- export type { IOpenAnimOptions, IRoamEvent, IRoamHandler, IRoamItem, IRoamItemHPR, IRoaming };
668
+ export { BaseMaterialProperty, BasePrimitive, types as Common, CoordinateTransformer, DefaultViewerOptions, FlyAttitude, Popup, RoamStatus, Tooltip, calcArea, calcCameraHeightFromZoom, calcGeodesicDistance, calcGeodesicDistances, calcLerpPosition, calcPoistionCenter, calcSceneHeightFromPositions, calcSpaceDistance, calcSpaceDistances, calcTerrainHeightFromPositions, calcTriangleArea, calcZoomFromCameraHeight, clacPositionsForParabola, createBottomStatusBar, createEagleEye, createOpenAnim, createRoamHandler, createSkyBox, createSkyBoxOnGround, flyToCameraView, flyToCesium3DTile, flyToDataSource, flyToFromSphere, flyToImagery, flyToLnglat, flyToPosition, getCameraView, getCesiumForAutoFitScale, getInoCesiumBaseUrl, initCesium, initCesiumEvent, makeGridFromElevationExtrema, makeGridToInstanceForBox, makeGridToInstanceForLine, makeLnglatToPosition, makeLnglatsToLineGeojson, makeLnglatsToPointGeojson, makeLnglatsToPolygonGeojson, makeLnglatsToPositions, makePositionsClose, makePositionsForAntiClockwise, makePositionsForClockwise, makePositionsToLnglats, makePositiontoLnglat, makeYawPitchRollToHeadingPitchRoll, mekeGridPolygonAndHeight, numberId, randomColor, randomPointToGeoJson, randomPolygonToGeoJson, randomPolylineToGeoJson, setCesiumForAutoFitScale, setGlobeOpatity, setInoCesiumBaseUrl, setViewToLnglat, twinkleModel };
669
+ export type { DeepPartial, ICamearView, ICesiumEventListener, IOpenAnimOptions, IRoamEvent, IRoamHandler, IRoamItem, IRoamItemHPR, IRoaming, ISetViewByLngLatOptions, ISetViewByPositionOptions, ISkyBoxOnGroundOptions, ISkyBoxOptions, ISkyBoxSources, IYawPitchRoll };