@xingm/vmap-cesium-toolbar 0.0.2-alpha.13 → 0.0.2-alpha.14

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.
@@ -3,6 +3,54 @@ import { Cartesian3, Entity, Color, MaterialProperty, Rectangle, Cartographic }
3
3
  * 覆盖物位置类型
4
4
  */
5
5
  export type OverlayPosition = Cartesian3 | [number, number] | [number, number, number];
6
+ export interface OverlayHighlightOriginalStyle {
7
+ point?: {
8
+ pixelSize?: any;
9
+ color?: any;
10
+ outlineColor?: any;
11
+ outlineWidth?: any;
12
+ };
13
+ label?: {
14
+ fillColor?: any;
15
+ outlineColor?: any;
16
+ outlineWidth?: any;
17
+ scale?: any;
18
+ };
19
+ billboard?: {
20
+ scale?: any;
21
+ color?: any;
22
+ };
23
+ polyline?: {
24
+ width?: any;
25
+ material?: any;
26
+ };
27
+ polygon?: {
28
+ outline?: any;
29
+ outlineColor?: any;
30
+ outlineWidth?: any;
31
+ material?: any;
32
+ };
33
+ rectangle?: {
34
+ outline?: any;
35
+ outlineColor?: any;
36
+ outlineWidth?: any;
37
+ material?: any;
38
+ };
39
+ ellipse?: {
40
+ outline?: any;
41
+ outlineColor?: any;
42
+ outlineWidth?: any;
43
+ material?: any;
44
+ };
45
+ }
46
+ export interface OverlayClickHighlightOptions {
47
+ /** 高亮主颜色(默认 yellow) */
48
+ color?: Color | string;
49
+ /** 面填充透明度(默认 0.35) */
50
+ fillAlpha?: number;
51
+ }
52
+ /** 与 clickHighlight 使用同样的参数结构(颜色 + 面填充透明度) */
53
+ export type OverlayHoverHighlightOptions = OverlayClickHighlightOptions;
6
54
  /**
7
55
  * 覆盖物扩展实体类型
8
56
  * 用于在 Cesium.Entity 上挂载覆盖物相关的元数据
@@ -10,6 +58,21 @@ export type OverlayPosition = Cartesian3 | [number, number] | [number, number, n
10
58
  export interface OverlayEntity extends Entity {
11
59
  /** 覆盖物点击回调(由各 Map* 工具类设置) */
12
60
  _onClick?: (entity: Entity) => void;
61
+ /** 点击覆盖物时是否启用高亮(由各 Map* 工具类设置) */
62
+ _clickHighlight?: boolean | OverlayClickHighlightOptions;
63
+ /** 鼠标移入覆盖物时是否启用高亮(由各 Map* 工具类设置) */
64
+ _hoverHighlight?: boolean | OverlayHoverHighlightOptions;
65
+ /** 高亮联动的实体集合(复合覆盖物:边框/填充等一起切换) */
66
+ _highlightEntities?: Entity[];
67
+ /** 当前是否处于高亮状态 */
68
+ _isHighlighted?: boolean;
69
+ /** 当前高亮原因(click/hover 可叠加;click 优先显示) */
70
+ _highlightState?: {
71
+ click?: boolean;
72
+ hover?: boolean;
73
+ };
74
+ /** 用于还原高亮前的原始样式 */
75
+ _highlightOriginalStyle?: OverlayHighlightOriginalStyle;
13
76
  /** 覆盖物类型标识(用于 CesiumOverlayService 做差异化更新/删除) */
14
77
  _overlayType?: string;
15
78
  /** 信息窗口根 DOM(由 MapInfoWindow / CesiumOverlayService 使用) */
@@ -18,6 +81,10 @@ export interface OverlayEntity extends Entity {
18
81
  _borderEntity?: Entity;
19
82
  _innerEntity?: Entity;
20
83
  /** 粗边框 / 环形等形状相关元数据 */
84
+ /** 是否贴地(粗边框/环形等复合形状用) */
85
+ _clampToGround?: boolean;
86
+ /** 复合形状的基准高度(米,clampToGround=false 时有效) */
87
+ _baseHeight?: number;
21
88
  _isThickOutline?: boolean;
22
89
  _outlineWidth?: number;
23
90
  _isRing?: boolean;
@@ -38,4 +105,9 @@ export interface OverlayEntity extends Entity {
38
105
  _outerRadius?: number;
39
106
  _innerRadius?: number;
40
107
  _outerRectangle?: Rectangle;
108
+ /** primitive circle: 内部使用的纯色缓存(用于高亮恢复) */
109
+ _primitiveRingBaseColor?: Color;
110
+ _primitiveFillBaseColor?: Color;
111
+ /** primitive polygon/rectangle: 边框纯色缓存(用于高亮恢复) */
112
+ _primitiveBorderBaseColor?: Color;
41
113
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.2-alpha.13",
3
+ "version": "0.0.2-alpha.14",
4
4
  "description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -42,3 +42,9 @@ export declare function calculatePolygonArea(positions: Cartesian3[], ellipsoid?
42
42
  * @returns 中心点坐标
43
43
  */
44
44
  export declare function calculatePolygonCenter(positions: Cartesian3[]): Cartesian3;
45
+ /**
46
+ * 计算折线总长度
47
+ * @param positions 折线顶点坐标数组
48
+ * @returns 总长度(米)
49
+ */
50
+ export declare function calculatePolylineDistance(positions: Cartesian3[]): number;
@@ -0,0 +1,13 @@
1
+ import { Cartesian3 } from '../../node_modules/cesium';
2
+ /**
3
+ * Returns true if adding `nextPoint` to an open polygon polyline would create a self-intersection.
4
+ */
5
+ export declare function wouldCreatePolygonSelfIntersection(existingPoints: Cartesian3[], nextPoint: Cartesian3, opts?: {
6
+ allowTouch?: boolean;
7
+ }): boolean;
8
+ /**
9
+ * Returns true if the closed polygon described by `points` is self-intersecting.
10
+ */
11
+ export declare function isClosedPolygonSelfIntersecting(points: Cartesian3[], opts?: {
12
+ allowTouch?: boolean;
13
+ }): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.2-alpha.13",
3
+ "version": "0.0.2-alpha.14",
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",