@xingm/vmap-cesium-toolbar 0.0.1 → 0.0.2-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 (41) hide show
  1. package/dist/hooks/toolBarConfig.d.ts +6 -3
  2. package/dist/hooks/useDrawHelper.d.ts +63 -0
  3. package/dist/hooks/useOverlayHelper.d.ts +173 -0
  4. package/dist/index.d.ts +6 -1
  5. package/dist/index.js +2563 -1559
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.umd.js +124 -124
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/libs/{CesiumMapHelper.d.ts → CesiumMapDraw.d.ts} +33 -43
  10. package/dist/libs/CesiumMapLoader.d.ts +8 -2
  11. package/dist/libs/CesiumMapModel.d.ts +5 -2
  12. package/dist/libs/CesiumMapToolbar.d.ts +23 -67
  13. package/dist/libs/CesiumOverlayService.d.ts +111 -0
  14. package/dist/libs/{CesiumMapConfig.d.ts → config/CesiumMapConfig.d.ts} +3 -3
  15. package/dist/libs/drawHelper/BaseDraw.d.ts +116 -0
  16. package/dist/libs/drawHelper/DrawCircle.d.ts +25 -0
  17. package/dist/libs/drawHelper/DrawLine.d.ts +44 -0
  18. package/dist/libs/drawHelper/DrawPolgon.d.ts +24 -0
  19. package/dist/libs/drawHelper/DrawRectangle.d.ts +24 -0
  20. package/dist/libs/drawHelper/index.d.ts +5 -0
  21. package/dist/libs/overlay/MapCircle.d.ts +54 -0
  22. package/dist/libs/overlay/MapIcon.d.ts +55 -0
  23. package/dist/libs/overlay/MapInfoWindow.d.ts +73 -0
  24. package/dist/libs/overlay/MapLabel.d.ts +59 -0
  25. package/dist/libs/overlay/MapMarker.d.ts +46 -0
  26. package/dist/libs/overlay/MapPolygon.d.ts +49 -0
  27. package/dist/libs/overlay/MapPolyline.d.ts +46 -0
  28. package/dist/libs/overlay/MapRectangle.d.ts +44 -0
  29. package/dist/libs/overlay/MapSVG.d.ts +59 -0
  30. package/dist/libs/overlay/index.d.ts +20 -0
  31. package/dist/libs/overlay/types.d.ts +5 -0
  32. package/dist/libs/toolBar/CesiumMapController.d.ts +78 -0
  33. package/dist/libs/toolBar/MapLayersService.d.ts +66 -0
  34. package/dist/libs/toolBar/MapSearchService.d.ts +41 -0
  35. package/dist/libs/toolBar/MapToolBarConfig.d.ts +3 -0
  36. package/dist/libs/toolBar/MeasurementService.d.ts +16 -0
  37. package/dist/libs/toolBar/NotFlyZonesService.d.ts +46 -0
  38. package/dist/package.json +5 -5
  39. package/dist/utils/calc.d.ts +44 -0
  40. package/dist/utils/common.d.ts +1 -0
  41. package/package.json +5 -5
@@ -0,0 +1,24 @@
1
+ import { Cartesian3 } from '../../../node_modules/cesium';
2
+ import { BaseDraw, DrawResult, DrawOptions } from './BaseDraw';
3
+ /**
4
+ * 画矩形绘制类
5
+ */
6
+ export declare class DrawRectangle extends BaseDraw {
7
+ private currentRectangleEntity;
8
+ /**
9
+ * 开始绘制
10
+ */
11
+ startDrawing(options?: DrawOptions): void;
12
+ /**
13
+ * 更新绘制实体(预览)
14
+ */
15
+ updateDrawingEntity(previewPoint?: Cartesian3): void;
16
+ /**
17
+ * 完成绘制
18
+ */
19
+ finishDrawing(): DrawResult | null;
20
+ /**
21
+ * 获取绘制类型
22
+ */
23
+ getDrawType(): "line" | "polygon" | "rectangle" | "circle";
24
+ }
@@ -0,0 +1,5 @@
1
+ export { BaseDraw, type DrawResult, type DrawCallbacks, type DrawOptions } from './BaseDraw';
2
+ export { DrawLine } from './DrawLine';
3
+ export { DrawPolygon } from './DrawPolgon';
4
+ export { DrawRectangle } from './DrawRectangle';
5
+ export { DrawCircle } from './DrawCircle';
@@ -0,0 +1,54 @@
1
+ import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * Circle 选项
6
+ */
7
+ export interface CircleOptions {
8
+ position: OverlayPosition;
9
+ radius: number;
10
+ material?: Cesium.MaterialProperty | Color | string;
11
+ outline?: boolean;
12
+ outlineColor?: Color | string;
13
+ outlineWidth?: number;
14
+ heightReference?: HeightReference;
15
+ extrudedHeight?: number;
16
+ onClick?: (entity: Entity) => void;
17
+ id?: string;
18
+ }
19
+ /**
20
+ * Circle 工具类
21
+ */
22
+ export declare class MapCircle {
23
+ private viewer;
24
+ private entities;
25
+ constructor(viewer: Viewer);
26
+ /**
27
+ * 转换位置为 Cartesian3
28
+ */
29
+ private convertPosition;
30
+ /**
31
+ * 转换颜色
32
+ */
33
+ private resolveColor;
34
+ /**
35
+ * 解析材质
36
+ */
37
+ private resolveMaterial;
38
+ /**
39
+ * 添加 Circle(圆形)
40
+ */
41
+ add(options: CircleOptions): Entity;
42
+ /**
43
+ * 更新 Circle 位置
44
+ */
45
+ updatePosition(entity: Entity, position: OverlayPosition): void;
46
+ /**
47
+ * 更新 Circle 半径
48
+ */
49
+ updateRadius(entity: Entity, radius: number): void;
50
+ /**
51
+ * 更新 Circle 样式
52
+ */
53
+ updateStyle(entity: Entity, options: Partial<Pick<CircleOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
54
+ }
@@ -0,0 +1,55 @@
1
+ import { Viewer, Entity, Color, HeightReference, VerticalOrigin, HorizontalOrigin } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * Icon 选项
6
+ */
7
+ export interface IconOptions {
8
+ position: OverlayPosition;
9
+ image: string;
10
+ width?: number;
11
+ height?: number;
12
+ scale?: number;
13
+ rotation?: number;
14
+ pixelOffset?: Cesium.Cartesian2;
15
+ eyeOffset?: Cesium.Cartesian3;
16
+ horizontalOrigin?: HorizontalOrigin;
17
+ verticalOrigin?: VerticalOrigin;
18
+ heightReference?: HeightReference;
19
+ disableDepthTestDistance?: number;
20
+ color?: Color | string;
21
+ onClick?: (entity: Entity) => void;
22
+ id?: string;
23
+ }
24
+ /**
25
+ * Icon 工具类
26
+ */
27
+ export declare class MapIcon {
28
+ private viewer;
29
+ private entities;
30
+ constructor(viewer: Viewer);
31
+ /**
32
+ * 转换位置为 Cartesian3
33
+ */
34
+ private convertPosition;
35
+ /**
36
+ * 转换颜色
37
+ */
38
+ private resolveColor;
39
+ /**
40
+ * 添加 Icon(图标,使用 Billboard)
41
+ */
42
+ add(options: IconOptions): Entity;
43
+ /**
44
+ * 更新 Icon 位置
45
+ */
46
+ updatePosition(entity: Entity, position: OverlayPosition): void;
47
+ /**
48
+ * 更新 Icon 图片
49
+ */
50
+ updateImage(entity: Entity, image: string): void;
51
+ /**
52
+ * 更新 Icon 样式
53
+ */
54
+ updateStyle(entity: Entity, options: Partial<Pick<IconOptions, 'scale' | 'rotation' | 'color'>>): void;
55
+ }
@@ -0,0 +1,73 @@
1
+ import { Viewer, Entity } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from 'cesium';
4
+ export interface InfoWindowOptions {
5
+ position: OverlayPosition;
6
+ content: string | HTMLElement;
7
+ width?: number;
8
+ height?: number;
9
+ pixelOffset?: Cesium.Cartesian2;
10
+ show?: boolean;
11
+ onClick?: (entity: Entity) => void;
12
+ id?: string;
13
+ closable?: boolean;
14
+ onClose?: (entity: Entity) => void;
15
+ backgroundColor?: string;
16
+ color?: string;
17
+ font?: string;
18
+ hideWhenOutOfView?: boolean;
19
+ }
20
+ /**
21
+ * 面向 Cesium 的 HTML 信息窗口管理器
22
+ * 要求 container 为 position: relative 的 DOM 容器(通常与 viewer.canvas 同级或包裹)
23
+ */
24
+ export declare class MapInfoWindow {
25
+ private viewer;
26
+ private container;
27
+ private entityMap;
28
+ private currentTopZIndex;
29
+ constructor(viewer: Viewer, container: HTMLElement);
30
+ private convertPosition;
31
+ /**
32
+ * 将世界坐标转换为相对于 container 的 CSS 像素坐标
33
+ */
34
+ private getContainerPixelPosition;
35
+ /**
36
+ * 更新单个 infoWindow 的显示状态和位置
37
+ */
38
+ private updateDomPosition;
39
+ /**
40
+ * 创建 DOM 元素
41
+ */
42
+ private createDomElement;
43
+ /**
44
+ * 将指定 InfoWindow 置于最前
45
+ */
46
+ bringToFront(entity: Entity): void;
47
+ /**
48
+ * 添加信息窗口
49
+ */
50
+ add(options: InfoWindowOptions): Entity;
51
+ /**
52
+ * 更新位置
53
+ */
54
+ updatePosition(entity: Entity, position: OverlayPosition): void;
55
+ /**
56
+ * 更新内容
57
+ */
58
+ updateContent(entity: Entity, content: string | HTMLElement): void;
59
+ /**
60
+ * 显示/隐藏
61
+ */
62
+ setVisible(entity: Entity, visible: boolean): void;
63
+ show(entity: Entity): void;
64
+ hide(entity: Entity): void;
65
+ /**
66
+ * 移除信息窗口(清理 DOM + 监听器 + 实体)
67
+ */
68
+ remove(entity: Entity): void;
69
+ /**
70
+ * 销毁整个管理器(清理所有 infoWindow)
71
+ */
72
+ destroy(): void;
73
+ }
@@ -0,0 +1,59 @@
1
+ import { Viewer, Entity, Color, HeightReference, LabelStyle, VerticalOrigin, HorizontalOrigin } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * Label 选项
6
+ */
7
+ export interface LabelOptions {
8
+ position: OverlayPosition;
9
+ text: string;
10
+ font?: string;
11
+ fillColor?: Color | string;
12
+ outlineColor?: Color | string;
13
+ outlineWidth?: number;
14
+ style?: LabelStyle;
15
+ pixelOffset?: Cesium.Cartesian2;
16
+ eyeOffset?: Cesium.Cartesian3;
17
+ horizontalOrigin?: HorizontalOrigin;
18
+ verticalOrigin?: VerticalOrigin;
19
+ heightReference?: HeightReference;
20
+ scale?: number;
21
+ showBackground?: boolean;
22
+ backgroundColor?: Color | string;
23
+ backgroundPadding?: Cesium.Cartesian2;
24
+ disableDepthTestDistance?: number;
25
+ onClick?: (entity: Entity) => void;
26
+ id?: string;
27
+ }
28
+ /**
29
+ * Label 工具类
30
+ */
31
+ export declare class MapLabel {
32
+ private viewer;
33
+ private entities;
34
+ constructor(viewer: Viewer);
35
+ /**
36
+ * 转换位置为 Cartesian3
37
+ */
38
+ private convertPosition;
39
+ /**
40
+ * 转换颜色
41
+ */
42
+ private resolveColor;
43
+ /**
44
+ * 添加 Label(文本标签)
45
+ */
46
+ add(options: LabelOptions): Entity;
47
+ /**
48
+ * 更新 Label 位置
49
+ */
50
+ updatePosition(entity: Entity, position: OverlayPosition): void;
51
+ /**
52
+ * 更新 Label 文本
53
+ */
54
+ updateText(entity: Entity, text: string): void;
55
+ /**
56
+ * 更新 Label 样式
57
+ */
58
+ updateStyle(entity: Entity, options: Partial<Pick<LabelOptions, 'fillColor' | 'outlineColor' | 'outlineWidth' | 'font' | 'scale'>>): void;
59
+ }
@@ -0,0 +1,46 @@
1
+ import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * Marker 选项
6
+ */
7
+ export interface MarkerOptions {
8
+ position: OverlayPosition;
9
+ pixelSize?: number;
10
+ color?: Color | string;
11
+ outlineColor?: Color | string;
12
+ outlineWidth?: number;
13
+ heightReference?: HeightReference;
14
+ scaleByDistance?: Cesium.NearFarScalar;
15
+ disableDepthTestDistance?: number;
16
+ onClick?: (entity: Entity) => void;
17
+ id?: string;
18
+ }
19
+ /**
20
+ * Marker 工具类
21
+ */
22
+ export declare class MapMarker {
23
+ private viewer;
24
+ private entities;
25
+ constructor(viewer: Viewer);
26
+ /**
27
+ * 转换位置为 Cartesian3
28
+ */
29
+ private convertPosition;
30
+ /**
31
+ * 转换颜色
32
+ */
33
+ private resolveColor;
34
+ /**
35
+ * 添加 Marker(点标记)
36
+ */
37
+ add(options: MarkerOptions): Entity;
38
+ /**
39
+ * 更新 Marker 位置
40
+ */
41
+ updatePosition(entity: Entity, position: OverlayPosition): void;
42
+ /**
43
+ * 更新 Marker 样式
44
+ */
45
+ updateStyle(entity: Entity, options: Partial<Pick<MarkerOptions, 'color' | 'outlineColor' | 'outlineWidth' | 'pixelSize'>>): void;
46
+ }
@@ -0,0 +1,49 @@
1
+ import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * Polygon 选项
6
+ */
7
+ export interface PolygonOptions {
8
+ positions: OverlayPosition[];
9
+ material?: Cesium.MaterialProperty | Color | string;
10
+ outline?: boolean;
11
+ outlineColor?: Color | string;
12
+ outlineWidth?: number;
13
+ heightReference?: HeightReference;
14
+ extrudedHeight?: number;
15
+ onClick?: (entity: Entity) => void;
16
+ id?: string;
17
+ }
18
+ /**
19
+ * Polygon 工具类
20
+ */
21
+ export declare class MapPolygon {
22
+ private viewer;
23
+ private entities;
24
+ constructor(viewer: Viewer);
25
+ /**
26
+ * 转换位置为 Cartesian3
27
+ */
28
+ private convertPosition;
29
+ /**
30
+ * 转换颜色
31
+ */
32
+ private resolveColor;
33
+ /**
34
+ * 解析材质
35
+ */
36
+ private resolveMaterial;
37
+ /**
38
+ * 添加 Polygon(多边形)
39
+ */
40
+ add(options: PolygonOptions): Entity;
41
+ /**
42
+ * 更新 Polygon 位置
43
+ */
44
+ updatePositions(entity: Entity, positions: OverlayPosition[]): void;
45
+ /**
46
+ * 更新 Polygon 样式
47
+ */
48
+ updateStyle(entity: Entity, options: Partial<Pick<PolygonOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
49
+ }
@@ -0,0 +1,46 @@
1
+ import { Viewer, Entity, Color } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * Polyline 选项
6
+ */
7
+ export interface PolylineOptions {
8
+ positions: OverlayPosition[];
9
+ width?: number;
10
+ material?: Cesium.MaterialProperty | Color | string;
11
+ clampToGround?: boolean;
12
+ onClick?: (entity: Entity) => void;
13
+ id?: string;
14
+ }
15
+ /**
16
+ * Polyline 工具类
17
+ */
18
+ export declare class MapPolyline {
19
+ private viewer;
20
+ private entities;
21
+ constructor(viewer: Viewer);
22
+ /**
23
+ * 转换位置为 Cartesian3
24
+ */
25
+ private convertPosition;
26
+ /**
27
+ * 转换颜色
28
+ */
29
+ private resolveColor;
30
+ /**
31
+ * 解析材质
32
+ */
33
+ private resolveMaterial;
34
+ /**
35
+ * 添加 Polyline(折线)
36
+ */
37
+ add(options: PolylineOptions): Entity;
38
+ /**
39
+ * 更新 Polyline 位置
40
+ */
41
+ updatePositions(entity: Entity, positions: OverlayPosition[]): void;
42
+ /**
43
+ * 更新 Polyline 样式
44
+ */
45
+ updateStyle(entity: Entity, options: Partial<Pick<PolylineOptions, 'width' | 'material'>>): void;
46
+ }
@@ -0,0 +1,44 @@
1
+ import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
+ import * as Cesium from "cesium";
3
+ /**
4
+ * Rectangle 选项
5
+ */
6
+ export interface RectangleOptions {
7
+ coordinates: Cesium.Rectangle;
8
+ material?: Cesium.MaterialProperty | Color | string;
9
+ outline?: boolean;
10
+ outlineColor?: Color | string;
11
+ outlineWidth?: number;
12
+ heightReference?: HeightReference;
13
+ extrudedHeight?: number;
14
+ onClick?: (entity: Entity) => void;
15
+ id?: string;
16
+ }
17
+ /**
18
+ * Rectangle 工具类
19
+ */
20
+ export declare class MapRectangle {
21
+ private viewer;
22
+ private entities;
23
+ constructor(viewer: Viewer);
24
+ /**
25
+ * 转换颜色
26
+ */
27
+ private resolveColor;
28
+ /**
29
+ * 解析材质
30
+ */
31
+ private resolveMaterial;
32
+ /**
33
+ * 添加 Rectangle(矩形)
34
+ */
35
+ add(options: RectangleOptions): Entity;
36
+ /**
37
+ * 更新 Rectangle 坐标
38
+ */
39
+ updateCoordinates(entity: Entity, coordinates: Cesium.Rectangle): void;
40
+ /**
41
+ * 更新 Rectangle 样式
42
+ */
43
+ updateStyle(entity: Entity, options: Partial<Pick<RectangleOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
44
+ }
@@ -0,0 +1,59 @@
1
+ import { Viewer, Entity, Color, HeightReference, VerticalOrigin, HorizontalOrigin } from '../../../node_modules/cesium';
2
+ import { OverlayPosition } from './types';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * SVG 选项
6
+ */
7
+ export interface SvgOptions {
8
+ position: OverlayPosition;
9
+ svg: string;
10
+ width?: number;
11
+ height?: number;
12
+ scale?: number;
13
+ rotation?: number;
14
+ pixelOffset?: Cesium.Cartesian2;
15
+ eyeOffset?: Cesium.Cartesian3;
16
+ horizontalOrigin?: HorizontalOrigin;
17
+ verticalOrigin?: VerticalOrigin;
18
+ heightReference?: HeightReference;
19
+ disableDepthTestDistance?: number;
20
+ color?: Color | string;
21
+ onClick?: (entity: Entity) => void;
22
+ id?: string;
23
+ }
24
+ /**
25
+ * SVG 工具类
26
+ */
27
+ export declare class MapSVG {
28
+ private viewer;
29
+ private entities;
30
+ constructor(viewer: Viewer);
31
+ /**
32
+ * 转换位置为 Cartesian3
33
+ */
34
+ private convertPosition;
35
+ /**
36
+ * 转换颜色
37
+ */
38
+ private resolveColor;
39
+ /**
40
+ * 将 SVG 字符串转换为 data URL
41
+ */
42
+ private svgToDataUrl;
43
+ /**
44
+ * 添加 SVG(使用 Billboard)
45
+ */
46
+ add(options: SvgOptions): Entity;
47
+ /**
48
+ * 更新 SVG 位置
49
+ */
50
+ updatePosition(entity: Entity, position: OverlayPosition): void;
51
+ /**
52
+ * 更新 SVG 内容
53
+ */
54
+ updateSvg(entity: Entity, svg: string): void;
55
+ /**
56
+ * 更新 SVG 样式
57
+ */
58
+ updateStyle(entity: Entity, options: Partial<Pick<SvgOptions, 'scale' | 'rotation' | 'color'>>): void;
59
+ }
@@ -0,0 +1,20 @@
1
+ export { CesiumOverlayService } from '../CesiumOverlayService';
2
+ export { MapMarker } from './MapMarker';
3
+ export { MapLabel } from './MapLabel';
4
+ export { MapIcon } from './MapIcon';
5
+ export { MapSVG } from './MapSVG';
6
+ export { MapInfoWindow } from './MapInfoWindow';
7
+ export { MapPolyline } from './MapPolyline';
8
+ export { MapPolygon } from './MapPolygon';
9
+ export { MapRectangle } from './MapRectangle';
10
+ export { MapCircle } from './MapCircle';
11
+ export type { OverlayPosition } from './types';
12
+ export type { MarkerOptions } from './MapMarker';
13
+ export type { LabelOptions } from './MapLabel';
14
+ export type { IconOptions } from './MapIcon';
15
+ export type { SvgOptions } from './MapSVG';
16
+ export type { InfoWindowOptions } from './MapInfoWindow';
17
+ export type { PolylineOptions } from './MapPolyline';
18
+ export type { PolygonOptions } from './MapPolygon';
19
+ export type { RectangleOptions } from './MapRectangle';
20
+ export type { CircleOptions } from './MapCircle';
@@ -0,0 +1,5 @@
1
+ import { Cartesian3 } from '../../../node_modules/cesium';
2
+ /**
3
+ * 覆盖物位置类型
4
+ */
5
+ export type OverlayPosition = Cartesian3 | [number, number] | [number, number, number];
@@ -0,0 +1,78 @@
1
+ import { Viewer } from '../../../node_modules/cesium';
2
+ import { MapType, ZoomCallback } from '../CesiumMapModel';
3
+ interface MapInitialCenter {
4
+ longitude: number;
5
+ latitude: number;
6
+ height: number;
7
+ }
8
+ interface CesiumMapControllerOptions {
9
+ initialCenter?: MapInitialCenter;
10
+ /** 当前可用的地图类型列表(由外部维护),用于读取 maximumLevel 等配置 */
11
+ getMapTypes?: () => MapType[];
12
+ /** 获取当前底图类型 id(由外部维护) */
13
+ getCurrentMapTypeId?: () => string;
14
+ /** 获取当前天地图 token(用于从 provider 读取 maximumLevel 时保持行为一致) */
15
+ getToken?: () => string;
16
+ /** 缩放回调(来自 Toolbar 的 ZoomCallback) */
17
+ zoomCallback?: ZoomCallback;
18
+ /** 场景模式切换后回调(例如通知 DrawHelper 重新计算偏移) */
19
+ onSceneModeChanged?: () => void;
20
+ }
21
+ /**
22
+ * 负责地图相机控制、缩放层级和 2D/3D 切换等逻辑的控制器
23
+ * 与 UI(工具栏)解耦,避免 Cesium 细节散落在各处。
24
+ */
25
+ export declare class CesiumMapController {
26
+ private viewer;
27
+ private initialCenter?;
28
+ private getMapTypes?;
29
+ private getCurrentMapTypeId?;
30
+ private getToken?;
31
+ private zoomCallback?;
32
+ private onSceneModeChanged?;
33
+ constructor(viewer: Viewer, options?: CesiumMapControllerOptions);
34
+ /**
35
+ * 监听相机缩放,限制层级范围到 [1, 18],并参考当前底图的 maximumLevel
36
+ */
37
+ setupCameraZoomLimitListener(): void;
38
+ /**
39
+ * 获取当前地图层级(1-18)
40
+ */
41
+ getCurrentZoomLevel(): number;
42
+ /**
43
+ * 设置地图层级
44
+ * @param zoomLevel 目标层级(1-18)
45
+ */
46
+ setZoomLevel(zoomLevel: number): void;
47
+ /** 放大 */
48
+ zoomIn(): void;
49
+ /** 缩小 */
50
+ zoomOut(): void;
51
+ /**
52
+ * 2D/3D 切换
53
+ */
54
+ toggle2D3D(buttonElement: HTMLElement): void;
55
+ /**
56
+ * 复位到初始位置
57
+ */
58
+ resetLocation(): void;
59
+ setInitialCenter(center: MapInitialCenter): void;
60
+ getInitialCenter(): MapInitialCenter | undefined;
61
+ /**
62
+ * 切换全屏
63
+ */
64
+ toggleFullscreen(): void;
65
+ /**
66
+ * 检查是否处于全屏状态
67
+ */
68
+ isFullscreen(): boolean;
69
+ /**
70
+ * 进入全屏
71
+ */
72
+ enterFullscreen(): void;
73
+ /**
74
+ * 退出全屏
75
+ */
76
+ exitFullscreen(): void;
77
+ }
78
+ export {};
@@ -0,0 +1,66 @@
1
+ import { Viewer } from '../../../node_modules/cesium';
2
+ import { MapType } from '../CesiumMapModel';
3
+ /**
4
+ * 图层服务配置接口
5
+ */
6
+ export interface MapLayersServiceConfig {
7
+ mapTypes: MapType[];
8
+ currentMapType: string;
9
+ token: string;
10
+ isNoFlyZoneChecked: boolean;
11
+ isNoFlyZoneVisible: boolean;
12
+ onMapTypeChange?: (mapTypeId: string) => void;
13
+ onNoFlyZoneToggle?: (isChecked: boolean) => void;
14
+ onShowNoFlyZones?: () => Promise<void> | void;
15
+ }
16
+ /**
17
+ * 图层服务类
18
+ * 负责处理地图图层切换相关的所有逻辑
19
+ */
20
+ export declare class MapLayersService {
21
+ private viewer;
22
+ private toolbarElement;
23
+ private config;
24
+ private currentGeoWTFS;
25
+ constructor(viewer: Viewer, toolbarElement: HTMLElement, config: MapLayersServiceConfig);
26
+ /**
27
+ * 更新配置
28
+ */
29
+ updateConfig(config: Partial<MapLayersServiceConfig>): void;
30
+ /**
31
+ * 切换图层菜单
32
+ */
33
+ toggleLayers(buttonElement: HTMLElement): void;
34
+ /**
35
+ * 创建地图类型部分
36
+ */
37
+ private createMapTypeSection;
38
+ /**
39
+ * 创建地图类型项
40
+ */
41
+ private createMapTypeItem;
42
+ /**
43
+ * 创建叠加图层部分
44
+ */
45
+ private createOverlaySection;
46
+ /**
47
+ * 创建叠加图层项
48
+ */
49
+ private createOverlayItem;
50
+ /**
51
+ * 切换地图类型
52
+ */
53
+ switchMapType(mapTypeId: string): void;
54
+ /**
55
+ * 获取当前地图类型
56
+ */
57
+ getCurrentMapType(): string;
58
+ /**
59
+ * 关闭图层菜单
60
+ */
61
+ closeLayersMenu(): void;
62
+ /**
63
+ * 销毁图层服务
64
+ */
65
+ destroy(): void;
66
+ }