@xingm/vmap-cesium-toolbar 0.0.1-alpha.4 → 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 +14 -218
- package/dist/{index.js → index.es.js} +761 -576
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +25 -25
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/CesiumMapHelper.d.ts +24 -0
- package/dist/libs/CesiumMapLoader.d.ts +1 -0
- package/dist/libs/CesiumMapToolbar.d.ts +4 -0
- package/package.json +2 -2
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -45
- package/dist/style.css +0 -162
package/dist/index.d.ts
CHANGED
|
@@ -1,218 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
terrain?: any; // Cesium.Terrain
|
|
105
|
-
terrainProvider?: any; // Cesium.TerrainProvider
|
|
106
|
-
mapType?: string;
|
|
107
|
-
imageryProvider?: any; // Cesium.UrlTemplateImageryProvider
|
|
108
|
-
imageryLayers?: any; // Cesium.ImageryLayerCollection
|
|
109
|
-
terrainShadows?: any; // Cesium.ShadowMode
|
|
110
|
-
contextOptions?: any; // Cesium.ContextOptions
|
|
111
|
-
scene3DOnly?: boolean;
|
|
112
|
-
isFlyTo?: boolean;
|
|
113
|
-
isFly?: boolean;
|
|
114
|
-
selectionIndicator?: boolean;
|
|
115
|
-
navigationHelpButton?: boolean;
|
|
116
|
-
fullscreenButton?: boolean;
|
|
117
|
-
geocoder?: boolean;
|
|
118
|
-
homeButton?: boolean;
|
|
119
|
-
infoBox?: boolean;
|
|
120
|
-
sceneModePicker?: boolean;
|
|
121
|
-
baseLayerPicker?: boolean;
|
|
122
|
-
timeline?: boolean;
|
|
123
|
-
animation?: boolean;
|
|
124
|
-
clock?: any; // Cesium.Clock
|
|
125
|
-
navigationInstructionsInitiallyVisible?: boolean;
|
|
126
|
-
sceneMode?: any; // Cesium.SceneMode
|
|
127
|
-
screenSpaceEventHandler?: any; // Cesium.ScreenSpaceEventHandler
|
|
128
|
-
useDefaultRenderLoop?: boolean;
|
|
129
|
-
targetFrameRate?: number;
|
|
130
|
-
showRenderLoopErrors?: boolean;
|
|
131
|
-
automaticallyTrackDataSourceClocks?: boolean;
|
|
132
|
-
dataSources?: any; // Cesium.DataSourceCollection
|
|
133
|
-
creationTime?: number;
|
|
134
|
-
useBrowserRecommendedResolution?: boolean;
|
|
135
|
-
resolutionScale?: number;
|
|
136
|
-
orderIndependentTransparency?: boolean;
|
|
137
|
-
shadows?: boolean;
|
|
138
|
-
terrainExaggeration?: number;
|
|
139
|
-
maximumScreenSpaceError?: number;
|
|
140
|
-
maximumNumberOfLoadedTiles?: number;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// 主要类声明
|
|
144
|
-
export declare class CesiumMapToolbar {
|
|
145
|
-
constructor(
|
|
146
|
-
viewer: Viewer,
|
|
147
|
-
container: HTMLElement,
|
|
148
|
-
config?: ToolbarConfig,
|
|
149
|
-
callbacks?: {
|
|
150
|
-
search?: SearchCallback;
|
|
151
|
-
measurement?: MeasurementCallback;
|
|
152
|
-
zoom?: ZoomCallback;
|
|
153
|
-
},
|
|
154
|
-
initialCenter?: { longitude: number; latitude: number; height: number }
|
|
155
|
-
);
|
|
156
|
-
setMapTypes(mapTypes: MapType[]): void;
|
|
157
|
-
setTDToken(TD_Token: string): void;
|
|
158
|
-
setInitialCenter(center: { longitude: number; latitude: number; height: number }): void;
|
|
159
|
-
getInitialCenter(): { longitude: number; latitude: number; height: number } | undefined;
|
|
160
|
-
resetToInitialLocation(): void;
|
|
161
|
-
drawMonitoringCircle(
|
|
162
|
-
longitude: number,
|
|
163
|
-
latitude: number,
|
|
164
|
-
height: number,
|
|
165
|
-
radius: number,
|
|
166
|
-
options?: {
|
|
167
|
-
borderColor?: string;
|
|
168
|
-
fillColor?: string;
|
|
169
|
-
borderWidth?: number;
|
|
170
|
-
name?: string;
|
|
171
|
-
}
|
|
172
|
-
): any; // Cesium.Entity
|
|
173
|
-
drawVerticalLine(
|
|
174
|
-
longitude: number,
|
|
175
|
-
latitude: number,
|
|
176
|
-
height: number,
|
|
177
|
-
options?: {
|
|
178
|
-
color?: string;
|
|
179
|
-
width?: number;
|
|
180
|
-
dashPattern?: number;
|
|
181
|
-
name?: string;
|
|
182
|
-
groundHeight?: number;
|
|
183
|
-
}
|
|
184
|
-
): any; // Cesium.Entity
|
|
185
|
-
destroy(): void;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export declare class DrawHelper {
|
|
189
|
-
constructor(viewer: Viewer);
|
|
190
|
-
startDrawingLine(): void;
|
|
191
|
-
startDrawingPolygon(): void;
|
|
192
|
-
startDrawingRectangle(): void;
|
|
193
|
-
drawFrustum(options?: FrustumOptions): void;
|
|
194
|
-
endDrawing(): void;
|
|
195
|
-
clearAll(): void;
|
|
196
|
-
clearFrustum(): void;
|
|
197
|
-
removeEntity(entity: any): void; // Cesium.Entity
|
|
198
|
-
getFinishedEntities(): any[]; // Cesium.Entity[]
|
|
199
|
-
onDrawStart(callback: () => void): void;
|
|
200
|
-
onDrawEnd(callback: (entity: any) => void): void; // Cesium.Entity | null
|
|
201
|
-
onEntityRemoved(callback: (entity: any) => void): void; // Cesium.Entity
|
|
202
|
-
destroy(): void;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export declare function initCesium(
|
|
206
|
-
containerId: string,
|
|
207
|
-
options: InitOptions,
|
|
208
|
-
mapCenter?: MapCenter
|
|
209
|
-
): Promise<{ viewer: Viewer; initialCenter: MapCenter }>;
|
|
210
|
-
|
|
211
|
-
// 默认导出
|
|
212
|
-
declare const _default: {
|
|
213
|
-
CesiumMapToolbar: typeof CesiumMapToolbar;
|
|
214
|
-
DrawHelper: typeof DrawHelper;
|
|
215
|
-
initCesium: typeof initCesium;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
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;
|