@xingm/vmap-cesium-toolbar 0.0.1-alpha.5 → 0.0.1-alpha.6

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,220 +1,14 @@
1
- // VMap Cesium Toolbar Plugin Type Definitions
2
-
3
- import type { Viewer, Cartesian3, Cartographic } from 'cesium';
4
-
5
- // 工具栏配置接口
6
- export interface ToolbarConfig {
7
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
8
- buttonSize?: number;
9
- buttonSpacing?: number;
10
- backgroundColor?: string;
11
- borderColor?: string;
12
- borderRadius?: number;
13
- borderWidth?: number;
14
- boxShadow?: string;
15
- zIndex?: number;
16
- }
17
-
18
- // 按钮配置接口
19
- export interface ButtonConfig {
20
- id: string;
21
- icon: string;
22
- title: string;
23
- size?: number;
24
- color?: string;
25
- hoverColor?: string;
26
- activeColor?: string;
27
- }
28
-
29
- // 搜索回调接口
30
- export interface SearchCallback {
31
- onSearch?: (query: string) => Promise<SearchResult[]>;
32
- onSelect?: (result: SearchResult) => void;
33
- }
34
-
35
- // 搜索结果接口
36
- export interface SearchResult {
37
- name: string;
38
- address: string;
39
- longitude: number;
40
- latitude: number;
41
- height?: number;
42
- }
43
-
44
- // 测量回调接口
45
- export interface MeasurementCallback {
46
- onDistanceComplete?: (positions: Cartesian3[], distance: number) => void;
47
- onAreaComplete?: (positions: Cartesian3[], area: number) => void;
48
- onClear?: () => void;
49
- }
50
-
51
- // 缩放回调接口
52
- export interface ZoomCallback {
53
- onZoomIn?: (beforeLevel: number, afterLevel: number) => void;
54
- onZoomOut?: (beforeLevel: number, afterLevel: number) => void;
55
- }
56
-
57
- // 地图类型接口
58
- export interface MapType {
59
- id: string;
60
- name: string;
61
- thumbnail: string;
62
- provider: any; // Cesium.ImageryProvider
63
- }
64
-
65
- // 视锥体选项接口
66
- export interface FrustumOptions {
67
- position?: Cartesian3;
68
- orientation?: any; // Cesium.Quaternion
69
- fov?: number;
70
- aspectRatio?: number;
71
- near?: number;
72
- far?: number;
73
- fillColor?: any; // Cesium.Color
74
- outlineColor?: any; // Cesium.Color
75
- onRightClick?: (position: Cartesian3) => void;
76
- }
77
-
78
- // 覆盖物选项接口
79
- export interface OverlayOptions {
80
- position: Cartesian3;
81
- type: 'point' | 'label' | 'billboard' | 'model' | 'cylinder';
82
- text?: string;
83
- image?: string;
84
- model?: string;
85
- color?: any; // Cesium.Color
86
- scale?: number;
87
- height?: number;
88
- width?: number;
89
- heightReference?: any; // Cesium.HeightReference
90
- }
91
-
92
- // 地图中心点接口
93
- export interface MapCenter {
94
- latitude: number;
95
- longitude: number;
96
- height: number;
97
- pitch?: number;
98
- heading?: number;
99
- }
100
-
101
- // 初始化选项接口
102
- export interface InitOptions {
103
- token?: string;
104
- cesiumToken?: string;
105
- terrain?: any; // Cesium.Terrain
106
- terrainProvider?: any; // Cesium.TerrainProvider
107
- mapType?: string;
108
- imageryProvider?: any; // Cesium.UrlTemplateImageryProvider
109
- imageryLayers?: any; // Cesium.ImageryLayerCollection
110
- terrainShadows?: any; // Cesium.ShadowMode
111
- contextOptions?: any; // Cesium.ContextOptions
112
- scene3DOnly?: boolean;
113
- isFlyTo?: boolean;
114
- isFly?: boolean;
115
- selectionIndicator?: boolean;
116
- navigationHelpButton?: boolean;
117
- fullscreenButton?: boolean;
118
- geocoder?: boolean;
119
- homeButton?: boolean;
120
- infoBox?: boolean;
121
- sceneModePicker?: boolean;
122
- baseLayerPicker?: boolean;
123
- timeline?: boolean;
124
- animation?: boolean;
125
- clock?: any; // Cesium.Clock
126
- navigationInstructionsInitiallyVisible?: boolean;
127
- sceneMode?: any; // Cesium.SceneMode
128
- screenSpaceEventHandler?: any; // Cesium.ScreenSpaceEventHandler
129
- useDefaultRenderLoop?: boolean;
130
- targetFrameRate?: number;
131
- showRenderLoopErrors?: boolean;
132
- automaticallyTrackDataSourceClocks?: boolean;
133
- dataSources?: any; // Cesium.DataSourceCollection
134
- creationTime?: number;
135
- useBrowserRecommendedResolution?: boolean;
136
- resolutionScale?: number;
137
- orderIndependentTransparency?: boolean;
138
- shadows?: boolean;
139
- terrainExaggeration?: number;
140
- maximumScreenSpaceError?: number;
141
- maximumNumberOfLoadedTiles?: number;
142
- }
143
-
144
- // 主要类声明
145
- export declare class CesiumMapToolbar {
146
- constructor(
147
- viewer: Viewer,
148
- container: HTMLElement,
149
- config?: ToolbarConfig,
150
- callbacks?: {
151
- search?: SearchCallback;
152
- measurement?: MeasurementCallback;
153
- zoom?: ZoomCallback;
154
- },
155
- initialCenter?: { longitude: number; latitude: number; height: number }
156
- );
157
- setMapTypes(mapTypes: MapType[]): void;
158
- setTDToken(TD_Token: string): void;
159
- setInitialCenter(center: { longitude: number; latitude: number; height: number }): void;
160
- getInitialCenter(): { longitude: number; latitude: number; height: number } | undefined;
161
- resetToInitialLocation(): void;
162
- drawMonitoringCircle(
163
- longitude: number,
164
- latitude: number,
165
- height: number,
166
- radius: number,
167
- options?: {
168
- borderColor?: string;
169
- fillColor?: string;
170
- borderWidth?: number;
171
- name?: string;
172
- }
173
- ): any; // Cesium.Entity
174
- drawVerticalLine(
175
- longitude: number,
176
- latitude: number,
177
- height: number,
178
- options?: {
179
- color?: string;
180
- width?: number;
181
- dashPattern?: number;
182
- name?: string;
183
- groundHeight?: number;
184
- }
185
- ): any; // Cesium.Entity
186
- destroy(): void;
187
- }
188
-
189
- export declare class DrawHelper {
190
- constructor(viewer: Viewer);
191
- startDrawingLine(): void;
192
- startDrawingPolygon(): void;
193
- startDrawingRectangle(): void;
194
- drawFrustum(options?: FrustumOptions): void;
195
- endDrawing(): void;
196
- clearAll(): void;
197
- clearFrustum(): void;
198
- removeEntity(entity: any): void; // Cesium.Entity
199
- getFinishedEntities(): any[]; // Cesium.Entity[]
200
- onDrawStart(callback: () => void): void;
201
- onDrawEnd(callback: (entity: any) => void): void; // Cesium.Entity | null
202
- onEntityRemoved(callback: (entity: any) => void): void; // Cesium.Entity
203
- destroy(): void;
204
- }
205
-
206
- export declare function initCesium(
207
- containerId: string,
208
- options: InitOptions,
209
- mapCenter?: MapCenter,
210
- cesiumToken?: String
211
- ): Promise<{ viewer: Viewer; initialCenter: MapCenter }>;
212
-
213
- // 默认导出
214
- declare const _default: {
215
- CesiumMapToolbar: typeof CesiumMapToolbar;
216
- DrawHelper: typeof DrawHelper;
217
- initCesium: typeof initCesium;
218
- };
219
-
220
- export default _default;
1
+ import { CesiumMapToolbar } from './libs/CesiumMapToolbar';
2
+ import { default as DrawHelper } from './libs/CesiumMapHelper';
3
+ import { initCesium } from './libs/CesiumMapLoader';
4
+ export { CesiumMapToolbar } from './libs/CesiumMapToolbar';
5
+ export { default as DrawHelper } from './libs/CesiumMapHelper';
6
+ export { initCesium } from './libs/CesiumMapLoader';
7
+ export type { OverlayOptions, ToolbarConfig, ButtonConfig, CustomButtonConfig, SearchCallback, SearchResult, MeasurementCallback, ZoomCallback, MapType, } from './libs/CesiumMapModel';
8
+ declare const _default: {
9
+ CesiumMapToolbar: typeof CesiumMapToolbar;
10
+ DrawHelper: typeof DrawHelper;
11
+ initCesium: typeof initCesium;
12
+ initCesiumMap: typeof initCesium;
13
+ };
14
+ export default _default;