@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.
- package/dist/hooks/toolBarConfig.d.ts +6 -3
- package/dist/hooks/useDrawHelper.d.ts +63 -0
- package/dist/hooks/useOverlayHelper.d.ts +173 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +2563 -1559
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +124 -124
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/{CesiumMapHelper.d.ts → CesiumMapDraw.d.ts} +33 -43
- package/dist/libs/CesiumMapLoader.d.ts +8 -2
- package/dist/libs/CesiumMapModel.d.ts +5 -2
- package/dist/libs/CesiumMapToolbar.d.ts +23 -67
- package/dist/libs/CesiumOverlayService.d.ts +111 -0
- package/dist/libs/{CesiumMapConfig.d.ts → config/CesiumMapConfig.d.ts} +3 -3
- package/dist/libs/drawHelper/BaseDraw.d.ts +116 -0
- package/dist/libs/drawHelper/DrawCircle.d.ts +25 -0
- package/dist/libs/drawHelper/DrawLine.d.ts +44 -0
- package/dist/libs/drawHelper/DrawPolgon.d.ts +24 -0
- package/dist/libs/drawHelper/DrawRectangle.d.ts +24 -0
- package/dist/libs/drawHelper/index.d.ts +5 -0
- package/dist/libs/overlay/MapCircle.d.ts +54 -0
- package/dist/libs/overlay/MapIcon.d.ts +55 -0
- package/dist/libs/overlay/MapInfoWindow.d.ts +73 -0
- package/dist/libs/overlay/MapLabel.d.ts +59 -0
- package/dist/libs/overlay/MapMarker.d.ts +46 -0
- package/dist/libs/overlay/MapPolygon.d.ts +49 -0
- package/dist/libs/overlay/MapPolyline.d.ts +46 -0
- package/dist/libs/overlay/MapRectangle.d.ts +44 -0
- package/dist/libs/overlay/MapSVG.d.ts +59 -0
- package/dist/libs/overlay/index.d.ts +20 -0
- package/dist/libs/overlay/types.d.ts +5 -0
- package/dist/libs/toolBar/CesiumMapController.d.ts +78 -0
- package/dist/libs/toolBar/MapLayersService.d.ts +66 -0
- package/dist/libs/toolBar/MapSearchService.d.ts +41 -0
- package/dist/libs/toolBar/MapToolBarConfig.d.ts +3 -0
- package/dist/libs/toolBar/MeasurementService.d.ts +16 -0
- package/dist/libs/toolBar/NotFlyZonesService.d.ts +46 -0
- package/dist/package.json +5 -5
- package/dist/utils/calc.d.ts +44 -0
- package/dist/utils/common.d.ts +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Viewer } from '../../../node_modules/cesium';
|
|
2
|
+
import { SearchResult, SearchCallback } from '../CesiumMapModel';
|
|
3
|
+
/**
|
|
4
|
+
* 搜索服务类
|
|
5
|
+
* 负责处理地图搜索相关的所有逻辑
|
|
6
|
+
*/
|
|
7
|
+
export declare class SearchService {
|
|
8
|
+
private viewer;
|
|
9
|
+
private toolbarElement;
|
|
10
|
+
private searchCallback?;
|
|
11
|
+
private searchContainer;
|
|
12
|
+
constructor(viewer: Viewer, toolbarElement: HTMLElement, searchCallback?: SearchCallback);
|
|
13
|
+
/**
|
|
14
|
+
* 设置搜索回调
|
|
15
|
+
*/
|
|
16
|
+
setSearchCallback(callback: SearchCallback): void;
|
|
17
|
+
/**
|
|
18
|
+
* 切换搜索功能
|
|
19
|
+
*/
|
|
20
|
+
toggleSearch(buttonElement: HTMLElement): void;
|
|
21
|
+
/**
|
|
22
|
+
* 执行默认搜索(使用天地图 API)
|
|
23
|
+
*/
|
|
24
|
+
private performDefaultSearch;
|
|
25
|
+
/**
|
|
26
|
+
* 显示搜索结果
|
|
27
|
+
*/
|
|
28
|
+
displaySearchResults(results: SearchResult[], container: HTMLElement): void;
|
|
29
|
+
/**
|
|
30
|
+
* 选择搜索结果
|
|
31
|
+
*/
|
|
32
|
+
selectSearchResult(result: SearchResult): void;
|
|
33
|
+
/**
|
|
34
|
+
* 关闭搜索框
|
|
35
|
+
*/
|
|
36
|
+
closeSearchContainer(): void;
|
|
37
|
+
/**
|
|
38
|
+
* 销毁搜索服务
|
|
39
|
+
*/
|
|
40
|
+
destroy(): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Viewer } from '../../../node_modules/cesium';
|
|
2
|
+
import { default as DrawHelper } from '../CesiumMapDraw';
|
|
3
|
+
import { MeasurementCallback } from '../CesiumMapModel';
|
|
4
|
+
export type MeasureMode = 'none' | 'distance' | 'area';
|
|
5
|
+
export declare class MeasurementService {
|
|
6
|
+
private viewer;
|
|
7
|
+
private drawHelper;
|
|
8
|
+
private measurementCallback?;
|
|
9
|
+
private currentMode;
|
|
10
|
+
constructor(viewer: Viewer, drawHelper: DrawHelper, measurementCallback?: MeasurementCallback);
|
|
11
|
+
getMeasureMode(): MeasureMode;
|
|
12
|
+
setupDrawHelperCallbacks(): void;
|
|
13
|
+
startAreaMeasurement(): void;
|
|
14
|
+
startDistanceMeasurement(): void;
|
|
15
|
+
clearMeasurements(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Viewer } from '../../../node_modules/cesium';
|
|
2
|
+
/**
|
|
3
|
+
* 禁飞区服务配置接口
|
|
4
|
+
*/
|
|
5
|
+
export interface NotFlyZonesServiceConfig {
|
|
6
|
+
extrudedHeight?: number;
|
|
7
|
+
autoLoad?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 禁飞区服务类
|
|
11
|
+
* 负责处理机场禁飞区相关的所有逻辑
|
|
12
|
+
*/
|
|
13
|
+
export declare class NotFlyZonesService {
|
|
14
|
+
private viewer;
|
|
15
|
+
private noFlyZoneEntities;
|
|
16
|
+
private isNoFlyZoneVisible;
|
|
17
|
+
private isNoFlyZoneLoading;
|
|
18
|
+
private readonly extrudedHeight;
|
|
19
|
+
constructor(viewer: Viewer, config?: NotFlyZonesServiceConfig);
|
|
20
|
+
/**
|
|
21
|
+
* 加载并显示机场禁飞区
|
|
22
|
+
*/
|
|
23
|
+
showNoFlyZones(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* 隐藏机场禁飞区
|
|
26
|
+
*/
|
|
27
|
+
hideNoFlyZones(): void;
|
|
28
|
+
/**
|
|
29
|
+
* 切换机场禁飞区显示状态
|
|
30
|
+
*/
|
|
31
|
+
toggleNoFlyZones(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 获取禁飞区显示状态
|
|
34
|
+
*/
|
|
35
|
+
getNoFlyZoneVisible(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 创建禁飞区多边形配置选项
|
|
38
|
+
* @param positions - 多边形的顶点坐标数组,使用笛卡尔坐标系
|
|
39
|
+
* @returns 返回一个包含多边形图形配置选项的对象
|
|
40
|
+
*/
|
|
41
|
+
private createNoFlyZonePolygonOptions;
|
|
42
|
+
/**
|
|
43
|
+
* 销毁禁飞区服务
|
|
44
|
+
*/
|
|
45
|
+
destroy(): void;
|
|
46
|
+
}
|
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
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Cartesian3, Ellipsoid, Rectangle } from '../../node_modules/cesium';
|
|
2
|
+
/**
|
|
3
|
+
* 判断一个 Cartesian3 是否为有效坐标(x/y/z 都是有限数字)
|
|
4
|
+
*/
|
|
5
|
+
export declare function isValidCartesian3(pos: Cartesian3 | null | undefined): pos is Cartesian3;
|
|
6
|
+
/**
|
|
7
|
+
* 格式化距离显示
|
|
8
|
+
* 超过1000m时转换为km,保留两位小数
|
|
9
|
+
* @param distance 距离(米)
|
|
10
|
+
* @returns 格式化后的距离字符串
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDistance(distance: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* 格式化面积显示
|
|
15
|
+
* @param areaKm2 面积(平方公里)
|
|
16
|
+
* @returns 格式化后的面积字符串
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatArea(areaKm2: number): string;
|
|
19
|
+
/**
|
|
20
|
+
* 计算矩形
|
|
21
|
+
* @param p1 第一个点
|
|
22
|
+
* @param p2 第二个点
|
|
23
|
+
* @returns 矩形对象
|
|
24
|
+
*/
|
|
25
|
+
export declare function calculateRectangle(p1: Cartesian3, p2: Cartesian3): Rectangle;
|
|
26
|
+
/**
|
|
27
|
+
* 计算矩形面积
|
|
28
|
+
* @param rect 矩形对象
|
|
29
|
+
* @returns 面积(平方公里)
|
|
30
|
+
*/
|
|
31
|
+
export declare function calculateRectangleArea(rect: Rectangle): number;
|
|
32
|
+
/**
|
|
33
|
+
* 计算多边形面积
|
|
34
|
+
* @param positions 多边形顶点坐标数组
|
|
35
|
+
* @param ellipsoid 椭球体对象(默认使用 WGS84)
|
|
36
|
+
* @returns 面积(平方公里)
|
|
37
|
+
*/
|
|
38
|
+
export declare function calculatePolygonArea(positions: Cartesian3[], ellipsoid?: Ellipsoid): number;
|
|
39
|
+
/**
|
|
40
|
+
* 计算多边形中心点
|
|
41
|
+
* @param positions 多边形顶点坐标数组
|
|
42
|
+
* @returns 中心点坐标
|
|
43
|
+
*/
|
|
44
|
+
export declare function calculatePolygonCenter(positions: Cartesian3[]): Cartesian3;
|
package/dist/utils/common.d.ts
CHANGED
package/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.2-alpha.1",
|
|
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
|
}
|