@poor-knight/cesium-utils 0.0.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/dist/cesium-utils.cjs +40 -10
- package/dist/cesium-utils.d.ts +50 -0
- package/dist/cesium-utils.js +3651 -2801
- package/dist/cesium-utils.umd.cjs +40 -10
- package/package.json +2 -1
package/dist/cesium-utils.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
import { default as default_2 } from 'eventemitter3';
|
|
1
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
|
+
import { Feature } from 'geojson';
|
|
5
|
+
import { FeatureCollection } from 'geojson';
|
|
2
6
|
import { ImageryLayer } from 'cesium';
|
|
3
7
|
import { ImageryLayerFeatureInfo } from 'cesium';
|
|
8
|
+
import { Point } from 'geojson';
|
|
9
|
+
import { Popup } from 'cesium-extends';
|
|
4
10
|
import { TerrainProvider } from 'cesium';
|
|
5
11
|
import { Viewer } from 'cesium';
|
|
6
12
|
import { WebMapServiceImageryProvider } from 'cesium';
|
|
@@ -24,6 +30,50 @@ export declare interface Layer {
|
|
|
24
30
|
hide(viewer: Viewer): void;
|
|
25
31
|
}
|
|
26
32
|
|
|
33
|
+
/** 弹窗控制器 */
|
|
34
|
+
export declare class PopupCtrl extends default_2<{
|
|
35
|
+
onMount: (id: string | number) => void;
|
|
36
|
+
onUnmount: (id: string | number) => void;
|
|
37
|
+
}> {
|
|
38
|
+
private static instance;
|
|
39
|
+
private constructor();
|
|
40
|
+
static getInstance(): PopupCtrl;
|
|
41
|
+
popupMap: Map<string | number, {
|
|
42
|
+
popup: Popup;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
}>;
|
|
45
|
+
popup(payload: {
|
|
46
|
+
viewer: Cesium.Viewer;
|
|
47
|
+
id: string | number;
|
|
48
|
+
position: number[];
|
|
49
|
+
offset?: [number, number];
|
|
50
|
+
element: HTMLElement;
|
|
51
|
+
}): void;
|
|
52
|
+
close(id: string | number): void;
|
|
53
|
+
closeAll(): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**船只图层 */
|
|
57
|
+
export declare class ShipLayer implements Layer {
|
|
58
|
+
key: string;
|
|
59
|
+
zIndex: number;
|
|
60
|
+
db: Cesium.CustomDataSource;
|
|
61
|
+
constructor(key: string, zIndex: number);
|
|
62
|
+
private isMounted;
|
|
63
|
+
private _viewer;
|
|
64
|
+
show(viewer: Cesium.Viewer): void;
|
|
65
|
+
hide(): void;
|
|
66
|
+
entityMap: Map<string, Cesium.Entity>;
|
|
67
|
+
/**生成entity, geojson的id优先和mmsi保持一致,没有mmsi的情况下,使用nanoid生成 */
|
|
68
|
+
render(geojson: FeatureCollection<Point>): void;
|
|
69
|
+
/**渲染feature */
|
|
70
|
+
renderFeature(feature: Feature<Point>): void;
|
|
71
|
+
/**更新or新增feature */
|
|
72
|
+
update(feature: Feature<Point>): void;
|
|
73
|
+
private readonly IS_MOVING_THRESHOLD;
|
|
74
|
+
private renderEntity;
|
|
75
|
+
}
|
|
76
|
+
|
|
27
77
|
export declare class WmsLayer implements Layer {
|
|
28
78
|
private ctrl;
|
|
29
79
|
key: string;
|