@vtx/ol-map 1.0.142 → 1.0.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) hide show
  1. package/package.json +3 -2
  2. package/lib/_util/EventEmitter.js +0 -78
  3. package/lib/_util/EventEmitter.js.map +0 -1
  4. package/lib/_util/StyleCache.js +0 -46
  5. package/lib/_util/StyleCache.js.map +0 -1
  6. package/lib/_util/encryptParams.js +0 -60
  7. package/lib/_util/encryptParams.js.map +0 -1
  8. package/lib/_util/filterSpecialCharacters.js +0 -90
  9. package/lib/_util/filterSpecialCharacters.js.map +0 -1
  10. package/lib/_util/getComponentProps.js +0 -14
  11. package/lib/_util/getComponentProps.js.map +0 -1
  12. package/lib/_util/getCookie.js +0 -24
  13. package/lib/_util/getCookie.js.map +0 -1
  14. package/lib/_util/getDefaultMapInfo.js +0 -50
  15. package/lib/_util/getDefaultMapInfo.js.map +0 -1
  16. package/lib/_util/getSystemInfo.js +0 -26
  17. package/lib/_util/getSystemInfo.js.map +0 -1
  18. package/lib/_util/getToken.js +0 -27
  19. package/lib/_util/getToken.js.map +0 -1
  20. package/lib/_util/getUrlParam.js +0 -15
  21. package/lib/_util/getUrlParam.js.map +0 -1
  22. package/lib/_util/http.js +0 -176
  23. package/lib/_util/http.js.map +0 -1
  24. package/lib/_util/isFunction.js +0 -10
  25. package/lib/_util/isFunction.js.map +0 -1
  26. package/lib/_util/isObject.js +0 -10
  27. package/lib/_util/isObject.js.map +0 -1
  28. package/lib/_util/layer.js +0 -152
  29. package/lib/_util/layer.js.map +0 -1
  30. package/lib/_util/mapTool.js +0 -188
  31. package/lib/_util/mapTool.js.map +0 -1
  32. package/lib/_util/projzh/datum/bd-09.js +0 -44
  33. package/lib/_util/projzh/datum/bd-09.js.map +0 -1
  34. package/lib/_util/projzh/datum/gcj-02.js +0 -72
  35. package/lib/_util/projzh/datum/gcj-02.js.map +0 -1
  36. package/lib/_util/projzh/datum/index.js +0 -14
  37. package/lib/_util/projzh/datum/index.js.map +0 -1
  38. package/lib/_util/projzh/index.js +0 -40
  39. package/lib/_util/projzh/index.js.map +0 -1
  40. package/lib/_util/projzh/projection/baidu-mercator.js +0 -74
  41. package/lib/_util/projzh/projection/baidu-mercator.js.map +0 -1
  42. package/lib/_util/projzh/projection/index.js +0 -14
  43. package/lib/_util/projzh/projection/index.js.map +0 -1
  44. package/lib/_util/projzh/projection/spherical-mercator.js +0 -25
  45. package/lib/_util/projzh/projection/spherical-mercator.js.map +0 -1
  46. package/lib/_util/projzh/util.js +0 -27
  47. package/lib/_util/projzh/util.js.map +0 -1
  48. package/lib/_util/search.js +0 -129
  49. package/lib/_util/search.js.map +0 -1
  50. package/lib/_util/setCookie.js +0 -15
  51. package/lib/_util/setCookie.js.map +0 -1
  52. package/lib/_util/stringToFun.js +0 -25
  53. package/lib/_util/stringToFun.js.map +0 -1
  54. package/lib/_util/transform.js +0 -169
  55. package/lib/_util/transform.js.map +0 -1
  56. package/lib/_util/useColSize.js +0 -28
  57. package/lib/_util/useColSize.js.map +0 -1
  58. package/lib/_util/useInterval.js +0 -19
  59. package/lib/_util/useInterval.js.map +0 -1
  60. package/lib/_util/useSet.js +0 -44
  61. package/lib/_util/useSet.js.map +0 -1
  62. package/lib/analysis-layer/index.js +0 -449
  63. package/lib/analysis-layer/index.js.map +0 -1
  64. package/lib/analysis-layer/style/css.js +0 -2
  65. package/lib/analysis-layer/style/css.js.map +0 -1
  66. package/lib/analysis-layer/style/index.js +0 -2
  67. package/lib/analysis-layer/style/index.js.map +0 -1
  68. package/lib/assets/arrow.png +0 -0
  69. package/lib/assets/base-img-1.png +0 -0
  70. package/lib/assets/base-img-2.png +0 -0
  71. package/lib/assets/base-img-3.png +0 -0
  72. package/lib/assets/base-img-4.png +0 -0
  73. package/lib/assets/base-img-5.png +0 -0
  74. package/lib/assets/base-img-6.png +0 -0
  75. package/lib/assets/base-img.png +0 -0
  76. package/lib/assets/bz.png +0 -0
  77. package/lib/assets/img.png +0 -0
  78. package/lib/assets/kz.png +0 -0
  79. package/lib/assets/ll.png +0 -0
  80. package/lib/assets/location.png +0 -0
  81. package/lib/assets/noLocation.png +0 -0
  82. package/lib/assets/people.png +0 -0
  83. package/lib/assets/qd.png +0 -0
  84. package/lib/assets/sw.png +0 -0
  85. package/lib/assets/yl.png +0 -0
  86. package/lib/assets/zd.png +0 -0
  87. package/lib/buffer-draw/BufferDraw.js +0 -398
  88. package/lib/buffer-draw/BufferDraw.js.map +0 -1
  89. package/lib/buffer-draw/index.js +0 -57
  90. package/lib/buffer-draw/index.js.map +0 -1
  91. package/lib/buffer-draw/style/css.js +0 -2
  92. package/lib/buffer-draw/style/css.js.map +0 -1
  93. package/lib/buffer-draw/style/index.js +0 -2
  94. package/lib/buffer-draw/style/index.js.map +0 -1
  95. package/lib/circle/Circle.js +0 -51
  96. package/lib/circle/Circle.js.map +0 -1
  97. package/lib/circle/index.js +0 -65
  98. package/lib/circle/index.js.map +0 -1
  99. package/lib/circle/style/css.js +0 -2
  100. package/lib/circle/style/css.js.map +0 -1
  101. package/lib/circle/style/index.js +0 -2
  102. package/lib/circle/style/index.js.map +0 -1
  103. package/lib/config.js +0 -12
  104. package/lib/config.js.map +0 -1
  105. package/lib/convertCamelToCSS.js +0 -23
  106. package/lib/convertCamelToCSS.js.map +0 -1
  107. package/lib/dom/Dom.js +0 -39
  108. package/lib/dom/Dom.js.map +0 -1
  109. package/lib/dom/index.js +0 -62
  110. package/lib/dom/index.js.map +0 -1
  111. package/lib/dom/style/css.js +0 -2
  112. package/lib/dom/style/css.js.map +0 -1
  113. package/lib/dom/style/index.js +0 -2
  114. package/lib/dom/style/index.js.map +0 -1
  115. package/lib/events/index.js +0 -25
  116. package/lib/events/index.js.map +0 -1
  117. package/lib/feature-draw/FeatureDraw.js +0 -230
  118. package/lib/feature-draw/FeatureDraw.js.map +0 -1
  119. package/lib/feature-draw/index.js +0 -73
  120. package/lib/feature-draw/index.js.map +0 -1
  121. package/lib/feature-draw/style/css.js +0 -2
  122. package/lib/feature-draw/style/css.js.map +0 -1
  123. package/lib/feature-draw/style/index.js +0 -2
  124. package/lib/feature-draw/style/index.js.map +0 -1
  125. package/lib/feature-layer/FeatureLayer.js +0 -1039
  126. package/lib/feature-layer/FeatureLayer.js.map +0 -1
  127. package/lib/feature-layer/MyCluster.js +0 -150
  128. package/lib/feature-layer/MyCluster.js.map +0 -1
  129. package/lib/feature-layer/createFeatureCollection.js +0 -167
  130. package/lib/feature-layer/createFeatureCollection.js.map +0 -1
  131. package/lib/feature-layer/index.js +0 -155
  132. package/lib/feature-layer/index.js.map +0 -1
  133. package/lib/feature-layer/style/css.js +0 -4
  134. package/lib/feature-layer/style/css.js.map +0 -1
  135. package/lib/feature-layer/style/index.css +0 -0
  136. package/lib/feature-layer/style/index.js +0 -4
  137. package/lib/feature-layer/style/index.js.map +0 -1
  138. package/lib/feature-layer/style/index.less +0 -0
  139. package/lib/flow-line-layer/FlowLineLayer.js +0 -197
  140. package/lib/flow-line-layer/FlowLineLayer.js.map +0 -1
  141. package/lib/flow-line-layer/index.js +0 -127
  142. package/lib/flow-line-layer/index.js.map +0 -1
  143. package/lib/flow-line-layer/style/css.js +0 -4
  144. package/lib/flow-line-layer/style/css.js.map +0 -1
  145. package/lib/flow-line-layer/style/index.css +0 -0
  146. package/lib/flow-line-layer/style/index.js +0 -4
  147. package/lib/flow-line-layer/style/index.js.map +0 -1
  148. package/lib/flow-line-layer/style/index.less +0 -0
  149. package/lib/fly-line-layer/FlyLineLayer.js +0 -217
  150. package/lib/fly-line-layer/FlyLineLayer.js.map +0 -1
  151. package/lib/fly-line-layer/index.js +0 -109
  152. package/lib/fly-line-layer/index.js.map +0 -1
  153. package/lib/fly-line-layer/style/css.js +0 -4
  154. package/lib/fly-line-layer/style/css.js.map +0 -1
  155. package/lib/fly-line-layer/style/index.css +0 -0
  156. package/lib/fly-line-layer/style/index.js +0 -4
  157. package/lib/fly-line-layer/style/index.js.map +0 -1
  158. package/lib/fly-line-layer/style/index.less +0 -0
  159. package/lib/group-layer/GroupLayer.js +0 -131
  160. package/lib/group-layer/GroupLayer.js.map +0 -1
  161. package/lib/group-layer/index.js +0 -74
  162. package/lib/group-layer/index.js.map +0 -1
  163. package/lib/group-layer/style/css.js +0 -4
  164. package/lib/group-layer/style/css.js.map +0 -1
  165. package/lib/group-layer/style/index.css +0 -0
  166. package/lib/group-layer/style/index.js +0 -4
  167. package/lib/group-layer/style/index.js.map +0 -1
  168. package/lib/group-layer/style/index.less +0 -0
  169. package/lib/heatmap-layer/HeatmapLayer.js +0 -191
  170. package/lib/heatmap-layer/HeatmapLayer.js.map +0 -1
  171. package/lib/heatmap-layer/index.js +0 -94
  172. package/lib/heatmap-layer/index.js.map +0 -1
  173. package/lib/heatmap-layer/style/css.js +0 -4
  174. package/lib/heatmap-layer/style/css.js.map +0 -1
  175. package/lib/heatmap-layer/style/index.css +0 -0
  176. package/lib/heatmap-layer/style/index.js +0 -4
  177. package/lib/heatmap-layer/style/index.js.map +0 -1
  178. package/lib/heatmap-layer/style/index.less +0 -0
  179. package/lib/high-layer/HighLayer.js +0 -199
  180. package/lib/high-layer/HighLayer.js.map +0 -1
  181. package/lib/high-layer/index.js +0 -45
  182. package/lib/high-layer/index.js.map +0 -1
  183. package/lib/high-layer/style/css.js +0 -2
  184. package/lib/high-layer/style/css.js.map +0 -1
  185. package/lib/high-layer/style/index.js +0 -2
  186. package/lib/high-layer/style/index.js.map +0 -1
  187. package/lib/image-layer/ImageLayer.js +0 -330
  188. package/lib/image-layer/ImageLayer.js.map +0 -1
  189. package/lib/image-layer/ImageTileLayer.js +0 -332
  190. package/lib/image-layer/ImageTileLayer.js.map +0 -1
  191. package/lib/image-layer/index.js +0 -101
  192. package/lib/image-layer/index.js.map +0 -1
  193. package/lib/image-layer/style/css.js +0 -4
  194. package/lib/image-layer/style/css.js.map +0 -1
  195. package/lib/image-layer/style/index.css +0 -0
  196. package/lib/image-layer/style/index.js +0 -4
  197. package/lib/image-layer/style/index.js.map +0 -1
  198. package/lib/image-layer/style/index.less +0 -0
  199. package/lib/index.js +0 -201
  200. package/lib/index.js.map +0 -1
  201. package/lib/legend/index.js +0 -221
  202. package/lib/legend/index.js.map +0 -1
  203. package/lib/legend/style/css.js +0 -8
  204. package/lib/legend/style/css.js.map +0 -1
  205. package/lib/legend/style/index.css +0 -74
  206. package/lib/legend/style/index.js +0 -8
  207. package/lib/legend/style/index.js.map +0 -1
  208. package/lib/legend/style/index.less +0 -73
  209. package/lib/map/Analysis.js +0 -148
  210. package/lib/map/Analysis.js.map +0 -1
  211. package/lib/map/Layers.js +0 -336
  212. package/lib/map/Layers.js.map +0 -1
  213. package/lib/map/Popup.js +0 -371
  214. package/lib/map/Popup.js.map +0 -1
  215. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +0 -163
  216. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +0 -1
  217. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +0 -84
  218. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +0 -1
  219. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +0 -65
  220. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +0 -1
  221. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +0 -84
  222. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +0 -1
  223. package/lib/map/getBaseLayers/index.js +0 -46
  224. package/lib/map/getBaseLayers/index.js.map +0 -1
  225. package/lib/map/index.js +0 -822
  226. package/lib/map/index.js.map +0 -1
  227. package/lib/map/style/css.js +0 -5
  228. package/lib/map/style/css.js.map +0 -1
  229. package/lib/map/style/index.css +0 -171
  230. package/lib/map/style/index.js +0 -5
  231. package/lib/map/style/index.js.map +0 -1
  232. package/lib/map/style/index.less +0 -152
  233. package/lib/map-icon/svg/index.js +0 -81
  234. package/lib/map-icon/svg/index.js.map +0 -1
  235. package/lib/map-icon/svg/tuceng.svg.js +0 -2
  236. package/lib/map-icon/svg/tuceng.svg.js.map +0 -1
  237. package/lib/marker/Marker.js +0 -105
  238. package/lib/marker/Marker.js.map +0 -1
  239. package/lib/marker/index.js +0 -62
  240. package/lib/marker/index.js.map +0 -1
  241. package/lib/marker/style/css.js +0 -2
  242. package/lib/marker/style/css.js.map +0 -1
  243. package/lib/marker/style/index.js +0 -2
  244. package/lib/marker/style/index.js.map +0 -1
  245. package/lib/path-line-layer/PathLineLayer.js +0 -45
  246. package/lib/path-line-layer/PathLineLayer.js.map +0 -1
  247. package/lib/path-line-layer/getPathLineStyles.js +0 -71
  248. package/lib/path-line-layer/getPathLineStyles.js.map +0 -1
  249. package/lib/path-line-layer/index.js +0 -152
  250. package/lib/path-line-layer/index.js.map +0 -1
  251. package/lib/path-line-layer/style/css.js +0 -4
  252. package/lib/path-line-layer/style/css.js.map +0 -1
  253. package/lib/path-line-layer/style/index.css +0 -0
  254. package/lib/path-line-layer/style/index.js +0 -4
  255. package/lib/path-line-layer/style/index.js.map +0 -1
  256. package/lib/path-line-layer/style/index.less +0 -0
  257. package/lib/path-play-back/PathPlayBack.js +0 -668
  258. package/lib/path-play-back/PathPlayBack.js.map +0 -1
  259. package/lib/path-play-back/index.js +0 -75
  260. package/lib/path-play-back/index.js.map +0 -1
  261. package/lib/path-play-back/style/css.js +0 -2
  262. package/lib/path-play-back/style/css.js.map +0 -1
  263. package/lib/path-play-back/style/index.js +0 -2
  264. package/lib/path-play-back/style/index.js.map +0 -1
  265. package/lib/poi-search/Location.js +0 -63
  266. package/lib/poi-search/Location.js.map +0 -1
  267. package/lib/poi-search/PoiList.js +0 -116
  268. package/lib/poi-search/PoiList.js.map +0 -1
  269. package/lib/poi-search/Search.js +0 -208
  270. package/lib/poi-search/Search.js.map +0 -1
  271. package/lib/poi-search/index.js +0 -173
  272. package/lib/poi-search/index.js.map +0 -1
  273. package/lib/poi-search/style/css.js +0 -8
  274. package/lib/poi-search/style/css.js.map +0 -1
  275. package/lib/poi-search/style/index.css +0 -96
  276. package/lib/poi-search/style/index.js +0 -8
  277. package/lib/poi-search/style/index.js.map +0 -1
  278. package/lib/poi-search/style/index.less +0 -97
  279. package/lib/point/Point.js +0 -57
  280. package/lib/point/Point.js.map +0 -1
  281. package/lib/point/index.js +0 -62
  282. package/lib/point/index.js.map +0 -1
  283. package/lib/point/style/css.js +0 -2
  284. package/lib/point/style/css.js.map +0 -1
  285. package/lib/point/style/index.js +0 -2
  286. package/lib/point/style/index.js.map +0 -1
  287. package/lib/polygon/Polygon.js +0 -51
  288. package/lib/polygon/Polygon.js.map +0 -1
  289. package/lib/polygon/index.js +0 -62
  290. package/lib/polygon/index.js.map +0 -1
  291. package/lib/polygon/style/css.js +0 -2
  292. package/lib/polygon/style/css.js.map +0 -1
  293. package/lib/polygon/style/index.js +0 -2
  294. package/lib/polygon/style/index.js.map +0 -1
  295. package/lib/polyline/Polyline.js +0 -51
  296. package/lib/polyline/Polyline.js.map +0 -1
  297. package/lib/polyline/index.js +0 -62
  298. package/lib/polyline/index.js.map +0 -1
  299. package/lib/polyline/style/css.js +0 -2
  300. package/lib/polyline/style/css.js.map +0 -1
  301. package/lib/polyline/style/index.js +0 -2
  302. package/lib/polyline/style/index.js.map +0 -1
  303. package/lib/popup/index.js +0 -203
  304. package/lib/popup/index.js.map +0 -1
  305. package/lib/popup/style/css.js +0 -4
  306. package/lib/popup/style/css.js.map +0 -1
  307. package/lib/popup/style/index.css +0 -131
  308. package/lib/popup/style/index.js +0 -4
  309. package/lib/popup/style/index.js.map +0 -1
  310. package/lib/popup/style/index.less +0 -129
  311. package/lib/provider/index.js +0 -12
  312. package/lib/provider/index.js.map +0 -1
  313. package/lib/provider/style/css.js +0 -2
  314. package/lib/provider/style/css.js.map +0 -1
  315. package/lib/provider/style/index.js +0 -2
  316. package/lib/provider/style/index.js.map +0 -1
  317. package/lib/renderer/Fill.js +0 -37
  318. package/lib/renderer/Fill.js.map +0 -1
  319. package/lib/renderer/Stroke.js +0 -39
  320. package/lib/renderer/Stroke.js.map +0 -1
  321. package/lib/renderer/index.js +0 -138
  322. package/lib/renderer/index.js.map +0 -1
  323. package/lib/renderer/style/css.js +0 -4
  324. package/lib/renderer/style/css.js.map +0 -1
  325. package/lib/renderer/style/index.css +0 -0
  326. package/lib/renderer/style/index.js +0 -4
  327. package/lib/renderer/style/index.js.map +0 -1
  328. package/lib/renderer/style/index.less +0 -0
  329. package/lib/renderer/transformRgb.js +0 -33
  330. package/lib/renderer/transformRgb.js.map +0 -1
  331. package/lib/search-map/VtxModal.js +0 -202
  332. package/lib/search-map/VtxModal.js.map +0 -1
  333. package/lib/search-map/index.js +0 -417
  334. package/lib/search-map/index.js.map +0 -1
  335. package/lib/search-map/style/css.js +0 -6
  336. package/lib/search-map/style/css.js.map +0 -1
  337. package/lib/search-map/style/index.css +0 -73
  338. package/lib/search-map/style/index.js +0 -6
  339. package/lib/search-map/style/index.js.map +0 -1
  340. package/lib/search-map/style/index.less +0 -83
  341. package/lib/search-map/style/modal.css +0 -54
  342. package/lib/search-map/style/modal.less +0 -58
  343. package/lib/style/index.css +0 -0
  344. package/lib/style/index.less +0 -2
  345. package/lib/style/themes/compact.css +0 -0
  346. package/lib/style/themes/compact.less +0 -1
  347. package/lib/style/themes/dark.css +0 -0
  348. package/lib/style/themes/dark.less +0 -9
  349. package/lib/style/themes/default.css +0 -0
  350. package/lib/style/themes/default.less +0 -7
  351. package/lib/style/themes/index.css +0 -0
  352. package/lib/style/themes/index.less +0 -1
  353. package/lib/style/themes/variable.css +0 -0
  354. package/lib/style/themes/variable.less +0 -5
  355. package/lib/tile-layer/TileLayer.js +0 -85
  356. package/lib/tile-layer/TileLayer.js.map +0 -1
  357. package/lib/tile-layer/index.js +0 -53
  358. package/lib/tile-layer/index.js.map +0 -1
  359. package/lib/tile-layer/style/css.js +0 -4
  360. package/lib/tile-layer/style/css.js.map +0 -1
  361. package/lib/tile-layer/style/index.css +0 -0
  362. package/lib/tile-layer/style/index.js +0 -4
  363. package/lib/tile-layer/style/index.js.map +0 -1
  364. package/lib/tile-layer/style/index.less +0 -0
  365. package/lib/tools/Layer/LayerService.js +0 -182
  366. package/lib/tools/Layer/LayerService.js.map +0 -1
  367. package/lib/tools/Layer/LayersCheckService.js +0 -188
  368. package/lib/tools/Layer/LayersCheckService.js.map +0 -1
  369. package/lib/tools/Layer/index.css +0 -50
  370. package/lib/tools/Layer/index.js +0 -226
  371. package/lib/tools/Layer/index.js.map +0 -1
  372. package/lib/tools/Layer/index.less +0 -43
  373. package/lib/tools/Search/index.js +0 -296
  374. package/lib/tools/Search/index.js.map +0 -1
  375. package/lib/tools/Toolbox/BoxSelect/index.js +0 -19
  376. package/lib/tools/Toolbox/BoxSelect/index.js.map +0 -1
  377. package/lib/tools/Toolbox/CircleSelect/index.js +0 -19
  378. package/lib/tools/Toolbox/CircleSelect/index.js.map +0 -1
  379. package/lib/tools/Toolbox/EagleEye/index.js +0 -56
  380. package/lib/tools/Toolbox/EagleEye/index.js.map +0 -1
  381. package/lib/tools/Toolbox/MapBookmark/Bookmark.js +0 -150
  382. package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +0 -1
  383. package/lib/tools/Toolbox/MapBookmark/index.css +0 -18
  384. package/lib/tools/Toolbox/MapBookmark/index.js +0 -429
  385. package/lib/tools/Toolbox/MapBookmark/index.js.map +0 -1
  386. package/lib/tools/Toolbox/MapBookmark/index.less +0 -20
  387. package/lib/tools/Toolbox/MapDownload/index.js +0 -16
  388. package/lib/tools/Toolbox/MapDownload/index.js.map +0 -1
  389. package/lib/tools/Toolbox/MapPrint/index.css +0 -4
  390. package/lib/tools/Toolbox/MapPrint/index.js +0 -233
  391. package/lib/tools/Toolbox/MapPrint/index.js.map +0 -1
  392. package/lib/tools/Toolbox/MapPrint/index.less +0 -4
  393. package/lib/tools/Toolbox/Measure/Area/index.js +0 -16
  394. package/lib/tools/Toolbox/Measure/Area/index.js.map +0 -1
  395. package/lib/tools/Toolbox/Measure/Distance/index.js +0 -16
  396. package/lib/tools/Toolbox/Measure/Distance/index.js.map +0 -1
  397. package/lib/tools/Toolbox/Measure/Measure.js +0 -227
  398. package/lib/tools/Toolbox/Measure/Measure.js.map +0 -1
  399. package/lib/tools/Toolbox/Measure/index.js +0 -76
  400. package/lib/tools/Toolbox/Measure/index.js.map +0 -1
  401. package/lib/tools/Toolbox/PolygonSelect/index.js +0 -19
  402. package/lib/tools/Toolbox/PolygonSelect/index.js.map +0 -1
  403. package/lib/tools/Toolbox/ScaleLine/index.js +0 -58
  404. package/lib/tools/Toolbox/ScaleLine/index.js.map +0 -1
  405. package/lib/tools/Toolbox/SelectTools/index.css +0 -103
  406. package/lib/tools/Toolbox/SelectTools/index.js +0 -777
  407. package/lib/tools/Toolbox/SelectTools/index.js.map +0 -1
  408. package/lib/tools/Toolbox/SelectTools/index.less +0 -87
  409. package/lib/tools/Toolbox/SpaceQuery/index.css +0 -19
  410. package/lib/tools/Toolbox/SpaceQuery/index.js +0 -593
  411. package/lib/tools/Toolbox/SpaceQuery/index.js.map +0 -1
  412. package/lib/tools/Toolbox/SpaceQuery/index.less +0 -16
  413. package/lib/tools/Toolbox/ZoomInput/index.css +0 -6
  414. package/lib/tools/Toolbox/ZoomInput/index.js +0 -49
  415. package/lib/tools/Toolbox/ZoomInput/index.js.map +0 -1
  416. package/lib/tools/Toolbox/ZoomInput/index.less +0 -6
  417. package/lib/tools/Toolbox/index.css +0 -0
  418. package/lib/tools/Toolbox/index.js +0 -170
  419. package/lib/tools/Toolbox/index.js.map +0 -1
  420. package/lib/tools/Toolbox/index.less +0 -2
  421. package/lib/tools/Utils/CreateOverlay.js +0 -46
  422. package/lib/tools/Utils/CreateOverlay.js.map +0 -1
  423. package/lib/tools/Utils/Draw.js +0 -127
  424. package/lib/tools/Utils/Draw.js.map +0 -1
  425. package/lib/tools/Utils/HighLayer.js +0 -211
  426. package/lib/tools/Utils/HighLayer.js.map +0 -1
  427. package/lib/tools/Utils/measure.js +0 -246
  428. package/lib/tools/Utils/measure.js.map +0 -1
  429. package/lib/tools/Utils/utils.js +0 -263
  430. package/lib/tools/Utils/utils.js.map +0 -1
  431. package/lib/tools/View/index.css +0 -35
  432. package/lib/tools/View/index.js +0 -165
  433. package/lib/tools/View/index.js.map +0 -1
  434. package/lib/tools/View/index.less +0 -28
  435. package/lib/tools/analysis-tool/index.js +0 -112
  436. package/lib/tools/analysis-tool/index.js.map +0 -1
  437. package/lib/tools/base-map-switch/index.js +0 -149
  438. package/lib/tools/base-map-switch/index.js.map +0 -1
  439. package/lib/tools/components/Chart/index.js +0 -818
  440. package/lib/tools/components/Chart/index.js.map +0 -1
  441. package/lib/tools/components/Icon/index.js +0 -31
  442. package/lib/tools/components/Icon/index.js.map +0 -1
  443. package/lib/tools/components/Info/index.css +0 -39
  444. package/lib/tools/components/Info/index.js +0 -34
  445. package/lib/tools/components/Info/index.js.map +0 -1
  446. package/lib/tools/components/Info/index.less +0 -26
  447. package/lib/tools/components/ItemWrap/index.css +0 -43
  448. package/lib/tools/components/ItemWrap/index.js +0 -47
  449. package/lib/tools/components/ItemWrap/index.js.map +0 -1
  450. package/lib/tools/components/ItemWrap/index.less +0 -41
  451. package/lib/tools/components/Modal/index.css +0 -42
  452. package/lib/tools/components/Modal/index.js +0 -45
  453. package/lib/tools/components/Modal/index.js.map +0 -1
  454. package/lib/tools/components/Modal/index.less +0 -33
  455. package/lib/tools/components/MyTabs/index.js +0 -22
  456. package/lib/tools/components/MyTabs/index.js.map +0 -1
  457. package/lib/tools/components/RequiredLabel/index.css +0 -5
  458. package/lib/tools/components/RequiredLabel/index.js +0 -32
  459. package/lib/tools/components/RequiredLabel/index.js.map +0 -1
  460. package/lib/tools/components/RequiredLabel/index.less +0 -5
  461. package/lib/tools/components/Select/index.js +0 -32
  462. package/lib/tools/components/Select/index.js.map +0 -1
  463. package/lib/tools/components/Table/assets/tableIcon.png +0 -0
  464. package/lib/tools/components/Table/index.css +0 -10
  465. package/lib/tools/components/Table/index.js +0 -90
  466. package/lib/tools/components/Table/index.js.map +0 -1
  467. package/lib/tools/components/Table/index.less +0 -13
  468. package/lib/tools/components/ToolItem/index.css +0 -30
  469. package/lib/tools/components/ToolItem/index.js +0 -28
  470. package/lib/tools/components/ToolItem/index.js.map +0 -1
  471. package/lib/tools/components/ToolItem/index.less +0 -27
  472. package/lib/tools/components/ToolsSelect/index.css +0 -15
  473. package/lib/tools/components/ToolsSelect/index.js +0 -44
  474. package/lib/tools/components/ToolsSelect/index.js.map +0 -1
  475. package/lib/tools/components/ToolsSelect/index.less +0 -10
  476. package/lib/tools/full-screen/index.js +0 -46
  477. package/lib/tools/full-screen/index.js.map +0 -1
  478. package/lib/tools/index.js +0 -151
  479. package/lib/tools/index.js.map +0 -1
  480. package/lib/tools/layer-control/index.js +0 -170
  481. package/lib/tools/layer-control/index.js.map +0 -1
  482. package/lib/tools/refresh/index.js +0 -40
  483. package/lib/tools/refresh/index.js.map +0 -1
  484. package/lib/tools/style/css.js +0 -22
  485. package/lib/tools/style/css.js.map +0 -1
  486. package/lib/tools/style/index.css +0 -136
  487. package/lib/tools/style/index.js +0 -22
  488. package/lib/tools/style/index.js.map +0 -1
  489. package/lib/tools/style/index.less +0 -154
  490. package/lib/tools-item/index.js +0 -66
  491. package/lib/tools-item/index.js.map +0 -1
  492. package/lib/use-props/index.js +0 -14
  493. package/lib/use-props/index.js.map +0 -1
  494. package/lib/use-props/style/css.js +0 -2
  495. package/lib/use-props/style/css.js.map +0 -1
  496. package/lib/use-props/style/index.js +0 -2
  497. package/lib/use-props/style/index.js.map +0 -1
  498. package/lib/wms-layer/WmsLayer.js +0 -313
  499. package/lib/wms-layer/WmsLayer.js.map +0 -1
  500. package/lib/wms-layer/index.js +0 -98
  501. package/lib/wms-layer/index.js.map +0 -1
  502. package/lib/wms-layer/style/css.js +0 -4
  503. package/lib/wms-layer/style/css.js.map +0 -1
  504. package/lib/wms-layer/style/index.css +0 -0
  505. package/lib/wms-layer/style/index.js +0 -4
  506. package/lib/wms-layer/style/index.js.map +0 -1
  507. package/lib/wms-layer/style/index.less +0 -0
@@ -1,668 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _Feature = _interopRequireDefault(require("ol/Feature"));
8
- var _geom = require("ol/geom");
9
- var _Vector = _interopRequireDefault(require("ol/source/Vector"));
10
- var _style = require("ol/style");
11
- var _layer = require("ol/layer");
12
- var _render = require("ol/render");
13
- var _people = _interopRequireDefault(require("../assets/people.png"));
14
- var _qd = _interopRequireDefault(require("../assets/qd.png"));
15
- var _zd = _interopRequireDefault(require("../assets/zd.png"));
16
- var _lodash = _interopRequireWildcard(require("lodash"));
17
- var _createFeatureCollection = require("../feature-layer/createFeatureCollection");
18
- var _getPathLineStyles = _interopRequireDefault(require("../path-line-layer/getPathLineStyles"));
19
- var _turf = require("@turf/turf");
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
22
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
23
- 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); }
24
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
25
- 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."); }
26
- 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; } }
27
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
28
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
29
- 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; }
30
- 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; }
31
- 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; }
32
- 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; }
33
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
34
- 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); } }
35
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
36
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
37
- 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); }
38
- var getAngle = function getAngle(point1, point2) {
39
- var arc = 0;
40
- if (point2 && point2.length && point1 && point1.length) {
41
- if (point2[0] - point1[0] >= 0 && point2[1] - point1[1] >= 0 || point2[0] - point1[0] < 0 && point2[1] - point1[1] > 0) {
42
- arc = Math.atan((point2[0] - point1[0]) / (point2[1] - point1[1]));
43
- } else if (point2[0] - point1[0] > 0 && point2[1] - point1[1] < 0 || point2[0] - point1[0] < 0 && point2[1] - point1[1] < 0) {
44
- arc = Math.PI + Math.atan((point2[0] - point1[0]) / (point2[1] - point1[1]));
45
- }
46
- }
47
- return arc;
48
- };
49
- var PathPlayBack = exports["default"] = /*#__PURE__*/function () {
50
- function PathPlayBack(options) {
51
- _classCallCheck(this, PathPlayBack);
52
- var data = options.data,
53
- _options$show = options.show,
54
- show = _options$show === void 0 ? true : _options$show,
55
- play = options.play,
56
- speed = options.speed,
57
- map = options.map,
58
- style = options.style,
59
- onPlaying = options.onPlaying,
60
- onPlayEnd = options.onPlayEnd,
61
- _options$repeatPlay = options.repeatPlay,
62
- repeatPlay = _options$repeatPlay === void 0 ? true : _options$repeatPlay,
63
- _options$autoView = options.autoView,
64
- autoView = _options$autoView === void 0 ? false : _options$autoView,
65
- _options$enableRotati = options.enableRotation,
66
- enableRotation = _options$enableRotati === void 0 ? false : _options$enableRotati,
67
- arrowStyle = options.arrowStyle,
68
- showTrace = options.showTrace,
69
- _options$traceStyle = options.traceStyle,
70
- traceStyle = _options$traceStyle === void 0 ? {} : _options$traceStyle,
71
- _options$showStartPoi = options.showStartPoint,
72
- showStartPoint = _options$showStartPoi === void 0 ? true : _options$showStartPoi,
73
- _options$showEndPoint = options.showEndPoint,
74
- showEndPoint = _options$showEndPoint === void 0 ? true : _options$showEndPoint,
75
- _options$zIndex = options.zIndex,
76
- zIndex = _options$zIndex === void 0 ? 10 : _options$zIndex,
77
- isHighlight = options.isHighlight;
78
- this._init = false;
79
- this.speed = speed || 10;
80
- this.onPlaying = onPlaying;
81
- this.onPlayEnd = onPlayEnd;
82
- this.style = style;
83
- this.repeatPlay = repeatPlay;
84
- this.enableRotation = enableRotation;
85
- this.arrowStyle = arrowStyle;
86
- this.showTrace = showTrace;
87
- this.traceStyle = traceStyle;
88
- this.currentIndex = 0;
89
- this._distance = 0;
90
- this._lastTime = Date.now();
91
- this.autoView = autoView;
92
- this.zIndex = zIndex;
93
- this.lastCoordinate = null;
94
- this.distanceRatioArr = [];
95
- this.dataDistanceRatioArr = [];
96
- this.isPlayEnd = false;
97
- this.initRotation = 0;
98
- this.isHighlight = isHighlight;
99
- this.startStyle = new _style.Style({
100
- image: new _style.Icon(_objectSpread({
101
- anchor: [0.5, 1],
102
- src: _qd["default"]
103
- }, (style === null || style === void 0 ? void 0 : style.start) || {}))
104
- });
105
- this.endStyle = new _style.Style({
106
- image: new _style.Icon(_objectSpread({
107
- anchor: [0.5, 1],
108
- src: _zd["default"]
109
- }, (style === null || style === void 0 ? void 0 : style.end) || {}))
110
- });
111
- this.geoMarkerStyle = new _style.Style({
112
- image: new _style.Icon(_objectSpread({
113
- anchor: [0.5, 1],
114
- src: _people["default"]
115
- }, (style === null || style === void 0 ? void 0 : style.geoMarker) || {}))
116
- });
117
- this.map = map;
118
- if (data !== null && data !== void 0 && data.length) {
119
- this.loadData(data);
120
- }
121
- this.play = play || false;
122
- this.show = show;
123
- this.showStartPoint = showStartPoint;
124
- this.showEndPoint = showEndPoint;
125
- this._init = true;
126
- }
127
- return _createClass(PathPlayBack, [{
128
- key: "play",
129
- set: function set(val) {
130
- if (this._init) {
131
- if (val) {
132
- this.startAnimation();
133
- } else {
134
- this.stopAnimation();
135
- }
136
- }
137
- }
138
- }, {
139
- key: "show",
140
- set: function set(val) {
141
- this.vectorLayer.setVisible(val);
142
- if (this._animating) {
143
- this.stopAnimation();
144
- }
145
- }
146
- }, {
147
- key: "showStartPoint",
148
- set: function set(val) {
149
- if (this.vectorLayer) {
150
- var source = this.vectorLayer.getSource();
151
- if (val) {
152
- !source.hasFeature(this.startMarker) && source.addFeature(this.startMarker);
153
- } else {
154
- source.removeFeature(this.startMarker);
155
- }
156
- }
157
- }
158
- }, {
159
- key: "showEndPoint",
160
- set: function set(val) {
161
- if (this.vectorLayer) {
162
- var source = this.vectorLayer.getSource();
163
- if (val) {
164
- !source.hasFeature(this.endMarker) && source.addFeature(this.endMarker);
165
- } else {
166
- source.removeFeature(this.endMarker);
167
- }
168
- }
169
- }
170
- }, {
171
- key: "loadObjectData",
172
- value: function loadObjectData(data) {
173
- var coordinates = [];
174
- var distanceArr = [];
175
- var dataDistanceArr = [];
176
- var routeFeature = data.map(function (item, index) {
177
- var geometryInfo = item.geometryInfo;
178
- var type = geometryInfo.type,
179
- lngLats = geometryInfo.lngLats,
180
- coordType = geometryInfo.coordType;
181
- var lineData = (0, _createFeatureCollection.transformGeometryInfoToWGS84)(lngLats, type, coordType)[0];
182
- coordinates.push.apply(coordinates, _toConsumableArray(lineData));
183
- var line = (0, _turf.lineString)(lineData);
184
- distanceArr.push((0, _turf.length)(line));
185
- var route = new _geom.LineString(lineData);
186
- // 计算两个点的之间距离
187
- lineData.forEach(function (v, i) {
188
- if (i === 0) {
189
- dataDistanceArr[index] = [0];
190
- } else {
191
- var from = (0, _turf.point)(lineData[i - 1]);
192
- var to = (0, _turf.point)(v);
193
- dataDistanceArr[index].push((0, _turf.distance)(from, to));
194
- }
195
- });
196
- return new _Feature["default"](_objectSpread({
197
- type: 'route',
198
- geometry: route
199
- }, item));
200
- });
201
- var dataDistanceRatioArr = dataDistanceArr.map(function (arr) {
202
- var totalDistance = _lodash["default"].sum(arr);
203
- var list = arr.map(function (distance) {
204
- return distance / (totalDistance || 1);
205
- });
206
- // 计算两个点之间距离的占比
207
- return list.map(function (distance, index) {
208
- if (index === 0) {
209
- return distance;
210
- } else if (index === arr.length - 1) {
211
- return 1;
212
- }
213
- return _lodash["default"].sum(list.slice(0, index + 1));
214
- });
215
- });
216
- this.distanceArr = distanceArr;
217
- var totalDistance = _lodash["default"].sum(distanceArr);
218
- distanceArr = distanceArr.map(function (distance) {
219
- return distance / (totalDistance || 1);
220
- });
221
- this.distanceRatioArr = distanceArr.map(function (distance, index) {
222
- if (index === 0) {
223
- return distance;
224
- } else if (index === distanceArr.length - 1) {
225
- return 1;
226
- }
227
- var total = _lodash["default"].sum(distanceArr.slice(0, index + 1));
228
- return total > 1 ? 1 : total;
229
- });
230
- this.dataDistanceRatioArr = dataDistanceRatioArr;
231
- this.route = new _geom.LineString(coordinates);
232
- var firstFeature = routeFeature[0];
233
- var lastFeature = _lodash["default"].last(routeFeature);
234
- var firstGeometry = new _geom.Point(firstFeature.getGeometry().getFirstCoordinate());
235
- var lastGeometry = new _geom.Point(lastFeature.getGeometry().getLastCoordinate());
236
- return {
237
- routeFeature: routeFeature,
238
- firstGeometry: firstGeometry,
239
- lastGeometry: lastGeometry
240
- };
241
- }
242
- }, {
243
- key: "loadArrayData",
244
- value: function loadArrayData(data) {
245
- var route = new _geom.LineString(data);
246
- var distance = (0, _turf.length)((0, _turf.lineString)(data));
247
- this.route = route;
248
- var routeFeature = [new _Feature["default"]({
249
- type: 'route',
250
- geometry: route
251
- })];
252
- this.distanceArr = [distance];
253
- this.distanceRatioArr = [1];
254
- var firstGeometry = new _geom.Point(route.getFirstCoordinate());
255
- var lastGeometry = new _geom.Point(route.getLastCoordinate());
256
- return {
257
- routeFeature: routeFeature,
258
- firstGeometry: firstGeometry,
259
- lastGeometry: lastGeometry
260
- };
261
- }
262
- }, {
263
- key: "getDefaultRouteStyle",
264
- value: function getDefaultRouteStyle(feature) {
265
- var _this$style, _this$style2;
266
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
267
- var style = (0, _lodash.isFunction)((_this$style = this.style) === null || _this$style === void 0 ? void 0 : _this$style.route) ? this.style.route(feature) : ((_this$style2 = this.style) === null || _this$style2 === void 0 ? void 0 : _this$style2.route) || {};
268
- return new _style.Style({
269
- stroke: new _style.Stroke(_objectSpread(_objectSpread({
270
- width: 6,
271
- color: [237, 212, 0, 0.8]
272
- }, style), options))
273
- });
274
- }
275
- }, {
276
- key: "setRouteStyle",
277
- value: function setRouteStyle(features) {
278
- var _this = this;
279
- features.forEach(function (feature) {
280
- feature.setStyle(function (feature, resolution) {
281
- var styles = [_this.getDefaultRouteStyle(feature)];
282
- if (!(0, _lodash.isEmpty)(_this.arrowStyle)) {
283
- styles.push.apply(styles, _toConsumableArray((0, _getPathLineStyles["default"])({
284
- feature: feature,
285
- resolution: resolution,
286
- arrowStyle: _this.arrowStyle
287
- })));
288
- }
289
- return styles;
290
- });
291
- });
292
- }
293
- }, {
294
- key: "loadData",
295
- value: function loadData(data) {
296
- if (this.vectorLayer) {
297
- this.destroy();
298
- }
299
- var routeFeature = null;
300
- var firstGeometry = null;
301
- var lastGeometry = null;
302
- if ((0, _lodash.isArray)(data[0])) {
303
- var _this$loadArrayData = this.loadArrayData(data);
304
- routeFeature = _this$loadArrayData.routeFeature;
305
- firstGeometry = _this$loadArrayData.firstGeometry;
306
- lastGeometry = _this$loadArrayData.lastGeometry;
307
- } else {
308
- var _this$loadObjectData = this.loadObjectData(data);
309
- routeFeature = _this$loadObjectData.routeFeature;
310
- firstGeometry = _this$loadObjectData.firstGeometry;
311
- lastGeometry = _this$loadObjectData.lastGeometry;
312
- }
313
- var startMarker = new _Feature["default"]({
314
- type: 'start',
315
- geometry: firstGeometry
316
- });
317
- startMarker.setStyle(this.startStyle);
318
- var endMarker = new _Feature["default"]({
319
- type: 'end',
320
- geometry: lastGeometry
321
- });
322
- endMarker.setStyle(this.endStyle);
323
- var position = startMarker.getGeometry().clone();
324
- var geoMarker = new _Feature["default"]({
325
- type: 'geoMarker',
326
- geometry: position,
327
- id: 'geoMarker'
328
- });
329
- if (this.isHighlight) {
330
- this.map.setHighlightFeature(geoMarker, {
331
- autoView: false
332
- });
333
- }
334
- geoMarker.setStyle(this.geoMarkerStyle);
335
- this.setRouteStyle(routeFeature);
336
- var vectorLayer = new _layer.Vector({
337
- source: new _Vector["default"]({
338
- features: [].concat(_toConsumableArray(routeFeature), [geoMarker])
339
- }),
340
- zIndex: this.zIndex
341
- });
342
- this.map.addLayer(vectorLayer);
343
- this.routeFeatures = routeFeature;
344
- this.position = position;
345
- this.vectorLayer = vectorLayer;
346
- this.geoMarker = geoMarker;
347
- this.startMarker = startMarker;
348
- this.endMarker = endMarker;
349
- if (!vectorLayer.getSource().hasFeature(startMarker)) {
350
- vectorLayer.getSource().addFeature(startMarker);
351
- }
352
- if (!vectorLayer.getSource().hasFeature(endMarker)) {
353
- vectorLayer.getSource().addFeature(endMarker);
354
- }
355
- if (this.showTrace) {
356
- this.addTrace();
357
- }
358
- }
359
- }, {
360
- key: "changeProcess",
361
- value: function changeProcess(process) {
362
- var _this2 = this;
363
- this._distance = process;
364
- var distance = this.calculateDistance();
365
- var route = this.routeFeatures[this.currentIndex].getGeometry();
366
- var currentCoordinate = route.getCoordinateAt(distance > 1 ? 2 - distance : distance);
367
- if (distance > 0) {
368
- var lastCoordinate = route.getCoordinateAt(distance - 0.0001);
369
- this.setRotation(lastCoordinate, currentCoordinate);
370
- } else {
371
- var nextCoordinate = route.getCoordinateAt(0.0000001);
372
- if ((0, _lodash.isEqual)(currentCoordinate, nextCoordinate)) {
373
- if (this.currentIndex === this.routeFeatures.length - 1) {
374
- var lastRoute = this.routeFeatures[this.currentIndex - 1].getGeometry();
375
- var _lastCoordinate = lastRoute.getCoordinateAt(1 - 0.0001);
376
- this.setRotation(_lastCoordinate, currentCoordinate);
377
- } else {
378
- var nextRoute = this.routeFeatures[this.currentIndex + 1].getGeometry();
379
- var _nextCoordinate = nextRoute.getCoordinateAt(0.0001);
380
- this.setRotation(currentCoordinate, _nextCoordinate);
381
- }
382
- } else {
383
- this.setRotation(currentCoordinate, nextCoordinate);
384
- }
385
- }
386
- if (distance >= 1 && this.currentIndex >= this.routeFeatures.length - 1) {
387
- this.isPlayEnd = true;
388
- this.playEnd();
389
- return;
390
- }
391
- this.position.setCoordinates(currentCoordinate);
392
- if (this.showTrace) {
393
- var list = [];
394
- var getCoordinates = function getCoordinates(_ref) {
395
- var startCoordinates = _ref.startCoordinates,
396
- endCoordinates = _ref.endCoordinates,
397
- lineCoordinates = _ref.lineCoordinates;
398
- var start = (0, _turf.point)(startCoordinates);
399
- var end = (0, _turf.point)(endCoordinates);
400
- var line = (0, _turf.lineString)(lineCoordinates);
401
- var sliced = (0, _turf.lineSlice)(start, end, line);
402
- return sliced.geometry.coordinates;
403
- };
404
- if (this.currentIndex === 0) {
405
- list.push(getCoordinates({
406
- startCoordinates: this.startMarker.getGeometry().getCoordinates(),
407
- endCoordinates: currentCoordinate,
408
- lineCoordinates: route.getCoordinates()
409
- }));
410
- } else {
411
- var features = this.routeFeatures.slice(0, this.currentIndex + 1);
412
- features.forEach(function (feature, index) {
413
- var geometry = feature.getGeometry();
414
- var endCoordinates = currentCoordinate;
415
- if (index !== _this2.currentIndex) {
416
- endCoordinates = geometry.getLastCoordinate();
417
- }
418
- list.push(getCoordinates({
419
- startCoordinates: geometry.getFirstCoordinate(),
420
- endCoordinates: endCoordinates,
421
- lineCoordinates: geometry.getCoordinates()
422
- }));
423
- });
424
- }
425
- list.forEach(function (coordinates, index) {
426
- coordinates.forEach(function (coordinate, i) {
427
- _this2.setPaintLinePath({
428
- coordinate: coordinate,
429
- init: i === 0,
430
- index: index
431
- });
432
- });
433
- });
434
- }
435
- return distance;
436
- }
437
- }, {
438
- key: "moveToIndex",
439
- value: function moveToIndex(index, dataIndex) {
440
- var process = 0;
441
- if (this.dataDistanceRatioArr[index][dataIndex] === 1) {
442
- process = this.distanceRatioArr[index];
443
- } else {
444
- process = index === 0 ? this.dataDistanceRatioArr[index][dataIndex] : (this.distanceRatioArr[index] - this.distanceRatioArr[index - 1]) * this.dataDistanceRatioArr[index][dataIndex] + this.distanceRatioArr[index - 1];
445
- }
446
- this.currentIndex = index;
447
- this.changeProcess(process);
448
- this.onPlaying && this.onPlaying(process, index, dataIndex);
449
- }
450
- }, {
451
- key: "moveTo",
452
- value: function moveTo(process) {
453
- this.currentIndex = this.distanceRatioArr.findIndex(function (distance) {
454
- return distance >= process;
455
- });
456
- var distance = this.changeProcess(process);
457
- // 计算当前进度的对应index
458
- var dataIndex = (this.dataDistanceRatioArr[this.currentIndex] || []).findIndex(function (v, index, arr) {
459
- if (index === arr.length - 1) {
460
- return true;
461
- }
462
- return v <= distance <= arr[index + 1];
463
- });
464
- this.onPlaying && this.onPlaying(this._distance, this.currentIndex, dataIndex);
465
- }
466
- }, {
467
- key: "playEnd",
468
- value: function playEnd() {
469
- var _this3 = this;
470
- if (!this.repeatPlay) {
471
- this.stopAnimation();
472
- }
473
- this.isPlayEnd = true;
474
- if (this.showTrace) {
475
- this.lineDashFeatures.forEach(function (feature) {
476
- _this3.vectorLayer.getSource().removeFeature(feature);
477
- });
478
- this.paintLineFeatures.forEach(function (feature) {
479
- _this3.vectorLayer.getSource().removeFeature(feature);
480
- feature.setGeometry(null);
481
- });
482
- this.setRouteStyle(this.routeFeatures);
483
- }
484
- }
485
- }, {
486
- key: "setRotation",
487
- value: function setRotation(lastCoordinate, coordinate) {
488
- if (lastCoordinate && coordinate && this.enableRotation) {
489
- this.geoMarkerStyle.getImage().setRotation(getAngle(lastCoordinate, coordinate));
490
- }
491
- }
492
-
493
- // 计算当前路段跑的距离,计算公式:(当前跑的总距离 - 已跑路段的总距离) / 当前路段的百分比
494
- }, {
495
- key: "calculateDistance",
496
- value: function calculateDistance() {
497
- var currentRouteRatio = this.currentIndex > 0 ? this.distanceRatioArr[this.currentIndex] - this.distanceRatioArr[this.currentIndex - 1] : this.distanceRatioArr[this.currentIndex];
498
- if (currentRouteRatio === 0) {
499
- return 1.001;
500
- }
501
- var distance = (this._distance - (this.currentIndex > 0 ? this.distanceRatioArr[this.currentIndex - 1] : 0)) / currentRouteRatio;
502
- return distance;
503
- }
504
- }, {
505
- key: "moveFeature",
506
- value: function moveFeature(event) {
507
- var vectorContext = (0, _render.getVectorContext)(event);
508
- var speed = Number(this.speed);
509
- var time = event.frameState.time;
510
- var elapsedTime = time - this._lastTime;
511
- this._distance = (this._distance + speed * elapsedTime / 1e6) % 2;
512
- var distance = this.calculateDistance();
513
- this._lastTime = time;
514
- if (distance > 1) {
515
- this.currentIndex = this.currentIndex + 1;
516
- distance = 0;
517
- }
518
- if (this.currentIndex > this.routeFeatures.length - 1) {
519
- this.playEnd();
520
- if (this.repeatPlay) {
521
- this.currentIndex = this.routeFeatures.length - 1;
522
- } else {
523
- var _currentCoordinate = this.endMarker.getGeometry().getCoordinates();
524
- this.position.setCoordinates(_currentCoordinate);
525
- vectorContext.setStyle(this.geoMarkerStyle);
526
- vectorContext.drawGeometry(this.position);
527
- this.onPlayEnd && this.onPlayEnd();
528
- return;
529
- }
530
- }
531
- // 计算当前进度的对应index
532
- var dataIndex = (this.dataDistanceRatioArr[this.currentIndex] || []).findIndex(function (v, index, arr) {
533
- if (index === arr.length - 1) {
534
- return true;
535
- }
536
- return v <= distance <= arr[index + 1];
537
- });
538
- var route = this.routeFeatures[this.currentIndex].getGeometry();
539
- var currentCoordinate = route.getCoordinateAt(distance > 1 ? 2 - distance : distance);
540
- this.position.setCoordinates(currentCoordinate);
541
- this.setRotation(this.lastCoordinate, currentCoordinate);
542
- this.lastCoordinate = currentCoordinate;
543
- if (this.autoView) {
544
- this.map.getView().fit(this.position, {
545
- padding: [100, 400, 100, 400],
546
- maxZoom: this.map.getView().getZoom(),
547
- duration: 0
548
- });
549
- }
550
- vectorContext.setStyle(this.geoMarkerStyle);
551
- vectorContext.drawGeometry(this.position);
552
- var overlay = this.map.getOverlayById('geoMarker');
553
- if (overlay) {
554
- overlay.setPosition(this.position.getFlatCoordinates());
555
- }
556
- if (this.showTrace) {
557
- this.setPaintLinePath({
558
- coordinate: currentCoordinate,
559
- index: this.currentIndex
560
- });
561
- }
562
- this.onPlaying && this.onPlaying(this._distance > 1 ? 1 : this._distance, this.currentIndex, dataIndex);
563
- this.map.render();
564
- }
565
- }, {
566
- key: "setPaintLinePath",
567
- value: function setPaintLinePath(_ref2) {
568
- var coordinate = _ref2.coordinate,
569
- init = _ref2.init,
570
- index = _ref2.index;
571
- var paintLineFeature = this.paintLineFeatures[index];
572
- if (init) {
573
- paintLineFeature.setGeometry(null);
574
- }
575
- var geometry = paintLineFeature.getGeometry();
576
- if (geometry) {
577
- geometry.setCoordinates([[].concat(_toConsumableArray(geometry.getCoordinates()[0]), [coordinate])]);
578
- } else {
579
- var lineData = [[coordinate]];
580
- var route = new _geom.MultiLineString(lineData);
581
- paintLineFeature.setGeometry(route);
582
- }
583
- if (!this.vectorLayer.getSource().hasFeature(paintLineFeature)) {
584
- this.vectorLayer.getSource().addFeature(paintLineFeature);
585
- }
586
- }
587
- }, {
588
- key: "addTrace",
589
- value: function addTrace() {
590
- var _this4 = this;
591
- if (this._distance === 0) {
592
- var lineDashFeatures = [];
593
- var paintLineFeatures = [];
594
- this.routeFeatures.forEach(function (feature) {
595
- var lineDashFeature = feature.clone();
596
- var paintLineFeature = feature.clone();
597
- paintLineFeature.setGeometry(null);
598
- lineDashFeature.setStyle(_this4.getDefaultRouteStyle(feature, {
599
- lineDash: [15]
600
- }));
601
- lineDashFeatures.push(lineDashFeature);
602
- paintLineFeatures.push(paintLineFeature);
603
- });
604
- this.lineDashFeatures = lineDashFeatures;
605
- this.paintLineFeatures = paintLineFeatures;
606
- }
607
- }
608
- }, {
609
- key: "startAnimation",
610
- value: function startAnimation() {
611
- var _this5 = this;
612
- if (!this.repeatPlay && this.isPlayEnd) {
613
- // 当不重复播放,且当前在终点时,从起点开始播放
614
- this.cancel();
615
- this.geoMarkerStyle.getImage().setRotation(0);
616
- }
617
- this.isPlayEnd = false;
618
- this._animating = true;
619
- this._lastTime = Date.now();
620
- this._on_event = this.vectorLayer.on('postrender', this.moveFeature.bind(this));
621
- this.geoMarker.setGeometry(null);
622
- if (this.showTrace) {
623
- this.lineDashFeatures.forEach(function (feature) {
624
- if (!_this5.vectorLayer.getSource().hasFeature(feature)) {
625
- _this5.vectorLayer.getSource().addFeature(feature);
626
- }
627
- });
628
- this.routeFeatures.forEach(function (feature) {
629
- feature.setStyle(new _style.Style({}));
630
- });
631
- }
632
- }
633
- }, {
634
- key: "stopAnimation",
635
- value: function stopAnimation() {
636
- this._animating = false;
637
- this.geoMarker.setGeometry(this.position);
638
- if (this._on_event) {
639
- this.vectorLayer.un('postrender', this._on_event.listener);
640
- }
641
- }
642
- }, {
643
- key: "cancel",
644
- value: function cancel() {
645
- this.geoMarkerStyle.getImage().setRotation(0);
646
- this._distance = 0;
647
- this.currentIndex = 0;
648
- var currentCoordinate = this.route.getCoordinateAt(0);
649
- this.position.setCoordinates(currentCoordinate);
650
- this.playEnd();
651
- this.onPlaying && this.onPlaying(this._distance, this.currentIndex, 0);
652
- }
653
- }, {
654
- key: "destroy",
655
- value: function destroy() {
656
- if (this._animating) {
657
- this.stopAnimation();
658
- }
659
- this.map.removeLayer(this.vectorLayer);
660
- this.map.clearHighlightFeature();
661
- this.routeFeatures = null;
662
- this.position = null;
663
- this.vectorLayer = null;
664
- this.geoMarker = null;
665
- }
666
- }]);
667
- }();
668
- //# sourceMappingURL=PathPlayBack.js.map