@sword916/vae-map-plus 1.0.0 → 1.0.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 (185) hide show
  1. package/lib/index.js +5376 -0
  2. package/lib/style.css +1 -0
  3. package/lib/vae-amap/favicon.ico +0 -0
  4. package/lib/vae-amap/images/game.png +0 -0
  5. package/lib/vae-amap/images/grid.png +0 -0
  6. package/lib/vae-amap/images/marker.png +0 -0
  7. package/lib/vae-amap/index.js +209 -0
  8. package/lib/vae-amap/style.css +1 -0
  9. package/lib/vae-cloudmap/favicon.ico +0 -0
  10. package/lib/vae-cloudmap/images/game.png +0 -0
  11. package/lib/vae-cloudmap/images/grid.png +0 -0
  12. package/lib/vae-cloudmap/images/marker.png +0 -0
  13. package/lib/vae-cloudmap/index.html +30 -0
  14. package/lib/vae-cloudmap/index.js +4085 -0
  15. package/lib/vae-cloudmap/style.css +1 -0
  16. package/lib/vae-map/favicon.ico +0 -0
  17. package/lib/vae-map/images/game.png +0 -0
  18. package/lib/vae-map/images/grid.png +0 -0
  19. package/lib/vae-map/images/marker.png +0 -0
  20. package/lib/vae-map/index.html +30 -0
  21. package/lib/vae-map/index.js +4322 -0
  22. package/lib/vae-map/style.css +1 -0
  23. package/package.json +1 -1
  24. package/plugins/L.AnimatedMarker/favicon.ico +0 -0
  25. package/plugins/L.AnimatedMarker/images/game.png +0 -0
  26. package/plugins/L.AnimatedMarker/images/grid.png +0 -0
  27. package/plugins/L.AnimatedMarker/images/marker.png +0 -0
  28. package/plugins/L.AnimatedMarker/index.html +30 -0
  29. package/plugins/L.AnimatedMarker/index.js +83 -0
  30. package/plugins/L.EchartsLayer/favicon.ico +0 -0
  31. package/plugins/L.EchartsLayer/images/game.png +0 -0
  32. package/plugins/L.EchartsLayer/images/grid.png +0 -0
  33. package/plugins/L.EchartsLayer/images/marker.png +0 -0
  34. package/plugins/L.EchartsLayer/index.html +30 -0
  35. package/plugins/L.EchartsLayer/index.js +176 -0
  36. package/plugins/L.FootageCalculator.Area/favicon.ico +0 -0
  37. package/plugins/L.FootageCalculator.Area/images/game.png +0 -0
  38. package/plugins/L.FootageCalculator.Area/images/grid.png +0 -0
  39. package/plugins/L.FootageCalculator.Area/images/marker.png +0 -0
  40. package/plugins/L.FootageCalculator.Area/index.html +30 -0
  41. package/plugins/L.FootageCalculator.Area/index.js +418 -0
  42. package/plugins/L.FootageCalculator.Line/favicon.ico +0 -0
  43. package/plugins/L.FootageCalculator.Line/images/game.png +0 -0
  44. package/plugins/L.FootageCalculator.Line/images/grid.png +0 -0
  45. package/plugins/L.FootageCalculator.Line/images/marker.png +0 -0
  46. package/plugins/L.FootageCalculator.Line/index.html +30 -0
  47. package/plugins/L.FootageCalculator.Line/index.js +416 -0
  48. package/plugins/L.GeoUtil/favicon.ico +0 -0
  49. package/plugins/L.GeoUtil/images/game.png +0 -0
  50. package/plugins/L.GeoUtil/images/grid.png +0 -0
  51. package/plugins/L.GeoUtil/images/marker.png +0 -0
  52. package/plugins/L.GeoUtil/index.html +30 -0
  53. package/plugins/L.GeoUtil/index.js +279 -0
  54. package/plugins/L.Glyphicon/favicon.ico +0 -0
  55. package/plugins/L.Glyphicon/images/game.png +0 -0
  56. package/plugins/L.Glyphicon/images/grid.png +0 -0
  57. package/plugins/L.Glyphicon/images/marker.png +0 -0
  58. package/plugins/L.Glyphicon/index.html +30 -0
  59. package/plugins/L.Glyphicon/index.js +57 -0
  60. package/plugins/L.Glyphicon/style.css +1 -0
  61. package/plugins/L.MarkerClusterX/favicon.ico +0 -0
  62. package/plugins/L.MarkerClusterX/images/game.png +0 -0
  63. package/plugins/L.MarkerClusterX/images/grid.png +0 -0
  64. package/plugins/L.MarkerClusterX/images/marker.png +0 -0
  65. package/plugins/L.MarkerClusterX/index.html +30 -0
  66. package/plugins/L.MarkerClusterX/index.js +33 -0
  67. package/plugins/L.MarkerClusterX/style.css +1 -0
  68. package/plugins/L.SafeDivOverlay/favicon.ico +0 -0
  69. package/plugins/L.SafeDivOverlay/images/game.png +0 -0
  70. package/plugins/L.SafeDivOverlay/images/grid.png +0 -0
  71. package/plugins/L.SafeDivOverlay/images/marker.png +0 -0
  72. package/plugins/L.SafeDivOverlay/index.html +30 -0
  73. package/plugins/L.SafeDivOverlay/index.js +26 -0
  74. package/plugins/L.TileLayer.ChinaProvider/favicon.ico +0 -0
  75. package/plugins/L.TileLayer.ChinaProvider/images/game.png +0 -0
  76. package/plugins/L.TileLayer.ChinaProvider/images/grid.png +0 -0
  77. package/plugins/L.TileLayer.ChinaProvider/images/marker.png +0 -0
  78. package/plugins/L.TileLayer.ChinaProvider/index.html +30 -0
  79. package/plugins/L.TileLayer.ChinaProvider/index.js +91 -0
  80. package/plugins/L.VuePopup/favicon.ico +0 -0
  81. package/plugins/L.VuePopup/images/game.png +0 -0
  82. package/plugins/L.VuePopup/images/grid.png +0 -0
  83. package/plugins/L.VuePopup/images/marker.png +0 -0
  84. package/plugins/L.VuePopup/index.html +30 -0
  85. package/plugins/L.VuePopup/index.js +68 -0
  86. package/plugins/L.VueTooltip/favicon.ico +0 -0
  87. package/plugins/L.VueTooltip/images/game.png +0 -0
  88. package/plugins/L.VueTooltip/images/grid.png +0 -0
  89. package/plugins/L.VueTooltip/images/marker.png +0 -0
  90. package/plugins/L.VueTooltip/index.html +30 -0
  91. package/plugins/L.VueTooltip/index.js +68 -0
  92. package/plugins/Mixin.Map.Measure/favicon.ico +0 -0
  93. package/plugins/Mixin.Map.Measure/images/game.png +0 -0
  94. package/plugins/Mixin.Map.Measure/images/grid.png +0 -0
  95. package/plugins/Mixin.Map.Measure/images/marker.png +0 -0
  96. package/plugins/Mixin.Map.Measure/index.html +30 -0
  97. package/plugins/Mixin.Map.Measure/index.js +84 -0
  98. package/plugins/globals/favicon.ico +0 -0
  99. package/plugins/globals/images/game.png +0 -0
  100. package/plugins/globals/images/grid.png +0 -0
  101. package/plugins/globals/images/marker.png +0 -0
  102. package/plugins/globals/index.html +30 -0
  103. package/plugins/globals/index.js +4 -0
  104. package/build/index.mjs +0 -113
  105. package/examples/App.vue +0 -18
  106. package/examples/index.js +0 -13
  107. package/examples/router/index.js +0 -35
  108. package/examples/views/amap.vue +0 -29
  109. package/examples/views/amarker.vue +0 -58
  110. package/examples/views/buffer.vue +0 -66
  111. package/examples/views/cluster.vue +0 -74
  112. package/examples/views/cover.vue +0 -85
  113. package/examples/views/draw-line.vue +0 -49
  114. package/examples/views/draw.vue +0 -54
  115. package/examples/views/echarts.vue +0 -142
  116. package/examples/views/emarker.vue +0 -39
  117. package/examples/views/image.vue +0 -182
  118. package/examples/views/index.vue +0 -61
  119. package/examples/views/lrmap.vue +0 -108
  120. package/examples/views/map.vue +0 -82
  121. package/examples/views/measure.vue +0 -86
  122. package/examples/views/parts/popup.vue +0 -39
  123. package/examples/views/parts/tooltip.vue +0 -39
  124. package/examples/views/push-area.vue +0 -52
  125. package/examples/views/push-line.vue +0 -84
  126. package/examples/views/trace.vue +0 -49
  127. package/jsconfig.json +0 -17
  128. package/src/components/resize-listener/component.jsx +0 -30
  129. package/src/components/resize-listener/index.js +0 -3
  130. package/src/composables/useAutoMessage.js +0 -41
  131. package/src/composables/useContextMenu.js +0 -99
  132. package/src/composables/useMapMeasure.js +0 -191
  133. package/src/composables/useResizeObserver.js +0 -81
  134. package/src/mixins/message.js +0 -1
  135. package/src/packages/index.js +0 -16
  136. package/src/packages/vae-amap/index.js +0 -8
  137. package/src/packages/vae-amap/style.less +0 -9
  138. package/src/packages/vae-amap/vae-amap.jsx +0 -98
  139. package/src/packages/vae-cloudmap/ctrl-context-menu/index.vue +0 -74
  140. package/src/packages/vae-cloudmap/ctrl-draw/index.vue +0 -499
  141. package/src/packages/vae-cloudmap/ctrl-draw-line/index.vue +0 -161
  142. package/src/packages/vae-cloudmap/index.js +0 -57
  143. package/src/packages/vae-cloudmap/scripts/L.MarkerCluster/index.js +0 -2690
  144. package/src/packages/vae-cloudmap/scripts/L.MarkerCluster/style.css +0 -14
  145. package/src/packages/vae-cloudmap/scripts/L.Vae.CRS/index.js +0 -212
  146. package/src/packages/vae-cloudmap/scripts/L.Vae.Client/index.js +0 -780
  147. package/src/packages/vae-cloudmap/scripts/Mixin.ContextMenu/index.js +0 -101
  148. package/src/packages/vae-cloudmap/style.less +0 -163
  149. package/src/packages/vae-cloudmap/vae-cloudmap.jsx +0 -272
  150. package/src/packages/vae-map/ctrl-context-menu/index.vue +0 -74
  151. package/src/packages/vae-map/ctrl-draw/index.vue +0 -498
  152. package/src/packages/vae-map/ctrl-draw-line/index.vue +0 -128
  153. package/src/packages/vae-map/index.js +0 -59
  154. package/src/packages/vae-map/scripts/L.MarkerCluster/index.js +0 -2690
  155. package/src/packages/vae-map/scripts/L.MarkerCluster/style.css +0 -14
  156. package/src/packages/vae-map/scripts/L.Vae.CRS/index.js +0 -114
  157. package/src/packages/vae-map/scripts/L.Vae.Client/index.js +0 -548
  158. package/src/packages/vae-map/scripts/Mixin.ContextMenu/index.js +0 -1
  159. package/src/packages/vae-map/style.less +0 -161
  160. package/src/packages/vae-map/vae-lrmap.jsx +0 -237
  161. package/src/packages/vae-map/vae-map.jsx +0 -135
  162. package/src/plugins/L.AnimatedMarker/index.js +0 -158
  163. package/src/plugins/L.EchartsLayer/index.js +0 -339
  164. package/src/plugins/L.ElasticMarker/index.js +0 -162
  165. package/src/plugins/L.FootageCalculator.Area/index.js +0 -263
  166. package/src/plugins/L.FootageCalculator.Line/index.js +0 -273
  167. package/src/plugins/L.GeoUtil/buffer.js +0 -67
  168. package/src/plugins/L.GeoUtil/index.js +0 -284
  169. package/src/plugins/L.Glyphicon/index.js +0 -91
  170. package/src/plugins/L.Glyphicon/style.less +0 -37
  171. package/src/plugins/L.MarkerClusterX/index.js +0 -93
  172. package/src/plugins/L.MarkerClusterX/style.less +0 -162
  173. package/src/plugins/L.SafeDivOverlay/index.js +0 -55
  174. package/src/plugins/L.TileLayer.ChinaProvider/index.js +0 -108
  175. package/src/plugins/L.VuePopup/index.js +0 -67
  176. package/src/plugins/L.VueTooltip/index.js +0 -63
  177. package/src/plugins/Mixin.Map.Measure/index.js +0 -248
  178. package/src/plugins/globals/index.js +0 -7
  179. package/src/utils/index.js +0 -36
  180. package/src/utils/resize-event.js +0 -45
  181. /package/{public → lib}/favicon.ico +0 -0
  182. /package/{public → lib}/images/game.png +0 -0
  183. /package/{public → lib}/images/grid.png +0 -0
  184. /package/{public → lib}/images/marker.png +0 -0
  185. /package/{public → lib/vae-amap}/index.html +0 -0
@@ -1,284 +0,0 @@
1
- import buffer from './buffer'
2
-
3
- const fns = {
4
-
5
- /**
6
- * 角度转弧度
7
- * @param {角度} angle
8
- */
9
- angleToRad(angle) {
10
- return angle * Math.PI / 180
11
- },
12
-
13
- /**
14
- * 弧度转角度
15
- * @param {弧度} rad
16
- */
17
- radToAngle(rad) {
18
- return rad * 180 / Math.PI
19
- },
20
-
21
- /**
22
- * 水平角度转顺时针角
23
- * @param {角度} angle
24
- */
25
- toClockwiseAngle(angle) {
26
- let a = 90 - angle
27
- if (a < 0) {
28
- a += 360
29
- }
30
- return a
31
- },
32
-
33
- /**
34
- * 求两点水平弧度
35
- * @param {L.Point} a 起点
36
- * @param {L.Point} b 终点
37
- */
38
- computeRad(a, b) {
39
- return Math.atan2(b.y - a.y, b.x - a.x)
40
- },
41
-
42
- /**
43
- * 求两点水平角度
44
- * @param {L.Point} a 起点
45
- * @param {L.Point} b 终点
46
- */
47
- computeAngle(a, b) {
48
- return this.radToAngle(this.computeRad(a, b))
49
- },
50
-
51
- /**
52
- * 获取线段夹角弧度
53
- * @param {L.Point} a 交点
54
- * @param {L.Point} b 终点一
55
- * @param {L.Point} c 终点二
56
- */
57
- segmentsRad(a, b, c) {
58
- const x1 = b.x - a.x
59
- const y1 = b.y - a.y
60
- const x2 = c.x - a.x
61
- const y2 = c.y - a.y
62
-
63
- const dot = x1 * x2 + y1 * y2
64
- const det = x1 * y2 - y1 * x2
65
-
66
- return Math.atan2(det, dot)
67
- },
68
-
69
- /**
70
- * 获取点到线段所在直线的垂足
71
- * @param {L.Point} a 点
72
- * @param {L.Point} m 线段起点
73
- * @param {L.Point} n 线段终点
74
- */
75
- footPointOnLine(a, m, n) {
76
- const s = (m.x - n.x) * (m.x - n.x) + (m.y - n.y) * (m.y - n.y)
77
- const p = (a.x - m.x) * (n.x - m.x) + (a.y - m.y) * (n.y - m.y)
78
- const r = p / s
79
- const x = m.x + r * (n.x - m.x)
80
- const y = m.y + r * (n.y - m.y)
81
-
82
- return L.point(x, y)
83
- },
84
-
85
- /**
86
- * 两线段所在直线的交点坐标,平行或共线时不返回
87
- * @param {L.Point} a 线段一起点
88
- * @param {L.Point} b 线段一终点
89
- * @param {L.Point} c 线段二起点
90
- * @param {L.Point} d 线段二终点
91
- */
92
- linesIntersection(a, b, c, d) {
93
- const denominator = (b.y - a.y) * (d.x - c.x) - (a.x - b.x) * (c.y - d.y)
94
- if (denominator) {
95
- const x = ((b.x - a.x) * (d.x - c.x) * (c.y - a.y) +
96
- (b.y - a.y) * (d.x - c.x) * a.x -
97
- (d.y - c.y) * (b.x - a.x) * c.x) / denominator
98
- const y = -((b.y - a.y) * (d.y - c.y) * (c.x - a.x) +
99
- (b.x - a.x) * (d.y - c.y) * a.y -
100
- (d.x - c.x) * (b.y - a.y) * c.y) / denominator
101
-
102
- return L.point(x, y)
103
- }
104
- },
105
-
106
- /**
107
- * 根据经纬度计算累计距离,单位米
108
- * @param {Array<L.LatLng>} latLngs
109
- * @param {L.CRS} 坐标系,默认使用L.CRS.EPSG3857
110
- */
111
- distanceByLatLngs(latLngs, crs = L.CRS.EPSG3857) {
112
- if (typeof (crs.distance) !== 'function') {
113
- crs = L.CRS.EPSG3857
114
- }
115
- let sum = 0
116
- if (Array.isArray(latLngs) && latLngs.length > 1) {
117
- for (let i = 0; i < latLngs.length - 1; i++) {
118
- sum += crs.distance(latLngs[i], latLngs[i + 1])
119
- }
120
- }
121
- return sum
122
- },
123
-
124
- /**
125
- * 根据经纬度计算面积,单位平方米
126
- * @param {Array<L.LatLng>} latLngs
127
- */
128
- areaByLatLngs(latLngs) {
129
- let pointsCount = latLngs.length,
130
- area = 0.0,
131
- d2r = Math.PI / 180,
132
- p1, p2
133
-
134
- if (pointsCount > 2) {
135
- for (let i = 0; i < pointsCount; i++) {
136
- p1 = latLngs[i]
137
- p2 = latLngs[(i + 1) % pointsCount]
138
- area += ((p2.lng - p1.lng) * d2r) * (2 + Math.sin(p1.lat * d2r) + Math.sin(p2.lat * d2r))
139
- }
140
- area = area * 6378137.0 * 6378137.0 / 2.0
141
- }
142
-
143
- return Math.abs(area)
144
- },
145
-
146
- /**
147
- * 根据坐标点计算面积
148
- * @param {Array<L.Point>} points
149
- */
150
- areaByPoints(points) {
151
- let area = 0
152
- if (Array.isArray(points) && points.length > 2) {
153
- let sum = 0
154
- for (let i = 0; i < points.length; i++) {
155
- if (i + 1 == points.length) {
156
- sum += points[i].x * points[0].y - points[0].x * points[i].y
157
- } else {
158
- sum += (points[i].x * points[i + 1].y - points[i + 1].x * points[i].y)
159
- }
160
- }
161
- area = 1 / 2 * Math.abs(sum)
162
- }
163
- return area
164
- },
165
-
166
- /**
167
- * 转换面积,增加单位
168
- * @param {number} area 面积数字,单位平方米
169
- */
170
- readableArea(area) {
171
- let areaStr = 0
172
- if (area > 1000 * 1000) {
173
- areaStr = (area / (1000 * 1000)).toFixed(2) + ' km²';
174
- } else {
175
- areaStr = Math.ceil(area) + ' m²';
176
- }
177
- return areaStr
178
- },
179
-
180
- /**
181
- * 点是否在多边形内,射线法
182
- * @param {L.Point} point 给定点
183
- * @param {Array<L.Point>} points 多边形坐标
184
- * @returns {Boolean} 是否置于多边形内或边界上
185
- */
186
- isPointInPoly(point, points) {
187
- const px = point.x
188
- const py = point.y
189
- let flag = false
190
-
191
- // 是否置于边界上
192
- let isOn = false
193
- // 遍历边界
194
- const length = points.length
195
- for (let i = 0, j = length - 1; i < length; j = i, i++) {
196
- const sx = points[i].x
197
- const sy = points[i].y
198
- const tx = points[j].x
199
- const ty = points[j].y
200
-
201
- // 点与多边形顶点重合
202
- if ((sx === px && sy === py) || (tx === px && ty === py)) {
203
- isOn = true
204
- }
205
-
206
- // 判断线段两端点是否在射线两侧
207
- if ((sy < py && ty >= py) || (sy >= py && ty < py)) {
208
- // 线段上与射线Y坐标相同的点的X坐标
209
- const x = sx + (py - sy) * (tx - sx) / (ty - sy)
210
- // 点在多边形的边上
211
- isOn = (x === px)
212
- // 射线穿过边界
213
- if (x > px) {
214
- flag = !flag
215
- }
216
- }
217
- if (isOn) {
218
- break
219
- }
220
- }
221
-
222
- return isOn || flag
223
- },
224
-
225
- /**
226
- * 点到面的距离,在内部视为0
227
- * @param {L.Point} point 给定点
228
- * @param {Array<L.Point>} points 多边形坐标
229
- * @param {L.CRS} crs 地图CRS
230
- * @returns {Boolean} 距离数值,若CRS可用,单位为米
231
- */
232
- distanceToPoly(point, points, crs) {
233
- let result = 0
234
- if (!this.isPointInPoly(point, points)) {
235
- let distances = []
236
- let ps = []
237
- const length = points.length
238
- for (let i = 0, j = length - 1; i < length; j = i, i++) {
239
- distances.push(L.LineUtil.pointToSegmentDistance(point, points[i], points[j]))
240
- ps.push(L.LineUtil.closestPointOnSegment(point, points[i], points[j]))
241
- }
242
- result = _.min(distances)
243
- const index = _.indexOf(distances, result)
244
- const closePoint = ps[index]
245
- if (crs && crs.unproject) {
246
- const latLng1 = crs.unproject(point)
247
- const latLng2 = crs.unproject(closePoint)
248
- result = crs.distance(latLng1, latLng2)
249
- }
250
- }
251
- return result
252
- },
253
-
254
- /**
255
- * 点到折线的距离
256
- * @param {L.Point} point 给定点
257
- * @param {Array<L.Point>} points 折线坐标
258
- * @param {L.CRS} crs 地图CRS
259
- * @param {Boolean} 距离数值,若CRS可用,单位为米
260
- */
261
- distanceToLine(point, points, crs) {
262
- let result = 0
263
- let distances = []
264
- let ps = []
265
- if (Array.isArray(points) && points.length > 1) {
266
- for (let i = 0; i < points.length - 1; i++) {
267
- distances.push(L.LineUtil.pointToSegmentDistance(point, points[i], points[i + 1]))
268
- ps.push(L.LineUtil.closestPointOnSegment(point, points[i], points[i + 1]))
269
- }
270
- result = _.min(distances)
271
- const index = _.indexOf(distances, result)
272
- const closePoint = ps[index]
273
- if (crs && crs.unproject) {
274
- const latLng1 = crs.unproject(point)
275
- const latLng2 = crs.unproject(closePoint)
276
- result = crs.distance(latLng1, latLng2)
277
- }
278
- }
279
- return result
280
- }
281
-
282
- }
283
-
284
- L.GeoUtil = L.extend(L.GeoUtil || {}, _.assign(fns, buffer))
@@ -1,91 +0,0 @@
1
- import './style.less'
2
-
3
- L.Glyphicon = L.DivIcon.extend({
4
-
5
- options: {
6
- icon: 'fas fa-leaf',
7
- size: 32,
8
- fontSize: null,
9
- background: 'white',
10
- color: '#4d90fe',
11
- borderRadius: null,
12
- borderWidth: 2,
13
- borderColor: null,
14
- boxShadow: true,
15
- additionalCSS: '',
16
- className: '',
17
- effect: {
18
- type: null,
19
- size: null,
20
- color: null,
21
- interval: null
22
- }
23
- },
24
-
25
- initialize(options = {}) {
26
- L.setOptions(this, options)
27
-
28
- // 图标元素-外层
29
- let args = this.options
30
- let container = document.createElement('div')
31
- L.DomUtil.addClass(container, 'vae-glyphicon')
32
- let style = []
33
- style.push(`height:${args.size - args.borderWidth * 2}px`)
34
- style.push(`width:${args.size - args.borderWidth * 2}px`)
35
- style.push(`color:${args.color}`)
36
- let fontSize = _.isNil(args.fontSize) ? args.size / 2 : args.fontSize
37
- style.push(`font-size:${fontSize}px`)
38
- let borderRadius = _.isNil(args.borderRadius) ? args.size : args.borderRadius
39
- style.push(`border-radius:${borderRadius}px`)
40
- style.push(`border-width:${args.borderWidth}px`)
41
- style.push(`border-color:${args.borderColor || args.color}`)
42
- style.push("border-style:solid")
43
- style.push(`background-color:${args.background}`)
44
- if (args.boxShadow) {
45
- style.push("box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.2)")
46
- }
47
- style.push(args.additionalCSS)
48
- let styleAttributes = document.createAttribute("style")
49
- styleAttributes.value = style.join(";")
50
-
51
- // 图标元素-内层
52
- let iconElement = document.createElement("div")
53
- L.DomUtil.addClass(iconElement, args.icon)
54
-
55
- container.setAttributeNode(styleAttributes)
56
- container.appendChild(iconElement)
57
-
58
- // 特效元素
59
- let effect = args.effect
60
- if (effect && effect.type) {
61
- let effectElement = document.createElement('div')
62
- let effectType = effect.type
63
- if (effectType === 'halo') {
64
- let effectStyleAttributes = document.createAttribute("style")
65
- let effectStyles = []
66
- L.DomUtil.addClass(effectElement, 'halo')
67
- let effectSize = effect.size || args.size * 3
68
- effectStyles.push(`height:${effectSize}px`)
69
- effectStyles.push(`width:${effectSize}px`)
70
- let effectColor = effect.color || args.color
71
- effectStyles.push(`background-color:${effectColor}`)
72
- effectStyles.push(`top:-${(effectSize - args.size) / 2}px`)
73
- effectStyles.push(`left:-${(effectSize - args.size) / 2}px`)
74
- effectStyles.push(`animation:vae-effect-${effectType} ${effect.interval || 2}s 0s infinite ease-in`)
75
- effectStyleAttributes.value = effectStyles.join(";")
76
- effectElement.setAttributeNode(effectStyleAttributes)
77
- }
78
- container.appendChild(effectElement)
79
- }
80
-
81
- L.DivIcon.prototype.initialize.call(this, {
82
- html: container.outerHTML,
83
- iconSize: [args.size, args.size],
84
- className: args.className
85
- })
86
- }
87
- })
88
-
89
- L.glyphicon = function (options) {
90
- return new L.Glyphicon(options)
91
- }
@@ -1,37 +0,0 @@
1
- .vae-glyphicon {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
-
6
- .halo {
7
- border-radius: 50% 50%;
8
- position: absolute;
9
- pointer-events: none;
10
- z-index: -1;
11
- }
12
- }
13
-
14
- // 光晕扩散
15
- @keyframes vae-effect-halo {
16
- 0% {
17
- transform: scale(0.2);
18
- opacity: 0;
19
- }
20
-
21
- 65% {
22
- opacity: 0.75;
23
- }
24
-
25
- 75% {
26
- opacity: 0.75;
27
- }
28
-
29
- 85% {
30
- opacity: 0.2;
31
- }
32
-
33
- 100% {
34
- transform: scale(1);
35
- opacity: 0;
36
- }
37
- }
@@ -1,93 +0,0 @@
1
- import './style.less'
2
-
3
- // 自定义聚合图标
4
- function iconCreateFunction(cluster) {
5
-
6
- // 尺寸和颜色设六个级别
7
- let level = 1
8
- let iconSize = 30
9
- let borderSize = 6
10
-
11
- const count = cluster.getChildCount()
12
- // 0-9
13
- if (count > 0 && count <= 9) {
14
- level = 1
15
- iconSize = 30
16
- borderSize = 6
17
- }
18
- // 10-49
19
- else if (count > 9 && count <= 49) {
20
- level = 2
21
- iconSize = 38
22
- borderSize = 8
23
- }
24
- // 50-99
25
- else if (count > 49 && count <= 99) {
26
- level = 3
27
- iconSize = 46
28
- borderSize = 8
29
- }
30
- // 100-499
31
- else if (count > 99 && count <= 499) {
32
- level = 4
33
- iconSize = 54
34
- borderSize = 10
35
- }
36
- // 500-999
37
- else if (count > 499 && count < 999) {
38
- level = 5
39
- iconSize = 62
40
- borderSize = 10
41
- }
42
- // 999+
43
- else {
44
- level = 6
45
- iconSize = 70
46
- borderSize = 12
47
- }
48
-
49
- const className = `vae-markercluster--icon style--${this.iconStyle || 'blue'} level--${level}`
50
- const innerSize = iconSize - borderSize
51
-
52
- const outerStyle = `border-radius:${iconSize / 2}px;`
53
- const innerStyle = `height:${innerSize}px;width:${innerSize}px;border-radius:${innerSize / 2}px;`
54
-
55
- return L.divIcon({
56
- html: `<div class="outer center" style="${outerStyle}"><div class="inner center" style="${innerStyle}">${count}</div></div>`,
57
- className,
58
- iconSize: [iconSize, iconSize]
59
- })
60
- }
61
-
62
- L.MarkerClusterGroupX = L.MarkerClusterGroup.extend({
63
-
64
- options: {
65
- iconStyle: 'blue',
66
- showCoverageOnHover: false,
67
- maxClusterRadius: 60,
68
- spiderLegPolylineOptions: {
69
- weight: 2,
70
- dashArray: [5, 5],
71
- interactive: false,
72
- opacity: 0.8
73
- },
74
- iconCreateFunction
75
- },
76
-
77
- initialize(options = {}) {
78
- L.setOptions(this, options)
79
- const iconStyle = this.options.iconStyle || 'blue'
80
- this.options.spiderLegPolylineOptions.color =
81
- iconStyle == 'red' ? 'hsl(354, 70%, 54%)' : iconStyle == 'blue' ? 'hsl(211, 100%, 45%)' : iconStyle == 'green' ? 'hsl(134, 61%, 41%)'
82
- : iconStyle == 'gray' ? '#606266' : iconStyle == 'yellow' ? '#f9c31f' : iconStyle == 'orange' ? '#fd7e14'
83
- : iconStyle == 'cyan' ? '#17a2b8' : iconStyle == 'purple' ? '#5c11d4' : iconStyle == 'pink' ? '#e83e8c'
84
- : iconStyle == 'transparent' ? 'rgba(0,0,0,0.6)' : null
85
-
86
- L.MarkerClusterGroup.prototype.initialize.call(this, this.options)
87
- }
88
-
89
- })
90
-
91
- L.markerClusterGroupX = function (options) {
92
- return new L.MarkerClusterGroupX(options)
93
- }
@@ -1,162 +0,0 @@
1
- // 聚合图标
2
- .vae-markercluster--icon {
3
-
4
- .outer {
5
- height: 100%;
6
- width: 100%;
7
- font-size: 12px;
8
-
9
- .inner {
10
- color: white;
11
- font-weight: bold;
12
- }
13
- }
14
-
15
- .center {
16
- display: flex;
17
- align-items: center;
18
- justify-content: center;
19
- }
20
-
21
- // 红色
22
- each(range(6), {
23
- &.style--red.level--@{value} {
24
- .outer {
25
- background: darken(#ff7d52, @value * 2%);
26
-
27
- .inner {
28
- background: darken(hsl(354, 70%, 54%), @value * 3%);
29
- }
30
- }
31
- }
32
- }
33
- )
34
-
35
- // 橙色
36
- each(range(6), {
37
- &.style--orange.level--@{value} {
38
- .outer {
39
- background: darken(#f9c31f, @value * 1%);
40
-
41
- .inner {
42
- background: darken(#fd7e14, @value * 2%);
43
- }
44
- }
45
- }
46
- }
47
- )
48
-
49
- // 黄色
50
- each(range(6), {
51
- &.style--yellow.level--@{value} {
52
- .outer {
53
- background: darken(#fdfd77, @value * 2%);
54
-
55
- .inner {
56
- background: darken(#f9c31f, @value * 3%);
57
- }
58
- }
59
- }
60
- }
61
- )
62
-
63
- // 蓝色
64
- each(range(6), {
65
- &.style--blue.level--@{value} {
66
- .outer {
67
- background: darken(hsl(200, 100%, 67%), @value * 2%);
68
-
69
- .inner {
70
- background: darken(hsl(211, 100%, 45%), @value * 3%);
71
- }
72
- }
73
- }
74
- }
75
- )
76
-
77
- // 绿色
78
- each(range(6), {
79
- &.style--green.level--@{value} {
80
- .outer {
81
- background: darken(hsl(100, 54%, 58%), @value * 2%);
82
-
83
- .inner {
84
- background: darken(hsl(134, 61%, 41%), @value * 3%);
85
- }
86
- }
87
- }
88
- }
89
- )
90
-
91
- // 青绿
92
- each(range(6), {
93
- &.style--cyan.level--@{value} {
94
- .outer {
95
- background: darken(aqua, @value * 1%);
96
-
97
- .inner {
98
- background: darken(#17a2b8, @value * 2%);
99
- }
100
- }
101
- }
102
- }
103
- )
104
-
105
- // 紫色
106
- each(range(6), {
107
- &.style--purple.level--@{value} {
108
- .outer {
109
- background: darken(hsl(211, 90%, 70%), @value * 2%);
110
-
111
- .inner {
112
- background: darken(#5c11d4, @value * 3%);
113
- }
114
- }
115
- }
116
- }
117
- )
118
-
119
- // 粉色
120
- each(range(6), {
121
- &.style--pink.level--@{value} {
122
- .outer {
123
- background: darken(#f7bac9, @value * 2%);
124
-
125
- .inner {
126
- background: darken(#e83e8c, @value * 3%);
127
- }
128
- }
129
- }
130
- }
131
- )
132
-
133
-
134
- // 灰色
135
- each(range(6), {
136
- &.style--gray.level--@{value} {
137
- .outer {
138
- background: darken(#c0c4cc, @value * 2%);
139
-
140
- .inner {
141
- background: darken(#606266, @value * 3%);
142
- }
143
- }
144
- }
145
- }
146
- )
147
-
148
- // 透明
149
- each(range(6), {
150
- &.style--transparent.level--@{value} {
151
- .outer {
152
- background: darken(rgba(0,0,0,0.2), @value * 2%);
153
-
154
- .inner {
155
- background: darken(rgba(0,0,0,0.6), @value * 3%);
156
- }
157
- }
158
- }
159
- }
160
- )
161
-
162
- }