my-openlayer 2.4.12 → 2.5.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.
Files changed (171) hide show
  1. package/CHANGELOG.md +251 -251
  2. package/LICENSE +21 -21
  3. package/MyOl.d.ts +9 -9
  4. package/MyOl.js +17 -14
  5. package/README.md +174 -148
  6. package/core/line/Line.d.ts +40 -0
  7. package/core/line/Line.js +144 -0
  8. package/core/line/LineFeatureFactory.d.ts +17 -0
  9. package/core/line/LineFeatureFactory.js +75 -0
  10. package/core/line/LineFlowAnimator.d.ts +53 -0
  11. package/core/line/LineFlowAnimator.js +297 -0
  12. package/core/line/LineStyleFactory.d.ts +43 -0
  13. package/core/line/LineStyleFactory.js +135 -0
  14. package/core/{RiverLayerManager.d.ts → line/RiverLayerManager.d.ts} +2 -2
  15. package/core/{RiverLayerManager.js → line/RiverLayerManager.js} +3 -5
  16. package/core/line/index.d.ts +6 -0
  17. package/core/line/index.js +5 -0
  18. package/core/{ConfigManager.d.ts → map/ConfigManager.d.ts} +25 -1
  19. package/core/{ConfigManager.js → map/ConfigManager.js} +22 -1
  20. package/core/{EventManager.d.ts → map/EventManager.d.ts} +1 -1
  21. package/core/{EventManager.js → map/EventManager.js} +2 -2
  22. package/core/{MapBaseLayers.d.ts → map/MapBaseLayers.d.ts} +1 -1
  23. package/core/{MapBaseLayers.js → map/MapBaseLayers.js} +3 -3
  24. package/core/{MapTools.d.ts → map/MapTools.d.ts} +5 -2
  25. package/core/{MapTools.js → map/MapTools.js} +11 -5
  26. package/core/{MeasureHandler.d.ts → map/MeasureHandler.d.ts} +1 -1
  27. package/core/{MeasureHandler.js → map/MeasureHandler.js} +41 -41
  28. package/core/map/index.d.ts +5 -0
  29. package/core/map/index.js +5 -0
  30. package/core/{Point.d.ts → point/Point.d.ts} +6 -14
  31. package/core/point/Point.js +272 -0
  32. package/core/point/PointClusterLayer.d.ts +10 -0
  33. package/core/point/PointClusterLayer.js +52 -0
  34. package/core/point/PointOverlay.d.ts +13 -0
  35. package/core/point/PointOverlay.js +57 -0
  36. package/core/point/PointPulseLayer.d.ts +13 -0
  37. package/core/point/PointPulseLayer.js +207 -0
  38. package/core/point/index.d.ts +4 -0
  39. package/core/point/index.js +4 -0
  40. package/core/{Polygon.d.ts → polygon/Polygon.d.ts} +4 -50
  41. package/core/polygon/Polygon.js +248 -0
  42. package/core/polygon/PolygonHeatmapLayer.d.ts +11 -0
  43. package/core/polygon/PolygonHeatmapLayer.js +40 -0
  44. package/core/polygon/PolygonImageLayer.d.ts +9 -0
  45. package/core/polygon/PolygonImageLayer.js +61 -0
  46. package/core/polygon/PolygonMaskLayer.d.ts +20 -0
  47. package/core/polygon/PolygonMaskLayer.js +107 -0
  48. package/core/polygon/PolygonStyleFactory.d.ts +12 -0
  49. package/core/polygon/PolygonStyleFactory.js +100 -0
  50. package/core/polygon/index.d.ts +5 -0
  51. package/core/polygon/index.js +5 -0
  52. package/core/{SelectHandler.d.ts → select/SelectHandler.d.ts} +2 -3
  53. package/core/{SelectHandler.js → select/SelectHandler.js} +4 -4
  54. package/core/select/index.d.ts +1 -0
  55. package/core/select/index.js +1 -0
  56. package/core/{VueTemplatePoint.d.ts → vue-template-point/VueTemplatePoint.d.ts} +1 -1
  57. package/core/{VueTemplatePoint.js → vue-template-point/VueTemplatePoint.js} +4 -4
  58. package/core/vue-template-point/index.d.ts +1 -0
  59. package/core/vue-template-point/index.js +1 -0
  60. package/docs/.vitepress/config.mts +57 -57
  61. package/docs/ConfigManager.md +71 -71
  62. package/docs/ErrorHandler.md +106 -106
  63. package/docs/EventManager.md +142 -142
  64. package/docs/Line.md +215 -187
  65. package/docs/MapBaseLayers.md +198 -198
  66. package/docs/MapTools.md +172 -172
  67. package/docs/MeasureHandler.md +87 -87
  68. package/docs/MyOl.md +247 -247
  69. package/docs/Point.md +136 -136
  70. package/docs/Polygon.md +241 -241
  71. package/docs/RiverLayerManager.md +187 -187
  72. package/docs/SelectHandler.md +147 -147
  73. package/docs/ValidationUtils.md +83 -83
  74. package/docs/VueTemplatePoint.md +214 -214
  75. package/docs/index.md +73 -73
  76. package/index.d.ts +10 -15
  77. package/index.js +7 -13
  78. package/package.json +11 -1
  79. package/types/base.d.ts +47 -0
  80. package/types/base.js +1 -0
  81. package/types/common.d.ts +59 -0
  82. package/types/common.js +1 -0
  83. package/types/index.d.ts +9 -0
  84. package/types/index.js +1 -0
  85. package/types/line.d.ts +41 -0
  86. package/types/line.js +1 -0
  87. package/types/map.d.ts +77 -0
  88. package/types/map.js +1 -0
  89. package/types/point.d.ts +54 -0
  90. package/types/point.js +1 -0
  91. package/types/polygon.d.ts +8 -0
  92. package/types/polygon.js +1 -0
  93. package/types/select.d.ts +25 -0
  94. package/types/select.js +1 -0
  95. package/types/vue-template-point.d.ts +54 -0
  96. package/{types.js → types/vue-template-point.js} +0 -3
  97. package/utils/ProjectionUtils.d.ts +28 -0
  98. package/utils/ProjectionUtils.js +34 -0
  99. package/utils/ValidationUtils.d.ts +33 -86
  100. package/utils/ValidationUtils.js +60 -165
  101. package/core/Line.d.ts +0 -49
  102. package/core/Line.js +0 -114
  103. package/core/Point.js +0 -560
  104. package/core/Polygon.js +0 -646
  105. package/docs/.vitepress/dist/404.html +0 -22
  106. package/docs/.vitepress/dist/ConfigManager.html +0 -46
  107. package/docs/.vitepress/dist/ErrorHandler.html +0 -52
  108. package/docs/.vitepress/dist/EventManager.html +0 -58
  109. package/docs/.vitepress/dist/Line.html +0 -92
  110. package/docs/.vitepress/dist/MapBaseLayers.html +0 -52
  111. package/docs/.vitepress/dist/MapTools.html +0 -81
  112. package/docs/.vitepress/dist/MeasureHandler.html +0 -32
  113. package/docs/.vitepress/dist/MyOl.html +0 -62
  114. package/docs/.vitepress/dist/Point.html +0 -81
  115. package/docs/.vitepress/dist/Polygon.html +0 -102
  116. package/docs/.vitepress/dist/RiverLayerManager.html +0 -66
  117. package/docs/.vitepress/dist/SelectHandler.html +0 -46
  118. package/docs/.vitepress/dist/ValidationUtils.html +0 -47
  119. package/docs/.vitepress/dist/VueTemplatePoint.html +0 -112
  120. package/docs/.vitepress/dist/assets/ConfigManager.md.BOMdGTaa.js +0 -22
  121. package/docs/.vitepress/dist/assets/ConfigManager.md.BOMdGTaa.lean.js +0 -1
  122. package/docs/.vitepress/dist/assets/ErrorHandler.md.yUiuJ9w9.js +0 -28
  123. package/docs/.vitepress/dist/assets/ErrorHandler.md.yUiuJ9w9.lean.js +0 -1
  124. package/docs/.vitepress/dist/assets/EventManager.md.BhCUVy1f.js +0 -34
  125. package/docs/.vitepress/dist/assets/EventManager.md.BhCUVy1f.lean.js +0 -1
  126. package/docs/.vitepress/dist/assets/Line.md.BAQOzmSt.js +0 -68
  127. package/docs/.vitepress/dist/assets/Line.md.BAQOzmSt.lean.js +0 -1
  128. package/docs/.vitepress/dist/assets/MapBaseLayers.md.Bw0L_m0b.js +0 -28
  129. package/docs/.vitepress/dist/assets/MapBaseLayers.md.Bw0L_m0b.lean.js +0 -1
  130. package/docs/.vitepress/dist/assets/MapTools.md.DaYgiDPe.js +0 -57
  131. package/docs/.vitepress/dist/assets/MapTools.md.DaYgiDPe.lean.js +0 -1
  132. package/docs/.vitepress/dist/assets/MeasureHandler.md.7Sf4ymRv.js +0 -8
  133. package/docs/.vitepress/dist/assets/MeasureHandler.md.7Sf4ymRv.lean.js +0 -1
  134. package/docs/.vitepress/dist/assets/MyOl.md.D-14Gzjy.js +0 -38
  135. package/docs/.vitepress/dist/assets/MyOl.md.D-14Gzjy.lean.js +0 -1
  136. package/docs/.vitepress/dist/assets/Point.md.Bi9juuuv.js +0 -57
  137. package/docs/.vitepress/dist/assets/Point.md.Bi9juuuv.lean.js +0 -1
  138. package/docs/.vitepress/dist/assets/Polygon.md.-JIqEvzD.js +0 -78
  139. package/docs/.vitepress/dist/assets/Polygon.md.-JIqEvzD.lean.js +0 -1
  140. package/docs/.vitepress/dist/assets/RiverLayerManager.md.CfUu2RxH.js +0 -42
  141. package/docs/.vitepress/dist/assets/RiverLayerManager.md.CfUu2RxH.lean.js +0 -1
  142. package/docs/.vitepress/dist/assets/SelectHandler.md.COR4ez_p.js +0 -22
  143. package/docs/.vitepress/dist/assets/SelectHandler.md.COR4ez_p.lean.js +0 -1
  144. package/docs/.vitepress/dist/assets/ValidationUtils.md.ReTVWa73.js +0 -23
  145. package/docs/.vitepress/dist/assets/ValidationUtils.md.ReTVWa73.lean.js +0 -1
  146. package/docs/.vitepress/dist/assets/VueTemplatePoint.md.CtxSb5Pm.js +0 -88
  147. package/docs/.vitepress/dist/assets/VueTemplatePoint.md.CtxSb5Pm.lean.js +0 -1
  148. package/docs/.vitepress/dist/assets/app.YvjVuxaB.js +0 -1
  149. package/docs/.vitepress/dist/assets/chunks/framework.C_W0ODpn.js +0 -18
  150. package/docs/.vitepress/dist/assets/chunks/theme.Bf87fILP.js +0 -1
  151. package/docs/.vitepress/dist/assets/index.md.BJz6tHSr.js +0 -26
  152. package/docs/.vitepress/dist/assets/index.md.BJz6tHSr.lean.js +0 -1
  153. package/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  154. package/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  155. package/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  156. package/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  157. package/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  158. package/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  159. package/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  160. package/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  161. package/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  162. package/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  163. package/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  164. package/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  165. package/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  166. package/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  167. package/docs/.vitepress/dist/assets/style.C2pAQzDq.css +0 -1
  168. package/docs/.vitepress/dist/hashmap.json +0 -1
  169. package/docs/.vitepress/dist/index.html +0 -50
  170. package/docs/.vitepress/dist/vp-icons.css +0 -1
  171. package/types.d.ts +0 -431
package/docs/Point.md CHANGED
@@ -1,38 +1,38 @@
1
- # Point 类
2
-
1
+ # Point 类
2
+
3
3
  `Point` 类用于在地图上添加和管理点要素,支持普通点、聚合点、DOM 点、高性能闪烁点和 Vue 组件点。
4
-
5
- ## 构造函数
6
-
7
- ```typescript
8
- constructor(map: Map)
9
- ```
10
-
11
- - **map**: OpenLayers 地图实例。
12
-
13
- ## 接口定义
14
-
15
- ### PointOptions
16
-
17
- 继承自 `BaseOptions`, `StyleOptions`, `TextOptions`。
18
-
19
- | 属性名 | 类型 | 说明 |
20
- | :--- | :--- | :--- |
21
- | textKey | `string` | 数据中用于显示文本的字段键名 |
22
- | img | `string` | 图标图片的 URL |
23
- | scale | `number` | 图标缩放比例 |
24
- | iconColor | `string` | 图标颜色(用于改变图标色调) |
25
- | layerName | `string` | 图层名称(必填,继承自 BaseOptions) |
26
- | zIndex | `number` | 图层层级 |
27
- | visible | `boolean` | 是否可见 |
28
- | style | `Style \| Style[] \| ((feature: FeatureLike) => Style \| Style[])` | 自定义样式函数 |
29
-
4
+
5
+ ## 构造函数
6
+
7
+ ```typescript
8
+ constructor(map: Map)
9
+ ```
10
+
11
+ - **map**: OpenLayers 地图实例。
12
+
13
+ ## 接口定义
14
+
15
+ ### PointOptions
16
+
17
+ 继承自 `BaseOptions`, `StyleOptions`, `TextOptions`。
18
+
19
+ | 属性名 | 类型 | 说明 |
20
+ | :--- | :--- | :--- |
21
+ | textKey | `string` | 数据中用于显示文本的字段键名 |
22
+ | img | `string` | 图标图片的 URL |
23
+ | scale | `number` | 图标缩放比例 |
24
+ | iconColor | `string` | 图标颜色(用于改变图标色调) |
25
+ | layerName | `string` | 图层名称(必填,继承自 BaseOptions) |
26
+ | zIndex | `number` | 图层层级 |
27
+ | visible | `boolean` | 是否可见 |
28
+ | style | `Style \| Style[] \| ((feature: FeatureLike) => Style \| Style[])` | 自定义样式函数 |
29
+
30
30
  ### ClusterOptions
31
31
 
32
32
  继承自 `PointOptions`。
33
-
34
- | 属性名 | 类型 | 说明 |
35
- | :--- | :--- | :--- |
33
+
34
+ | 属性名 | 类型 | 说明 |
35
+ | :--- | :--- | :--- |
36
36
  | distance | `number` | 聚合距离(像素),默认为 20 |
37
37
  | minDistance | `number` | 最小聚合距离 |
38
38
 
@@ -67,65 +67,65 @@ constructor(map: Map)
67
67
  ### PointData
68
68
 
69
69
  | 属性名 | 类型 | 说明 |
70
- | :--- | :--- | :--- |
71
- | lgtd | `number` | 经度 |
72
- | lttd | `number` | 纬度 |
73
- | [key: string] | `any` | 其他业务数据字段 |
74
-
75
- ### VueTemplatePointOptions
76
-
77
- | 属性名 | 类型 | 说明 |
78
- | :--- | :--- | :--- |
79
- | Template | `any` | Vue 组件模板 |
80
- | lgtd | `number` | 经度 |
81
- | lttd | `number` | 纬度 |
82
- | props | `any` | 传递给组件的 props |
83
- | styleType | `'default' \| 'custom'` | 样式类型 |
84
- | positioning | `string` | 定位方式,如 'bottom-center' |
85
- | stopEvent | `boolean` | 是否阻止事件冒泡 |
86
- | visible | `boolean` | 是否可见 |
87
- | className | `string` | 自定义类名 |
88
- | zIndex | `number` | 层级 |
89
-
90
- ## 方法
91
-
92
- ### addPoint
93
-
94
- 添加普通点图层。
95
-
96
- ```typescript
97
- addPoint(pointData: PointData[], options: PointOptions): VectorLayer<VectorSource> | null
98
- ```
99
-
100
- - **pointData**: 点位数据数组。
101
- - **options**: 配置选项。
102
- - **返回值**: 创建的向量图层,如果数据无效返回 `null`。
103
-
104
- ### addClusterPoint
105
-
106
- 添加聚合点图层。
107
-
108
- ```typescript
109
- addClusterPoint(pointData: PointData[], options: ClusterOptions): VectorLayer<VectorSource> | null
110
- ```
111
-
112
- - **pointData**: 点位数据数组。
113
- - **options**: 聚合配置选项。
114
- - **返回值**: 创建的聚合图层。
115
-
70
+ | :--- | :--- | :--- |
71
+ | lgtd | `number` | 经度 |
72
+ | lttd | `number` | 纬度 |
73
+ | [key: string] | `any` | 其他业务数据字段 |
74
+
75
+ ### VueTemplatePointOptions
76
+
77
+ | 属性名 | 类型 | 说明 |
78
+ | :--- | :--- | :--- |
79
+ | Template | `any` | Vue 组件模板 |
80
+ | lgtd | `number` | 经度 |
81
+ | lttd | `number` | 纬度 |
82
+ | props | `any` | 传递给组件的 props |
83
+ | styleType | `'default' \| 'custom'` | 样式类型 |
84
+ | positioning | `string` | 定位方式,如 'bottom-center' |
85
+ | stopEvent | `boolean` | 是否阻止事件冒泡 |
86
+ | visible | `boolean` | 是否可见 |
87
+ | className | `string` | 自定义类名 |
88
+ | zIndex | `number` | 层级 |
89
+
90
+ ## 方法
91
+
92
+ ### addPoint
93
+
94
+ 添加普通点图层。
95
+
96
+ ```typescript
97
+ addPoint(pointData: PointData[], options: PointOptions): VectorLayer<VectorSource> | null
98
+ ```
99
+
100
+ - **pointData**: 点位数据数组。
101
+ - **options**: 配置选项。
102
+ - **返回值**: 创建的向量图层,如果数据无效返回 `null`。
103
+
104
+ ### addClusterPoint
105
+
106
+ 添加聚合点图层。
107
+
108
+ ```typescript
109
+ addClusterPoint(pointData: PointData[], options: ClusterOptions): VectorLayer<VectorSource> | null
110
+ ```
111
+
112
+ - **pointData**: 点位数据数组。
113
+ - **options**: 聚合配置选项。
114
+ - **返回值**: 创建的聚合图层。
115
+
116
116
  ### addDomPoint
117
117
 
118
118
  添加 DOM 元素点(Overlay)。
119
-
120
- ```typescript
121
- addDomPoint(twinkleList: TwinkleItem[], callback?: Function): {
122
- anchors: Overlay[],
123
- remove: () => void,
124
- setVisible: (visible: boolean) => void
125
- }
126
- ```
127
-
128
- - **twinkleList**: 包含经纬度和类名的数据列表。
119
+
120
+ ```typescript
121
+ addDomPoint(twinkleList: TwinkleItem[], callback?: Function): {
122
+ anchors: Overlay[],
123
+ remove: () => void,
124
+ setVisible: (visible: boolean) => void
125
+ }
126
+ ```
127
+
128
+ - **twinkleList**: 包含经纬度和类名的数据列表。
129
129
  - **callback**: 点击回调函数。
130
130
  - **返回值**: 控制对象,包含 `remove` 和 `setVisible` 方法。
131
131
 
@@ -144,45 +144,45 @@ addPulsePointLayer(pointData: PointData[], options: PulsePointOptions): PulsePoi
144
144
  ### addVueTemplatePoint
145
145
 
146
146
  添加 Vue 组件作为点位。
147
-
148
- ```typescript
149
- addVueTemplatePoint(pointDataList: PointData[], template: any, options?: VueTemplatePointOptions): {
150
- setVisible: (visible: boolean) => void,
151
- setOneVisibleByProp: (propName: string, propValue: any, visible: boolean) => void,
152
- remove: () => void,
153
- getPoints: () => VueTemplatePointInstance[]
154
- }
155
- ```
156
-
157
- - **pointDataList**: 点位数据列表。
158
- - **template**: Vue 组件。
159
- - **options**: 配置选项。
160
- - **返回值**: 控制对象,包含显示/隐藏和移除方法。
161
-
162
- ## 使用示例
163
-
164
- ### 添加普通点
165
-
166
- ```typescript
167
- import { Point } from 'my-openlayers';
168
-
169
- const point = new Point(map);
170
- const data = [
171
- { lgtd: 116.40, lttd: 39.90, name: '北京' },
172
- { lgtd: 121.47, lttd: 31.23, name: '上海' }
173
- ];
174
-
175
- point.addPoint(data, {
176
- layerName: 'cities',
177
- img: 'path/to/icon.png',
178
- textKey: 'name',
179
- scale: 0.8
180
- });
181
- ```
182
-
183
- ### 添加聚合点
184
-
185
- ```typescript
147
+
148
+ ```typescript
149
+ addVueTemplatePoint(pointDataList: PointData[], template: any, options?: VueTemplatePointOptions): {
150
+ setVisible: (visible: boolean) => void,
151
+ setOneVisibleByProp: (propName: string, propValue: any, visible: boolean) => void,
152
+ remove: () => void,
153
+ getPoints: () => VueTemplatePointInstance[]
154
+ }
155
+ ```
156
+
157
+ - **pointDataList**: 点位数据列表。
158
+ - **template**: Vue 组件。
159
+ - **options**: 配置选项。
160
+ - **返回值**: 控制对象,包含显示/隐藏和移除方法。
161
+
162
+ ## 使用示例
163
+
164
+ ### 添加普通点
165
+
166
+ ```typescript
167
+ import { Point } from 'my-openlayers';
168
+
169
+ const point = new Point(map);
170
+ const data = [
171
+ { lgtd: 116.40, lttd: 39.90, name: '北京' },
172
+ { lgtd: 121.47, lttd: 31.23, name: '上海' }
173
+ ];
174
+
175
+ point.addPoint(data, {
176
+ layerName: 'cities',
177
+ img: 'path/to/icon.png',
178
+ textKey: 'name',
179
+ scale: 0.8
180
+ });
181
+ ```
182
+
183
+ ### 添加聚合点
184
+
185
+ ```typescript
186
186
  point.addClusterPoint(data, {
187
187
  layerName: 'clusters',
188
188
  distance: 40,
@@ -221,13 +221,13 @@ pulseCtrl?.remove();
221
221
  ### 添加 Vue 组件点
222
222
 
223
223
  ```typescript
224
- import MyComponent from './MyComponent.vue';
225
-
226
- const ctrl = point.addVueTemplatePoint(data, MyComponent, {
227
- positioning: 'bottom-center',
228
- props: { status: 'active' }
229
- });
230
-
231
- // 隐藏所有点
232
- ctrl.setVisible(false);
233
- ```
224
+ import MyComponent from './MyComponent.vue';
225
+
226
+ const ctrl = point.addVueTemplatePoint(data, MyComponent, {
227
+ positioning: 'bottom-center',
228
+ props: { status: 'active' }
229
+ });
230
+
231
+ // 隐藏所有点
232
+ ctrl.setVisible(false);
233
+ ```