@xingm/vmap-cesium-toolbar 0.0.2-alpha.5 → 0.0.2-alpha.7
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 +272 -42
- package/dist/index.js +822 -498
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +15 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/drawHelper/DrawCircle.d.ts +5 -0
- package/dist/libs/drawHelper/DrawPolgon.d.ts +1 -0
- package/dist/libs/overlay/MapCircle.d.ts +6 -0
- package/dist/libs/overlay/MapPolygon.d.ts +17 -0
- package/dist/libs/overlay/MapRectangle.d.ts +8 -0
- package/dist/package.json +1 -1
- package/package.json +3 -3
|
@@ -5,6 +5,7 @@ import { BaseDraw, DrawResult, DrawOptions } from './BaseDraw';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class DrawCircle extends BaseDraw {
|
|
7
7
|
private currentCircleEntity;
|
|
8
|
+
private currentBorderEntity;
|
|
8
9
|
private centerPosition;
|
|
9
10
|
/**
|
|
10
11
|
* 开始绘制
|
|
@@ -22,4 +23,8 @@ export declare class DrawCircle extends BaseDraw {
|
|
|
22
23
|
* 获取绘制类型
|
|
23
24
|
*/
|
|
24
25
|
getDrawType(): "line" | "polygon" | "rectangle" | "circle";
|
|
26
|
+
/**
|
|
27
|
+
* 生成近似圆(多边形)顶点
|
|
28
|
+
*/
|
|
29
|
+
private generateCirclePositions;
|
|
25
30
|
}
|
|
@@ -13,6 +13,7 @@ export interface CircleOptions {
|
|
|
13
13
|
outlineWidth?: number;
|
|
14
14
|
heightReference?: HeightReference;
|
|
15
15
|
extrudedHeight?: number;
|
|
16
|
+
heightEpsilon?: number;
|
|
16
17
|
onClick?: (entity: Entity) => void;
|
|
17
18
|
id?: string;
|
|
18
19
|
}
|
|
@@ -39,6 +40,11 @@ export declare class MapCircle {
|
|
|
39
40
|
* 添加 Circle(圆形)
|
|
40
41
|
*/
|
|
41
42
|
add(options: CircleOptions): Entity;
|
|
43
|
+
/**
|
|
44
|
+
* 生成近似圆(多边形)顶点,返回 Cartesian3 数组。
|
|
45
|
+
* 使用大圆航线公式,segments 越大越平滑。
|
|
46
|
+
*/
|
|
47
|
+
private generateCirclePositions;
|
|
42
48
|
/**
|
|
43
49
|
* 更新 Circle 位置
|
|
44
50
|
*/
|
|
@@ -34,6 +34,23 @@ export declare class MapPolygon {
|
|
|
34
34
|
* 解析材质
|
|
35
35
|
*/
|
|
36
36
|
private resolveMaterial;
|
|
37
|
+
/**
|
|
38
|
+
* 计算二维多边形方向(正值为 CCW)
|
|
39
|
+
*/
|
|
40
|
+
private polygonArea2D;
|
|
41
|
+
/**
|
|
42
|
+
* 向内偏移二维多边形顶点(线偏移 + 邻边相交)。厚度单位:米。
|
|
43
|
+
* 对复杂凹形可能產生伪影,更适合凸多边形或温和凹形。
|
|
44
|
+
*/
|
|
45
|
+
private offsetPolygon2DInward;
|
|
46
|
+
/**
|
|
47
|
+
* 计算内偏移后的 3D 顶点:使用切平面近似进行 2D 偏移再投回椭球,并统一高度。
|
|
48
|
+
*/
|
|
49
|
+
private computeInnerOffsetPositions;
|
|
50
|
+
/**
|
|
51
|
+
* 为多边形顶点统一高度(含微小抬升)
|
|
52
|
+
*/
|
|
53
|
+
private elevatePositions;
|
|
37
54
|
/**
|
|
38
55
|
* 添加 Polygon(多边形)
|
|
39
56
|
*/
|
|
@@ -29,6 +29,14 @@ export declare class MapRectangle {
|
|
|
29
29
|
* 解析材质
|
|
30
30
|
*/
|
|
31
31
|
private resolveMaterial;
|
|
32
|
+
/**
|
|
33
|
+
* 将 Rectangle 转为四点多边形顶点(按西南→东南→东北→西北顺序)
|
|
34
|
+
*/
|
|
35
|
+
private rectangleToPositions;
|
|
36
|
+
/**
|
|
37
|
+
* 按米单位向内收缩矩形边界,返回新的 Rectangle
|
|
38
|
+
*/
|
|
39
|
+
private shrinkRectangle;
|
|
32
40
|
/**
|
|
33
41
|
* 添加 Rectangle(矩形)
|
|
34
42
|
*/
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.7",
|
|
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",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "vite --force",
|
|
25
|
-
"build": "vite build
|
|
26
|
-
"build:
|
|
25
|
+
"build": "vite build --mode lib",
|
|
26
|
+
"build:dts": "vue-tsc -p tsconfig.dts.json",
|
|
27
27
|
"build:plugin": "node scripts/build-plugin.js",
|
|
28
28
|
"generate:file-list": "node scripts/generate-file-list.js",
|
|
29
29
|
"preview": "vite preview",
|