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

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 +124 -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 +26 -16
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_ArrowFlowLayer","_interopRequireDefault","_ahooks","_events","_useProps2","_provider","_excluded","e","__esModule","t","WeakMap","r","n","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","isArray","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","configurable","writable","_toPrimitive","toPrimitive","String","Number","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","ArrowFlowLayerComponent","props","data","features","zIndex","key","id","_key","_props$show","show","legend","_props$lineStyle","lineStyle","_props$arrowStyle","arrowStyle","flowSpeed","flowCycleSeconds","minZoomForFlow","maxArrowsPerLine","_props$layerControl","layerControl","children","rest","mergedArrowStyle","_useState","useState","_useState2","layerLoad","setLayerLoad","_useProps","useProps","map","groupLayer","layerRef","useRef","useEffect","layer","ArrowFlowLayer","registerEventLayer","addLayer","layers","current","destroy","removeLayer","useUpdateEffect","loadData","loadFeatures","setShow","setLineStyle","JSON","stringify","setArrowStyle","createElement","Fragment","featureLayer","vectorLayer"],"sources":["arrow-flow-layer/index.js"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useState, useRef, useEffect } from 'react';\nimport ArrowFlowLayer from './ArrowFlowLayer';\nimport { useUpdateEffect } from 'ahooks';\nimport { registerEventLayer } from '../events';\nimport useProps from '../use-props';\nimport Provider from '../provider';\n\nexport default function ArrowFlowLayerComponent(props) {\n const {\n data,\n features,\n zIndex,\n id: key,\n _key,\n name,\n show = true,\n legend,\n lineStyle = {},\n arrowStyle = {},\n flowSpeed,\n flowCycleSeconds,\n minZoomForFlow,\n maxArrowsPerLine,\n layerControl = true,\n children,\n ...rest\n } = props;\n\n const mergedArrowStyle = {\n ...arrowStyle,\n ...(flowSpeed != null && arrowStyle.flowSpeed == null ? { flowSpeed } : {}),\n ...(flowCycleSeconds != null && arrowStyle.flowCycleSeconds == null\n ? { flowCycleSeconds }\n : {}),\n ...(minZoomForFlow != null && arrowStyle.minZoomForFlow == null\n ? { minZoomForFlow }\n : {}),\n };\n const [layerLoad, setLayerLoad] = useState(false);\n const { map, groupLayer } = useProps();\n const layerRef = useRef();\n\n useEffect(() => {\n const layer = new ArrowFlowLayer({\n data,\n features,\n zIndex,\n key: key || _key,\n name,\n show,\n legend,\n map,\n lineStyle,\n arrowStyle: mergedArrowStyle,\n flowSpeed,\n flowCycleSeconds,\n minZoomForFlow,\n maxArrowsPerLine,\n layerControl,\n ...rest,\n });\n\n registerEventLayer(layer, props);\n\n setLayerLoad(true);\n\n if (groupLayer) {\n groupLayer.addLayer(layer);\n } else {\n map.layers.addLayer(layer);\n }\n\n layerRef.current = layer;\n\n return () => {\n layer.destroy();\n if (groupLayer) {\n groupLayer.removeLayer(layer);\n } else {\n map.layers.removeLayer(layer);\n }\n };\n }, []);\n\n useUpdateEffect(() => {\n if (layerRef.current && data) {\n layerRef.current.loadData(data);\n }\n }, [data]);\n\n useUpdateEffect(() => {\n if (layerRef.current && features) {\n layerRef.current.loadFeatures(features);\n }\n }, [features]);\n\n useUpdateEffect(() => {\n if (layerRef.current) {\n layerRef.current.setShow(show);\n }\n }, [show]);\n\n useUpdateEffect(() => {\n if (layerRef.current && lineStyle) {\n layerRef.current.setLineStyle(lineStyle);\n }\n }, [JSON.stringify(lineStyle)]);\n\n useUpdateEffect(() => {\n if (layerRef.current) {\n layerRef.current.setArrowStyle(mergedArrowStyle);\n }\n }, [JSON.stringify(mergedArrowStyle)]);\n\n useUpdateEffect(() => {\n if (layerRef.current && maxArrowsPerLine != null) {\n layerRef.current.maxArrowsPerLine = maxArrowsPerLine;\n }\n }, [maxArrowsPerLine]);\n\n return (\n <>\n {layerLoad && (\n <Provider\n value={{\n map,\n featureLayer: layerRef.current.vectorLayer,\n }}\n >\n {children}\n </Provider>\n )}\n </>\n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,oBACIhG,MAAA,YAAAkI,aAAA,CAAAlI,MAAA,YAAAmI,QAAA,QACK1B,SAAS,iBACNzG,MAAA,YAAAkI,aAAA,CAAC1H,SAAA,WAAQ;IACL6C,KAAK,EAAE;MACHwD,GAAG,EAAHA,GAAG;MACHuB,YAAY,EAAErB,QAAQ,CAACQ,OAAO,CAACc;IACnC;EAAE,GAEDlC,QACK,CAEhB,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.flattenLineStrings = flattenLineStrings;
7
+ exports.getPixelAngle = getPixelAngle;
8
+ exports.sampleArrowsForLineString = sampleArrowsForLineString;
9
+ var _transform = require("ol/transform");
10
+ /**
11
+ * 将线几何拆成若干 LineString(MultiLineString 按段独立采样,避免跨段插值)。
12
+ * @param {import('ol/geom').Geometry} geometry
13
+ * @returns {import('ol/geom/LineString').default[]}
14
+ */
15
+ function flattenLineStrings(geometry) {
16
+ if (!geometry) return [];
17
+ var t = geometry.getType();
18
+ if (t === 'LineString') {
19
+ return [geometry];
20
+ }
21
+ if (t === 'MultiLineString') {
22
+ return geometry.getLineStrings();
23
+ }
24
+ return [];
25
+ }
26
+
27
+ /**
28
+ * 沿一条 LineString 按弧长等距采样箭头位置;step 可被 maxArrows 放大以控性能。
29
+ * @param {import('ol/geom/LineString').default} lineString
30
+ * @param {import('ol/extent').Extent} extent 当前帧范围,用于裁剪
31
+ * @param {{ stepWorld: number, phase: number, maxArrows: number }} opts
32
+ * @returns {Array<{ coord: number[], frac: number }>}
33
+ */
34
+ function sampleArrowsForLineString(lineString, extent, opts) {
35
+ var stepWorld = opts.stepWorld,
36
+ phase = opts.phase,
37
+ maxArrows = opts.maxArrows;
38
+ if (!lineString.intersectsExtent(extent)) {
39
+ return [];
40
+ }
41
+ var len = lineString.getLength();
42
+ if (len <= 0) {
43
+ return [];
44
+ }
45
+ var step = stepWorld;
46
+ var count = Math.ceil(len / step);
47
+ if (count > maxArrows) {
48
+ step = len / maxArrows;
49
+ }
50
+
51
+ // 流动相位:短线(弧长 < 一个屏幕间距)时把相位映射到 [0,len),否则 phaseMod 常 ≥ len 导致无采样
52
+ var phaseNorm = (phase % stepWorld + stepWorld) % stepWorld;
53
+ var phaseMod = len > 0 && len < stepWorld ? phaseNorm / stepWorld * len : phaseNorm;
54
+ var samples = [];
55
+ var eps = 1e-6;
56
+ for (var d = phaseMod; d < len; d += step) {
57
+ var frac = d / len;
58
+ var coord = lineString.getCoordinateAt(frac);
59
+ var f0 = Math.max(0, frac - eps);
60
+ var f1 = Math.min(1, frac + eps);
61
+ var c0 = lineString.getCoordinateAt(f0);
62
+ var c1 = lineString.getCoordinateAt(f1);
63
+ samples.push({
64
+ coord: coord.slice(),
65
+ frac: frac,
66
+ c0: c0.slice(),
67
+ c1: c1.slice()
68
+ });
69
+ }
70
+ return samples;
71
+ }
72
+
73
+ /**
74
+ * 在像素空间计算箭头朝向(与地图旋转一致)。
75
+ * @param {import('ol/transform').Transform} transform inversePixel * coordinateToPixel
76
+ * @param {number[]} c0 地图坐标
77
+ * @param {number[]} c1 地图坐标
78
+ * @returns {number}
79
+ */
80
+ function getPixelAngle(transform, c0, c1) {
81
+ var p0 = [c0[0], c0[1]];
82
+ var p1 = [c1[0], c1[1]];
83
+ (0, _transform.apply)(transform, p0);
84
+ (0, _transform.apply)(transform, p1);
85
+ return Math.atan2(p1[1] - p0[1], p1[0] - p0[0]);
86
+ }
87
+ //# sourceMappingURL=sampleArrowsAlongLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sampleArrowsAlongLine.js","names":["_transform","require","flattenLineStrings","geometry","t","getType","getLineStrings","sampleArrowsForLineString","lineString","extent","opts","stepWorld","phase","maxArrows","intersectsExtent","len","getLength","step","count","Math","ceil","phaseNorm","phaseMod","samples","eps","d","frac","coord","getCoordinateAt","f0","max","f1","min","c0","c1","push","slice","getPixelAngle","transform","p0","p1","apply","atan2"],"sources":["arrow-flow-layer/sampleArrowsAlongLine.js"],"sourcesContent":["import { apply } from 'ol/transform';\n\n/**\n * 将线几何拆成若干 LineString(MultiLineString 按段独立采样,避免跨段插值)。\n * @param {import('ol/geom').Geometry} geometry\n * @returns {import('ol/geom/LineString').default[]}\n */\nexport function flattenLineStrings(geometry) {\n if (!geometry) return [];\n const t = geometry.getType();\n if (t === 'LineString') {\n return [geometry];\n }\n if (t === 'MultiLineString') {\n return geometry.getLineStrings();\n }\n return [];\n}\n\n/**\n * 沿一条 LineString 按弧长等距采样箭头位置;step 可被 maxArrows 放大以控性能。\n * @param {import('ol/geom/LineString').default} lineString\n * @param {import('ol/extent').Extent} extent 当前帧范围,用于裁剪\n * @param {{ stepWorld: number, phase: number, maxArrows: number }} opts\n * @returns {Array<{ coord: number[], frac: number }>}\n */\nexport function sampleArrowsForLineString(lineString, extent, opts) {\n const { stepWorld, phase, maxArrows } = opts;\n if (!lineString.intersectsExtent(extent)) {\n return [];\n }\n const len = lineString.getLength();\n if (len <= 0) {\n return [];\n }\n\n let step = stepWorld;\n const count = Math.ceil(len / step);\n if (count > maxArrows) {\n step = len / maxArrows;\n }\n\n // 流动相位:短线(弧长 < 一个屏幕间距)时把相位映射到 [0,len),否则 phaseMod 常 ≥ len 导致无采样\n const phaseNorm = ((phase % stepWorld) + stepWorld) % stepWorld;\n const phaseMod =\n len > 0 && len < stepWorld ? (phaseNorm / stepWorld) * len : phaseNorm;\n const samples = [];\n const eps = 1e-6;\n\n for (let d = phaseMod; d < len; d += step) {\n const frac = d / len;\n const coord = lineString.getCoordinateAt(frac);\n const f0 = Math.max(0, frac - eps);\n const f1 = Math.min(1, frac + eps);\n const c0 = lineString.getCoordinateAt(f0);\n const c1 = lineString.getCoordinateAt(f1);\n samples.push({\n coord: coord.slice(),\n frac,\n c0: c0.slice(),\n c1: c1.slice(),\n });\n }\n\n return samples;\n}\n\n/**\n * 在像素空间计算箭头朝向(与地图旋转一致)。\n * @param {import('ol/transform').Transform} transform inversePixel * coordinateToPixel\n * @param {number[]} c0 地图坐标\n * @param {number[]} c1 地图坐标\n * @returns {number}\n */\nexport function getPixelAngle(transform, c0, c1) {\n const p0 = [c0[0], c0[1]];\n const p1 = [c1[0], c1[1]];\n apply(transform, p0);\n apply(transform, p1);\n return Math.atan2(p1[1] - p0[1], p1[0] - p0[0]);\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACC,QAAQ,EAAE;EACzC,IAAI,CAACA,QAAQ,EAAE,OAAO,EAAE;EACxB,IAAMC,CAAC,GAAGD,QAAQ,CAACE,OAAO,CAAC,CAAC;EAC5B,IAAID,CAAC,KAAK,YAAY,EAAE;IACpB,OAAO,CAACD,QAAQ,CAAC;EACrB;EACA,IAAIC,CAAC,KAAK,iBAAiB,EAAE;IACzB,OAAOD,QAAQ,CAACG,cAAc,CAAC,CAAC;EACpC;EACA,OAAO,EAAE;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CAACC,UAAU,EAAEC,MAAM,EAAEC,IAAI,EAAE;EAChE,IAAQC,SAAS,GAAuBD,IAAI,CAApCC,SAAS;IAAEC,KAAK,GAAgBF,IAAI,CAAzBE,KAAK;IAAEC,SAAS,GAAKH,IAAI,CAAlBG,SAAS;EACnC,IAAI,CAACL,UAAU,CAACM,gBAAgB,CAACL,MAAM,CAAC,EAAE;IACtC,OAAO,EAAE;EACb;EACA,IAAMM,GAAG,GAAGP,UAAU,CAACQ,SAAS,CAAC,CAAC;EAClC,IAAID,GAAG,IAAI,CAAC,EAAE;IACV,OAAO,EAAE;EACb;EAEA,IAAIE,IAAI,GAAGN,SAAS;EACpB,IAAMO,KAAK,GAAGC,IAAI,CAACC,IAAI,CAACL,GAAG,GAAGE,IAAI,CAAC;EACnC,IAAIC,KAAK,GAAGL,SAAS,EAAE;IACnBI,IAAI,GAAGF,GAAG,GAAG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CAAC,CAAC,CAAC;EACzB,IAAMO,EAAE,GAAG,CAACN,EAAE,CAAC,CAAC,CAAC,EAAEA,EAAE,CAAC,CAAC,CAAC,CAAC;EACzB,IAAAO,gBAAK,EAACH,SAAS,EAAEC,EAAE,CAAC;EACpB,IAAAE,gBAAK,EAACH,SAAS,EAAEE,EAAE,CAAC;EACpB,OAAOrB,IAAI,CAACuB,KAAK,CAACF,EAAE,CAAC,CAAC,CAAC,GAAGD,EAAE,CAAC,CAAC,CAAC,EAAEC,EAAE,CAAC,CAAC,CAAC,GAAGD,EAAE,CAAC,CAAC,CAAC,CAAC;AACnD","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ require("./index.css");
4
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.js","names":["require"],"sources":["arrow-flow-layer/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
File without changes
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ require("./index.less");
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["require"],"sources":["arrow-flow-layer/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
File without changes
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,399 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _style2 = require("ol/style");
8
+ var _interaction = require("ol/interaction");
9
+ var _geom = require("ol/geom");
10
+ var _source = require("ol/source");
11
+ var _layer = require("ol/layer");
12
+ var _format = require("ol/format");
13
+ var _ol = require("ol");
14
+ var _condition = require("ol/events/condition");
15
+ var _turf = require("@turf/turf");
16
+ 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); }
17
+ 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; }
18
+ 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; }
19
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
20
+ 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); } }
21
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
22
+ 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; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
24
+ 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); }
25
+ var createBox = _interaction.Draw.createBox;
26
+ var format = new _format.GeoJSON();
27
+ var getCoordinateAndType = function getCoordinateAndType(geometry) {
28
+ var coordinates, type;
29
+ if (geometry instanceof _geom.Point) {
30
+ coordinates = [geometry.getCoordinates()];
31
+ } else if (geometry instanceof _geom.Polygon) {
32
+ coordinates = geometry.getCoordinates()[0];
33
+ } else if (geometry instanceof _geom.LineString) {
34
+ coordinates = geometry.getCoordinates();
35
+ } else if (geometry instanceof _geom.Circle) {
36
+ coordinates = geometry.flatCoordinates;
37
+ type = 'circle';
38
+ }
39
+ return {
40
+ coordinates: coordinates,
41
+ type: type
42
+ };
43
+ };
44
+ var getTopRightCorner = function getTopRightCorner(coordinates, type) {
45
+ var topRightCorner = [0, 0];
46
+ if (type === 'circle') {
47
+ topRightCorner = [coordinates === null || coordinates === void 0 ? void 0 : coordinates[0], coordinates === null || coordinates === void 0 ? void 0 : coordinates[1]];
48
+ } else {
49
+ for (var i = 0; i < coordinates.length; i++) {
50
+ var coordinate = coordinates[i];
51
+ if (coordinate[0] > topRightCorner[0] || coordinate[0] === topRightCorner[0] && coordinate[1] < topRightCorner[1]) {
52
+ topRightCorner = coordinate;
53
+ }
54
+ }
55
+ }
56
+ return topRightCorner;
57
+ };
58
+ var CANCEL_TEXT_FEATURE_ID = 'cancelTextFeatureKey';
59
+ var _default = exports["default"] = /*#__PURE__*/function () {
60
+ function _default(options, callback) {
61
+ var _this = this;
62
+ _classCallCheck(this, _default);
63
+ _defineProperty(this, "drawInit", function () {
64
+ _this.map.removeInteraction(_this.drawTool);
65
+ _this.addInteractions();
66
+ });
67
+ _defineProperty(this, "modifyInit", function () {
68
+ var t = _this;
69
+ var source = new _source.Vector();
70
+ _this.modifySource = source;
71
+
72
+ // 绘制完成的样式
73
+ var _style = new _style2.Style({
74
+ geometry: function geometry(feature) {
75
+ var modifyGeometry = feature.get('modifyGeometry');
76
+ return modifyGeometry ? modifyGeometry.geometry : feature.getGeometry();
77
+ },
78
+ fill: new _style2.Fill({
79
+ color: 'rgba(0,128,255, 0.3)'
80
+ }),
81
+ stroke: new _style2.Stroke({
82
+ color: 'rgba(0,128,255, 0.3)',
83
+ width: 2
84
+ })
85
+ });
86
+ var vector = new _layer.Vector({
87
+ source: _this.modifySource,
88
+ zIndex: 3,
89
+ style: function style(feature) {
90
+ var styles = [_style];
91
+ var modifyGeometry = feature.get('modifyGeometry');
92
+ var geometry = modifyGeometry ? modifyGeometry.geometry : feature.getGeometry();
93
+ var topRightCorner = getTopRightCorner(geometry.getCoordinates()[0]);
94
+ if (topRightCorner) {
95
+ t.addCancelTextLayer(topRightCorner);
96
+ var distance = feature.get('distance');
97
+ t.distance = distance;
98
+ var text = Number(distance) < 1 ? Number(distance * 1000).toFixed(0) + _this.TextEnum.meter : Number(distance).toFixed(2) + _this.TextEnum.kilometer;
99
+ var drawFeature = t.source.getFeatures()[0].getGeometry();
100
+ var _getCoordinateAndType = getCoordinateAndType(drawFeature),
101
+ coordinates = _getCoordinateAndType.coordinates,
102
+ type = _getCoordinateAndType.type;
103
+ var topRightCorner_modify = getTopRightCorner(coordinates, type);
104
+ // 待带修改的样式
105
+ styles.push(new _style2.Style({
106
+ geometry: new _geom.LineString([topRightCorner, topRightCorner_modify]),
107
+ stroke: new _style2.Stroke({
108
+ color: '#0084FF',
109
+ width: 2
110
+ })
111
+ }));
112
+ styles.push(new _style2.Style({
113
+ geometry: new _geom.Point(topRightCorner),
114
+ // 修改了点位的样式
115
+ image: new _style2.Icon({
116
+ src: require('../assets/kz.png')
117
+ }),
118
+ // image: new CircleStyle({
119
+ // radius: 6,
120
+ // fill: new Fill({
121
+ // color: '#0080FF',
122
+ // }),
123
+ // stroke: new Stroke({
124
+ // color: '#FFF',
125
+ // width: 2,
126
+ // }),
127
+ // }),
128
+ text: new _style2.Text({
129
+ text: text,
130
+ font: '12px Calibri,sans-serif',
131
+ fill: new _style2.Fill({
132
+ color: '#FFF'
133
+ }),
134
+ backgroundFill: new _style2.Fill({
135
+ color: '#0080FF'
136
+ }),
137
+ backgroundStroke: new _style2.Stroke({
138
+ color: '#0080FF',
139
+ width: 1
140
+ }),
141
+ padding: [3, 2, 2, 4],
142
+ justify: 'right',
143
+ textBaseline: 'middle',
144
+ offsetX: 40
145
+ })
146
+ }));
147
+ }
148
+ return styles;
149
+ }
150
+ });
151
+ _this.modifyLayer = vector;
152
+ _this.map.addLayer(vector);
153
+ var defaultStyle = new _interaction.Modify({
154
+ source: _this.modifySource
155
+ }).getOverlay().getStyleFunction();
156
+ var modify = new _interaction.Modify({
157
+ source: _this.modifySource,
158
+ maxDistance: _this.maxDistance,
159
+ condition: function condition(event) {
160
+ return (0, _condition.primaryAction)(event) && !(0, _condition.platformModifierKeyOnly)(event);
161
+ },
162
+ deleteCondition: _condition.never,
163
+ insertVertexCondition: _condition.never,
164
+ style: function style(feature) {
165
+ feature.get('features').forEach(function (modifyFeature) {
166
+ var modifyGeometry = modifyFeature.get('modifyGeometry');
167
+ if (modifyGeometry) {
168
+ var point = feature.getGeometry().getCoordinates();
169
+ var geometry = t.source.getFeatures()[0].getGeometry();
170
+ var _getCoordinateAndType2 = getCoordinateAndType(geometry),
171
+ coordinates = _getCoordinateAndType2.coordinates,
172
+ type = _getCoordinateAndType2.type;
173
+ var topRightCorner = getTopRightCorner(coordinates, type);
174
+ var from = (0, _turf.point)(point);
175
+ var to = (0, _turf.point)(topRightCorner);
176
+ var distance = (0, _turf.distance)(from, to, {
177
+ units: 'kilometers'
178
+ });
179
+
180
+ // 限制拖动长度
181
+ if (t.maxDistance && distance && distance * 1000 > t.maxDistance) {
182
+ modifyFeature.setProperties({
183
+ distance: t.maxDistance / 1000
184
+ });
185
+ return defaultStyle(feature);
186
+ }
187
+ modifyFeature.setProperties({
188
+ distance: distance
189
+ });
190
+ var bufferFeature = t.getBufferFeature(t.source.getFeatures()[0], distance);
191
+ modifyGeometry.geometry = bufferFeature.getGeometry();
192
+ }
193
+ });
194
+ return defaultStyle(feature);
195
+ }
196
+ });
197
+ modify.on('modifystart', function (event) {
198
+ event.features.forEach(function (feature) {
199
+ feature.set('modifyGeometry', {
200
+ geometry: feature.getGeometry().clone()
201
+ }, true);
202
+ });
203
+ });
204
+ modify.on('modifyend', function (event) {
205
+ event.features.forEach(function (feature) {
206
+ var modifyGeometry = feature.get('modifyGeometry');
207
+ if (modifyGeometry) {
208
+ feature.setGeometry(modifyGeometry.geometry);
209
+ feature.unset('modifyGeometry', true);
210
+ t.drawFeature = feature;
211
+ var _feature = feature === null || feature === void 0 ? void 0 : feature.clone();
212
+ t.callback(_feature, t.distance * 1000);
213
+ }
214
+ t.isFit && t.fitView(feature);
215
+ });
216
+ });
217
+ _this.map.addInteraction(modify);
218
+ _this.modifyTool = modify;
219
+ });
220
+ _defineProperty(this, "addInteractions", function () {
221
+ var t = _this;
222
+ var draw = new _interaction.Draw(_objectSpread({
223
+ source: _this.source,
224
+ type: _this.drawType
225
+ }, _this.drawType === 'DragBox' ? {
226
+ type: 'Circle',
227
+ // 用于在绘制过程中创建或修改几何对象。这个函数允许开发者自定义绘制逻辑,以满足特定的需求。如果未提供此函数,则使用默认的几何创建逻辑
228
+ geometryFunction: createBox()
229
+ } : {}));
230
+ draw.on('drawstart', function () {
231
+ t.onClear();
232
+ });
233
+ draw.on('drawend', function (event) {
234
+ var distance = 500 / 1000;
235
+ var feature = t.getBufferFeature(event.feature, distance);
236
+ feature.setProperties({
237
+ distance: distance
238
+ });
239
+ t.modifySource.addFeature(feature);
240
+ t.drawFeature = feature;
241
+ var _feature = feature === null || feature === void 0 ? void 0 : feature.clone();
242
+ t.callback(_feature, distance * 1000);
243
+ t.isFit && t.fitView(feature);
244
+ });
245
+ _this.map.addInteraction(draw);
246
+ _this.drawTool = draw;
247
+ });
248
+ _defineProperty(this, "getBufferFeature", function (feature, distance) {
249
+ var coordinates = feature.getGeometry().getCoordinates();
250
+ var g = feature.getGeometry();
251
+ var geometry;
252
+ if (g instanceof _geom.Point) {
253
+ geometry = (0, _turf.point)(coordinates);
254
+ } else if (g instanceof _geom.Polygon) {
255
+ geometry = (0, _turf.polygon)(coordinates);
256
+ } else if (g instanceof _geom.LineString) {
257
+ geometry = (0, _turf.lineString)(coordinates);
258
+ } else if (g instanceof _geom.Circle) {
259
+ var center = g === null || g === void 0 ? void 0 : g.getCenter();
260
+ var radius = g === null || g === void 0 ? void 0 : g.getRadius();
261
+ _this.distance = radius;
262
+ geometry = (0, _turf.circle)(center, radius);
263
+ }
264
+ var buffered = (0, _turf.buffer)(geometry, distance, {
265
+ units: 'kilometers'
266
+ });
267
+ return format.readFeature(buffered);
268
+ });
269
+ _defineProperty(this, "fitView", function (feature) {
270
+ _this.map.getView().fit(feature.getGeometry().getExtent(), {
271
+ padding: [100, 400, 100, 400],
272
+ maxZoom: 18,
273
+ duration: 500
274
+ });
275
+ });
276
+ _defineProperty(this, "onClear", function () {
277
+ _this.source.clear();
278
+ _this.modifySource.clear();
279
+ });
280
+ var _options$isFit = options.isFit,
281
+ isFit = _options$isFit === void 0 ? true : _options$isFit;
282
+ this.map = options.map;
283
+ this.TextEnum = options.TextEnum;
284
+ this.cancelTextLayer = null;
285
+ this.drawTool = null;
286
+ this.modifyTool = null;
287
+ this.drawFeature = null;
288
+ this.distance = 500;
289
+ this.showCancel = options.showCancel;
290
+ this.maxDistance = options.maxDistance;
291
+ this.drawType = options.drawType;
292
+ this.callback = callback;
293
+ this.isFit = isFit;
294
+ this.source = new _source.Vector();
295
+ this.layer = new _layer.Vector({
296
+ source: this.source,
297
+ zIndex: 4,
298
+ style: new _style2.Style({
299
+ fill: new _style2.Fill({
300
+ color: 'rgba(0,128,255, 0.7)'
301
+ }),
302
+ stroke: new _style2.Stroke({
303
+ color: 'rgba(0,128,255, 0.7)',
304
+ width: 2
305
+ }),
306
+ image: new _style2.Circle({
307
+ radius: 6,
308
+ fill: new _style2.Fill({
309
+ // color: '#ffcc33',
310
+ color: '#1890FF'
311
+ }),
312
+ stroke: new _style2.Stroke({
313
+ color: '#FFF',
314
+ width: 2
315
+ })
316
+ })
317
+ })
318
+ });
319
+ this.map.addLayer(this.layer);
320
+ this.modifySource = null;
321
+ this.modifyLayer = null;
322
+ this.modifyInit();
323
+ }
324
+ return _createClass(_default, [{
325
+ key: "removeCancelTextLayer",
326
+ value: function removeCancelTextLayer() {
327
+ if (this.cancelTextLayer) {
328
+ this.map.removeLayer(this.cancelTextLayer);
329
+ this.cancelTextLayer = null;
330
+ }
331
+ }
332
+ }, {
333
+ key: "addCancelTextLayer",
334
+ value: function addCancelTextLayer(topRightCorner) {
335
+ var _this2 = this;
336
+ if (!this.showCancel) {
337
+ return;
338
+ }
339
+ this.removeCancelTextLayer();
340
+
341
+ // 创建文本 Feature
342
+ var cancelTextFeature = new _ol.Feature({
343
+ geometry: new _geom.Point(topRightCorner),
344
+ name: this.TextEnum.cancelBoxSelect
345
+ });
346
+ cancelTextFeature.setId(CANCEL_TEXT_FEATURE_ID);
347
+ cancelTextFeature.onClick = function () {
348
+ _this2.onClear();
349
+ _this2.drawInit();
350
+ _this2.removeCancelTextLayer();
351
+ };
352
+ var style = new _style2.Style({
353
+ geometry: new _geom.Point(topRightCorner),
354
+ text: new _style2.Text({
355
+ text: this.TextEnum.cancelBoxSelect,
356
+ font: '12px Calibri,sans-serif',
357
+ fill: new _style2.Fill({
358
+ color: '#0080FF'
359
+ }),
360
+ backgroundFill: new _style2.Fill({
361
+ color: '#FFF'
362
+ }),
363
+ backgroundStroke: new _style2.Stroke({
364
+ color: '#FFF',
365
+ width: 1
366
+ }),
367
+ padding: [3, 2, 2, 4],
368
+ justify: 'right',
369
+ offsetX: 40,
370
+ offsetY: 24
371
+ })
372
+ });
373
+ cancelTextFeature.setStyle(style);
374
+ this.cancelTextLayer = new _layer.Vector({
375
+ source: new _source.Vector({
376
+ features: [cancelTextFeature]
377
+ })
378
+ });
379
+ this.map.addLayer(this.cancelTextLayer);
380
+ }
381
+ }, {
382
+ key: "removeDrawTool",
383
+ value: function removeDrawTool() {
384
+ this.map.removeInteraction(this.drawTool);
385
+ this.map.removeInteraction(this.modifyTool);
386
+ }
387
+ }, {
388
+ key: "destroy",
389
+ value: function destroy() {
390
+ this.map.removeLayer(this.layer);
391
+ this.map.removeLayer(this.modifyLayer);
392
+ this.removeCancelTextLayer();
393
+ this.removeDrawTool();
394
+ this.drawTool && this.drawTool.setActive(false);
395
+ this.map.hideTip();
396
+ }
397
+ }]);
398
+ }();
399
+ //# sourceMappingURL=BufferDraw.js.map