@jorgmoritz/gis-manager 0.1.21

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,160 @@
1
+ import * as Cesium from 'cesium';
2
+ import { V as VertexDetailInfo, a as VertexOperationInfo } from '../VertexDetailInfo-BoVDy22s.cjs';
3
+
4
+ /**
5
+ * 🎨 GisViewer 组件 - Vue3 声明式地图容器
6
+ *
7
+ * @example
8
+ * ```vue
9
+ * <template>
10
+ * <GisViewer
11
+ * :cesium="Cesium"
12
+ * :options="{ timeline: false, animation: false }"
13
+ * @ready="handleReady"
14
+ * class="map-container"
15
+ * style="width: 100%; height: 100vh;"
16
+ * />
17
+ * </template>
18
+ *
19
+ * <script setup>
20
+ * import * as Cesium from 'cesium';
21
+ * import GisViewer from '@jorgmoritz/gis-manager/vue';
22
+ *
23
+ * const handleReady = ({ sceneManager, czmlManager, cameraManager, viewer }) => {
24
+ * console.log('地图已就绪', viewer);
25
+ *
26
+ * // 使用 czmlManager 管理路径
27
+ * czmlManager.createPath(...);
28
+ * };
29
+ * </script>
30
+ * ```
31
+ */
32
+ declare const _default: any;
33
+
34
+ /**
35
+ * GIS 查看器配置选项
36
+ */
37
+ interface GisViewerOptions {
38
+ /** Cesium 初始化选项(会合并到 container 配置中) */
39
+ [key: string]: any;
40
+ }
41
+ /**
42
+ * Vue Ref 类型(兼容 Vue 2 和 Vue 3)
43
+ */
44
+ interface VueRef<T> {
45
+ value: T;
46
+ }
47
+ /**
48
+ * 路径绘制选项
49
+ */
50
+ interface PathDrawingOptions {
51
+ layer?: Cesium.CustomDataSource;
52
+ idPrefix?: string;
53
+ defaultHeight?: number;
54
+ width?: number;
55
+ material?: Cesium.MaterialProperty | Cesium.Color;
56
+ altitudeMode?: 'absolute' | 'relativeToStart' | 'relativeToGround';
57
+ climbHeight?: number;
58
+ autoStartEditing?: boolean | {
59
+ preview?: {
60
+ enabled?: boolean;
61
+ showFootprint?: boolean;
62
+ fov?: number;
63
+ pitch?: number;
64
+ roll?: number;
65
+ lengthFactor?: number;
66
+ container?: HTMLElement;
67
+ };
68
+ };
69
+ onEditingStarted?: (editSession: any) => void;
70
+ onVertexSelectDetail?: (info: VertexDetailInfo) => void;
71
+ onVertexDragCompleteDetail?: (info: VertexOperationInfo) => void;
72
+ onVertexInsertDetail?: (info: VertexOperationInfo) => void;
73
+ onVertexDeleteDetail?: (info: VertexOperationInfo) => void;
74
+ }
75
+ /**
76
+ * 路径编辑选项
77
+ */
78
+ interface PathEditingOptions {
79
+ layer?: Cesium.CustomDataSource;
80
+ defaultHeight?: number;
81
+ width?: number;
82
+ material?: Cesium.MaterialProperty | Cesium.Color;
83
+ preview?: {
84
+ enabled?: boolean;
85
+ container?: HTMLElement;
86
+ showFootprint?: boolean;
87
+ fov?: number;
88
+ pitch?: number;
89
+ roll?: number;
90
+ lengthFactor?: number;
91
+ };
92
+ quickEdit?: {
93
+ enabled?: boolean;
94
+ climbHeight?: number;
95
+ altitudeMode?: 'absolute' | 'relativeToStart' | 'relativeToGround';
96
+ };
97
+ onVertexSelectDetail?: (info: VertexDetailInfo) => void;
98
+ onVertexDragCompleteDetail?: (info: VertexOperationInfo) => void;
99
+ onVertexInsertDetail?: (info: VertexOperationInfo) => void;
100
+ onVertexDeleteDetail?: (info: VertexOperationInfo) => void;
101
+ }
102
+ /**
103
+ * 🚀 Vue3 GIS 查看器 Composable
104
+ *
105
+ * @param cesium - Cesium 命名空间对象
106
+ * @param containerOrRef - 容器元素、CSS选择器或 Vue Ref
107
+ * @param options - 初始化选项
108
+ *
109
+ * @example
110
+ * ```vue
111
+ * <script setup>
112
+ * import { ref } from 'vue';
113
+ * import * as Cesium from 'cesium';
114
+ * import { useGisViewer } from '@jorgmoritz/gis-manager/vue';
115
+ *
116
+ * const mapContainer = ref(null);
117
+ * const {
118
+ * sceneManager,
119
+ * czmlManager,
120
+ * cameraManager,
121
+ * isReady,
122
+ * startDrawingPath,
123
+ * startEditingPath
124
+ * } = useGisViewer(Cesium, mapContainer);
125
+ *
126
+ * // 开始绘制路径
127
+ * const handleDrawPath = () => {
128
+ * if (!isReady.value) return;
129
+ * const session = startDrawingPath.value({
130
+ * autoStartEditing: true,
131
+ * onVertexSelectDetail: (info) => {
132
+ * console.log('选中顶点:', info.displayNumber);
133
+ * }
134
+ * });
135
+ * };
136
+ * </script>
137
+ *
138
+ * <template>
139
+ * <div ref="mapContainer" class="map-container"></div>
140
+ * <button @click="handleDrawPath" :disabled="!isReady">绘制路径</button>
141
+ * </template>
142
+ * ```
143
+ */
144
+ declare function useGisViewer(cesium: typeof Cesium, containerOrRef?: HTMLElement | string | VueRef<HTMLElement | null>, options?: GisViewerOptions): {
145
+ readonly containerRef: {
146
+ value: HTMLElement | null;
147
+ };
148
+ readonly sceneManager: any;
149
+ readonly czmlManager: any;
150
+ readonly cameraManager: any;
151
+ readonly isReady: any;
152
+ readonly error: any;
153
+ readonly startDrawingPath: any;
154
+ readonly startEditingPath: any;
155
+ readonly initialize: () => void;
156
+ readonly destroy: () => void;
157
+ readonly viewer: Cesium.Viewer | null;
158
+ };
159
+
160
+ export { _default as GisViewer, type GisViewerOptions, type PathDrawingOptions, type PathEditingOptions, type VueRef, useGisViewer };
@@ -0,0 +1,160 @@
1
+ import * as Cesium from 'cesium';
2
+ import { V as VertexDetailInfo, a as VertexOperationInfo } from '../VertexDetailInfo-BoVDy22s.js';
3
+
4
+ /**
5
+ * 🎨 GisViewer 组件 - Vue3 声明式地图容器
6
+ *
7
+ * @example
8
+ * ```vue
9
+ * <template>
10
+ * <GisViewer
11
+ * :cesium="Cesium"
12
+ * :options="{ timeline: false, animation: false }"
13
+ * @ready="handleReady"
14
+ * class="map-container"
15
+ * style="width: 100%; height: 100vh;"
16
+ * />
17
+ * </template>
18
+ *
19
+ * <script setup>
20
+ * import * as Cesium from 'cesium';
21
+ * import GisViewer from '@jorgmoritz/gis-manager/vue';
22
+ *
23
+ * const handleReady = ({ sceneManager, czmlManager, cameraManager, viewer }) => {
24
+ * console.log('地图已就绪', viewer);
25
+ *
26
+ * // 使用 czmlManager 管理路径
27
+ * czmlManager.createPath(...);
28
+ * };
29
+ * </script>
30
+ * ```
31
+ */
32
+ declare const _default: any;
33
+
34
+ /**
35
+ * GIS 查看器配置选项
36
+ */
37
+ interface GisViewerOptions {
38
+ /** Cesium 初始化选项(会合并到 container 配置中) */
39
+ [key: string]: any;
40
+ }
41
+ /**
42
+ * Vue Ref 类型(兼容 Vue 2 和 Vue 3)
43
+ */
44
+ interface VueRef<T> {
45
+ value: T;
46
+ }
47
+ /**
48
+ * 路径绘制选项
49
+ */
50
+ interface PathDrawingOptions {
51
+ layer?: Cesium.CustomDataSource;
52
+ idPrefix?: string;
53
+ defaultHeight?: number;
54
+ width?: number;
55
+ material?: Cesium.MaterialProperty | Cesium.Color;
56
+ altitudeMode?: 'absolute' | 'relativeToStart' | 'relativeToGround';
57
+ climbHeight?: number;
58
+ autoStartEditing?: boolean | {
59
+ preview?: {
60
+ enabled?: boolean;
61
+ showFootprint?: boolean;
62
+ fov?: number;
63
+ pitch?: number;
64
+ roll?: number;
65
+ lengthFactor?: number;
66
+ container?: HTMLElement;
67
+ };
68
+ };
69
+ onEditingStarted?: (editSession: any) => void;
70
+ onVertexSelectDetail?: (info: VertexDetailInfo) => void;
71
+ onVertexDragCompleteDetail?: (info: VertexOperationInfo) => void;
72
+ onVertexInsertDetail?: (info: VertexOperationInfo) => void;
73
+ onVertexDeleteDetail?: (info: VertexOperationInfo) => void;
74
+ }
75
+ /**
76
+ * 路径编辑选项
77
+ */
78
+ interface PathEditingOptions {
79
+ layer?: Cesium.CustomDataSource;
80
+ defaultHeight?: number;
81
+ width?: number;
82
+ material?: Cesium.MaterialProperty | Cesium.Color;
83
+ preview?: {
84
+ enabled?: boolean;
85
+ container?: HTMLElement;
86
+ showFootprint?: boolean;
87
+ fov?: number;
88
+ pitch?: number;
89
+ roll?: number;
90
+ lengthFactor?: number;
91
+ };
92
+ quickEdit?: {
93
+ enabled?: boolean;
94
+ climbHeight?: number;
95
+ altitudeMode?: 'absolute' | 'relativeToStart' | 'relativeToGround';
96
+ };
97
+ onVertexSelectDetail?: (info: VertexDetailInfo) => void;
98
+ onVertexDragCompleteDetail?: (info: VertexOperationInfo) => void;
99
+ onVertexInsertDetail?: (info: VertexOperationInfo) => void;
100
+ onVertexDeleteDetail?: (info: VertexOperationInfo) => void;
101
+ }
102
+ /**
103
+ * 🚀 Vue3 GIS 查看器 Composable
104
+ *
105
+ * @param cesium - Cesium 命名空间对象
106
+ * @param containerOrRef - 容器元素、CSS选择器或 Vue Ref
107
+ * @param options - 初始化选项
108
+ *
109
+ * @example
110
+ * ```vue
111
+ * <script setup>
112
+ * import { ref } from 'vue';
113
+ * import * as Cesium from 'cesium';
114
+ * import { useGisViewer } from '@jorgmoritz/gis-manager/vue';
115
+ *
116
+ * const mapContainer = ref(null);
117
+ * const {
118
+ * sceneManager,
119
+ * czmlManager,
120
+ * cameraManager,
121
+ * isReady,
122
+ * startDrawingPath,
123
+ * startEditingPath
124
+ * } = useGisViewer(Cesium, mapContainer);
125
+ *
126
+ * // 开始绘制路径
127
+ * const handleDrawPath = () => {
128
+ * if (!isReady.value) return;
129
+ * const session = startDrawingPath.value({
130
+ * autoStartEditing: true,
131
+ * onVertexSelectDetail: (info) => {
132
+ * console.log('选中顶点:', info.displayNumber);
133
+ * }
134
+ * });
135
+ * };
136
+ * </script>
137
+ *
138
+ * <template>
139
+ * <div ref="mapContainer" class="map-container"></div>
140
+ * <button @click="handleDrawPath" :disabled="!isReady">绘制路径</button>
141
+ * </template>
142
+ * ```
143
+ */
144
+ declare function useGisViewer(cesium: typeof Cesium, containerOrRef?: HTMLElement | string | VueRef<HTMLElement | null>, options?: GisViewerOptions): {
145
+ readonly containerRef: {
146
+ value: HTMLElement | null;
147
+ };
148
+ readonly sceneManager: any;
149
+ readonly czmlManager: any;
150
+ readonly cameraManager: any;
151
+ readonly isReady: any;
152
+ readonly error: any;
153
+ readonly startDrawingPath: any;
154
+ readonly startEditingPath: any;
155
+ readonly initialize: () => void;
156
+ readonly destroy: () => void;
157
+ readonly viewer: Cesium.Viewer | null;
158
+ };
159
+
160
+ export { _default as GisViewer, type GisViewerOptions, type PathDrawingOptions, type PathEditingOptions, type VueRef, useGisViewer };