@vtx/ol-map 1.0.164 → 2.0.0-beta.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 (525) hide show
  1. package/package.json +9 -8
  2. package/lib/_util/EventEmitter.js +0 -78
  3. package/lib/_util/EventEmitter.js.map +0 -1
  4. package/lib/_util/StyleCache.js +0 -46
  5. package/lib/_util/StyleCache.js.map +0 -1
  6. package/lib/_util/encryptParams.js +0 -60
  7. package/lib/_util/encryptParams.js.map +0 -1
  8. package/lib/_util/filterSpecialCharacters.js +0 -90
  9. package/lib/_util/filterSpecialCharacters.js.map +0 -1
  10. package/lib/_util/getComponentProps.js +0 -14
  11. package/lib/_util/getComponentProps.js.map +0 -1
  12. package/lib/_util/getCookie.js +0 -24
  13. package/lib/_util/getCookie.js.map +0 -1
  14. package/lib/_util/getDefaultMapInfo.js +0 -50
  15. package/lib/_util/getDefaultMapInfo.js.map +0 -1
  16. package/lib/_util/getSystemInfo.js +0 -26
  17. package/lib/_util/getSystemInfo.js.map +0 -1
  18. package/lib/_util/getToken.js +0 -27
  19. package/lib/_util/getToken.js.map +0 -1
  20. package/lib/_util/getUrlParam.js +0 -15
  21. package/lib/_util/getUrlParam.js.map +0 -1
  22. package/lib/_util/http.js +0 -176
  23. package/lib/_util/http.js.map +0 -1
  24. package/lib/_util/isFunction.js +0 -10
  25. package/lib/_util/isFunction.js.map +0 -1
  26. package/lib/_util/isObject.js +0 -10
  27. package/lib/_util/isObject.js.map +0 -1
  28. package/lib/_util/layer.js +0 -152
  29. package/lib/_util/layer.js.map +0 -1
  30. package/lib/_util/mapTool.js +0 -188
  31. package/lib/_util/mapTool.js.map +0 -1
  32. package/lib/_util/projzh/datum/bd-09.js +0 -44
  33. package/lib/_util/projzh/datum/bd-09.js.map +0 -1
  34. package/lib/_util/projzh/datum/gcj-02.js +0 -72
  35. package/lib/_util/projzh/datum/gcj-02.js.map +0 -1
  36. package/lib/_util/projzh/datum/index.js +0 -14
  37. package/lib/_util/projzh/datum/index.js.map +0 -1
  38. package/lib/_util/projzh/index.js +0 -40
  39. package/lib/_util/projzh/index.js.map +0 -1
  40. package/lib/_util/projzh/projection/baidu-mercator.js +0 -74
  41. package/lib/_util/projzh/projection/baidu-mercator.js.map +0 -1
  42. package/lib/_util/projzh/projection/index.js +0 -14
  43. package/lib/_util/projzh/projection/index.js.map +0 -1
  44. package/lib/_util/projzh/projection/spherical-mercator.js +0 -25
  45. package/lib/_util/projzh/projection/spherical-mercator.js.map +0 -1
  46. package/lib/_util/projzh/util.js +0 -27
  47. package/lib/_util/projzh/util.js.map +0 -1
  48. package/lib/_util/search.js +0 -130
  49. package/lib/_util/search.js.map +0 -1
  50. package/lib/_util/setCookie.js +0 -15
  51. package/lib/_util/setCookie.js.map +0 -1
  52. package/lib/_util/stringToFun.js +0 -25
  53. package/lib/_util/stringToFun.js.map +0 -1
  54. package/lib/_util/transform.js +0 -169
  55. package/lib/_util/transform.js.map +0 -1
  56. package/lib/_util/useColSize.js +0 -28
  57. package/lib/_util/useColSize.js.map +0 -1
  58. package/lib/_util/useInterval.js +0 -19
  59. package/lib/_util/useInterval.js.map +0 -1
  60. package/lib/_util/useSet.js +0 -44
  61. package/lib/_util/useSet.js.map +0 -1
  62. package/lib/analysis-layer/index.js +0 -461
  63. package/lib/analysis-layer/index.js.map +0 -1
  64. package/lib/analysis-layer/style/css.js +0 -2
  65. package/lib/analysis-layer/style/css.js.map +0 -1
  66. package/lib/analysis-layer/style/index.js +0 -2
  67. package/lib/analysis-layer/style/index.js.map +0 -1
  68. package/lib/assets/arrow.png +0 -0
  69. package/lib/assets/base-img-1.png +0 -0
  70. package/lib/assets/base-img-2.png +0 -0
  71. package/lib/assets/base-img-3.png +0 -0
  72. package/lib/assets/base-img-4.png +0 -0
  73. package/lib/assets/base-img-5.png +0 -0
  74. package/lib/assets/base-img-6.png +0 -0
  75. package/lib/assets/base-img.png +0 -0
  76. package/lib/assets/bz.png +0 -0
  77. package/lib/assets/img.png +0 -0
  78. package/lib/assets/kz.png +0 -0
  79. package/lib/assets/ll.png +0 -0
  80. package/lib/assets/location.png +0 -0
  81. package/lib/assets/noLocation.png +0 -0
  82. package/lib/assets/people.png +0 -0
  83. package/lib/assets/qd.png +0 -0
  84. package/lib/assets/sw.png +0 -0
  85. package/lib/assets/yl.png +0 -0
  86. package/lib/assets/zd.png +0 -0
  87. package/lib/buffer-draw/BufferDraw.js +0 -399
  88. package/lib/buffer-draw/BufferDraw.js.map +0 -1
  89. package/lib/buffer-draw/index.js +0 -58
  90. package/lib/buffer-draw/index.js.map +0 -1
  91. package/lib/buffer-draw/style/css.js +0 -2
  92. package/lib/buffer-draw/style/css.js.map +0 -1
  93. package/lib/buffer-draw/style/index.js +0 -2
  94. package/lib/buffer-draw/style/index.js.map +0 -1
  95. package/lib/circle/Circle.js +0 -51
  96. package/lib/circle/Circle.js.map +0 -1
  97. package/lib/circle/index.js +0 -64
  98. package/lib/circle/index.js.map +0 -1
  99. package/lib/circle/style/css.js +0 -2
  100. package/lib/circle/style/css.js.map +0 -1
  101. package/lib/circle/style/index.js +0 -2
  102. package/lib/circle/style/index.js.map +0 -1
  103. package/lib/config.js +0 -12
  104. package/lib/config.js.map +0 -1
  105. package/lib/convertCamelToCSS.js +0 -23
  106. package/lib/convertCamelToCSS.js.map +0 -1
  107. package/lib/dom/Dom.js +0 -39
  108. package/lib/dom/Dom.js.map +0 -1
  109. package/lib/dom/index.js +0 -82
  110. package/lib/dom/index.js.map +0 -1
  111. package/lib/dom/style/css.js +0 -2
  112. package/lib/dom/style/css.js.map +0 -1
  113. package/lib/dom/style/index.js +0 -2
  114. package/lib/dom/style/index.js.map +0 -1
  115. package/lib/dom-layer/index.js +0 -249
  116. package/lib/dom-layer/index.js.map +0 -1
  117. package/lib/dom-layer/style/css.js +0 -4
  118. package/lib/dom-layer/style/css.js.map +0 -1
  119. package/lib/dom-layer/style/index.css +0 -3
  120. package/lib/dom-layer/style/index.js +0 -4
  121. package/lib/dom-layer/style/index.js.map +0 -1
  122. package/lib/dom-layer/style/index.less +0 -3
  123. package/lib/events/index.js +0 -25
  124. package/lib/events/index.js.map +0 -1
  125. package/lib/feature-draw/FeatureDraw.js +0 -231
  126. package/lib/feature-draw/FeatureDraw.js.map +0 -1
  127. package/lib/feature-draw/index.js +0 -75
  128. package/lib/feature-draw/index.js.map +0 -1
  129. package/lib/feature-draw/style/css.js +0 -2
  130. package/lib/feature-draw/style/css.js.map +0 -1
  131. package/lib/feature-draw/style/index.js +0 -2
  132. package/lib/feature-draw/style/index.js.map +0 -1
  133. package/lib/feature-layer/FeatureLayer.js +0 -1057
  134. package/lib/feature-layer/FeatureLayer.js.map +0 -1
  135. package/lib/feature-layer/MyCluster.js +0 -150
  136. package/lib/feature-layer/MyCluster.js.map +0 -1
  137. package/lib/feature-layer/createFeatureCollection.js +0 -167
  138. package/lib/feature-layer/createFeatureCollection.js.map +0 -1
  139. package/lib/feature-layer/index.js +0 -154
  140. package/lib/feature-layer/index.js.map +0 -1
  141. package/lib/feature-layer/style/css.js +0 -4
  142. package/lib/feature-layer/style/css.js.map +0 -1
  143. package/lib/feature-layer/style/index.css +0 -0
  144. package/lib/feature-layer/style/index.js +0 -4
  145. package/lib/feature-layer/style/index.js.map +0 -1
  146. package/lib/feature-layer/style/index.less +0 -0
  147. package/lib/flow-line-layer/FlowLineLayer.js +0 -197
  148. package/lib/flow-line-layer/FlowLineLayer.js.map +0 -1
  149. package/lib/flow-line-layer/index.js +0 -126
  150. package/lib/flow-line-layer/index.js.map +0 -1
  151. package/lib/flow-line-layer/style/css.js +0 -4
  152. package/lib/flow-line-layer/style/css.js.map +0 -1
  153. package/lib/flow-line-layer/style/index.css +0 -0
  154. package/lib/flow-line-layer/style/index.js +0 -4
  155. package/lib/flow-line-layer/style/index.js.map +0 -1
  156. package/lib/flow-line-layer/style/index.less +0 -0
  157. package/lib/fly-line-layer/FlyLineLayer.js +0 -218
  158. package/lib/fly-line-layer/FlyLineLayer.js.map +0 -1
  159. package/lib/fly-line-layer/index.js +0 -109
  160. package/lib/fly-line-layer/index.js.map +0 -1
  161. package/lib/fly-line-layer/style/css.js +0 -4
  162. package/lib/fly-line-layer/style/css.js.map +0 -1
  163. package/lib/fly-line-layer/style/index.css +0 -0
  164. package/lib/fly-line-layer/style/index.js +0 -4
  165. package/lib/fly-line-layer/style/index.js.map +0 -1
  166. package/lib/fly-line-layer/style/index.less +0 -0
  167. package/lib/group-layer/GroupLayer.js +0 -132
  168. package/lib/group-layer/GroupLayer.js.map +0 -1
  169. package/lib/group-layer/index.js +0 -73
  170. package/lib/group-layer/index.js.map +0 -1
  171. package/lib/group-layer/style/css.js +0 -4
  172. package/lib/group-layer/style/css.js.map +0 -1
  173. package/lib/group-layer/style/index.css +0 -0
  174. package/lib/group-layer/style/index.js +0 -4
  175. package/lib/group-layer/style/index.js.map +0 -1
  176. package/lib/group-layer/style/index.less +0 -0
  177. package/lib/heatmap-layer/HeatmapLayer.js +0 -191
  178. package/lib/heatmap-layer/HeatmapLayer.js.map +0 -1
  179. package/lib/heatmap-layer/index.js +0 -102
  180. package/lib/heatmap-layer/index.js.map +0 -1
  181. package/lib/heatmap-layer/style/css.js +0 -4
  182. package/lib/heatmap-layer/style/css.js.map +0 -1
  183. package/lib/heatmap-layer/style/index.css +0 -0
  184. package/lib/heatmap-layer/style/index.js +0 -4
  185. package/lib/heatmap-layer/style/index.js.map +0 -1
  186. package/lib/heatmap-layer/style/index.less +0 -0
  187. package/lib/high-layer/HighLayer.js +0 -200
  188. package/lib/high-layer/HighLayer.js.map +0 -1
  189. package/lib/high-layer/index.js +0 -46
  190. package/lib/high-layer/index.js.map +0 -1
  191. package/lib/high-layer/style/css.js +0 -2
  192. package/lib/high-layer/style/css.js.map +0 -1
  193. package/lib/high-layer/style/index.js +0 -2
  194. package/lib/high-layer/style/index.js.map +0 -1
  195. package/lib/image-layer/ImageLayer.js +0 -330
  196. package/lib/image-layer/ImageLayer.js.map +0 -1
  197. package/lib/image-layer/ImageTileLayer.js +0 -332
  198. package/lib/image-layer/ImageTileLayer.js.map +0 -1
  199. package/lib/image-layer/index.js +0 -100
  200. package/lib/image-layer/index.js.map +0 -1
  201. package/lib/image-layer/style/css.js +0 -4
  202. package/lib/image-layer/style/css.js.map +0 -1
  203. package/lib/image-layer/style/index.css +0 -0
  204. package/lib/image-layer/style/index.js +0 -4
  205. package/lib/image-layer/style/index.js.map +0 -1
  206. package/lib/image-layer/style/index.less +0 -0
  207. package/lib/index.js +0 -208
  208. package/lib/index.js.map +0 -1
  209. package/lib/legend/index.js +0 -253
  210. package/lib/legend/index.js.map +0 -1
  211. package/lib/legend/style/css.js +0 -8
  212. package/lib/legend/style/css.js.map +0 -1
  213. package/lib/legend/style/index.css +0 -109
  214. package/lib/legend/style/index.js +0 -8
  215. package/lib/legend/style/index.js.map +0 -1
  216. package/lib/legend/style/index.less +0 -100
  217. package/lib/map/Analysis.js +0 -148
  218. package/lib/map/Analysis.js.map +0 -1
  219. package/lib/map/Layers.js +0 -337
  220. package/lib/map/Layers.js.map +0 -1
  221. package/lib/map/Popup.js +0 -386
  222. package/lib/map/Popup.js.map +0 -1
  223. package/lib/map/ScaleDenominator.js +0 -68
  224. package/lib/map/ScaleDenominator.js.map +0 -1
  225. package/lib/map/Test.js +0 -144
  226. package/lib/map/Test.js.map +0 -1
  227. package/lib/map/defaultTextEnum.js +0 -165
  228. package/lib/map/defaultTextEnum.js.map +0 -1
  229. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +0 -163
  230. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +0 -1
  231. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +0 -84
  232. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +0 -1
  233. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +0 -65
  234. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +0 -1
  235. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +0 -84
  236. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +0 -1
  237. package/lib/map/getBaseLayers/index.js +0 -46
  238. package/lib/map/getBaseLayers/index.js.map +0 -1
  239. package/lib/map/index.js +0 -837
  240. package/lib/map/index.js.map +0 -1
  241. package/lib/map/style/css.js +0 -5
  242. package/lib/map/style/css.js.map +0 -1
  243. package/lib/map/style/index.css +0 -171
  244. package/lib/map/style/index.js +0 -5
  245. package/lib/map/style/index.js.map +0 -1
  246. package/lib/map/style/index.less +0 -152
  247. package/lib/map-icon/svg/index.js +0 -81
  248. package/lib/map-icon/svg/index.js.map +0 -1
  249. package/lib/map-icon/svg/tuceng.svg.js +0 -2
  250. package/lib/map-icon/svg/tuceng.svg.js.map +0 -1
  251. package/lib/marker/Marker.js +0 -105
  252. package/lib/marker/Marker.js.map +0 -1
  253. package/lib/marker/index.js +0 -61
  254. package/lib/marker/index.js.map +0 -1
  255. package/lib/marker/style/css.js +0 -2
  256. package/lib/marker/style/css.js.map +0 -1
  257. package/lib/marker/style/index.js +0 -2
  258. package/lib/marker/style/index.js.map +0 -1
  259. package/lib/path-line-layer/PathLineLayer.js +0 -45
  260. package/lib/path-line-layer/PathLineLayer.js.map +0 -1
  261. package/lib/path-line-layer/getPathLineStyles.js +0 -71
  262. package/lib/path-line-layer/getPathLineStyles.js.map +0 -1
  263. package/lib/path-line-layer/index.js +0 -151
  264. package/lib/path-line-layer/index.js.map +0 -1
  265. package/lib/path-line-layer/style/css.js +0 -4
  266. package/lib/path-line-layer/style/css.js.map +0 -1
  267. package/lib/path-line-layer/style/index.css +0 -0
  268. package/lib/path-line-layer/style/index.js +0 -4
  269. package/lib/path-line-layer/style/index.js.map +0 -1
  270. package/lib/path-line-layer/style/index.less +0 -0
  271. package/lib/path-play-back/PathPlayBack.js +0 -700
  272. package/lib/path-play-back/PathPlayBack.js.map +0 -1
  273. package/lib/path-play-back/index.js +0 -83
  274. package/lib/path-play-back/index.js.map +0 -1
  275. package/lib/path-play-back/style/css.js +0 -2
  276. package/lib/path-play-back/style/css.js.map +0 -1
  277. package/lib/path-play-back/style/index.js +0 -2
  278. package/lib/path-play-back/style/index.js.map +0 -1
  279. package/lib/poi-search/Location.js +0 -62
  280. package/lib/poi-search/Location.js.map +0 -1
  281. package/lib/poi-search/PoiList.js +0 -118
  282. package/lib/poi-search/PoiList.js.map +0 -1
  283. package/lib/poi-search/Search.js +0 -207
  284. package/lib/poi-search/Search.js.map +0 -1
  285. package/lib/poi-search/index.js +0 -172
  286. package/lib/poi-search/index.js.map +0 -1
  287. package/lib/poi-search/style/css.js +0 -8
  288. package/lib/poi-search/style/css.js.map +0 -1
  289. package/lib/poi-search/style/index.css +0 -96
  290. package/lib/poi-search/style/index.js +0 -8
  291. package/lib/poi-search/style/index.js.map +0 -1
  292. package/lib/poi-search/style/index.less +0 -97
  293. package/lib/point/Point.js +0 -57
  294. package/lib/point/Point.js.map +0 -1
  295. package/lib/point/index.js +0 -61
  296. package/lib/point/index.js.map +0 -1
  297. package/lib/point/style/css.js +0 -2
  298. package/lib/point/style/css.js.map +0 -1
  299. package/lib/point/style/index.js +0 -2
  300. package/lib/point/style/index.js.map +0 -1
  301. package/lib/polygon/Polygon.js +0 -51
  302. package/lib/polygon/Polygon.js.map +0 -1
  303. package/lib/polygon/index.js +0 -61
  304. package/lib/polygon/index.js.map +0 -1
  305. package/lib/polygon/style/css.js +0 -2
  306. package/lib/polygon/style/css.js.map +0 -1
  307. package/lib/polygon/style/index.js +0 -2
  308. package/lib/polygon/style/index.js.map +0 -1
  309. package/lib/polyline/Polyline.js +0 -51
  310. package/lib/polyline/Polyline.js.map +0 -1
  311. package/lib/polyline/index.js +0 -61
  312. package/lib/polyline/index.js.map +0 -1
  313. package/lib/polyline/style/css.js +0 -2
  314. package/lib/polyline/style/css.js.map +0 -1
  315. package/lib/polyline/style/index.js +0 -2
  316. package/lib/polyline/style/index.js.map +0 -1
  317. package/lib/popup/index.js +0 -202
  318. package/lib/popup/index.js.map +0 -1
  319. package/lib/popup/style/css.js +0 -4
  320. package/lib/popup/style/css.js.map +0 -1
  321. package/lib/popup/style/index.css +0 -131
  322. package/lib/popup/style/index.js +0 -4
  323. package/lib/popup/style/index.js.map +0 -1
  324. package/lib/popup/style/index.less +0 -129
  325. package/lib/provider/index.js +0 -12
  326. package/lib/provider/index.js.map +0 -1
  327. package/lib/provider/style/css.js +0 -2
  328. package/lib/provider/style/css.js.map +0 -1
  329. package/lib/provider/style/index.js +0 -2
  330. package/lib/provider/style/index.js.map +0 -1
  331. package/lib/renderer/Fill.js +0 -37
  332. package/lib/renderer/Fill.js.map +0 -1
  333. package/lib/renderer/Stroke.js +0 -39
  334. package/lib/renderer/Stroke.js.map +0 -1
  335. package/lib/renderer/index.js +0 -137
  336. package/lib/renderer/index.js.map +0 -1
  337. package/lib/renderer/style/css.js +0 -4
  338. package/lib/renderer/style/css.js.map +0 -1
  339. package/lib/renderer/style/index.css +0 -0
  340. package/lib/renderer/style/index.js +0 -4
  341. package/lib/renderer/style/index.js.map +0 -1
  342. package/lib/renderer/style/index.less +0 -0
  343. package/lib/renderer/transformRgb.js +0 -33
  344. package/lib/renderer/transformRgb.js.map +0 -1
  345. package/lib/search-map/VtxModal.js +0 -202
  346. package/lib/search-map/VtxModal.js.map +0 -1
  347. package/lib/search-map/index.js +0 -515
  348. package/lib/search-map/index.js.map +0 -1
  349. package/lib/search-map/style/css.js +0 -6
  350. package/lib/search-map/style/css.js.map +0 -1
  351. package/lib/search-map/style/index.css +0 -73
  352. package/lib/search-map/style/index.js +0 -6
  353. package/lib/search-map/style/index.js.map +0 -1
  354. package/lib/search-map/style/index.less +0 -83
  355. package/lib/search-map/style/modal.css +0 -54
  356. package/lib/search-map/style/modal.less +0 -58
  357. package/lib/style/index.css +0 -0
  358. package/lib/style/index.less +0 -2
  359. package/lib/style/themes/compact.css +0 -0
  360. package/lib/style/themes/compact.less +0 -1
  361. package/lib/style/themes/dark.css +0 -0
  362. package/lib/style/themes/dark.less +0 -9
  363. package/lib/style/themes/default.css +0 -0
  364. package/lib/style/themes/default.less +0 -7
  365. package/lib/style/themes/index.css +0 -0
  366. package/lib/style/themes/index.less +0 -1
  367. package/lib/style/themes/variable.css +0 -0
  368. package/lib/style/themes/variable.less +0 -5
  369. package/lib/tile-layer/TileLayer.js +0 -85
  370. package/lib/tile-layer/TileLayer.js.map +0 -1
  371. package/lib/tile-layer/index.js +0 -54
  372. package/lib/tile-layer/index.js.map +0 -1
  373. package/lib/tile-layer/style/css.js +0 -4
  374. package/lib/tile-layer/style/css.js.map +0 -1
  375. package/lib/tile-layer/style/index.css +0 -0
  376. package/lib/tile-layer/style/index.js +0 -4
  377. package/lib/tile-layer/style/index.js.map +0 -1
  378. package/lib/tile-layer/style/index.less +0 -0
  379. package/lib/tools/Layer/LayerService.js +0 -182
  380. package/lib/tools/Layer/LayerService.js.map +0 -1
  381. package/lib/tools/Layer/LayersCheckService.js +0 -188
  382. package/lib/tools/Layer/LayersCheckService.js.map +0 -1
  383. package/lib/tools/Layer/index.css +0 -50
  384. package/lib/tools/Layer/index.js +0 -225
  385. package/lib/tools/Layer/index.js.map +0 -1
  386. package/lib/tools/Layer/index.less +0 -43
  387. package/lib/tools/Search/index.js +0 -296
  388. package/lib/tools/Search/index.js.map +0 -1
  389. package/lib/tools/Toolbox/BoxSelect/index.js +0 -22
  390. package/lib/tools/Toolbox/BoxSelect/index.js.map +0 -1
  391. package/lib/tools/Toolbox/CircleSelect/index.js +0 -22
  392. package/lib/tools/Toolbox/CircleSelect/index.js.map +0 -1
  393. package/lib/tools/Toolbox/EagleEye/index.js +0 -56
  394. package/lib/tools/Toolbox/EagleEye/index.js.map +0 -1
  395. package/lib/tools/Toolbox/MapBookmark/Bookmark.js +0 -147
  396. package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +0 -1
  397. package/lib/tools/Toolbox/MapBookmark/index.css +0 -18
  398. package/lib/tools/Toolbox/MapBookmark/index.js +0 -429
  399. package/lib/tools/Toolbox/MapBookmark/index.js.map +0 -1
  400. package/lib/tools/Toolbox/MapBookmark/index.less +0 -20
  401. package/lib/tools/Toolbox/MapDownload/index.js +0 -16
  402. package/lib/tools/Toolbox/MapDownload/index.js.map +0 -1
  403. package/lib/tools/Toolbox/MapPrint/index.css +0 -4
  404. package/lib/tools/Toolbox/MapPrint/index.js +0 -233
  405. package/lib/tools/Toolbox/MapPrint/index.js.map +0 -1
  406. package/lib/tools/Toolbox/MapPrint/index.less +0 -4
  407. package/lib/tools/Toolbox/Measure/Area/index.js +0 -16
  408. package/lib/tools/Toolbox/Measure/Area/index.js.map +0 -1
  409. package/lib/tools/Toolbox/Measure/Distance/index.js +0 -16
  410. package/lib/tools/Toolbox/Measure/Distance/index.js.map +0 -1
  411. package/lib/tools/Toolbox/Measure/Measure.js +0 -228
  412. package/lib/tools/Toolbox/Measure/Measure.js.map +0 -1
  413. package/lib/tools/Toolbox/Measure/index.js +0 -77
  414. package/lib/tools/Toolbox/Measure/index.js.map +0 -1
  415. package/lib/tools/Toolbox/PolygonSelect/index.js +0 -19
  416. package/lib/tools/Toolbox/PolygonSelect/index.js.map +0 -1
  417. package/lib/tools/Toolbox/ScaleLine/index.js +0 -58
  418. package/lib/tools/Toolbox/ScaleLine/index.js.map +0 -1
  419. package/lib/tools/Toolbox/SelectTools/index.css +0 -103
  420. package/lib/tools/Toolbox/SelectTools/index.js +0 -788
  421. package/lib/tools/Toolbox/SelectTools/index.js.map +0 -1
  422. package/lib/tools/Toolbox/SelectTools/index.less +0 -87
  423. package/lib/tools/Toolbox/SpaceQuery/index.css +0 -19
  424. package/lib/tools/Toolbox/SpaceQuery/index.js +0 -597
  425. package/lib/tools/Toolbox/SpaceQuery/index.js.map +0 -1
  426. package/lib/tools/Toolbox/SpaceQuery/index.less +0 -16
  427. package/lib/tools/Toolbox/ZoomInput/index.css +0 -6
  428. package/lib/tools/Toolbox/ZoomInput/index.js +0 -51
  429. package/lib/tools/Toolbox/ZoomInput/index.js.map +0 -1
  430. package/lib/tools/Toolbox/ZoomInput/index.less +0 -6
  431. package/lib/tools/Toolbox/draftingPrint/index.css +0 -26
  432. package/lib/tools/Toolbox/draftingPrint/index.js +0 -366
  433. package/lib/tools/Toolbox/draftingPrint/index.js.map +0 -1
  434. package/lib/tools/Toolbox/draftingPrint/index.less +0 -34
  435. package/lib/tools/Toolbox/index.css +0 -0
  436. package/lib/tools/Toolbox/index.js +0 -179
  437. package/lib/tools/Toolbox/index.js.map +0 -1
  438. package/lib/tools/Toolbox/index.less +0 -2
  439. package/lib/tools/Utils/CreateOverlay.js +0 -46
  440. package/lib/tools/Utils/CreateOverlay.js.map +0 -1
  441. package/lib/tools/Utils/Draw.js +0 -127
  442. package/lib/tools/Utils/Draw.js.map +0 -1
  443. package/lib/tools/Utils/HighLayer.js +0 -212
  444. package/lib/tools/Utils/HighLayer.js.map +0 -1
  445. package/lib/tools/Utils/measure.js +0 -246
  446. package/lib/tools/Utils/measure.js.map +0 -1
  447. package/lib/tools/Utils/utils.js +0 -263
  448. package/lib/tools/Utils/utils.js.map +0 -1
  449. package/lib/tools/View/index.css +0 -35
  450. package/lib/tools/View/index.js +0 -165
  451. package/lib/tools/View/index.js.map +0 -1
  452. package/lib/tools/View/index.less +0 -28
  453. package/lib/tools/analysis-tool/index.js +0 -111
  454. package/lib/tools/analysis-tool/index.js.map +0 -1
  455. package/lib/tools/base-map-switch/index.js +0 -168
  456. package/lib/tools/base-map-switch/index.js.map +0 -1
  457. package/lib/tools/components/Chart/index.js +0 -821
  458. package/lib/tools/components/Chart/index.js.map +0 -1
  459. package/lib/tools/components/Icon/index.js +0 -31
  460. package/lib/tools/components/Icon/index.js.map +0 -1
  461. package/lib/tools/components/Info/index.css +0 -39
  462. package/lib/tools/components/Info/index.js +0 -34
  463. package/lib/tools/components/Info/index.js.map +0 -1
  464. package/lib/tools/components/Info/index.less +0 -26
  465. package/lib/tools/components/ItemWrap/index.css +0 -43
  466. package/lib/tools/components/ItemWrap/index.js +0 -46
  467. package/lib/tools/components/ItemWrap/index.js.map +0 -1
  468. package/lib/tools/components/ItemWrap/index.less +0 -41
  469. package/lib/tools/components/Modal/index.css +0 -42
  470. package/lib/tools/components/Modal/index.js +0 -45
  471. package/lib/tools/components/Modal/index.js.map +0 -1
  472. package/lib/tools/components/Modal/index.less +0 -33
  473. package/lib/tools/components/MyTabs/index.js +0 -22
  474. package/lib/tools/components/MyTabs/index.js.map +0 -1
  475. package/lib/tools/components/RequiredLabel/index.css +0 -5
  476. package/lib/tools/components/RequiredLabel/index.js +0 -32
  477. package/lib/tools/components/RequiredLabel/index.js.map +0 -1
  478. package/lib/tools/components/RequiredLabel/index.less +0 -5
  479. package/lib/tools/components/Select/index.js +0 -32
  480. package/lib/tools/components/Select/index.js.map +0 -1
  481. package/lib/tools/components/Table/assets/tableIcon.png +0 -0
  482. package/lib/tools/components/Table/index.css +0 -10
  483. package/lib/tools/components/Table/index.js +0 -92
  484. package/lib/tools/components/Table/index.js.map +0 -1
  485. package/lib/tools/components/Table/index.less +0 -13
  486. package/lib/tools/components/ToolItem/index.css +0 -30
  487. package/lib/tools/components/ToolItem/index.js +0 -28
  488. package/lib/tools/components/ToolItem/index.js.map +0 -1
  489. package/lib/tools/components/ToolItem/index.less +0 -27
  490. package/lib/tools/components/ToolsSelect/index.css +0 -15
  491. package/lib/tools/components/ToolsSelect/index.js +0 -44
  492. package/lib/tools/components/ToolsSelect/index.js.map +0 -1
  493. package/lib/tools/components/ToolsSelect/index.less +0 -10
  494. package/lib/tools/full-screen/index.js +0 -45
  495. package/lib/tools/full-screen/index.js.map +0 -1
  496. package/lib/tools/index.js +0 -150
  497. package/lib/tools/index.js.map +0 -1
  498. package/lib/tools/layer-control/index.js +0 -170
  499. package/lib/tools/layer-control/index.js.map +0 -1
  500. package/lib/tools/refresh/index.js +0 -39
  501. package/lib/tools/refresh/index.js.map +0 -1
  502. package/lib/tools/style/css.js +0 -22
  503. package/lib/tools/style/css.js.map +0 -1
  504. package/lib/tools/style/index.css +0 -136
  505. package/lib/tools/style/index.js +0 -22
  506. package/lib/tools/style/index.js.map +0 -1
  507. package/lib/tools/style/index.less +0 -154
  508. package/lib/tools-item/index.js +0 -65
  509. package/lib/tools-item/index.js.map +0 -1
  510. package/lib/use-props/index.js +0 -14
  511. package/lib/use-props/index.js.map +0 -1
  512. package/lib/use-props/style/css.js +0 -2
  513. package/lib/use-props/style/css.js.map +0 -1
  514. package/lib/use-props/style/index.js +0 -2
  515. package/lib/use-props/style/index.js.map +0 -1
  516. package/lib/wms-layer/WmsLayer.js +0 -313
  517. package/lib/wms-layer/WmsLayer.js.map +0 -1
  518. package/lib/wms-layer/index.js +0 -97
  519. package/lib/wms-layer/index.js.map +0 -1
  520. package/lib/wms-layer/style/css.js +0 -4
  521. package/lib/wms-layer/style/css.js.map +0 -1
  522. package/lib/wms-layer/style/index.css +0 -0
  523. package/lib/wms-layer/style/index.js +0 -4
  524. package/lib/wms-layer/style/index.js.map +0 -1
  525. package/lib/wms-layer/style/index.less +0 -0
@@ -1,1057 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _layer = require("ol/layer");
8
- var _ol = require("ol");
9
- var _source = require("ol/source");
10
- var _renderer = _interopRequireDefault(require("../renderer"));
11
- var _style5 = require("ol/style");
12
- var _isFunction = _interopRequireDefault(require("../_util/isFunction"));
13
- var _createFeatureCollection = require("./createFeatureCollection");
14
- var _isObject = _interopRequireDefault(require("../_util/isObject"));
15
- var _encryptParams = _interopRequireDefault(require("../_util/encryptParams"));
16
- var _stringToFun = _interopRequireDefault(require("../_util/stringToFun"));
17
- var _convertCamelToCSS = _interopRequireDefault(require("../convertCamelToCSS"));
18
- var _MyCluster = _interopRequireDefault(require("./MyCluster"));
19
- var _Marker = require("../marker/Marker");
20
- var _excluded = ["url", "params", "data", "dataField", "features", "sourceOptions", "key", "name", "label", "labelField", "point", "cluster", "template", "autoRefresh", "method", "layerControl", "show", "style", "group", "iconOptions", "afterGetData", "legend", "viewOnly", "encrypt", "valueField", "map", "tipTemplate", "alarmBg", "cancelPopup"],
21
- _excluded2 = ["color", "background", "backgroundStroke", "backgroundStrokeWidth"],
22
- _excluded3 = ["type", "iconSrc", "color", "scale", "numberStyle", "numberScale"],
23
- _excluded4 = ["numberStyle", "iconOptions"];
24
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
25
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
26
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
28
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
29
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
30
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
31
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
32
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
35
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
36
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
37
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
38
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
39
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
40
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
41
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
42
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
43
- function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
44
- function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
45
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
46
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
47
- function _superPropSet(t, e, o, r, p, f) { return _set(_getPrototypeOf(f ? t.prototype : t), e, o, r, p); }
48
- function set(e, r, t, o) { return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { var f, i = _superPropBase(e, r); if (i) { if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; if (!f.writable) return !1; } if (f = Object.getOwnPropertyDescriptor(o, r)) { if (!f.writable) return !1; f.value = t, Object.defineProperty(o, r, f); } else _defineProperty(o, r, t); return !0; }, set(e, r, t, o); }
49
- function _set(e, r, t, o, f) { if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); return t; }
50
- function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
51
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
52
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
53
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
54
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
55
- var addOverlay = function addOverlay(feature, map, alarmBg) {
56
- if (alarmBg) {
57
- var itemVal = alarmBg.find(function (v) {
58
- return v.filter(feature.values_);
59
- });
60
- if (itemVal) {
61
- var image = itemVal.image,
62
- style = itemVal.style;
63
- var dom;
64
- if (image) {
65
- dom = document.createElement('img');
66
- dom.src = image;
67
- } else {
68
- dom = document.createElement('div');
69
- dom.className = "ol-map-icon-alarm";
70
- }
71
- if (style) {
72
- dom.style.cssText = style;
73
- }
74
- var overlay = new _ol.Overlay({
75
- element: dom,
76
- positioning: 'bottom-center',
77
- stopEvent: true,
78
- className: 'ol-overlay_container-stop_event'
79
- });
80
- map.addOverlay(overlay);
81
- overlay.setPosition(feature.getGeometry().getCoordinates());
82
- return overlay;
83
- }
84
- }
85
- };
86
- var FeatureLayer = /*#__PURE__*/function (_Vector) {
87
- function FeatureLayer(_options) {
88
- var _this2;
89
- _classCallCheck(this, FeatureLayer);
90
- var url = _options.url,
91
- params = _options.params,
92
- data = _options.data,
93
- dataField = _options.dataField,
94
- features = _options.features,
95
- sourceOptions = _options.sourceOptions,
96
- key = _options.key,
97
- name = _options.name,
98
- label = _options.label,
99
- _labelField = _options.labelField,
100
- point = _options.point,
101
- cluster = _options.cluster,
102
- template = _options.template,
103
- autoRefresh = _options.autoRefresh,
104
- method = _options.method,
105
- layerControl = _options.layerControl,
106
- show = _options.show,
107
- _style2 = _options.style,
108
- group = _options.group,
109
- iconOptions = _options.iconOptions,
110
- afterGetData = _options.afterGetData,
111
- legend = _options.legend,
112
- viewOnly = _options.viewOnly,
113
- encrypt = _options.encrypt,
114
- valueField = _options.valueField,
115
- map = _options.map,
116
- tipTemplate = _options.tipTemplate,
117
- alarmBg = _options.alarmBg,
118
- cancelPopup = _options.cancelPopup,
119
- other = _objectWithoutProperties(_options, _excluded);
120
- var props = _objectSpread({}, other);
121
- props.source = props.source || new _source.Vector(_objectSpread({
122
- features: features
123
- }, sourceOptions));
124
- var defaultShow = show;
125
- if (group !== null && group !== void 0 && group.length) {
126
- defaultShow = false;
127
- if (show) {
128
- group.map(function (f) {
129
- if (f.show) {
130
- defaultShow = true;
131
- }
132
-
133
- // 将字符函数转化为可执行的函数
134
- f.filter = (0, _stringToFun["default"])(f.filter);
135
- });
136
- }
137
- }
138
- _this2 = _callSuper(this, FeatureLayer, [props]);
139
- _defineProperty(_this2, "getClusterTextStyle", function (size, options) {
140
- var _ref = options && _typeof(options) === 'object' ? options : {},
141
- color = _ref.color,
142
- background = _ref.background,
143
- backgroundStroke = _ref.backgroundStroke,
144
- backgroundStrokeWidth = _ref.backgroundStrokeWidth,
145
- otherVal = _objectWithoutProperties(_ref, _excluded2);
146
- var style = _objectSpread({
147
- text: String(size),
148
- font: '18px Calibri,sans-serif',
149
- fill: new _style5.Fill({
150
- color: color || '#fff'
151
- }),
152
- padding: [0, 0, 0, 0],
153
- justify: 'center',
154
- textAlign: 'center',
155
- textBaseline: 'middle',
156
- offsetY: -22,
157
- offsetX: 16
158
- }, otherVal);
159
- if (background) {
160
- style.backgroundFill = new _style5.Fill({
161
- color: background
162
- });
163
- }
164
- if (backgroundStroke) {
165
- style.backgroundStroke = new _style5.Stroke({
166
- color: '#FFFFFF',
167
- width: backgroundStrokeWidth || 2
168
- });
169
- }
170
- return new _style5.Text(style);
171
- });
172
- _defineProperty(_this2, "getLabelStyle", function (feature, color) {
173
- var labelField = _this2._options.labelField;
174
-
175
- // 判断是否是聚合点位
176
- if (feature.isCluster) {
177
- var _feature$get;
178
- var size = ((_feature$get = feature.get('features')) === null || _feature$get === void 0 ? void 0 : _feature$get.length) || 0;
179
- if (size !== 1) {
180
- return;
181
- }
182
- }
183
- if (labelField) {
184
- return new _style5.Text({
185
- text: feature.values_[labelField] || '-',
186
- font: '12px Calibri,sans-serif',
187
- fill: new _style5.Fill({
188
- color: color
189
- }),
190
- backgroundFill: new _style5.Fill({
191
- color: '#fff'
192
- }),
193
- backgroundStroke: new _style5.Stroke({
194
- color: color,
195
- width: 1
196
- }),
197
- padding: [4, 2, 2, 4],
198
- justify: 'center',
199
- textBaseline: 'middle',
200
- offsetY: 12
201
- });
202
- }
203
- });
204
- _superPropSet((_this2, FeatureLayer), "show", show, _this2, 1, 1);
205
- // 参数
206
- _this2._options = _options;
207
-
208
- // 地图
209
- _this2.map = map;
210
-
211
- // 接口地址
212
- _this2.url = url;
213
-
214
- // 接口地址请求类型
215
- _this2.method = method;
216
-
217
- // 接口查询参数
218
- _this2.params = params;
219
-
220
- // 图层标识
221
- _this2.key = key;
222
-
223
- // 图层名称
224
- _this2.name = name;
225
-
226
- // 标签
227
- _this2.label = label;
228
-
229
- // 标签字段
230
- _this2.labelField = _labelField;
231
-
232
- // 聚合
233
- _this2.cluster = cluster;
234
-
235
- // 聚合距离
236
- _this2.distance = (cluster === null || cluster === void 0 ? void 0 : cluster.distance) || 80;
237
-
238
- // 海量点
239
- _this2.point = point;
240
-
241
- // 自动刷新标识
242
- _this2.autoRefresh = autoRefresh;
243
-
244
- // 模版内容
245
- _this2.template = template;
246
-
247
- // 图层控制
248
- _this2.layerControl = layerControl;
249
-
250
- // 过滤
251
- _this2.group = group;
252
-
253
- // 处理获取的数据
254
- _this2.afterGetData = afterGetData;
255
-
256
- // 数据查询字段
257
- _this2.valueField = valueField;
258
-
259
- // 图例
260
- _this2.legend = legend;
261
-
262
- // 样式
263
- _this2.style = _style2;
264
-
265
- // 数据
266
- _this2.data = data;
267
-
268
- // 数据取值字段
269
- _this2.dataField = dataField || 'geometryInfo';
270
-
271
- // 仅展示
272
- _this2.viewOnly = viewOnly;
273
-
274
- // 是否初始化
275
- _this2.inited = false;
276
-
277
- // 加密
278
- _this2.encrypt = encrypt;
279
-
280
- // 气泡模板
281
- _this2.tipTemplate = tipTemplate;
282
-
283
- // 取消气泡
284
- _this2.cancelPopup = cancelPopup;
285
-
286
- // 报警背景
287
- if (alarmBg) {
288
- _this2.alarmBg = (Array.isArray(alarmBg) ? alarmBg : [alarmBg]).map(function (item) {
289
- var filter = item.filter,
290
- style = item.style;
291
- filter = (0, _stringToFun["default"])(filter);
292
- if (style) {
293
- style = item.style && _typeof(item.style) === 'object' ? style : {
294
- color: style
295
- };
296
- style = (0, _convertCamelToCSS["default"])(style);
297
- }
298
- return _objectSpread(_objectSpread({}, item), {}, {
299
- filter: filter,
300
- style: style
301
- });
302
- });
303
- }
304
-
305
- // 临时数据
306
- _this2._features = [];
307
-
308
- // 默认是否展示
309
- if (defaultShow) {
310
- _this2.init();
311
- }
312
- return _this2;
313
- }
314
-
315
- // 初始化数据
316
- _inherits(FeatureLayer, _Vector);
317
- return _createClass(FeatureLayer, [{
318
- key: "init",
319
- value: function init() {
320
- // 是否存在地址
321
- if (this.url) {
322
- // 执行
323
- this.loadUrlData(this.url, this.params, this.method);
324
- }
325
-
326
- // 直接加载数据
327
- if (this.data) {
328
- // 执行
329
- this.loadData(this.data);
330
- }
331
- this.inited = true;
332
- }
333
-
334
- // 重写父类的属性访问器
335
- }, {
336
- key: "show",
337
- get: function get() {
338
- return _superPropGet(FeatureLayer, "show", this, 1);
339
- },
340
- set: function set(value) {
341
- this.setVisible(value);
342
- }
343
- }, {
344
- key: "label",
345
- set: function set(val) {
346
- this._options.label = val;
347
- this.setStyle(this.getStyleByMode());
348
- }
349
- }, {
350
- key: "point",
351
- set: function set(val) {
352
- this._options.point = val;
353
- this.setStyle(this.getStyleByMode());
354
- }
355
- }, {
356
- key: "cluster",
357
- set: function set(val) {
358
- this.setClusterMode(val);
359
- }
360
- }, {
361
- key: "setShow",
362
- value: function setShow(value) {
363
- this.show = value;
364
- this.setVisible(value);
365
- }
366
- }, {
367
- key: "setClusterMode",
368
- value: function setClusterMode(val) {
369
- var _this3 = this;
370
- var _ref2 = (0, _isObject["default"])(val) ? val : {
371
- show: val
372
- },
373
- show = _ref2.show;
374
- this.setClusterSource(val);
375
- this.setStyle(this.getStyleByMode());
376
- if (this.map && show) {
377
- var map = this.map;
378
- this.destroy();
379
-
380
- // 监听地图缩放大于阈值时取消聚合
381
- var oldZoom = map.getView().getZoom();
382
- this.moveEnd = map.on('moveend', function () {
383
- var zoom = map.getView().getZoom(); //获取当前地图的缩放级别
384
- if (oldZoom !== zoom) {
385
- var _this3$_options$clust;
386
- oldZoom = zoom;
387
- if (zoom >= (((_this3$_options$clust = _this3._options.cluster) === null || _this3$_options$clust === void 0 ? void 0 : _this3$_options$clust.zoomThreshold) || 14)) {
388
- _this3.setClusterSource();
389
- } else {
390
- _this3.setClusterSource(val);
391
- }
392
- }
393
- });
394
- }
395
- }
396
- }, {
397
- key: "getCustomClusterStyle",
398
- value: function getCustomClusterStyle(feature, clusterStyle) {
399
- var _feature$get2;
400
- var type = clusterStyle.type,
401
- iconSrc = clusterStyle.iconSrc,
402
- color = clusterStyle.color,
403
- _clusterStyle$scale = clusterStyle.scale,
404
- scale = _clusterStyle$scale === void 0 ? 1 : _clusterStyle$scale,
405
- numberStyle = clusterStyle.numberStyle,
406
- numberScale = clusterStyle.numberScale,
407
- iconOptions = _objectWithoutProperties(clusterStyle, _excluded3);
408
- var size = ((_feature$get2 = feature.get('features')) === null || _feature$get2 === void 0 ? void 0 : _feature$get2.length) || 0;
409
- return [new _renderer["default"].Marker({
410
- image: (0, _Marker.getImgUrl)(type || 'CommonIcon', {
411
- color: color || '#2491fc',
412
- hideFooter: true,
413
- info: {
414
- text: size,
415
- fontSize: 18
416
- }
417
- }),
418
- // text: this.getClusterTextStyle(size, numberStyle),
419
- scale: numberScale || 1
420
- }), new _renderer["default"].Marker(_objectSpread({
421
- image: iconSrc,
422
- scale: scale || 1,
423
- anchor: [1.1, 1.25]
424
- }, iconOptions))];
425
- }
426
- }, {
427
- key: "getStyleByMode",
428
- value: function getStyleByMode() {
429
- var _this4 = this;
430
- return function (feature, resolution) {
431
- var _feature$get3, _this4$group, _cluster$style;
432
- var size = ((_feature$get3 = feature.get('features')) === null || _feature$get3 === void 0 ? void 0 : _feature$get3.length) || 0;
433
- var _this4$_options = _this4._options,
434
- style = _this4$_options.style,
435
- cluster = _this4$_options.cluster,
436
- otherStyle = _this4$_options.otherStyle;
437
- var show = true;
438
- (_this4$group = _this4.group) === null || _this4$group === void 0 || _this4$group.map(function (v) {
439
- var _v$filter;
440
- if (v !== null && v !== void 0 && (_v$filter = v.filter) !== null && _v$filter !== void 0 && _v$filter.call(v, feature.values_)) {
441
- style = v.style || style;
442
- if (v.hasOwnProperty('show') && !v.show) {
443
- show = false;
444
- }
445
- }
446
- });
447
- feature.show = show;
448
- if (!show) {
449
- return null;
450
- }
451
- var styles = [];
452
- if (otherStyle) {
453
- if ((0, _isFunction["default"])(otherStyle)) {
454
- var _styles = otherStyle(feature, resolution);
455
- if (_styles) {
456
- if (Array.isArray(styles)) {
457
- styles.push.apply(styles, _toConsumableArray(_styles));
458
- } else {
459
- styles.push(_styles);
460
- }
461
- }
462
- }
463
- }
464
- if (size > 1 && cluster !== null && cluster !== void 0 && (_cluster$style = cluster.style) !== null && _cluster$style !== void 0 && _cluster$style.iconSrc) {
465
- return _this4.getCustomClusterStyle(feature, cluster.style);
466
- }
467
- if (style) {
468
- if (typeof style === 'string' || (0, _isFunction["default"])(style) && cluster) {
469
- styles.push(new _renderer["default"].Marker(_objectSpread({}, _this4.getMarkerOptions(feature, style))));
470
- return styles;
471
- } else if (style instanceof _style5.Style) {
472
- // 判断是否为 ol Style
473
- styles.push(style);
474
- return styles;
475
- } else if ((0, _isFunction["default"])(style)) {
476
- // 判断是否为自定义函数渲染
477
-
478
- var _style = style(feature);
479
- if (_style !== null && _style !== void 0 && _style.type && _style !== null && _style !== void 0 && _style.style) {
480
- var options = _this4.getSimpleStyle(feature, _style);
481
- styles.push(_renderer["default"].Simple(options));
482
- return styles;
483
- }
484
- styles.push(_style);
485
- return styles;
486
- } else if ((0, _isObject["default"])(style)) {
487
- var _style3 = style,
488
- mode = _style3.mode;
489
- if (mode) {
490
- if (mode === 'Simple') {
491
- var _options2 = _this4.getSimpleStyle(feature, style.render);
492
- styles.push(_renderer["default"].Simple(_options2));
493
- return styles;
494
- }
495
- if (mode === 'UniqueValue') {
496
- if (size > 1) {
497
- var _options3 = _this4.getSimpleStyle(feature, style.render.render[0]);
498
- styles.push(_renderer["default"].Simple(_options3));
499
- return styles;
500
- }
501
- var _options4 = _this4.getMultipleStyle(feature, style.render);
502
- styles.push(_renderer["default"].UniqueValue(feature, _options4));
503
- return styles;
504
- }
505
- if (mode === 'ClassBreaks') {
506
- if (size > 1) {
507
- var _options5 = _this4.getSimpleStyle(feature, style.render.render[0]);
508
- styles.push(_renderer["default"].Simple(_options5));
509
- return styles;
510
- }
511
- var _options6 = _this4.getMultipleStyle(feature, style.render);
512
- styles.push(_renderer["default"].ClassBreaks(feature, _options6));
513
- return styles;
514
- }
515
- } else if (style.style) {
516
- var _options7 = _this4.getSimpleStyle(feature, style);
517
- styles.push(_renderer["default"].Simple(_options7));
518
- return styles;
519
- }
520
- }
521
- }
522
- styles.push(new _style5.Style({
523
- image: new _style5.Circle({
524
- radius: 4,
525
- fill: new _style5.Fill({
526
- color: 'rgba(0,155,255, 0.8)'
527
- })
528
- }),
529
- fill: new _style5.Fill({
530
- color: 'rgba(255, 255, 255, 0.6)'
531
- }),
532
- stroke: new _style5.Stroke({
533
- color: '#009BFF',
534
- width: 2
535
- })
536
- }));
537
- return styles;
538
- };
539
- }
540
- }, {
541
- key: "getSimpleStyle",
542
- value: function getSimpleStyle(feature, _render) {
543
- var _render$style, _render$style2;
544
- var cluster = this._options.cluster;
545
- var render = _objectSpread({}, _render);
546
- if (render.type === 'Marker' && (render !== null && render !== void 0 && (_render$style = render.style) !== null && _render$style !== void 0 && _render$style.icon || cluster && render !== null && render !== void 0 && (_render$style2 = render.style) !== null && _render$style2 !== void 0 && _render$style2.image)) {
547
- render.style = _objectSpread(_objectSpread({}, render.style), this.getMarkerOptions(feature, render.style));
548
- }
549
- return render;
550
- }
551
- }, {
552
- key: "getMultipleStyle",
553
- value: function getMultipleStyle(feature, _render) {
554
- var _render$render,
555
- _this5 = this;
556
- var render = _objectSpread({}, _render);
557
- if (render !== null && render !== void 0 && (_render$render = render.render) !== null && _render$render !== void 0 && _render$render.length) {
558
- render.render = render.render.map(function (v) {
559
- return _this5.getSimpleStyle(feature, v);
560
- });
561
- }
562
- return render;
563
- }
564
- }, {
565
- key: "getMarkerOptions",
566
- value: function getMarkerOptions(feature, style) {
567
- var _feature$get4;
568
- var icon = (style === null || style === void 0 ? void 0 : style.icon) || style;
569
- var image = style === null || style === void 0 ? void 0 : style.image;
570
- var scale = style === null || style === void 0 ? void 0 : style.scale;
571
- var color = (style === null || style === void 0 ? void 0 : style.color) || '#2491fc';
572
- var iconSize = (style === null || style === void 0 ? void 0 : style.size) || null;
573
- var hideFooter = (style === null || style === void 0 ? void 0 : style.hideFooter) || null;
574
- var _this$_options = this._options,
575
- cluster = _this$_options.cluster,
576
- point = _this$_options.point,
577
- label = _this$_options.label;
578
- // 判断是否为自定义函数渲染
579
- var isFun = (0, _isFunction["default"])(style);
580
- var data = {};
581
- if (isFun) {
582
- var _data, _data2, _data3, _data4, _data5, _data6, _data7, _data8, _data9, _data0, _data1, _data10;
583
- data = style(feature) || {};
584
- icon = ((_data = data) === null || _data === void 0 || (_data = _data.style) === null || _data === void 0 ? void 0 : _data.icon) || ((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.icon) || icon;
585
- color = ((_data3 = data) === null || _data3 === void 0 || (_data3 = _data3.style) === null || _data3 === void 0 ? void 0 : _data3.color) || ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.color) || color;
586
- image = ((_data5 = data) === null || _data5 === void 0 || (_data5 = _data5.style) === null || _data5 === void 0 ? void 0 : _data5.image) || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.image) || image;
587
- scale = ((_data7 = data) === null || _data7 === void 0 || (_data7 = _data7.style) === null || _data7 === void 0 ? void 0 : _data7.scale) || ((_data8 = data) === null || _data8 === void 0 ? void 0 : _data8.scale) || scale;
588
- iconSize = ((_data9 = data) === null || _data9 === void 0 || (_data9 = _data9.style) === null || _data9 === void 0 ? void 0 : _data9.size) || ((_data0 = data) === null || _data0 === void 0 ? void 0 : _data0.size) || iconSize;
589
- hideFooter = ((_data1 = data) === null || _data1 === void 0 || (_data1 = _data1.style) === null || _data1 === void 0 ? void 0 : _data1.hideFooter) || ((_data10 = data) === null || _data10 === void 0 ? void 0 : _data10.hideFooter) || hideFooter;
590
- }
591
- var size = ((_feature$get4 = feature.get('features')) === null || _feature$get4 === void 0 ? void 0 : _feature$get4.length) || 0;
592
- var iconOptions = {
593
- size: iconSize,
594
- hideFooter: hideFooter
595
- };
596
- var P = {
597
- marker: {
598
- // 图标
599
- icon: icon,
600
- image: image,
601
- iconOptions: iconOptions,
602
- scale: scale
603
- },
604
- point: {
605
- // 点位
606
- icon: icon,
607
- type: 'PointIcon',
608
- iconOptions: iconOptions
609
- },
610
- marker_cluster: _objectSpread({
611
- // 聚合图标
612
- icon: icon,
613
- image: image,
614
- scale: scale,
615
- color: size > 1 ? '' : color,
616
- iconOptions: size > 1 ? _objectSpread({
617
- hideFooter: true,
618
- info: {
619
- text: '',
620
- fontSize: 18
621
- }
622
- }, (cluster === null || cluster === void 0 ? void 0 : cluster.iconOptions) || {}) : {}
623
- }, size > 1 ? cluster === null || cluster === void 0 ? void 0 : cluster.style : cluster === null || cluster === void 0 ? void 0 : cluster.commonStyle),
624
- point_cluster: _objectSpread({
625
- // 聚合点位
626
- icon: icon,
627
- type: 'PointIcon',
628
- iconOptions: size > 1 ? {
629
- text: size
630
- } : {}
631
- }, size > 1 && (cluster === null || cluster === void 0 ? void 0 : cluster.style))
632
- };
633
- var type = point ? 'point' : 'marker';
634
- if (cluster) {
635
- if ((0, _isObject["default"])(cluster)) {
636
- if (cluster.show) {
637
- type = 'marker_cluster';
638
- if (point) {
639
- type = 'point_cluster';
640
- }
641
- }
642
- } else {
643
- type = 'marker_cluster';
644
- if (point) {
645
- type = 'point_cluster';
646
- }
647
- }
648
- }
649
- var _style = P[type];
650
- if (label) {
651
- var _Object$keys;
652
- if ((_Object$keys = Object.keys(data)) !== null && _Object$keys !== void 0 && _Object$keys.includes('customText')) {
653
- var _data11;
654
- _style.text = (_data11 = data) === null || _data11 === void 0 ? void 0 : _data11.customText;
655
- } else {
656
- _style.text = this.getLabelStyle(feature, color);
657
- }
658
- }
659
- if (feature.isCluster && size > 1 && type === 'marker_cluster') {
660
- var _cluster$style2;
661
- _style.text = this.getClusterTextStyle(size, cluster === null || cluster === void 0 || (_cluster$style2 = cluster.style) === null || _cluster$style2 === void 0 ? void 0 : _cluster$style2.numberStyle);
662
- }
663
- return _style;
664
- }
665
- }, {
666
- key: "setClusterSource",
667
- value: function setClusterSource(cluster) {
668
- var _this$_features,
669
- _this6 = this;
670
- var _this = this;
671
- cluster = (0, _isObject["default"])(cluster) ? cluster : {
672
- show: cluster
673
- };
674
- var _cluster = cluster,
675
- show = _cluster.show,
676
- minDistance = _cluster.minDistance,
677
- distance = _cluster.distance,
678
- group = _cluster.group;
679
- var source = new _source.Vector({
680
- features: (_this$_features = this._features) === null || _this$_features === void 0 ? void 0 : _this$_features.filter(function (v) {
681
- return !v.hasOwnProperty('show') || v.show;
682
- })
683
- });
684
- if (show) {
685
- group = group || this.group;
686
- var clusterSource = new _MyCluster["default"](_objectSpread({
687
- distance: distance || 100,
688
- minDistance: minDistance || 50,
689
- source: source,
690
- group: group,
691
- clusterChange: function clusterChange(features) {
692
- _this6.setAlarmBgByFeatures(features);
693
- },
694
- createCluster: function createCluster(point, features) {
695
- var _group;
696
- var feature = new _ol.Feature({
697
- geometry: point,
698
- features: features.map(function (v) {
699
- v.layerKey = _this.key;
700
- return v;
701
- })
702
- });
703
- if ((_group = group) !== null && _group !== void 0 && _group.length) {
704
- var _group2, _groupItem;
705
- var style, groupItem;
706
- var f = features[0];
707
- var size = features.length;
708
- (_group2 = group) === null || _group2 === void 0 || _group2.map(function (v) {
709
- var _v$filter2;
710
- if (v !== null && v !== void 0 && (_v$filter2 = v.filter) !== null && _v$filter2 !== void 0 && _v$filter2.call(v, f.values_)) {
711
- style = v.style || style;
712
- groupItem = v;
713
- }
714
- });
715
-
716
- // 当点位单独展示时,并且style为自定义函数
717
- if (size === 1 && (0, _isFunction["default"])(style)) {
718
- style = style(f);
719
- }
720
- var markerStyle = _objectSpread({}, style.style);
721
- if (size > 1 && (_groupItem = groupItem) !== null && _groupItem !== void 0 && (_groupItem = _groupItem.clusterStyle) !== null && _groupItem !== void 0 && _groupItem.iconSrc) {
722
- var _style = _this6.getCustomClusterStyle(feature, groupItem.clusterStyle);
723
- feature.setStyle(_style);
724
- } else {
725
- var _this6$_options;
726
- if (size > 1) {
727
- var _style4, _markerStyle2, _cluster2;
728
- if ((_style4 = style) !== null && _style4 !== void 0 && _style4.clusterStyle) {
729
- markerStyle = _objectSpread({}, style.clusterStyle);
730
- }
731
- var _markerStyle = markerStyle,
732
- numberStyle = _markerStyle.numberStyle,
733
- iconOptions = _markerStyle.iconOptions,
734
- _otherStyle = _objectWithoutProperties(_markerStyle, _excluded4);
735
- markerStyle = _objectSpread(_objectSpread({}, _otherStyle), {}, {
736
- text: _this6.getClusterTextStyle((_markerStyle2 = markerStyle) !== null && _markerStyle2 !== void 0 && _markerStyle2.image ? size : ' ', numberStyle),
737
- iconOptions: _objectSpread({
738
- hideFooter: true,
739
- info: {
740
- text: size,
741
- fontSize: 18
742
- }
743
- }, iconOptions || ((_cluster2 = cluster) === null || _cluster2 === void 0 ? void 0 : _cluster2.iconOptions) || {})
744
- });
745
- }
746
- var otherStyle = groupItem.otherStyle || ((_this6$_options = _this6._options) === null || _this6$_options === void 0 ? void 0 : _this6$_options.otherStyle);
747
- feature.setStyle(function (feature, resolution) {
748
- var styles = [new _renderer["default"].Marker(markerStyle)];
749
- if (otherStyle) {
750
- if ((0, _isFunction["default"])(otherStyle)) {
751
- var _styles = otherStyle(feature, resolution);
752
- if (_styles) {
753
- if (Array.isArray(styles)) {
754
- styles.push.apply(styles, _toConsumableArray(_styles));
755
- } else {
756
- styles.push(_styles);
757
- }
758
- }
759
- }
760
- }
761
- return styles;
762
- });
763
- }
764
- }
765
-
766
- // 增加聚合点位标识
767
- feature.isCluster = true;
768
- if (features.length === 1) {
769
- feature.setProperties(features[0].values_);
770
- }
771
- return feature;
772
- }
773
- }, cluster));
774
- this.setSource(clusterSource);
775
- } else {
776
- this.setSource(source);
777
- }
778
- }
779
-
780
- // 清除报警背景
781
- }, {
782
- key: "clearAlarmBg",
783
- value: function clearAlarmBg() {
784
- var _this$overlays,
785
- _this7 = this;
786
- if (this.map && (_this$overlays = this.overlays) !== null && _this$overlays !== void 0 && _this$overlays.length) {
787
- this.overlays.map(function (overlay) {
788
- return _this7.map.removeOverlay(overlay);
789
- });
790
- this.overlays = null;
791
- }
792
- }
793
-
794
- // 设置报警背景
795
- }, {
796
- key: "setAlarmBgByFeatures",
797
- value: function setAlarmBgByFeatures(features) {
798
- var _this8 = this;
799
- this.clearAlarmBg();
800
- this.overlays = [];
801
- if (this.map && this.alarmBg && features !== null && features !== void 0 && features.length) {
802
- features.map(function (feature) {
803
- var _feature = feature;
804
- var cluster = feature.get('features');
805
- if (cluster) {
806
- _feature = cluster.length < 2 ? cluster[0] : null;
807
- }
808
- if (_feature && (_feature.hasOwnProperty('show') ? _feature.show : true)) {
809
- var overlay = addOverlay(_feature, _this8.map, _this8.alarmBg);
810
- if (overlay) {
811
- _this8.overlays.push(overlay);
812
- }
813
- }
814
- });
815
- }
816
- }
817
- }, {
818
- key: "refresh",
819
- value: function refresh() {
820
- var _this9 = this;
821
- (0, _createFeatureCollection.getDataByHttpByParams)({
822
- url: this.url,
823
- params: this.params,
824
- method: this.method,
825
- afterGetData: this.afterGetData,
826
- field: this.dataField
827
- }).then(function (features) {
828
- if (features) {
829
- var new_features = features;
830
- _this9._features = new_features;
831
- var newFeatures = [];
832
- new_features.map(function (v) {
833
- var f = _this9.getFeatureByFieldValue('id', v.values_.id);
834
- if (f) {
835
- f.values_ = v.values_;
836
- } else {
837
- newFeatures.push(v);
838
- }
839
- });
840
- if (newFeatures.length) {
841
- _this9.getSource().addFeatures(newFeatures);
842
- _this9.setAlarmBgByFeatures(_this9.getSource().getFeatures());
843
- }
844
- _this9.getSource().changed();
845
- }
846
- });
847
- }
848
- }, {
849
- key: "loadData",
850
- value: function loadData(data) {
851
- this.getSource().clear();
852
- var features = (0, _createFeatureCollection.createGeoJson)(data, this.dataField);
853
- this.getSource().addFeatures(features);
854
- this.setAlarmBgByFeatures(this.getSource().getFeatures());
855
- this._features = features;
856
- if (this._options.cluster) {
857
- this.setClusterMode(this._options.cluster);
858
- }
859
- }
860
- }, {
861
- key: "loadUrlData",
862
- value: function loadUrlData(url, params, method) {
863
- var _this0 = this;
864
- var afterGetData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.afterGetData;
865
- this.getSource().clear();
866
- this._features = [];
867
- if (this.encrypt) {
868
- params = (0, _encryptParams["default"])(params, this.encrypt);
869
- }
870
- (0, _createFeatureCollection.getDataByHttpByParams)({
871
- url: url,
872
- params: params,
873
- method: method,
874
- afterGetData: afterGetData,
875
- field: this.dataField
876
- }).then(function (features) {
877
- _this0.getSource().clear();
878
- _this0._features = [];
879
- if (features !== null && features !== void 0 && features.length) {
880
- _this0._features = features;
881
- _this0.getSource().addFeatures(features);
882
- _this0.setAlarmBgByFeatures(_this0.getSource().getFeatures());
883
- }
884
- if (_this0._options.cluster) {
885
- _this0.setClusterMode(_this0._options.cluster);
886
- }
887
- });
888
- }
889
- }, {
890
- key: "loadFeatures",
891
- value: function loadFeatures(features) {
892
- this.getSource().clear();
893
- this.getSource().addFeatures(features);
894
- this.setAlarmBgByFeatures(this.getSource().getFeatures());
895
- this._features = features;
896
- if (this._options.cluster) {
897
- this.setClusterMode(this._options.cluster);
898
- }
899
- }
900
- }, {
901
- key: "getFeatures",
902
- value: function getFeatures() {
903
- var source = this.getSource().source || this.getSource();
904
- return source.getFeatures();
905
- }
906
- }, {
907
- key: "getFeatureByFieldValue",
908
- value: function getFeatureByFieldValue(field, value) {
909
- return this.getFeatures().find(function (v) {
910
- return v.values_[field] === value;
911
- });
912
- }
913
- }, {
914
- key: "getFeaturesByFieldValueOpera",
915
- value: function getFeaturesByFieldValueOpera(_ref3) {
916
- var _this1 = this;
917
- var field = _ref3.field,
918
- value = _ref3.value,
919
- _ref3$operation = _ref3.operation,
920
- operation = _ref3$operation === void 0 ? '===' : _ref3$operation,
921
- features = _ref3.features,
922
- filter = _ref3.filter;
923
- return new Promise(function (resolve, reject) {
924
- var _features = features || _this1.getFeatures();
925
- if (filter) {
926
- _features = _features.filter(function (feature) {
927
- return filter(feature.values_);
928
- });
929
- }
930
- var result = _features;
931
- if (operation && value !== undefined) {
932
- if (['>', '>=', '<', '<=', '===', '!=='].includes(operation)) {
933
- try {
934
- // 通过动态创建方法自动传入操作符
935
- var fun = new Function('features', 'field', 'value', "return features.filter(v => v.values_[field] ".concat(operation, " value)"));
936
- result = fun(_features, field, value);
937
- } catch (err) {
938
- reject(err);
939
- }
940
- } else if (operation === 'like') {
941
- // 包含
942
- result = _features.filter(function (v) {
943
- var _v$values_$field;
944
- return ((_v$values_$field = v.values_[field]) === null || _v$values_$field === void 0 ? void 0 : _v$values_$field.indexOf(value)) !== -1;
945
- });
946
- } else if (operation === 'notLike') {
947
- // 不包含
948
- result = _features.filter(function (v) {
949
- var _v$values_$field2;
950
- return ((_v$values_$field2 = v.values_[field]) === null || _v$values_$field2 === void 0 ? void 0 : _v$values_$field2.indexOf(value)) === -1;
951
- });
952
- } else {
953
- result = _features.filter(function (v) {
954
- var _v$values_$field3;
955
- return ((_v$values_$field3 = v.values_[field]) === null || _v$values_$field3 === void 0 ? void 0 : _v$values_$field3.indexOf(value)) !== -1;
956
- });
957
- }
958
- }
959
- resolve(result);
960
- });
961
- }
962
-
963
- // 获取地图
964
- }, {
965
- key: "getMap",
966
- value: function getMap() {
967
- return this.map;
968
- }
969
-
970
- // 设置过滤条件
971
- }, {
972
- key: "setGroup",
973
- value: function setGroup(group) {
974
- if (group !== null && group !== void 0 && group.length) {
975
- var _this$_features2;
976
- if ((_this$_features2 = this._features) !== null && _this$_features2 !== void 0 && _this$_features2.length) {
977
- this._features.map(function (feature) {
978
- var show = true;
979
- group.map(function (v) {
980
- var _v$filter3;
981
- v.filter = (0, _stringToFun["default"])(v.filter);
982
- if (v !== null && v !== void 0 && (_v$filter3 = v.filter) !== null && _v$filter3 !== void 0 && _v$filter3.call(v, feature.values_)) {
983
- if (v.hasOwnProperty('show') && !v.show) {
984
- show = false;
985
- }
986
- }
987
- });
988
- feature.show = show;
989
- });
990
- }
991
- this.group = group;
992
- this.setVisibleByGroup();
993
- if (this._options.cluster) {
994
- this.setClusterMode(this._options.cluster);
995
- } else {
996
- this.setStyle(this.getStyleByMode());
997
- }
998
- this.setAlarmBgByFeatures(this._features);
999
- }
1000
- }
1001
-
1002
- // 根据过滤条件组显示图层
1003
- }, {
1004
- key: "setVisibleByGroup",
1005
- value: function setVisibleByGroup() {
1006
- var group = this.group;
1007
- if (group !== null && group !== void 0 && group.length) {
1008
- var visible = false;
1009
- group.map(function (v) {
1010
- if (!v.hasOwnProperty('show') || v.show) {
1011
- visible = true;
1012
- }
1013
- });
1014
- this.setVisible(visible);
1015
- }
1016
- }
1017
-
1018
- // 设置图层显示隐藏
1019
- }, {
1020
- key: "setVisible",
1021
- value: function setVisible(visible) {
1022
- _superPropGet(FeatureLayer, "setVisible", this, 3)([visible]); // 将属性传递给父类
1023
-
1024
- var map = this.getMap && this.getMap();
1025
- if (map) {
1026
- map.layers.onChange();
1027
- }
1028
-
1029
- // 判断是否完成过初始化,没有的话就加载一波数据
1030
- if (!this.inited) {
1031
- this.init();
1032
- }
1033
- if (!visible) {
1034
- this.clearAlarmBg();
1035
- } else {
1036
- this.setAlarmBgByFeatures(this.getSource().getFeatures());
1037
- }
1038
- }
1039
- }, {
1040
- key: "clearMoveEnd",
1041
- value: function clearMoveEnd() {
1042
- var map = this.map;
1043
- if (map && this.moveEnd) {
1044
- map.un('moveend', this.moveEnd);
1045
- this.moveEnd = null;
1046
- }
1047
- }
1048
- }, {
1049
- key: "destroy",
1050
- value: function destroy() {
1051
- this.clearMoveEnd();
1052
- this.clearAlarmBg();
1053
- }
1054
- }]);
1055
- }(_layer.Vector);
1056
- var _default = exports["default"] = FeatureLayer;
1057
- //# sourceMappingURL=FeatureLayer.js.map