@vtx/ol-map 1.0.142 → 1.0.144

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