@vtx/ol-map 2.0.0-beta.1 → 2.0.0-beta.10

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