@xingm/vmap-cesium-toolbar 0.0.1-alpha.1 → 0.0.1-alpha.11
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/hooks/toolBarConfig.d.ts +4 -3
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1084 -836
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +37 -37
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/CesiumMapHelper.d.ts +31 -27
- package/dist/libs/CesiumMapLoader.d.ts +6 -1
- package/dist/libs/CesiumMapModel.d.ts +3 -2
- package/dist/libs/CesiumMapToolbar.d.ts +20 -0
- package/dist/package.json +5 -5
- package/package.json +5 -5
|
@@ -20,18 +20,31 @@ declare class DrawHelper {
|
|
|
20
20
|
private publicEntities;
|
|
21
21
|
private _doubleClickPending;
|
|
22
22
|
private currentLineEntity;
|
|
23
|
+
private currentPolygonEntity;
|
|
24
|
+
private currentRectangleEntity;
|
|
23
25
|
private currentSegmentLabels;
|
|
24
26
|
private currentTotalLabel;
|
|
27
|
+
private currentLinePositions;
|
|
28
|
+
private isTotalLabelWarmedUp;
|
|
25
29
|
private screenSpaceEventHandler;
|
|
26
30
|
private onDrawStartCallback;
|
|
27
31
|
private onDrawEndCallback;
|
|
28
32
|
private onEntityRemovedCallback;
|
|
29
33
|
private offsetHeight;
|
|
34
|
+
private originalDepthTestAgainstTerrain;
|
|
30
35
|
/**
|
|
31
36
|
* 构造函数
|
|
32
37
|
* @param viewer Cesium Viewer 实例
|
|
33
38
|
*/
|
|
34
39
|
constructor(viewer: Cesium.Viewer);
|
|
40
|
+
/**
|
|
41
|
+
* 判断一个 Cartesian3 是否为有效坐标(x/y/z 都是有限数字)
|
|
42
|
+
*/
|
|
43
|
+
private isValidCartesian3;
|
|
44
|
+
/**
|
|
45
|
+
* 外部调用:在场景模式(2D/3D)切换后,更新偏移高度并重算已完成实体
|
|
46
|
+
*/
|
|
47
|
+
handleSceneModeChanged(): void;
|
|
35
48
|
/**
|
|
36
49
|
* 根据场景模式更新偏移高度
|
|
37
50
|
*/
|
|
@@ -139,6 +152,20 @@ declare class DrawHelper {
|
|
|
139
152
|
* @returns 格式化后的距离字符串
|
|
140
153
|
*/
|
|
141
154
|
private formatDistance;
|
|
155
|
+
/**
|
|
156
|
+
* 格式化面积显示
|
|
157
|
+
* @param areaKm2 面积(平方公里)
|
|
158
|
+
*/
|
|
159
|
+
private formatArea;
|
|
160
|
+
/**
|
|
161
|
+
* 使用 Canvas 绘制总长文本,生成用于 billboard 的图片
|
|
162
|
+
*/
|
|
163
|
+
private createTotalLengthBillboardImage;
|
|
164
|
+
/**
|
|
165
|
+
* 使用 Canvas 绘制分段长度文本,生成用于 billboard 的图片
|
|
166
|
+
* 样式与总长保持一致,便于统一视觉
|
|
167
|
+
*/
|
|
168
|
+
private createSegmentLengthBillboardImage;
|
|
142
169
|
/**
|
|
143
170
|
* 设置开始绘制时的回调函数
|
|
144
171
|
* @param callback 回调函数
|
|
@@ -155,33 +182,10 @@ declare class DrawHelper {
|
|
|
155
182
|
*/
|
|
156
183
|
onEntityRemoved(callback: (entity: Cesium.Entity) => void): void;
|
|
157
184
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
* @param radius 监控范围半径(米)
|
|
163
|
-
* @param options 可选配置
|
|
164
|
-
*/
|
|
165
|
-
drawMonitoringCircle(longitude: number, latitude: number, height: number, radius: number, options?: {
|
|
166
|
-
borderColor?: string;
|
|
167
|
-
fillColor?: string;
|
|
168
|
-
borderWidth?: number;
|
|
169
|
-
name?: string;
|
|
170
|
-
}): Cesium.Entity;
|
|
171
|
-
/**
|
|
172
|
-
* 绘制垂直线条
|
|
173
|
-
* @param longitude 经度
|
|
174
|
-
* @param latitude 纬度
|
|
175
|
-
* @param height 高度
|
|
176
|
-
* @param options 可选配置
|
|
177
|
-
*/
|
|
178
|
-
drawVerticalLine(longitude: number, latitude: number, height: number, options?: {
|
|
179
|
-
color?: string;
|
|
180
|
-
width?: number;
|
|
181
|
-
dashPattern?: number;
|
|
182
|
-
name?: string;
|
|
183
|
-
groundHeight?: number;
|
|
184
|
-
}): Cesium.Entity;
|
|
185
|
+
* 总长标签预热:创建一个隐藏的、与总长标签样式一致的 label
|
|
186
|
+
* 让 Cesium 预先构建字体图集和背景布局,避免首次真正显示时背景与文字错位
|
|
187
|
+
*/
|
|
188
|
+
private warmupTotalLengthLabel;
|
|
185
189
|
/**
|
|
186
190
|
* 更新所有已完成实体以适应场景模式变化
|
|
187
191
|
* 当从2D切换到3D或从3D切换到2D时,需要更新实体的高度参考和位置
|
|
@@ -20,6 +20,7 @@ interface InitOptions {
|
|
|
20
20
|
timeline?: boolean;
|
|
21
21
|
animation?: boolean;
|
|
22
22
|
isFly?: boolean;
|
|
23
|
+
flyDuration?: number;
|
|
23
24
|
baseLayerPicker?: boolean;
|
|
24
25
|
navigationInstructionsInitiallyVisible?: boolean;
|
|
25
26
|
clock?: Cesium.Clock;
|
|
@@ -35,10 +36,14 @@ interface InitOptions {
|
|
|
35
36
|
resolutionScale?: number;
|
|
36
37
|
orderIndependentTransparency?: boolean;
|
|
37
38
|
shadows?: boolean;
|
|
39
|
+
depthTestAgainstTerrain?: boolean;
|
|
38
40
|
terrainExaggeration?: number;
|
|
39
41
|
maximumScreenSpaceError?: number;
|
|
40
42
|
maximumNumberOfLoadedTiles?: number;
|
|
41
43
|
token?: string;
|
|
44
|
+
cesiumToken?: string;
|
|
45
|
+
success?: () => void;
|
|
46
|
+
cancel?: () => void;
|
|
42
47
|
}
|
|
43
48
|
interface MapCenter {
|
|
44
49
|
latitude: number;
|
|
@@ -47,7 +52,7 @@ interface MapCenter {
|
|
|
47
52
|
pitch?: number;
|
|
48
53
|
heading?: number;
|
|
49
54
|
}
|
|
50
|
-
export declare function initCesium(containerId: string, options: InitOptions, mapCenter?: MapCenter): Promise<{
|
|
55
|
+
export declare function initCesium(containerId: string, options: InitOptions, mapCenter?: MapCenter, defaultAccessToken?: any): Promise<{
|
|
51
56
|
viewer: CesiumViewer;
|
|
52
57
|
initialCenter: MapCenter;
|
|
53
58
|
}>;
|
|
@@ -60,13 +60,14 @@ export interface SearchResult {
|
|
|
60
60
|
height?: number;
|
|
61
61
|
}
|
|
62
62
|
export interface MeasurementCallback {
|
|
63
|
+
onMeasurementStart?: (positions?: Cartesian3[]) => void;
|
|
63
64
|
onDistanceComplete?: (positions: Cartesian3[], distance: number) => void;
|
|
64
65
|
onAreaComplete?: (positions: Cartesian3[], area: number) => void;
|
|
65
66
|
onClear?: () => void;
|
|
66
67
|
}
|
|
67
68
|
export interface ZoomCallback {
|
|
68
|
-
onZoomIn?: (
|
|
69
|
-
onZoomOut?: (
|
|
69
|
+
onZoomIn?: (beforeHeight: number, afterHeight: number, currentLevel: number) => void;
|
|
70
|
+
onZoomOut?: (beforeHeight: number, afterHeight: number, currentLevel: number) => void;
|
|
70
71
|
}
|
|
71
72
|
export interface MapType {
|
|
72
73
|
id: string;
|
|
@@ -20,7 +20,14 @@ export declare class CesiumMapToolbar {
|
|
|
20
20
|
mapTypes: MapType[];
|
|
21
21
|
private noFlyZoneEntities;
|
|
22
22
|
private isNoFlyZoneVisible;
|
|
23
|
+
private isNoFlyZoneLoading;
|
|
24
|
+
private isNoFlyZoneChecked;
|
|
25
|
+
private readonly noFlyZoneExtrudedHeight;
|
|
23
26
|
private currentGeoWTFS;
|
|
27
|
+
private currentMeasureMode;
|
|
28
|
+
readonly measurement: {
|
|
29
|
+
getMeasureMode: () => "none" | "distance" | "area";
|
|
30
|
+
};
|
|
24
31
|
constructor(viewer: Viewer, container: HTMLElement, config?: ToolbarConfig, callbacks?: {
|
|
25
32
|
search?: SearchCallback;
|
|
26
33
|
measurement?: MeasurementCallback;
|
|
@@ -30,6 +37,10 @@ export declare class CesiumMapToolbar {
|
|
|
30
37
|
latitude: number;
|
|
31
38
|
height: number;
|
|
32
39
|
});
|
|
40
|
+
/**
|
|
41
|
+
* 监听相机缩放,限制层级范围到 [1, 18],并参考当前底图的 maximumLevel
|
|
42
|
+
*/
|
|
43
|
+
private setupCameraZoomLimitListener;
|
|
33
44
|
setMapTypes(mapTypes: MapType[]): void;
|
|
34
45
|
setTDToken(TD_Token: string): void;
|
|
35
46
|
/**
|
|
@@ -201,6 +212,15 @@ export declare class CesiumMapToolbar {
|
|
|
201
212
|
* 隐藏机场禁飞区
|
|
202
213
|
*/
|
|
203
214
|
hideNoFlyZones(): void;
|
|
215
|
+
/**
|
|
216
|
+
* 根据当前场景模式配置禁飞区多边形
|
|
217
|
+
*/
|
|
218
|
+
/**
|
|
219
|
+
* 创建禁飞区多边形配置选项
|
|
220
|
+
* @param positions - 多边形的顶点坐标数组,使用笛卡尔坐标系
|
|
221
|
+
* @returns 返回一个包含多边形图形配置选项的对象
|
|
222
|
+
*/
|
|
223
|
+
private createNoFlyZonePolygonOptions;
|
|
204
224
|
/**
|
|
205
225
|
* 切换机场禁飞区显示状态
|
|
206
226
|
*/
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
-
"version": "0.0.1",
|
|
3
|
+
"version": "0.0.1-alpha.11",
|
|
4
4
|
"description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"vue3",
|
|
33
33
|
"typescript"
|
|
34
34
|
],
|
|
35
|
-
"author": "
|
|
35
|
+
"author": "pengxueyou",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/
|
|
39
|
+
"url": "git+https://github.com/benxueyou/vmap-cesium-toolbar.git"
|
|
40
40
|
},
|
|
41
41
|
"bugs": {
|
|
42
|
-
"url": "https://github.com/
|
|
42
|
+
"url": "https://github.com/benxueyou/vmap-cesium-toolbar/issues"
|
|
43
43
|
},
|
|
44
|
-
"homepage": "https://github.com/
|
|
44
|
+
"homepage": "https://github.com/benxueyou/vmap-cesium-toolbar#readme"
|
|
45
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.11",
|
|
4
4
|
"description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"vue3",
|
|
56
56
|
"typescript"
|
|
57
57
|
],
|
|
58
|
-
"author": "
|
|
58
|
+
"author": "pengxueyou",
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"repository": {
|
|
61
61
|
"type": "git",
|
|
62
|
-
"url": "https://github.com/
|
|
62
|
+
"url": "git+https://github.com/benxueyou/vmap-cesium-toolbar.git"
|
|
63
63
|
},
|
|
64
64
|
"bugs": {
|
|
65
|
-
"url": "https://github.com/
|
|
65
|
+
"url": "https://github.com/benxueyou/vmap-cesium-toolbar/issues"
|
|
66
66
|
},
|
|
67
|
-
"homepage": "https://github.com/
|
|
67
|
+
"homepage": "https://github.com/benxueyou/vmap-cesium-toolbar#readme"
|
|
68
68
|
}
|