@xingm/vmap-cesium-toolbar 0.0.2-alpha.9 → 0.0.3-alpha.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.
Files changed (60) hide show
  1. package/README.md +22 -22
  2. package/dist/hooks/toolBarConfig.d.ts +4 -0
  3. package/dist/hooks/useDrawHelper.d.ts +7 -0
  4. package/dist/hooks/useDynamicRing.d.ts +44 -0
  5. package/dist/hooks/useHeatmapHelper.d.ts +7 -1
  6. package/dist/hooks/useMapInit.d.ts +14 -0
  7. package/dist/hooks/useOverlayHelper.d.ts +60 -4
  8. package/dist/hooks/usePointClusterHelper.d.ts +24 -0
  9. package/dist/i18n/en-US.d.ts +143 -0
  10. package/dist/i18n/index.d.ts +3 -0
  11. package/dist/i18n/zh-CN.d.ts +143 -0
  12. package/dist/index.d.ts +42 -831
  13. package/dist/{index.js → index.es.js} +6520 -1543
  14. package/dist/index.es.js.map +1 -0
  15. package/dist/index.umd.js +133 -39
  16. package/dist/index.umd.js.map +1 -1
  17. package/dist/libs/CesiumAutoRecover.d.ts +48 -0
  18. package/dist/libs/CesiumHeatmapLayer.d.ts +64 -0
  19. package/dist/libs/CesiumMapDraw.d.ts +84 -0
  20. package/dist/libs/CesiumMapLoader.d.ts +7 -0
  21. package/dist/libs/CesiumMapModel.d.ts +6 -0
  22. package/dist/libs/CesiumMapToolbar.d.ts +47 -5
  23. package/dist/libs/CesiumOverlayService.d.ts +120 -2
  24. package/dist/libs/CesiumPointClusterLayer.d.ts +73 -0
  25. package/dist/libs/drawHelper/BaseDraw.d.ts +24 -0
  26. package/dist/libs/drawHelper/DrawLine.d.ts +4 -0
  27. package/dist/libs/drawHelper/DrawPolgon.d.ts +6 -0
  28. package/dist/libs/i18n/en-US.d.ts +66 -0
  29. package/dist/libs/i18n/index.d.ts +25 -0
  30. package/dist/libs/i18n/zh-CN.d.ts +66 -0
  31. package/dist/libs/overlay/MapCircle.d.ts +65 -1
  32. package/dist/libs/overlay/MapIcon.d.ts +10 -0
  33. package/dist/libs/overlay/MapInfoWindow.d.ts +3 -3
  34. package/dist/libs/overlay/MapLabel.d.ts +10 -0
  35. package/dist/libs/overlay/MapMarker.d.ts +10 -0
  36. package/dist/libs/overlay/MapPolygon.d.ts +43 -1
  37. package/dist/libs/overlay/MapPolyline.d.ts +10 -0
  38. package/dist/libs/overlay/MapRectangle.d.ts +43 -0
  39. package/dist/libs/overlay/MapRing.d.ts +10 -0
  40. package/dist/libs/overlay/MapSVG.d.ts +10 -0
  41. package/dist/libs/overlay/OverlayEditController.d.ts +127 -0
  42. package/dist/libs/overlay/index.d.ts +1 -0
  43. package/dist/libs/overlay/primitives/CirclePrimitiveBatch.d.ts +41 -0
  44. package/dist/libs/overlay/primitives/CirclePrimitiveLayerStack.d.ts +24 -0
  45. package/dist/libs/overlay/primitives/PolygonPrimitiveBatch.d.ts +42 -0
  46. package/dist/libs/overlay/primitives/PolygonPrimitiveLayerStack.d.ts +24 -0
  47. package/dist/libs/overlay/primitives/RectanglePrimitiveBatch.d.ts +40 -0
  48. package/dist/libs/overlay/primitives/RectanglePrimitiveLayerStack.d.ts +24 -0
  49. package/dist/libs/overlay/types.d.ts +78 -0
  50. package/dist/libs/toolBar/CesiumMapController.d.ts +6 -0
  51. package/dist/libs/toolBar/MapLayersService.d.ts +5 -0
  52. package/dist/libs/toolBar/MapSearchService.d.ts +7 -1
  53. package/dist/libs/toolBar/MapToolBarConfig.d.ts +8 -1
  54. package/dist/libs/toolBar/NotFlyZonesService.d.ts +5 -0
  55. package/dist/utils/calc.d.ts +6 -0
  56. package/dist/utils/selfIntersection.d.ts +13 -0
  57. package/package.json +13 -8
  58. package/dist/index.js.map +0 -1
  59. package/dist/package.json +0 -45
  60. package/dist/style.css +0 -162
package/README.md CHANGED
@@ -28,12 +28,14 @@ import { CesiumMapToolbar, initCesium } from '@xingm/vmap-cesium-toolbar';
28
28
  import '@xingm/vmap-cesium-toolbar/style';
29
29
 
30
30
  // 初始化Cesium
31
- const viewer = initCesium('cesiumContainer', {
32
- terrainProvider: Cesium.createWorldTerrain()
33
- });
31
+ (async () => {
32
+ const { viewer } = await initCesium('cesiumContainer', {
33
+ terrainProvider: Cesium.createWorldTerrain(),
34
+ });
34
35
 
35
- // 创建工具栏
36
- const toolbar = new CesiumMapToolbar(viewer, document.getElementById('toolbar'));
36
+ // 创建工具栏
37
+ const toolbar = new CesiumMapToolbar(viewer, document.getElementById('toolbar'));
38
+ })();
37
39
  ```
38
40
 
39
41
  ### Vue 3 项目中使用
@@ -52,11 +54,12 @@ import '@xingm/vmap-cesium-toolbar/style';
52
54
  let viewer;
53
55
  let toolbar;
54
56
 
55
- onMounted(() => {
57
+ onMounted(async () => {
56
58
  // 初始化Cesium
57
- viewer = initCesium('cesiumContainer', {
58
- terrainProvider: Cesium.createWorldTerrain()
59
+ const result = await initCesium('cesiumContainer', {
60
+ terrainProvider: Cesium.createWorldTerrain(),
59
61
  });
62
+ viewer = result.viewer;
60
63
 
61
64
  // 创建工具栏
62
65
  toolbar = new CesiumMapToolbar(viewer, document.getElementById('toolbar'));
@@ -80,30 +83,26 @@ const toolbar = new CesiumMapToolbar(
80
83
  );
81
84
  ```
82
85
 
83
- ### CesiumMapHelper
86
+ ### DrawHelper
84
87
 
85
- 地图辅助工具类,提供绘制和测量功能。
88
+ 绘制工具类(包的默认导出),提供线/面/矩形/圆等交互绘制能力。
86
89
 
87
90
  ```typescript
88
- import { CesiumMapHelper } from '@xingm/vmap-cesium-toolbar';
91
+ import DrawHelper from '@xingm/vmap-cesium-toolbar';
89
92
 
90
- const helper = new CesiumMapHelper(viewer);
91
- helper.startDrawing('line'); // 开始绘制线条
92
- helper.startMeasurement('distance'); // 开始距离测量
93
+ const drawHelper = new DrawHelper(viewer);
94
+ drawHelper.startDrawingPolygon();
93
95
  ```
94
96
 
95
- ### CesiumMapLoader
97
+ ### initCesium
96
98
 
97
- Cesium初始化工具,简化Cesium的配置和初始化。
99
+ Cesium 初始化函数,简化 Viewer 创建、底图/地形与初始视角配置。
98
100
 
99
101
  ```typescript
100
- import { CesiumMapLoader } from '@xingm/vmap-cesium-toolbar';
102
+ import { initCesium } from '@xingm/vmap-cesium-toolbar';
101
103
 
102
- const viewer = CesiumMapLoader.init('container', {
103
- terrainProvider: Cesium.createWorldTerrain(),
104
- imageryProvider: new Cesium.OpenStreetMapImageryProvider({
105
- url: 'https://a.tile.openstreetmap.org/'
106
- })
104
+ const { viewer } = await initCesium('cesiumContainer', {
105
+ cesiumToken: 'your_cesium_ion_token',
107
106
  });
108
107
  ```
109
108
 
@@ -231,6 +230,7 @@ npm run dev
231
230
  - [CesiumMapToolbar API](./doc/CesiumMapToolbar_API.md)
232
231
  - [CesiumMapHelper API](./doc/CesiumMapHelper_API.md)
233
232
  - [CesiumMapLoader API](./doc/CesiumMapLoader_API.md)
233
+ - [CesiumOverlayService API](./doc/CesiumOverlayService_API.md)
234
234
 
235
235
  ## 依赖要求
236
236
 
@@ -15,6 +15,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
15
15
  id: string;
16
16
  icon: string;
17
17
  title: string;
18
+ titleKey: string;
18
19
  color: string;
19
20
  borderColor: string;
20
21
  backgroundColor: string;
@@ -25,6 +26,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
25
26
  id: string;
26
27
  icon: string;
27
28
  title: string;
29
+ titleKey: string;
28
30
  color: string;
29
31
  backgroundColor: string;
30
32
  borderColor?: undefined;
@@ -36,6 +38,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
36
38
  icon: boolean;
37
39
  activeIcon: boolean;
38
40
  title: string;
41
+ titleKey: string;
39
42
  color: string;
40
43
  backgroundColor: string;
41
44
  borderColor?: undefined;
@@ -45,6 +48,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
45
48
  id: string;
46
49
  icon: string;
47
50
  title: string;
51
+ titleKey: string;
48
52
  color: string;
49
53
  borderColor: string;
50
54
  backgroundColor: string;
@@ -18,6 +18,7 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
18
18
  clearAllEntities: () => void;
19
19
  clearAllPoints: () => void;
20
20
  removeEntity: (entity: Cesium.Entity) => void;
21
+ getEntityLabelEntities: (entity: Cesium.Entity) => Cesium.Entity[];
21
22
  getFinishedEntities: () => Cesium.Entity[];
22
23
  onMeasureComplete: (callback: (result: {
23
24
  type: "line" | "polygon" | "rectangle" | "circle";
@@ -41,6 +42,7 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
41
42
  clearAllEntities: () => void;
42
43
  clearAllPoints: () => void;
43
44
  removeEntity: (entity: Cesium.Entity) => void;
45
+ getEntityLabelEntities: (entity: Cesium.Entity) => Cesium.Entity[];
44
46
  getFinishedEntities: () => Cesium.Entity[];
45
47
  onMeasureComplete: (callback: (result: {
46
48
  type: "line" | "polygon" | "rectangle" | "circle";
@@ -59,7 +61,12 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
59
61
  endDrawing: () => void;
60
62
  addDrawLine: () => void;
61
63
  addDrawArea: () => void;
64
+ addDrawAreaNoLabel: () => void;
62
65
  addDrawCircle: () => void;
66
+ addDrawCircleNoLabel: () => void;
63
67
  addDrawPolygon: () => void;
68
+ addDrawPolygonNoLabel: () => void;
69
+ addDrawPolygon_PointIntercept: () => void;
70
+ addDrawPolygon_FinishFallback: () => void;
64
71
  destroyDrawHelper: () => void;
65
72
  };
@@ -0,0 +1,44 @@
1
+ import { Viewer } from '../../node_modules/cesium';
2
+ import * as Cesium from "cesium";
3
+ export type CleanupFn = () => void;
4
+ export type RingDirection = "outward" | "inward";
5
+ export type AddDynamicRingOptions = {
6
+ position: Cesium.Cartesian3;
7
+ color?: Cesium.Color;
8
+ width?: number;
9
+ height?: number;
10
+ scale?: number;
11
+ direction?: RingDirection;
12
+ imageSize?: number;
13
+ disableDepthTestDistance?: number;
14
+ };
15
+ export type DynamicRingInstance = {
16
+ billboard: Cesium.Billboard;
17
+ color: Cesium.Color;
18
+ direction: RingDirection;
19
+ };
20
+ export declare function getRingCanvas(size?: number): HTMLCanvasElement;
21
+ export declare function addDynamicRing(collection: Cesium.BillboardCollection, options: AddDynamicRingOptions): DynamicRingInstance;
22
+ export type StartDynamicRingOptions = {
23
+ lon: number;
24
+ lat: number;
25
+ /** 任选其一:radiusMeters / diameterMeters / widthMeters+heightMeters */
26
+ radiusMeters?: number;
27
+ diameterMeters?: number;
28
+ widthMeters?: number;
29
+ heightMeters?: number;
30
+ color?: Cesium.Color;
31
+ /** 发散方向:outward(由小到大) / inward(由大到小) */
32
+ direction?: RingDirection;
33
+ heightOffset?: number;
34
+ imageSize?: number;
35
+ disableDepthTestDistance?: number;
36
+ period?: number;
37
+ baseScale?: number;
38
+ scaleRange?: number;
39
+ baseAlpha?: number;
40
+ };
41
+ /**
42
+ * 一站式:创建光圈 + 贴地采样 + preRender 动画,并返回 cleanup
43
+ */
44
+ export declare function startDynamicRing(viewer: Viewer, options: StartDynamicRingOptions): CleanupFn;
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { default as CesiumHeatmapLayer, HeatPoint, HeatmapOptions, HeatmapGradient } from '../libs/CesiumHeatmapLayer';
2
+ import { default as CesiumHeatmapLayer, HeatPoint, HeatmapOptions, HeatmapGradient, HeatmapAutoUpdateOptions } from '../libs/CesiumHeatmapLayer';
3
3
  import * as Cesium from "cesium";
4
4
  /**
5
5
  * 热力图相关的辅助逻辑
@@ -11,12 +11,16 @@ export declare function useHeatmapHelper(viewer: Ref<Cesium.Viewer | undefined>)
11
11
  setOpacity: (opacity: number) => void;
12
12
  setVisible: (visible: boolean) => void;
13
13
  destroy: () => void;
14
+ setAutoUpdate: (options?: HeatmapAutoUpdateOptions) => void;
15
+ stopAutoUpdate: () => void;
14
16
  } | null, CesiumHeatmapLayer | {
15
17
  setData: (points: HeatPoint[]) => void;
16
18
  setGradient: (gradient: HeatmapGradient) => void;
17
19
  setOpacity: (opacity: number) => void;
18
20
  setVisible: (visible: boolean) => void;
19
21
  destroy: () => void;
22
+ setAutoUpdate: (options?: HeatmapAutoUpdateOptions) => void;
23
+ stopAutoUpdate: () => void;
20
24
  } | null>;
21
25
  visible: Ref<boolean, boolean>;
22
26
  initHeatmap: (options?: HeatmapOptions) => void;
@@ -24,5 +28,7 @@ export declare function useHeatmapHelper(viewer: Ref<Cesium.Viewer | undefined>)
24
28
  setHeatmapVisible: (v: boolean) => void;
25
29
  setHeatmapOpacity: (alpha: number) => void;
26
30
  setHeatmapGradient: (gradient: HeatmapGradient) => void;
31
+ setHeatmapAutoUpdate: (options?: HeatmapAutoUpdateOptions) => void;
32
+ stopHeatmapAutoUpdate: () => void;
27
33
  destroyHeatmap: () => void;
28
34
  };
@@ -0,0 +1,14 @@
1
+ export declare const TD_Map_TOKEN: any;
2
+ export declare const China_Map_Bound = "73.5577,18.1597,135.0882,53.5609";
3
+ export declare const China_Map_Center: {
4
+ longitude: number;
5
+ latitude: number;
6
+ height: number;
7
+ };
8
+ export declare const China_Map_Extent: {
9
+ west: number;
10
+ south: number;
11
+ east: number;
12
+ north: number;
13
+ };
14
+ export declare const TD_Map_Search_URL: (keywords: string, mapConfig: any, token?: any) => string;
@@ -1,7 +1,16 @@
1
1
  import { Ref } from 'vue';
2
2
  import { Entity } from '../../node_modules/cesium';
3
+ import { OverlayEntity } from '../libs/overlay/types';
3
4
  import { CesiumOverlayService } from '../libs/overlay';
4
5
  import * as Cesium from "cesium";
6
+ type OverlayEditChangeHandler = (entity: Entity & OverlayEntity) => void;
7
+ type OverlayHelperOptions = {
8
+ /**
9
+ * 覆盖物编辑模式下,拖拽结束且几何变化时触发。
10
+ * 可用于同步业务数据或触发保存。
11
+ */
12
+ onOverlayEditChange?: OverlayEditChangeHandler;
13
+ };
5
14
  /**
6
15
  * 覆盖物相关的辅助逻辑
7
16
  * - 提供添加点位(Marker)与示例覆盖物的便捷方法
@@ -9,6 +18,9 @@ import * as Cesium from "cesium";
9
18
  */
10
19
  export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>, message: Ref<string>): {
11
20
  overlayService: Ref<{
21
+ beginBulkUpdate: () => void;
22
+ endBulkUpdate: () => void;
23
+ bulkUpdate: <T>(fn: () => T) => T;
12
24
  readonly marker: {
13
25
  add: (options: import('../libs/overlay').MarkerOptions) => Entity;
14
26
  updatePosition: (entity: Entity, position: import('../libs/overlay').OverlayPosition) => void;
@@ -60,12 +72,18 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
60
72
  updatePositions: (entity: Entity, positions: import('../libs/overlay').OverlayPosition[]) => void;
61
73
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').PolygonOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
62
74
  remove: (entityOrId: Entity | string) => boolean;
75
+ setPrimitiveVisible: (entity: Entity, visible: boolean) => void;
76
+ applyPrimitiveHighlight: (entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number) => void;
77
+ restorePrimitiveHighlight: (entity: OverlayEntity) => void;
63
78
  };
64
79
  readonly rectangle: {
65
80
  add: (options: import('../libs/overlay').RectangleOptions) => Entity;
66
81
  updateCoordinates: (entity: Entity, coordinates: Cesium.Rectangle) => void;
67
82
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').RectangleOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
68
83
  remove: (entityOrId: Entity | string) => boolean;
84
+ setPrimitiveVisible: (entity: Entity, visible: boolean) => void;
85
+ applyPrimitiveHighlight: (entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number) => void;
86
+ restorePrimitiveHighlight: (entity: OverlayEntity) => void;
69
87
  };
70
88
  readonly circle: {
71
89
  add: (options: import('../libs/overlay').CircleOptions) => Entity;
@@ -73,6 +91,9 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
73
91
  updateRadius: (entity: Entity, radius: number) => void;
74
92
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').CircleOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
75
93
  remove: (entityOrId: Entity | string) => boolean;
94
+ setPrimitiveVisible: (entity: Entity, visible: boolean) => void;
95
+ applyPrimitiveHighlight: (entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number) => void;
96
+ restorePrimitiveHighlight: (entity: OverlayEntity) => void;
76
97
  };
77
98
  readonly ring: {
78
99
  add: (options: import('../libs/overlay').RingOptions) => Entity;
@@ -82,6 +103,12 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
82
103
  setVisible: (entity: Entity, visible: boolean) => void;
83
104
  remove: (entityOrId: Entity | string) => boolean;
84
105
  };
106
+ setOverlayEditMode: (enabled: boolean) => void;
107
+ getOverlayEditModeEnabled: () => boolean;
108
+ stopOverlayEdit: () => void;
109
+ startOverlayEdit: (entityOrId: (import('..').DrawEntity & OverlayEntity) | string) => boolean;
110
+ toggleOverlayHighlight: (entity: OverlayEntity, reason?: "click" | "hover") => void;
111
+ setOverlayHighlight: (entityOrId: OverlayEntity | string, enabled: boolean, reason?: "click" | "hover") => boolean;
85
112
  addMarker: (options: import('../libs/overlay').MarkerOptions) => Entity;
86
113
  addLabel: (options: import('../libs/overlay').LabelOptions) => Entity;
87
114
  addIcon: (options: import('../libs/overlay').IconOptions) => Entity;
@@ -101,6 +128,9 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
101
128
  getAllOverlays: () => Entity[];
102
129
  destroy: () => void;
103
130
  } | null, CesiumOverlayService | {
131
+ beginBulkUpdate: () => void;
132
+ endBulkUpdate: () => void;
133
+ bulkUpdate: <T>(fn: () => T) => T;
104
134
  readonly marker: {
105
135
  add: (options: import('../libs/overlay').MarkerOptions) => Entity;
106
136
  updatePosition: (entity: Entity, position: import('../libs/overlay').OverlayPosition) => void;
@@ -152,12 +182,18 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
152
182
  updatePositions: (entity: Entity, positions: import('../libs/overlay').OverlayPosition[]) => void;
153
183
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').PolygonOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
154
184
  remove: (entityOrId: Entity | string) => boolean;
185
+ setPrimitiveVisible: (entity: Entity, visible: boolean) => void;
186
+ applyPrimitiveHighlight: (entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number) => void;
187
+ restorePrimitiveHighlight: (entity: OverlayEntity) => void;
155
188
  };
156
189
  readonly rectangle: {
157
190
  add: (options: import('../libs/overlay').RectangleOptions) => Entity;
158
191
  updateCoordinates: (entity: Entity, coordinates: Cesium.Rectangle) => void;
159
192
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').RectangleOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
160
193
  remove: (entityOrId: Entity | string) => boolean;
194
+ setPrimitiveVisible: (entity: Entity, visible: boolean) => void;
195
+ applyPrimitiveHighlight: (entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number) => void;
196
+ restorePrimitiveHighlight: (entity: OverlayEntity) => void;
161
197
  };
162
198
  readonly circle: {
163
199
  add: (options: import('../libs/overlay').CircleOptions) => Entity;
@@ -165,6 +201,9 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
165
201
  updateRadius: (entity: Entity, radius: number) => void;
166
202
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').CircleOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
167
203
  remove: (entityOrId: Entity | string) => boolean;
204
+ setPrimitiveVisible: (entity: Entity, visible: boolean) => void;
205
+ applyPrimitiveHighlight: (entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number) => void;
206
+ restorePrimitiveHighlight: (entity: OverlayEntity) => void;
168
207
  };
169
208
  readonly ring: {
170
209
  add: (options: import('../libs/overlay').RingOptions) => Entity;
@@ -174,6 +213,12 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
174
213
  setVisible: (entity: Entity, visible: boolean) => void;
175
214
  remove: (entityOrId: Entity | string) => boolean;
176
215
  };
216
+ setOverlayEditMode: (enabled: boolean) => void;
217
+ getOverlayEditModeEnabled: () => boolean;
218
+ stopOverlayEdit: () => void;
219
+ startOverlayEdit: (entityOrId: (import('..').DrawEntity & OverlayEntity) | string) => boolean;
220
+ toggleOverlayHighlight: (entity: OverlayEntity, reason?: "click" | "hover") => void;
221
+ setOverlayHighlight: (entityOrId: OverlayEntity | string, enabled: boolean, reason?: "click" | "hover") => boolean;
177
222
  addMarker: (options: import('../libs/overlay').MarkerOptions) => Entity;
178
223
  addLabel: (options: import('../libs/overlay').LabelOptions) => Entity;
179
224
  addIcon: (options: import('../libs/overlay').IconOptions) => Entity;
@@ -193,20 +238,31 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
193
238
  getAllOverlays: () => Entity[];
194
239
  destroy: () => void;
195
240
  } | null>;
196
- initOverlayService: () => void;
241
+ initOverlayService: (options?: OverlayHelperOptions) => void;
197
242
  addMarker: () => void;
198
243
  addMarkerWithLabel: () => void;
199
244
  addLabel: (options: any) => void;
200
- addIcon: () => void;
201
- addSvg: () => void;
245
+ addIcon: (coords?: {
246
+ longitude: number;
247
+ latitude: number;
248
+ }) => void;
249
+ addSvg: (coords?: {
250
+ longitude: number;
251
+ latitude: number;
252
+ }) => void;
202
253
  addPolyline: () => void;
203
254
  addLine: () => void;
204
255
  addArea: () => void;
205
256
  addCircle: () => void;
206
- addRing: () => void;
257
+ addCircle123: () => void;
258
+ addRing: (i?: number) => Cesium.Entity | undefined;
207
259
  addPolygon: () => void;
208
260
  addRectangle: () => void;
209
261
  addInfoWindow: () => void;
262
+ closeInfoWindow: () => void;
263
+ testSetOverlayHighlight: () => void;
264
+ testToggleOverlayHighlight: () => void;
210
265
  cancelMarkerMode: () => void;
211
266
  destroyOverlayService: () => void;
212
267
  };
268
+ export {};
@@ -0,0 +1,24 @@
1
+ import { Ref } from 'vue';
2
+ import { default as CesiumPointClusterLayer, ClusterPoint, PointClusterLayerOptions } from '../libs/CesiumPointClusterLayer';
3
+ import * as Cesium from 'cesium';
4
+ /**
5
+ * 点聚类图层相关的辅助逻辑(Vue3 composition API)
6
+ */
7
+ export declare function usePointClusterHelper(viewer: Ref<Cesium.Viewer | undefined>): {
8
+ clusterLayer: Ref<{
9
+ setData: (points: ClusterPoint[]) => void;
10
+ setVisible: (visible: boolean) => void;
11
+ setClusteringEnabled: (enabled: boolean) => void;
12
+ destroy: () => void;
13
+ } | null, CesiumPointClusterLayer | {
14
+ setData: (points: ClusterPoint[]) => void;
15
+ setVisible: (visible: boolean) => void;
16
+ setClusteringEnabled: (enabled: boolean) => void;
17
+ destroy: () => void;
18
+ } | null>;
19
+ visible: Ref<boolean, boolean>;
20
+ initCluster: (options?: PointClusterLayerOptions) => void;
21
+ updateClusterData: (points: ClusterPoint[]) => void;
22
+ setClusterVisible: (v: boolean) => void;
23
+ destroyCluster: () => void;
24
+ };
@@ -0,0 +1,143 @@
1
+ declare const enUS: {
2
+ locale: string;
3
+ app: {
4
+ lang: {
5
+ zh: string;
6
+ en: string;
7
+ };
8
+ located: string;
9
+ init_success: string;
10
+ heatmap_empty: string;
11
+ heatmap_need_add: string;
12
+ heatmap_added: string;
13
+ heatmap_auto_on: string;
14
+ heatmap_auto_off: string;
15
+ heatmap_lod_coarse: string;
16
+ heatmap_lod_medium: string;
17
+ heatmap_lod_fine: string;
18
+ ring_test_added: string;
19
+ custom_alert: string;
20
+ custom_stats: string;
21
+ custom_visibility: string;
22
+ custom_alert_title: string;
23
+ custom_stats_title: string;
24
+ custom_visibility_title: string;
25
+ };
26
+ ui: {
27
+ draw: {
28
+ line: string;
29
+ area: string;
30
+ area_no_label: string;
31
+ circle: string;
32
+ circle_no_label: string;
33
+ polygon: string;
34
+ polygon_point_intercept: string;
35
+ polygon_finish_fallback: string;
36
+ polygon_no_label: string;
37
+ };
38
+ add: {
39
+ marker: string;
40
+ line: string;
41
+ area: string;
42
+ circle: string;
43
+ circle123: string;
44
+ polygon: string;
45
+ polyline: string;
46
+ icon: string;
47
+ svg: string;
48
+ marker_with_label: string;
49
+ label: string;
50
+ rectangle: string;
51
+ info_window: string;
52
+ ring: string;
53
+ ring_test: string;
54
+ heatmap: string;
55
+ };
56
+ test: {
57
+ set_highlight: string;
58
+ toggle_highlight: string;
59
+ };
60
+ heatmap: {
61
+ auto_on: string;
62
+ auto_off: string;
63
+ lod_coarse: string;
64
+ lod_medium: string;
65
+ lod_fine: string;
66
+ };
67
+ overlay_edit: {
68
+ enable: string;
69
+ disable: string;
70
+ stop: string;
71
+ };
72
+ };
73
+ draw: {
74
+ start: {
75
+ line: string;
76
+ rectangle: string;
77
+ rectangle_no_label: string;
78
+ circle: string;
79
+ circle_no_label: string;
80
+ polygon: string;
81
+ polygon_no_label: string;
82
+ polygon_point_intercept: string;
83
+ polygon_finish_fallback: string;
84
+ };
85
+ done: {
86
+ line: string;
87
+ rectangle: string;
88
+ rectangle_no_label: string;
89
+ circle: string;
90
+ circle_no_label: string;
91
+ polygon: string;
92
+ polygon_no_label: string;
93
+ polygon_point_intercept_ok: string;
94
+ polygon_point_intercept_end: string;
95
+ polygon_finish_fallback_ok: string;
96
+ polygon_finish_fallback_blocked: string;
97
+ };
98
+ };
99
+ overlay: {
100
+ marker_mode: string;
101
+ marker_added: string;
102
+ marker_position: string;
103
+ sample_marker_label: string;
104
+ sample_marker_added: string;
105
+ icon_added: string;
106
+ icon_clicked: string;
107
+ svg_added: string;
108
+ svg_clicked: string;
109
+ polyline_added: string;
110
+ polyline_clicked: string;
111
+ line_added: string;
112
+ line_clicked: string;
113
+ area_added: string;
114
+ area_a_clicked: string;
115
+ area_b_clicked: string;
116
+ circle_added: string;
117
+ circle_a_clicked: string;
118
+ circle_b_clicked: string;
119
+ circle_c_clicked: string;
120
+ circle_d_clicked: string;
121
+ circle_e_clicked: string;
122
+ circle_alarm_clicked: string;
123
+ circle_detect_clicked: string;
124
+ rectangle_added: string;
125
+ rectangle_a_clicked: string;
126
+ rectangle_b_clicked: string;
127
+ rectangle_c_clicked: string;
128
+ rectangle_d_clicked: string;
129
+ rectangle_e_clicked: string;
130
+ highlight_need_rect_b: string;
131
+ highlight_need_rect_e: string;
132
+ info_window_added: string;
133
+ info_clicked: string;
134
+ info_window_title: string;
135
+ info_window_desc: string;
136
+ ring_added: string;
137
+ ring_clicked: string;
138
+ edit_mode_on: string;
139
+ edit_mode_off: string;
140
+ edit_stopped: string;
141
+ };
142
+ };
143
+ export default enUS;
@@ -0,0 +1,3 @@
1
+ import { I18nLike } from '../libs/i18n';
2
+ export declare const i18n: I18nLike;
3
+ export type { I18nLike };