@vtx/ol-map 1.0.144 → 1.0.145

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 (511) 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/getUrlParam.js +15 -0
  20. package/lib/_util/getUrlParam.js.map +1 -0
  21. package/lib/_util/http.js +176 -0
  22. package/lib/_util/http.js.map +1 -0
  23. package/lib/_util/isFunction.js +10 -0
  24. package/lib/_util/isFunction.js.map +1 -0
  25. package/lib/_util/isObject.js +10 -0
  26. package/lib/_util/isObject.js.map +1 -0
  27. package/lib/_util/layer.js +152 -0
  28. package/lib/_util/layer.js.map +1 -0
  29. package/lib/_util/mapTool.js +188 -0
  30. package/lib/_util/mapTool.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 +130 -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 +449 -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/assets/arrow.png +0 -0
  68. package/lib/assets/base-img-1.png +0 -0
  69. package/lib/assets/base-img-2.png +0 -0
  70. package/lib/assets/base-img-3.png +0 -0
  71. package/lib/assets/base-img-4.png +0 -0
  72. package/lib/assets/base-img-5.png +0 -0
  73. package/lib/assets/base-img-6.png +0 -0
  74. package/lib/assets/base-img.png +0 -0
  75. package/lib/assets/bz.png +0 -0
  76. package/lib/assets/img.png +0 -0
  77. package/lib/assets/kz.png +0 -0
  78. package/lib/assets/ll.png +0 -0
  79. package/lib/assets/location.png +0 -0
  80. package/lib/assets/noLocation.png +0 -0
  81. package/lib/assets/people.png +0 -0
  82. package/lib/assets/qd.png +0 -0
  83. package/lib/assets/sw.png +0 -0
  84. package/lib/assets/yl.png +0 -0
  85. package/lib/assets/zd.png +0 -0
  86. package/lib/buffer-draw/BufferDraw.js +398 -0
  87. package/lib/buffer-draw/BufferDraw.js.map +1 -0
  88. package/lib/buffer-draw/index.js +56 -0
  89. package/lib/buffer-draw/index.js.map +1 -0
  90. package/lib/buffer-draw/style/css.js +2 -0
  91. package/lib/buffer-draw/style/css.js.map +1 -0
  92. package/lib/buffer-draw/style/index.js +2 -0
  93. package/lib/buffer-draw/style/index.js.map +1 -0
  94. package/lib/circle/Circle.js +51 -0
  95. package/lib/circle/Circle.js.map +1 -0
  96. package/lib/circle/index.js +64 -0
  97. package/lib/circle/index.js.map +1 -0
  98. package/lib/circle/style/css.js +2 -0
  99. package/lib/circle/style/css.js.map +1 -0
  100. package/lib/circle/style/index.js +2 -0
  101. package/lib/circle/style/index.js.map +1 -0
  102. package/lib/config.js +12 -0
  103. package/lib/config.js.map +1 -0
  104. package/lib/convertCamelToCSS.js +23 -0
  105. package/lib/convertCamelToCSS.js.map +1 -0
  106. package/lib/dom/Dom.js +39 -0
  107. package/lib/dom/Dom.js.map +1 -0
  108. package/lib/dom/index.js +61 -0
  109. package/lib/dom/index.js.map +1 -0
  110. package/lib/dom/style/css.js +2 -0
  111. package/lib/dom/style/css.js.map +1 -0
  112. package/lib/dom/style/index.js +2 -0
  113. package/lib/dom/style/index.js.map +1 -0
  114. package/lib/events/index.js +25 -0
  115. package/lib/events/index.js.map +1 -0
  116. package/lib/feature-draw/FeatureDraw.js +230 -0
  117. package/lib/feature-draw/FeatureDraw.js.map +1 -0
  118. package/lib/feature-draw/index.js +73 -0
  119. package/lib/feature-draw/index.js.map +1 -0
  120. package/lib/feature-draw/style/css.js +2 -0
  121. package/lib/feature-draw/style/css.js.map +1 -0
  122. package/lib/feature-draw/style/index.js +2 -0
  123. package/lib/feature-draw/style/index.js.map +1 -0
  124. package/lib/feature-layer/FeatureLayer.js +1039 -0
  125. package/lib/feature-layer/FeatureLayer.js.map +1 -0
  126. package/lib/feature-layer/MyCluster.js +150 -0
  127. package/lib/feature-layer/MyCluster.js.map +1 -0
  128. package/lib/feature-layer/createFeatureCollection.js +167 -0
  129. package/lib/feature-layer/createFeatureCollection.js.map +1 -0
  130. package/lib/feature-layer/index.js +154 -0
  131. package/lib/feature-layer/index.js.map +1 -0
  132. package/lib/feature-layer/style/css.js +4 -0
  133. package/lib/feature-layer/style/css.js.map +1 -0
  134. package/lib/feature-layer/style/index.css +0 -0
  135. package/lib/feature-layer/style/index.js +4 -0
  136. package/lib/feature-layer/style/index.js.map +1 -0
  137. package/lib/feature-layer/style/index.less +0 -0
  138. package/lib/flow-line-layer/FlowLineLayer.js +197 -0
  139. package/lib/flow-line-layer/FlowLineLayer.js.map +1 -0
  140. package/lib/flow-line-layer/index.js +126 -0
  141. package/lib/flow-line-layer/index.js.map +1 -0
  142. package/lib/flow-line-layer/style/css.js +4 -0
  143. package/lib/flow-line-layer/style/css.js.map +1 -0
  144. package/lib/flow-line-layer/style/index.css +0 -0
  145. package/lib/flow-line-layer/style/index.js +4 -0
  146. package/lib/flow-line-layer/style/index.js.map +1 -0
  147. package/lib/flow-line-layer/style/index.less +0 -0
  148. package/lib/fly-line-layer/FlyLineLayer.js +217 -0
  149. package/lib/fly-line-layer/FlyLineLayer.js.map +1 -0
  150. package/lib/fly-line-layer/index.js +108 -0
  151. package/lib/fly-line-layer/index.js.map +1 -0
  152. package/lib/fly-line-layer/style/css.js +4 -0
  153. package/lib/fly-line-layer/style/css.js.map +1 -0
  154. package/lib/fly-line-layer/style/index.css +0 -0
  155. package/lib/fly-line-layer/style/index.js +4 -0
  156. package/lib/fly-line-layer/style/index.js.map +1 -0
  157. package/lib/fly-line-layer/style/index.less +0 -0
  158. package/lib/group-layer/GroupLayer.js +132 -0
  159. package/lib/group-layer/GroupLayer.js.map +1 -0
  160. package/lib/group-layer/index.js +73 -0
  161. package/lib/group-layer/index.js.map +1 -0
  162. package/lib/group-layer/style/css.js +4 -0
  163. package/lib/group-layer/style/css.js.map +1 -0
  164. package/lib/group-layer/style/index.css +0 -0
  165. package/lib/group-layer/style/index.js +4 -0
  166. package/lib/group-layer/style/index.js.map +1 -0
  167. package/lib/group-layer/style/index.less +0 -0
  168. package/lib/heatmap-layer/HeatmapLayer.js +191 -0
  169. package/lib/heatmap-layer/HeatmapLayer.js.map +1 -0
  170. package/lib/heatmap-layer/index.js +93 -0
  171. package/lib/heatmap-layer/index.js.map +1 -0
  172. package/lib/heatmap-layer/style/css.js +4 -0
  173. package/lib/heatmap-layer/style/css.js.map +1 -0
  174. package/lib/heatmap-layer/style/index.css +0 -0
  175. package/lib/heatmap-layer/style/index.js +4 -0
  176. package/lib/heatmap-layer/style/index.js.map +1 -0
  177. package/lib/heatmap-layer/style/index.less +0 -0
  178. package/lib/high-layer/HighLayer.js +199 -0
  179. package/lib/high-layer/HighLayer.js.map +1 -0
  180. package/lib/high-layer/index.js +44 -0
  181. package/lib/high-layer/index.js.map +1 -0
  182. package/lib/high-layer/style/css.js +2 -0
  183. package/lib/high-layer/style/css.js.map +1 -0
  184. package/lib/high-layer/style/index.js +2 -0
  185. package/lib/high-layer/style/index.js.map +1 -0
  186. package/lib/image-layer/ImageLayer.js +330 -0
  187. package/lib/image-layer/ImageLayer.js.map +1 -0
  188. package/lib/image-layer/ImageTileLayer.js +332 -0
  189. package/lib/image-layer/ImageTileLayer.js.map +1 -0
  190. package/lib/image-layer/index.js +100 -0
  191. package/lib/image-layer/index.js.map +1 -0
  192. package/lib/image-layer/style/css.js +4 -0
  193. package/lib/image-layer/style/css.js.map +1 -0
  194. package/lib/image-layer/style/index.css +0 -0
  195. package/lib/image-layer/style/index.js +4 -0
  196. package/lib/image-layer/style/index.js.map +1 -0
  197. package/lib/image-layer/style/index.less +0 -0
  198. package/lib/index.js +201 -0
  199. package/lib/index.js.map +1 -0
  200. package/lib/legend/index.js +220 -0
  201. package/lib/legend/index.js.map +1 -0
  202. package/lib/legend/style/css.js +8 -0
  203. package/lib/legend/style/css.js.map +1 -0
  204. package/lib/legend/style/index.css +74 -0
  205. package/lib/legend/style/index.js +8 -0
  206. package/lib/legend/style/index.js.map +1 -0
  207. package/lib/legend/style/index.less +73 -0
  208. package/lib/map/Analysis.js +148 -0
  209. package/lib/map/Analysis.js.map +1 -0
  210. package/lib/map/Layers.js +337 -0
  211. package/lib/map/Layers.js.map +1 -0
  212. package/lib/map/Popup.js +370 -0
  213. package/lib/map/Popup.js.map +1 -0
  214. package/lib/map/ScaleDenominator.js +68 -0
  215. package/lib/map/ScaleDenominator.js.map +1 -0
  216. package/lib/map/Test.js +144 -0
  217. package/lib/map/Test.js.map +1 -0
  218. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +163 -0
  219. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -0
  220. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +84 -0
  221. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -0
  222. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +65 -0
  223. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -0
  224. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +84 -0
  225. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -0
  226. package/lib/map/getBaseLayers/index.js +46 -0
  227. package/lib/map/getBaseLayers/index.js.map +1 -0
  228. package/lib/map/index.js +819 -0
  229. package/lib/map/index.js.map +1 -0
  230. package/lib/map/style/css.js +5 -0
  231. package/lib/map/style/css.js.map +1 -0
  232. package/lib/map/style/index.css +171 -0
  233. package/lib/map/style/index.js +5 -0
  234. package/lib/map/style/index.js.map +1 -0
  235. package/lib/map/style/index.less +152 -0
  236. package/lib/map-icon/svg/index.js +81 -0
  237. package/lib/map-icon/svg/index.js.map +1 -0
  238. package/lib/map-icon/svg/tuceng.svg.js +2 -0
  239. package/lib/map-icon/svg/tuceng.svg.js.map +1 -0
  240. package/lib/marker/Marker.js +105 -0
  241. package/lib/marker/Marker.js.map +1 -0
  242. package/lib/marker/index.js +61 -0
  243. package/lib/marker/index.js.map +1 -0
  244. package/lib/marker/style/css.js +2 -0
  245. package/lib/marker/style/css.js.map +1 -0
  246. package/lib/marker/style/index.js +2 -0
  247. package/lib/marker/style/index.js.map +1 -0
  248. package/lib/path-line-layer/PathLineLayer.js +45 -0
  249. package/lib/path-line-layer/PathLineLayer.js.map +1 -0
  250. package/lib/path-line-layer/getPathLineStyles.js +71 -0
  251. package/lib/path-line-layer/getPathLineStyles.js.map +1 -0
  252. package/lib/path-line-layer/index.js +151 -0
  253. package/lib/path-line-layer/index.js.map +1 -0
  254. package/lib/path-line-layer/style/css.js +4 -0
  255. package/lib/path-line-layer/style/css.js.map +1 -0
  256. package/lib/path-line-layer/style/index.css +0 -0
  257. package/lib/path-line-layer/style/index.js +4 -0
  258. package/lib/path-line-layer/style/index.js.map +1 -0
  259. package/lib/path-line-layer/style/index.less +0 -0
  260. package/lib/path-play-back/PathPlayBack.js +674 -0
  261. package/lib/path-play-back/PathPlayBack.js.map +1 -0
  262. package/lib/path-play-back/index.js +75 -0
  263. package/lib/path-play-back/index.js.map +1 -0
  264. package/lib/path-play-back/style/css.js +2 -0
  265. package/lib/path-play-back/style/css.js.map +1 -0
  266. package/lib/path-play-back/style/index.js +2 -0
  267. package/lib/path-play-back/style/index.js.map +1 -0
  268. package/lib/poi-search/Location.js +62 -0
  269. package/lib/poi-search/Location.js.map +1 -0
  270. package/lib/poi-search/PoiList.js +115 -0
  271. package/lib/poi-search/PoiList.js.map +1 -0
  272. package/lib/poi-search/Search.js +207 -0
  273. package/lib/poi-search/Search.js.map +1 -0
  274. package/lib/poi-search/index.js +172 -0
  275. package/lib/poi-search/index.js.map +1 -0
  276. package/lib/poi-search/style/css.js +8 -0
  277. package/lib/poi-search/style/css.js.map +1 -0
  278. package/lib/poi-search/style/index.css +96 -0
  279. package/lib/poi-search/style/index.js +8 -0
  280. package/lib/poi-search/style/index.js.map +1 -0
  281. package/lib/poi-search/style/index.less +97 -0
  282. package/lib/point/Point.js +57 -0
  283. package/lib/point/Point.js.map +1 -0
  284. package/lib/point/index.js +61 -0
  285. package/lib/point/index.js.map +1 -0
  286. package/lib/point/style/css.js +2 -0
  287. package/lib/point/style/css.js.map +1 -0
  288. package/lib/point/style/index.js +2 -0
  289. package/lib/point/style/index.js.map +1 -0
  290. package/lib/polygon/Polygon.js +51 -0
  291. package/lib/polygon/Polygon.js.map +1 -0
  292. package/lib/polygon/index.js +61 -0
  293. package/lib/polygon/index.js.map +1 -0
  294. package/lib/polygon/style/css.js +2 -0
  295. package/lib/polygon/style/css.js.map +1 -0
  296. package/lib/polygon/style/index.js +2 -0
  297. package/lib/polygon/style/index.js.map +1 -0
  298. package/lib/polyline/Polyline.js +51 -0
  299. package/lib/polyline/Polyline.js.map +1 -0
  300. package/lib/polyline/index.js +61 -0
  301. package/lib/polyline/index.js.map +1 -0
  302. package/lib/polyline/style/css.js +2 -0
  303. package/lib/polyline/style/css.js.map +1 -0
  304. package/lib/polyline/style/index.js +2 -0
  305. package/lib/polyline/style/index.js.map +1 -0
  306. package/lib/popup/index.js +202 -0
  307. package/lib/popup/index.js.map +1 -0
  308. package/lib/popup/style/css.js +4 -0
  309. package/lib/popup/style/css.js.map +1 -0
  310. package/lib/popup/style/index.css +131 -0
  311. package/lib/popup/style/index.js +4 -0
  312. package/lib/popup/style/index.js.map +1 -0
  313. package/lib/popup/style/index.less +129 -0
  314. package/lib/provider/index.js +12 -0
  315. package/lib/provider/index.js.map +1 -0
  316. package/lib/provider/style/css.js +2 -0
  317. package/lib/provider/style/css.js.map +1 -0
  318. package/lib/provider/style/index.js +2 -0
  319. package/lib/provider/style/index.js.map +1 -0
  320. package/lib/renderer/Fill.js +37 -0
  321. package/lib/renderer/Fill.js.map +1 -0
  322. package/lib/renderer/Stroke.js +39 -0
  323. package/lib/renderer/Stroke.js.map +1 -0
  324. package/lib/renderer/index.js +137 -0
  325. package/lib/renderer/index.js.map +1 -0
  326. package/lib/renderer/style/css.js +4 -0
  327. package/lib/renderer/style/css.js.map +1 -0
  328. package/lib/renderer/style/index.css +0 -0
  329. package/lib/renderer/style/index.js +4 -0
  330. package/lib/renderer/style/index.js.map +1 -0
  331. package/lib/renderer/style/index.less +0 -0
  332. package/lib/renderer/transformRgb.js +33 -0
  333. package/lib/renderer/transformRgb.js.map +1 -0
  334. package/lib/search-map/VtxModal.js +202 -0
  335. package/lib/search-map/VtxModal.js.map +1 -0
  336. package/lib/search-map/index.js +416 -0
  337. package/lib/search-map/index.js.map +1 -0
  338. package/lib/search-map/style/css.js +6 -0
  339. package/lib/search-map/style/css.js.map +1 -0
  340. package/lib/search-map/style/index.css +73 -0
  341. package/lib/search-map/style/index.js +6 -0
  342. package/lib/search-map/style/index.js.map +1 -0
  343. package/lib/search-map/style/index.less +83 -0
  344. package/lib/search-map/style/modal.css +54 -0
  345. package/lib/search-map/style/modal.less +58 -0
  346. package/lib/style/index.css +0 -0
  347. package/lib/style/index.less +2 -0
  348. package/lib/style/themes/compact.css +0 -0
  349. package/lib/style/themes/compact.less +1 -0
  350. package/lib/style/themes/dark.css +0 -0
  351. package/lib/style/themes/dark.less +9 -0
  352. package/lib/style/themes/default.css +0 -0
  353. package/lib/style/themes/default.less +7 -0
  354. package/lib/style/themes/index.css +0 -0
  355. package/lib/style/themes/index.less +1 -0
  356. package/lib/style/themes/variable.css +0 -0
  357. package/lib/style/themes/variable.less +5 -0
  358. package/lib/tile-layer/TileLayer.js +85 -0
  359. package/lib/tile-layer/TileLayer.js.map +1 -0
  360. package/lib/tile-layer/index.js +52 -0
  361. package/lib/tile-layer/index.js.map +1 -0
  362. package/lib/tile-layer/style/css.js +4 -0
  363. package/lib/tile-layer/style/css.js.map +1 -0
  364. package/lib/tile-layer/style/index.css +0 -0
  365. package/lib/tile-layer/style/index.js +4 -0
  366. package/lib/tile-layer/style/index.js.map +1 -0
  367. package/lib/tile-layer/style/index.less +0 -0
  368. package/lib/tools/Layer/LayerService.js +182 -0
  369. package/lib/tools/Layer/LayerService.js.map +1 -0
  370. package/lib/tools/Layer/LayersCheckService.js +188 -0
  371. package/lib/tools/Layer/LayersCheckService.js.map +1 -0
  372. package/lib/tools/Layer/index.css +50 -0
  373. package/lib/tools/Layer/index.js +225 -0
  374. package/lib/tools/Layer/index.js.map +1 -0
  375. package/lib/tools/Layer/index.less +43 -0
  376. package/lib/tools/Search/index.js +295 -0
  377. package/lib/tools/Search/index.js.map +1 -0
  378. package/lib/tools/Toolbox/BoxSelect/index.js +19 -0
  379. package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -0
  380. package/lib/tools/Toolbox/CircleSelect/index.js +19 -0
  381. package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -0
  382. package/lib/tools/Toolbox/EagleEye/index.js +55 -0
  383. package/lib/tools/Toolbox/EagleEye/index.js.map +1 -0
  384. package/lib/tools/Toolbox/MapBookmark/Bookmark.js +147 -0
  385. package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -0
  386. package/lib/tools/Toolbox/MapBookmark/index.css +18 -0
  387. package/lib/tools/Toolbox/MapBookmark/index.js +428 -0
  388. package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -0
  389. package/lib/tools/Toolbox/MapBookmark/index.less +20 -0
  390. package/lib/tools/Toolbox/MapDownload/index.js +16 -0
  391. package/lib/tools/Toolbox/MapDownload/index.js.map +1 -0
  392. package/lib/tools/Toolbox/MapPrint/index.css +4 -0
  393. package/lib/tools/Toolbox/MapPrint/index.js +231 -0
  394. package/lib/tools/Toolbox/MapPrint/index.js.map +1 -0
  395. package/lib/tools/Toolbox/MapPrint/index.less +4 -0
  396. package/lib/tools/Toolbox/Measure/Area/index.js +16 -0
  397. package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -0
  398. package/lib/tools/Toolbox/Measure/Distance/index.js +16 -0
  399. package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -0
  400. package/lib/tools/Toolbox/Measure/Measure.js +227 -0
  401. package/lib/tools/Toolbox/Measure/Measure.js.map +1 -0
  402. package/lib/tools/Toolbox/Measure/index.js +75 -0
  403. package/lib/tools/Toolbox/Measure/index.js.map +1 -0
  404. package/lib/tools/Toolbox/PolygonSelect/index.js +19 -0
  405. package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -0
  406. package/lib/tools/Toolbox/ScaleLine/index.js +57 -0
  407. package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -0
  408. package/lib/tools/Toolbox/SelectTools/index.css +103 -0
  409. package/lib/tools/Toolbox/SelectTools/index.js +776 -0
  410. package/lib/tools/Toolbox/SelectTools/index.js.map +1 -0
  411. package/lib/tools/Toolbox/SelectTools/index.less +87 -0
  412. package/lib/tools/Toolbox/SpaceQuery/index.css +19 -0
  413. package/lib/tools/Toolbox/SpaceQuery/index.js +592 -0
  414. package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -0
  415. package/lib/tools/Toolbox/SpaceQuery/index.less +16 -0
  416. package/lib/tools/Toolbox/ZoomInput/index.css +6 -0
  417. package/lib/tools/Toolbox/ZoomInput/index.js +48 -0
  418. package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -0
  419. package/lib/tools/Toolbox/ZoomInput/index.less +6 -0
  420. package/lib/tools/Toolbox/index.css +0 -0
  421. package/lib/tools/Toolbox/index.js +169 -0
  422. package/lib/tools/Toolbox/index.js.map +1 -0
  423. package/lib/tools/Toolbox/index.less +2 -0
  424. package/lib/tools/Utils/CreateOverlay.js +46 -0
  425. package/lib/tools/Utils/CreateOverlay.js.map +1 -0
  426. package/lib/tools/Utils/Draw.js +127 -0
  427. package/lib/tools/Utils/Draw.js.map +1 -0
  428. package/lib/tools/Utils/HighLayer.js +211 -0
  429. package/lib/tools/Utils/HighLayer.js.map +1 -0
  430. package/lib/tools/Utils/measure.js +246 -0
  431. package/lib/tools/Utils/measure.js.map +1 -0
  432. package/lib/tools/Utils/utils.js +263 -0
  433. package/lib/tools/Utils/utils.js.map +1 -0
  434. package/lib/tools/View/index.css +35 -0
  435. package/lib/tools/View/index.js +164 -0
  436. package/lib/tools/View/index.js.map +1 -0
  437. package/lib/tools/View/index.less +28 -0
  438. package/lib/tools/analysis-tool/index.js +111 -0
  439. package/lib/tools/analysis-tool/index.js.map +1 -0
  440. package/lib/tools/base-map-switch/index.js +148 -0
  441. package/lib/tools/base-map-switch/index.js.map +1 -0
  442. package/lib/tools/components/Chart/index.js +817 -0
  443. package/lib/tools/components/Chart/index.js.map +1 -0
  444. package/lib/tools/components/Icon/index.js +31 -0
  445. package/lib/tools/components/Icon/index.js.map +1 -0
  446. package/lib/tools/components/Info/index.css +39 -0
  447. package/lib/tools/components/Info/index.js +34 -0
  448. package/lib/tools/components/Info/index.js.map +1 -0
  449. package/lib/tools/components/Info/index.less +26 -0
  450. package/lib/tools/components/ItemWrap/index.css +43 -0
  451. package/lib/tools/components/ItemWrap/index.js +46 -0
  452. package/lib/tools/components/ItemWrap/index.js.map +1 -0
  453. package/lib/tools/components/ItemWrap/index.less +41 -0
  454. package/lib/tools/components/Modal/index.css +42 -0
  455. package/lib/tools/components/Modal/index.js +45 -0
  456. package/lib/tools/components/Modal/index.js.map +1 -0
  457. package/lib/tools/components/Modal/index.less +33 -0
  458. package/lib/tools/components/MyTabs/index.js +22 -0
  459. package/lib/tools/components/MyTabs/index.js.map +1 -0
  460. package/lib/tools/components/RequiredLabel/index.css +5 -0
  461. package/lib/tools/components/RequiredLabel/index.js +32 -0
  462. package/lib/tools/components/RequiredLabel/index.js.map +1 -0
  463. package/lib/tools/components/RequiredLabel/index.less +5 -0
  464. package/lib/tools/components/Select/index.js +32 -0
  465. package/lib/tools/components/Select/index.js.map +1 -0
  466. package/lib/tools/components/Table/assets/tableIcon.png +0 -0
  467. package/lib/tools/components/Table/index.css +10 -0
  468. package/lib/tools/components/Table/index.js +89 -0
  469. package/lib/tools/components/Table/index.js.map +1 -0
  470. package/lib/tools/components/Table/index.less +13 -0
  471. package/lib/tools/components/ToolItem/index.css +30 -0
  472. package/lib/tools/components/ToolItem/index.js +28 -0
  473. package/lib/tools/components/ToolItem/index.js.map +1 -0
  474. package/lib/tools/components/ToolItem/index.less +27 -0
  475. package/lib/tools/components/ToolsSelect/index.css +15 -0
  476. package/lib/tools/components/ToolsSelect/index.js +44 -0
  477. package/lib/tools/components/ToolsSelect/index.js.map +1 -0
  478. package/lib/tools/components/ToolsSelect/index.less +10 -0
  479. package/lib/tools/full-screen/index.js +45 -0
  480. package/lib/tools/full-screen/index.js.map +1 -0
  481. package/lib/tools/index.js +150 -0
  482. package/lib/tools/index.js.map +1 -0
  483. package/lib/tools/layer-control/index.js +169 -0
  484. package/lib/tools/layer-control/index.js.map +1 -0
  485. package/lib/tools/refresh/index.js +39 -0
  486. package/lib/tools/refresh/index.js.map +1 -0
  487. package/lib/tools/style/css.js +22 -0
  488. package/lib/tools/style/css.js.map +1 -0
  489. package/lib/tools/style/index.css +136 -0
  490. package/lib/tools/style/index.js +22 -0
  491. package/lib/tools/style/index.js.map +1 -0
  492. package/lib/tools/style/index.less +154 -0
  493. package/lib/tools-item/index.js +65 -0
  494. package/lib/tools-item/index.js.map +1 -0
  495. package/lib/use-props/index.js +14 -0
  496. package/lib/use-props/index.js.map +1 -0
  497. package/lib/use-props/style/css.js +2 -0
  498. package/lib/use-props/style/css.js.map +1 -0
  499. package/lib/use-props/style/index.js +2 -0
  500. package/lib/use-props/style/index.js.map +1 -0
  501. package/lib/wms-layer/WmsLayer.js +313 -0
  502. package/lib/wms-layer/WmsLayer.js.map +1 -0
  503. package/lib/wms-layer/index.js +97 -0
  504. package/lib/wms-layer/index.js.map +1 -0
  505. package/lib/wms-layer/style/css.js +4 -0
  506. package/lib/wms-layer/style/css.js.map +1 -0
  507. package/lib/wms-layer/style/index.css +0 -0
  508. package/lib/wms-layer/style/index.js +4 -0
  509. package/lib/wms-layer/style/index.js.map +1 -0
  510. package/lib/wms-layer/style/index.less +0 -0
  511. package/package.json +1 -1
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ require("./style");
10
+ var _useProps2 = _interopRequireDefault(require("../use-props"));
11
+ var _ScaleDenominator = _interopRequireDefault(require("./ScaleDenominator"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
15
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
+ 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; } }
17
+ 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; }
18
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // Test.jsx
20
+ // 获取地图容器的像素尺寸
21
+ function getMapSizeInPx(map) {
22
+ var viewport = map.getViewport();
23
+ var rect = viewport.getBoundingClientRect();
24
+ return {
25
+ width: rect.width,
26
+ height: rect.height
27
+ };
28
+ }
29
+
30
+ // 示例:在控制台输出当前地图尺寸
31
+ var Test = function Test() {
32
+ var _useProps = (0, _useProps2["default"])(),
33
+ map = _useProps.map;
34
+ var _useState = (0, _react.useState)('none'),
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ dispaly = _useState2[0],
37
+ setDispaly = _useState2[1];
38
+ var _useState3 = (0, _react.useState)(0),
39
+ _useState4 = _slicedToArray(_useState3, 2),
40
+ clickCount = _useState4[0],
41
+ setClickCount = _useState4[1];
42
+ var _useState5 = (0, _react.useState)(false),
43
+ _useState6 = _slicedToArray(_useState5, 2),
44
+ isDragging = _useState6[0],
45
+ setIsDragging = _useState6[1];
46
+ var _useState7 = (0, _react.useState)({
47
+ x: 0,
48
+ y: 0
49
+ }),
50
+ _useState8 = _slicedToArray(_useState7, 2),
51
+ dragStart = _useState8[0],
52
+ setDragStart = _useState8[1];
53
+ var _useState9 = (0, _react.useState)({
54
+ x: 100,
55
+ y: 100
56
+ }),
57
+ _useState0 = _slicedToArray(_useState9, 2),
58
+ boxPosition = _useState0[0],
59
+ setBoxPosition = _useState0[1];
60
+ var boxRef = (0, _react.useRef)(null);
61
+ var lastClickTime = (0, _react.useRef)(0);
62
+ (0, _react.useEffect)(function () {
63
+ if (!map) return;
64
+ setBoxPosition({
65
+ x: getMapSizeInPx(map).width / 2 - 100,
66
+ y: getMapSizeInPx(map).height / 2 - 75
67
+ });
68
+ var handleClick = function handleClick() {
69
+ var currentTime = Date.now();
70
+ // 检查两次点击间隔是否小于1秒(1000毫秒)
71
+ if (currentTime - lastClickTime.current < 1000) {
72
+ var newCount = clickCount + 1;
73
+ setClickCount(newCount);
74
+ if (newCount >= 10) {
75
+ setDispaly('block');
76
+ }
77
+ }
78
+ // 更新上次点击时间
79
+ lastClickTime.current = currentTime;
80
+ };
81
+ map.on('click', handleClick);
82
+ return function () {
83
+ map.un('click', handleClick);
84
+ };
85
+ }, [map, clickCount]);
86
+ // 处理拖动开始
87
+ var handleDragStart = function handleDragStart(e) {
88
+ setIsDragging(true);
89
+ setDragStart({
90
+ x: e.clientX - boxPosition.x,
91
+ y: e.clientY - boxPosition.y
92
+ });
93
+ e.preventDefault();
94
+ };
95
+
96
+ // 处理拖动过程
97
+ var handleDrag = function handleDrag(e) {
98
+ if (isDragging) {
99
+ setBoxPosition({
100
+ x: e.clientX - dragStart.x,
101
+ y: e.clientY - dragStart.y
102
+ });
103
+ }
104
+ };
105
+
106
+ // 处理拖动结束
107
+ var handleDragEnd = function handleDragEnd() {
108
+ setIsDragging(false);
109
+ };
110
+
111
+ // 在useEffect中添加鼠标事件监听
112
+ (0, _react.useEffect)(function () {
113
+ if (isDragging) {
114
+ document.addEventListener('mousemove', handleDrag);
115
+ document.addEventListener('mouseup', handleDragEnd);
116
+ } else {
117
+ document.removeEventListener('mousemove', handleDrag);
118
+ document.removeEventListener('mouseup', handleDragEnd);
119
+ }
120
+ return function () {
121
+ document.removeEventListener('mousemove', handleDrag);
122
+ document.removeEventListener('mouseup', handleDragEnd);
123
+ };
124
+ }, [isDragging, dragStart]);
125
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, dispaly === 'block' && /*#__PURE__*/_react["default"].createElement("div", {
126
+ ref: boxRef,
127
+ style: {
128
+ position: 'absolute',
129
+ top: "".concat(boxPosition.y, "px"),
130
+ left: "".concat(boxPosition.x, "px"),
131
+ width: '200px',
132
+ height: '150px',
133
+ border: '2px solid #333',
134
+ backgroundColor: 'rgba(255, 255, 255, 0.8)',
135
+ cursor: 'move',
136
+ resize: 'both',
137
+ overflow: 'auto',
138
+ zIndex: 1000
139
+ },
140
+ onMouseDown: handleDragStart
141
+ }, /*#__PURE__*/_react["default"].createElement(_ScaleDenominator["default"], null)));
142
+ };
143
+ var _default = exports["default"] = Test;
144
+ //# sourceMappingURL=Test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Test.js","names":["_react","_interopRequireWildcard","require","_useProps2","_interopRequireDefault","_ScaleDenominator","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","getMapSizeInPx","map","viewport","getViewport","rect","getBoundingClientRect","width","height","Test","_useProps","useProps","_useState","useState","_useState2","dispaly","setDispaly","_useState3","_useState4","clickCount","setClickCount","_useState5","_useState6","isDragging","setIsDragging","_useState7","x","y","_useState8","dragStart","setDragStart","_useState9","_useState0","boxPosition","setBoxPosition","boxRef","useRef","lastClickTime","useEffect","handleClick","currentTime","Date","now","current","newCount","on","un","handleDragStart","clientX","clientY","preventDefault","handleDrag","handleDragEnd","document","addEventListener","removeEventListener","createElement","Fragment","ref","style","position","top","concat","left","border","backgroundColor","cursor","resize","overflow","zIndex","onMouseDown","_default","exports"],"sources":["map/Test.jsx"],"sourcesContent":["// Test.jsx\r\nimport React, { useEffect, useState, useRef } from 'react';\r\nimport './style';\r\nimport useProps from '../use-props';\r\nimport Sd from './ScaleDenominator';\r\n\r\n// 获取地图容器的像素尺寸\r\nfunction getMapSizeInPx(map) {\r\n const viewport = map.getViewport();\r\n const rect = viewport.getBoundingClientRect();\r\n return {\r\n width: rect.width,\r\n height: rect.height,\r\n };\r\n}\r\n\r\n// 示例:在控制台输出当前地图尺寸\r\nconst Test = () => {\r\n const { map } = useProps();\r\n const [dispaly, setDispaly] = useState('none');\r\n const [clickCount, setClickCount] = useState(0);\r\n const [isDragging, setIsDragging] = useState(false);\r\n const [dragStart, setDragStart] = useState({ x: 0, y: 0 });\r\n const [boxPosition, setBoxPosition] = useState({ x: 100, y: 100 });\r\n\r\n const boxRef = useRef(null);\r\n const lastClickTime = useRef(0);\r\n\r\n useEffect(() => {\r\n if (!map) return;\r\n setBoxPosition({\r\n x: getMapSizeInPx(map).width / 2 - 100,\r\n y: getMapSizeInPx(map).height / 2 - 75,\r\n });\r\n\r\n const handleClick = () => {\r\n const currentTime = Date.now();\r\n // 检查两次点击间隔是否小于1秒(1000毫秒)\r\n if (currentTime - lastClickTime.current < 1000) {\r\n const newCount = clickCount + 1;\r\n setClickCount(newCount);\r\n\r\n if (newCount >= 10) {\r\n setDispaly('block');\r\n }\r\n }\r\n // 更新上次点击时间\r\n lastClickTime.current = currentTime;\r\n };\r\n\r\n map.on('click', handleClick);\r\n\r\n return () => {\r\n map.un('click', handleClick);\r\n };\r\n }, [map, clickCount]);\r\n // 处理拖动开始\r\n const handleDragStart = e => {\r\n setIsDragging(true);\r\n setDragStart({\r\n x: e.clientX - boxPosition.x,\r\n y: e.clientY - boxPosition.y,\r\n });\r\n e.preventDefault();\r\n };\r\n\r\n // 处理拖动过程\r\n const handleDrag = e => {\r\n if (isDragging) {\r\n setBoxPosition({\r\n x: e.clientX - dragStart.x,\r\n y: e.clientY - dragStart.y,\r\n });\r\n }\r\n };\r\n\r\n // 处理拖动结束\r\n const handleDragEnd = () => {\r\n setIsDragging(false);\r\n };\r\n\r\n // 在useEffect中添加鼠标事件监听\r\n useEffect(() => {\r\n if (isDragging) {\r\n document.addEventListener('mousemove', handleDrag);\r\n document.addEventListener('mouseup', handleDragEnd);\r\n } else {\r\n document.removeEventListener('mousemove', handleDrag);\r\n document.removeEventListener('mouseup', handleDragEnd);\r\n }\r\n\r\n return () => {\r\n document.removeEventListener('mousemove', handleDrag);\r\n document.removeEventListener('mouseup', handleDragEnd);\r\n };\r\n }, [isDragging, dragStart]);\r\n return (\r\n <>\r\n {dispaly === 'block' && (\r\n <div\r\n ref={boxRef}\r\n style={{\r\n position: 'absolute',\r\n top: `${boxPosition.y}px`,\r\n left: `${boxPosition.x}px`,\r\n width: '200px',\r\n height: '150px',\r\n border: '2px solid #333',\r\n backgroundColor: 'rgba(255, 255, 255, 0.8)',\r\n cursor: 'move',\r\n resize: 'both',\r\n overflow: 'auto',\r\n zIndex: 1000,\r\n }}\r\n onMouseDown={handleDragStart}\r\n >\r\n <Sd />\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default Test;\r\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAoC,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE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AC1D,CAAC;EACL,CAAC,EAAE,CAAC7B,UAAU,EAAEM,SAAS,CAAC,CAAC;EAC3B,oBACI/E,MAAA,YAAA0G,aAAA,CAAA1G,MAAA,YAAA2G,QAAA,QACK1C,OAAO,KAAK,OAAO,iBAChBjE,MAAA,YAAA0G,aAAA;IACIE,GAAG,EAAEvB,MAAO;IACZwB,KAAK,EAAE;MACHC,QAAQ,EAAE,UAAU;MACpBC,GAAG,KAAAC,MAAA,CAAK7B,WAAW,CAACN,CAAC,OAAI;MACzBoC,IAAI,KAAAD,MAAA,CAAK7B,WAAW,CAACP,CAAC,OAAI;MAC1BnB,KAAK,EAAE,OAAO;MACdC,MAAM,EAAE,OAAO;MACfwD,MAAM,EAAE,gBAAgB;MACxBC,eAAe,EAAE,0BAA0B;MAC3CC,MAAM,EAAE,MAAM;MACdC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EAAE;IACZ,CAAE;IACFC,WAAW,EAAEvB;EAAgB,gBAE7BjG,MAAA,YAAA0G,aAAA,CAACrG,iBAAA,WAAE,MAAE,CACJ,CAEX,CAAC;AAEX,CAAC;AAAC,IAAAoH,QAAA,GAAAC,OAAA,cAEa/D,IAAI","ignoreList":[]}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _layer = require("ol/layer");
8
+ var _proj = require("ol/proj");
9
+ var _source = require("ol/source");
10
+ // 导入proj控件,使用其方法注入gcj02坐标系
11
+
12
+ var PI = Math.PI;
13
+ var AXIS = 6378245.0;
14
+ var OFFSET = 0.00669342162296594323; // (a^2 - b^2) / a^2
15
+
16
+ function delta(wgLon, wgLat) {
17
+ var dLat = transformLat(wgLon - 105.0, wgLat - 35.0);
18
+ var dLon = transformLon(wgLon - 105.0, wgLat - 35.0);
19
+ var radLat = wgLat / 180.0 * PI;
20
+ var magic = Math.sin(radLat);
21
+ magic = 1 - OFFSET * magic * magic;
22
+ var sqrtMagic = Math.sqrt(magic);
23
+ dLat = dLat * 180.0 / (AXIS * (1 - OFFSET) / (magic * sqrtMagic) * PI);
24
+ dLon = dLon * 180.0 / (AXIS / sqrtMagic * Math.cos(radLat) * PI);
25
+ return [dLon, dLat];
26
+ }
27
+ function outOfChina(lon, lat) {
28
+ if (lon < 72.004 || lon > 137.8347) {
29
+ return true;
30
+ }
31
+ if (lat < 0.8293 || lat > 55.8271) {
32
+ return true;
33
+ }
34
+ return false;
35
+ }
36
+ function transformLat(x, y) {
37
+ var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
38
+ ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
39
+ ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0;
40
+ ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0;
41
+ return ret;
42
+ }
43
+ function transformLon(x, y) {
44
+ var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
45
+ ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
46
+ ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0;
47
+ ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0;
48
+ return ret;
49
+ }
50
+ var forEachPoint = function forEachPoint(func) {
51
+ return function (input, opt_output, opt_dimension) {
52
+ var len = input.length;
53
+ var dimension = opt_dimension || 2;
54
+ var output;
55
+ if (opt_output) {
56
+ output = opt_output;
57
+ } else if (dimension !== 2) {
58
+ output = input.slice();
59
+ } else {
60
+ output = new Array(len);
61
+ }
62
+ for (var offset = 0; offset < len; offset += dimension) {
63
+ func(input, output, offset);
64
+ }
65
+ return output;
66
+ };
67
+ };
68
+ var gcj02 = {
69
+ toWGS84: forEachPoint(function (input, output, offset) {
70
+ var lng = input[offset];
71
+ var lat = input[offset + 1];
72
+ if (!outOfChina(lng, lat)) {
73
+ var deltaD = delta(lng, lat);
74
+ lng = lng - deltaD[0];
75
+ lat = lat - deltaD[1];
76
+ }
77
+ output[offset] = lng;
78
+ output[offset + 1] = lat;
79
+ }),
80
+ fromWGS84: forEachPoint(function (input, output, offset) {
81
+ var lng = input[offset];
82
+ var lat = input[offset + 1];
83
+ if (!outOfChina(lng, lat)) {
84
+ var deltaD = delta(lng, lat);
85
+ lng = lng + deltaD[0];
86
+ lat = lat + deltaD[1];
87
+ }
88
+ output[offset] = lng;
89
+ output[offset + 1] = lat;
90
+ })
91
+ };
92
+ var projzh = {
93
+ ll2smerc: (0, _proj.getTransform)('EPSG:4326', 'EPSG:3857'),
94
+ smerc2ll: (0, _proj.getTransform)('EPSG:3857', 'EPSG:4326')
95
+ };
96
+
97
+ // wgs84 -> gcj02
98
+ projzh.ll2gmerc = function (input, opt_output, opt_dimension) {
99
+ var output = gcj02.fromWGS84(input, opt_output, opt_dimension);
100
+ return projzh.ll2smerc(output, output, opt_dimension);
101
+ };
102
+ // gcj02 -> wgs84
103
+ projzh.gmerc2ll = function (input, opt_output, opt_dimension) {
104
+ var output = projzh.smerc2ll(input, input, opt_dimension);
105
+ return gcj02.toWGS84(output, opt_output, opt_dimension);
106
+ };
107
+ // 3857 -> gcj02
108
+ projzh.smerc2gmerc = function (input, opt_output, opt_dimension) {
109
+ var output = projzh.smerc2ll(input, input, opt_dimension);
110
+ output = gcj02.fromWGS84(output, output, opt_dimension);
111
+ return projzh.ll2smerc(output, output, opt_dimension);
112
+ };
113
+ // gcj02 -> 3857
114
+ projzh.gmerc2smerc = function (input, opt_output, opt_dimension) {
115
+ var output = projzh.smerc2ll(input, input, opt_dimension);
116
+ output = gcj02.toWGS84(output, output, opt_dimension);
117
+ return projzh.ll2smerc(output, output, opt_dimension);
118
+ };
119
+
120
+ // 定义GCJ02墨卡托投影坐标系
121
+ var gcj02Mecator = new _proj.Projection({
122
+ code: 'GCJ-02',
123
+ // extent不能缺少,OpenLayers frame 渲染的时候需要
124
+ extent: [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244],
125
+ units: 'm'
126
+ });
127
+
128
+ // 将GCJ02墨卡托投影坐标系注册进OpenLayers
129
+ (0, _proj.addProjection)(gcj02Mecator);
130
+
131
+ // 覆盖默认的转换方法
132
+ (0, _proj.addCoordinateTransforms)('EPSG:4326', gcj02Mecator, projzh.ll2gmerc, projzh.gmerc2ll);
133
+ (0, _proj.addCoordinateTransforms)('EPSG:3857', gcj02Mecator, projzh.smerc2gmerc, projzh.gmerc2smerc);
134
+ var getSource = function getSource() {
135
+ return new _source.XYZ({
136
+ projection: gcj02Mecator,
137
+ maxZoom: 18,
138
+ url: '//wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=10&x={x}&y={y}&z={z}',
139
+ crossOrigin: 'anonymous'
140
+ });
141
+ };
142
+ var getLayer = function getLayer(_ref) {
143
+ var dark = _ref.dark;
144
+ var mapLayer = new _layer.Tile({
145
+ source: getSource(),
146
+ className: dark && 'ol-map-dark',
147
+ zIndex: 0
148
+ });
149
+ return [mapLayer];
150
+ };
151
+
152
+ // 转换方法
153
+ var transform = function transform(coordinate) {
154
+ return (0, _proj.transform)(coordinate, 'EPSG:4326', 'GCJ-02');
155
+ };
156
+ var _default = exports["default"] = {
157
+ mercator: gcj02Mecator,
158
+ gcj02: gcj02,
159
+ transform: transform,
160
+ getSource: getSource,
161
+ getLayer: getLayer
162
+ };
163
+ //# sourceMappingURL=AmapImageryProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmapImageryProvider.js","names":["_layer","require","_proj","_source","PI","Math","AXIS","OFFSET","delta","wgLon","wgLat","dLat","transformLat","dLon","transformLon","radLat","magic","sin","sqrtMagic","sqrt","cos","outOfChina","lon","lat","x","y","ret","abs","forEachPoint","func","input","opt_output","opt_dimension","len","length","dimension","output","slice","Array","offset","gcj02","toWGS84","lng","deltaD","fromWGS84","projzh","ll2smerc","getTransform","smerc2ll","ll2gmerc","gmerc2ll","smerc2gmerc","gmerc2smerc","gcj02Mecator","Projection","code","extent","units","addProjection","addCoordinateTransforms","getSource","XYZSource","projection","maxZoom","url","crossOrigin","getLayer","_ref","dark","mapLayer","TileLayer","source","className","zIndex","transform","coordinate","transformProj","_default","exports","mercator"],"sources":["map/getBaseLayers/imagery/amap/AmapImageryProvider.js"],"sourcesContent":["import { Tile as TileLayer } from 'ol/layer';\r\n// 导入proj控件,使用其方法注入gcj02坐标系\r\nimport { Projection, addProjection, addCoordinateTransforms, getTransform } from 'ol/proj';\r\nimport { XYZ as XYZSource } from 'ol/source';\r\nimport { transform as transformProj } from 'ol/proj';\r\n\r\nconst PI = Math.PI;\r\nconst AXIS = 6378245.0;\r\nconst OFFSET = 0.00669342162296594323; // (a^2 - b^2) / a^2\r\n\r\nfunction delta(wgLon, wgLat) {\r\n let dLat = transformLat(wgLon - 105.0, wgLat - 35.0);\r\n let dLon = transformLon(wgLon - 105.0, wgLat - 35.0);\r\n const radLat = (wgLat / 180.0) * PI;\r\n let magic = Math.sin(radLat);\r\n magic = 1 - OFFSET * magic * magic;\r\n const sqrtMagic = Math.sqrt(magic);\r\n dLat = (dLat * 180.0) / (((AXIS * (1 - OFFSET)) / (magic * sqrtMagic)) * PI);\r\n dLon = (dLon * 180.0) / ((AXIS / sqrtMagic) * Math.cos(radLat) * PI);\r\n return [dLon, dLat];\r\n}\r\n\r\nfunction outOfChina(lon, lat) {\r\n if (lon < 72.004 || lon > 137.8347) {\r\n return true;\r\n }\r\n if (lat < 0.8293 || lat > 55.8271) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nfunction transformLat(x, y) {\r\n let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));\r\n ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0;\r\n ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0;\r\n ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0;\r\n return ret;\r\n}\r\n\r\nfunction transformLon(x, y) {\r\n let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));\r\n ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0;\r\n ret += ((20.0 * Math.sin(x * PI) + 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0;\r\n ret += ((150.0 * Math.sin((x / 12.0) * PI) + 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0;\r\n return ret;\r\n}\r\n\r\nconst forEachPoint = function (func) {\r\n return function (input, opt_output, opt_dimension) {\r\n const len = input.length;\r\n const dimension = opt_dimension || 2;\r\n let output;\r\n if (opt_output) {\r\n output = opt_output;\r\n } else if (dimension !== 2) {\r\n output = input.slice();\r\n } else {\r\n output = new Array(len);\r\n }\r\n for (let offset = 0; offset < len; offset += dimension) {\r\n func(input, output, offset);\r\n }\r\n return output;\r\n };\r\n};\r\n\r\nconst gcj02 = {\r\n toWGS84: forEachPoint(function (input, output, offset) {\r\n let lng = input[offset];\r\n let lat = input[offset + 1];\r\n if (!outOfChina(lng, lat)) {\r\n const deltaD = delta(lng, lat);\r\n lng = lng - deltaD[0];\r\n lat = lat - deltaD[1];\r\n }\r\n output[offset] = lng;\r\n output[offset + 1] = lat;\r\n }),\r\n fromWGS84: forEachPoint(function (input, output, offset) {\r\n let lng = input[offset];\r\n let lat = input[offset + 1];\r\n if (!outOfChina(lng, lat)) {\r\n const deltaD = delta(lng, lat);\r\n lng = lng + deltaD[0];\r\n lat = lat + deltaD[1];\r\n }\r\n output[offset] = lng;\r\n output[offset + 1] = lat;\r\n }),\r\n};\r\n\r\nconst projzh = {\r\n ll2smerc: getTransform('EPSG:4326', 'EPSG:3857'),\r\n smerc2ll: getTransform('EPSG:3857', 'EPSG:4326'),\r\n};\r\n\r\n// wgs84 -> gcj02\r\nprojzh.ll2gmerc = function (input, opt_output, opt_dimension) {\r\n const output = gcj02.fromWGS84(input, opt_output, opt_dimension);\r\n return projzh.ll2smerc(output, output, opt_dimension);\r\n};\r\n// gcj02 -> wgs84\r\nprojzh.gmerc2ll = function (input, opt_output, opt_dimension) {\r\n const output = projzh.smerc2ll(input, input, opt_dimension);\r\n return gcj02.toWGS84(output, opt_output, opt_dimension);\r\n};\r\n// 3857 -> gcj02\r\nprojzh.smerc2gmerc = function (input, opt_output, opt_dimension) {\r\n let output = projzh.smerc2ll(input, input, opt_dimension);\r\n output = gcj02.fromWGS84(output, output, opt_dimension);\r\n return projzh.ll2smerc(output, output, opt_dimension);\r\n};\r\n// gcj02 -> 3857\r\nprojzh.gmerc2smerc = function (input, opt_output, opt_dimension) {\r\n let output = projzh.smerc2ll(input, input, opt_dimension);\r\n output = gcj02.toWGS84(output, output, opt_dimension);\r\n return projzh.ll2smerc(output, output, opt_dimension);\r\n};\r\n\r\n// 定义GCJ02墨卡托投影坐标系\r\nconst gcj02Mecator = new Projection({\r\n code: 'GCJ-02',\r\n // extent不能缺少,OpenLayers frame 渲染的时候需要\r\n extent: [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244],\r\n units: 'm',\r\n});\r\n\r\n// 将GCJ02墨卡托投影坐标系注册进OpenLayers\r\naddProjection(gcj02Mecator);\r\n\r\n// 覆盖默认的转换方法\r\naddCoordinateTransforms('EPSG:4326', gcj02Mecator, projzh.ll2gmerc, projzh.gmerc2ll);\r\naddCoordinateTransforms('EPSG:3857', gcj02Mecator, projzh.smerc2gmerc, projzh.gmerc2smerc);\r\n\r\nconst getSource = () => {\r\n return new XYZSource({\r\n projection: gcj02Mecator,\r\n maxZoom: 18,\r\n url: '//wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=10&x={x}&y={y}&z={z}',\r\n crossOrigin: 'anonymous',\r\n });\r\n};\r\n\r\nconst getLayer = ({ dark }) => {\r\n let mapLayer = new TileLayer({\r\n source: getSource(),\r\n className: dark && 'ol-map-dark',\r\n zIndex: 0\r\n });\r\n\r\n return [mapLayer];\r\n};\r\n\r\n// 转换方法\r\nconst transform = coordinate => {\r\n return transformProj(coordinate, 'EPSG:4326', 'GCJ-02');\r\n};\r\n\r\nexport default {\r\n mercator: gcj02Mecator,\r\n gcj02,\r\n transform,\r\n getSource,\r\n getLayer,\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAFA;;AAKA,IAAMG,EAAE,GAAGC,IAAI,CAACD,EAAE;AAClB,IAAME,IAAI,GAAG,SAAS;AACtB,IAAMC,MAAM,GAAG,sBAAsB,CAAC,CAAC;;AAEvC,SAASC,KAAKA,CAACC,KAAK,EAAEC,KAAK,EAAE;EACzB,IAAIC,IAAI,GAAGC,YAAY,CAACH,KAAK,GAAG,KAAK,EAAEC,KAAK,GAAG,IAAI,CAAC;EACpD,IAAIG,IAAI,GAAGC,YAAY,CAACL,KAAK,GAAG,KAAK,EAAEC,KAAK,GAAG,IAAI,CAAC;EACpD,IAAMK,MAAM,GAAIL,KAAK,GAAG,KAAK,GAAIN,EAAE;EACnC,IAAIY,KAAK,GAAGX,IAAI,CAACY,GAAG,CAACF,MAAM,CAAC;EAC5BC,KAAK,GAAG,CAAC,GAAGT,MAAM,GAAGS,KAAK,GAAGA,KAAK;EAClC,IAAME,SAAS,GAAGb,IAAI,CAACc,IAAI,CAACH,KAAK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SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;EACpB,OAAO,IAAIC,WAAS,CAAC;IACjBC,UAAU,EAAET,YAAY;IACxBU,OAAO,EAAE,EAAE;IACXC,GAAG,EAAE,sFAAsF;IAC3FC,WAAW,EAAE;EACjB,CAAC,CAAC;AACN,CAAC;AAED,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAiB;EAAA,IAAXC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EACpB,IAAIC,QAAQ,GAAG,IAAIC,WAAS,CAAC;IACzBC,MAAM,EAAEX,SAAS,CAAC,CAAC;IACnBY,SAAS,EAAEJ,IAAI,IAAI,aAAa;IAChCK,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,OAAO,CAACJ,QAAQ,CAAC;AACrB,CAAC;;AAED;AACA,IAAMK,SAAS,GAAG,SAAZA,SAASA,CAAGC,UAAU,EAAI;EAC5B,OAAO,IAAAC,eAAa,EAACD,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC;AAC3D,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAEa;EACXC,QAAQ,EAAE1B,YAAY;EACtBb,KAAK,EAALA,KAAK;EACLkC,SAAS,EAATA,SAAS;EACTd,SAAS,EAATA,SAAS;EACTM,QAAQ,EAARA;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _layer = require("ol/layer");
8
+ var _proj = require("ol/proj");
9
+ var _projzh = _interopRequireDefault(require("../../../../_util/projzh"));
10
+ var _source = require("ol/source");
11
+ var _TileGrid = _interopRequireDefault(require("ol/tilegrid/TileGrid"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ // 导入proj控件,使用其方法注入gcj02坐标系
14
+
15
+ var bd09Mercator = new _proj.Projection({
16
+ code: 'BD-09',
17
+ extent: [-20037726.37, -12474104.17, 20037726.37, 12474104.17],
18
+ units: 'm'
19
+ });
20
+
21
+ // 将BD09墨卡托投影坐标系注册进OpenLayers
22
+ (0, _proj.addProjection)(bd09Mercator);
23
+
24
+ // 覆盖默认的转换方法
25
+ (0, _proj.addCoordinateTransforms)('EPSG:4326', bd09Mercator, _projzh["default"].ll2bmerc, _projzh["default"].bmerc2ll);
26
+ (0, _proj.addCoordinateTransforms)('EPSG:3857', bd09Mercator, _projzh["default"].smerc2bmerc, _projzh["default"].bmerc2smerc);
27
+ var getSource = function getSource(options) {
28
+ var qt = options.qt;
29
+ var bmercResolutions = new Array(19);
30
+ for (var i = 0; i < 19; ++i) {
31
+ bmercResolutions[i] = Math.pow(2, 18 - i);
32
+ }
33
+ var urls = [0, 1, 2, 3].map(function (sub) {
34
+ return "//maponline".concat(sub, ".bdimg.com/tile/?qt=").concat(qt || 'vtile', "&x={x}&y={y}&z={z}&styles=pl&scaler=2&udt=20210506&from=jsapi3_0");
35
+ });
36
+ return new _source.XYZ({
37
+ projection: 'BD-09',
38
+ maxZoom: 18,
39
+ crossOrigin: 'anonymous',
40
+ tileUrlFunction: function tileUrlFunction(tileCoord) {
41
+ var x = tileCoord[1];
42
+ var y = -tileCoord[2] - 1;
43
+ var z = tileCoord[0];
44
+ var hash = (x << z) + y;
45
+ var index = hash % urls.length;
46
+ index = index < 0 ? index + urls.length : index;
47
+ if (x < 0) {
48
+ x = 'M' + -x;
49
+ }
50
+ if (y < 0) {
51
+ y = 'M' + -y;
52
+ }
53
+ return urls[index].replace('{x}', x).replace('{y}', y).replace('{z}', z);
54
+ },
55
+ tilePixelRatio: 2,
56
+ tileGrid: new _TileGrid["default"]({
57
+ resolutions: bmercResolutions,
58
+ origin: [0, 0]
59
+ })
60
+ });
61
+ };
62
+
63
+ // 获取百度底图
64
+ var getLayer = function getLayer(options) {
65
+ var dark = options.dark;
66
+ var mapLayer = new _layer.Tile({
67
+ source: getSource(options),
68
+ className: dark && 'ol-map-dark',
69
+ zIndex: 0
70
+ });
71
+ return [mapLayer];
72
+ };
73
+
74
+ // 转换方法
75
+ var transform = function transform(coordinate) {
76
+ return (0, _proj.transform)(coordinate, 'EPSG:4326', 'BD-09');
77
+ };
78
+ var _default = exports["default"] = {
79
+ mercator: bd09Mercator,
80
+ transform: transform,
81
+ getSource: getSource,
82
+ getLayer: getLayer
83
+ };
84
+ //# sourceMappingURL=BaiduImageryProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaiduImageryProvider.js","names":["_layer","require","_proj","_projzh","_interopRequireDefault","_source","_TileGrid","e","__esModule","bd09Mercator","Projection","code","extent","units","addProjection","addCoordinateTransforms","projzh","ll2bmerc","bmerc2ll","smerc2bmerc","bmerc2smerc","getSource","options","qt","bmercResolutions","Array","i","Math","pow","urls","map","sub","concat","XYZ","projection","maxZoom","crossOrigin","tileUrlFunction","tileCoord","x","y","z","hash","index","length","replace","tilePixelRatio","tileGrid","TileGrid","resolutions","origin","getLayer","dark","mapLayer","TileLayer","source","className","zIndex","transform","coordinate","transformProj","_default","exports","mercator"],"sources":["map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js"],"sourcesContent":["import { Tile as TileLayer } from 'ol/layer';\r\n// 导入proj控件,使用其方法注入gcj02坐标系\r\nimport {\r\n Projection,\r\n addProjection,\r\n addCoordinateTransforms,\r\n transform as transformProj,\r\n} from 'ol/proj';\r\nimport projzh from '../../../../_util/projzh';\r\nimport { XYZ } from 'ol/source';\r\nimport TileGrid from 'ol/tilegrid/TileGrid';\r\n\r\nlet bd09Mercator = new Projection({\r\n code: 'BD-09',\r\n extent: [-20037726.37, -12474104.17, 20037726.37, 12474104.17],\r\n units: 'm',\r\n});\r\n\r\n// 将BD09墨卡托投影坐标系注册进OpenLayers\r\naddProjection(bd09Mercator);\r\n\r\n// 覆盖默认的转换方法\r\naddCoordinateTransforms('EPSG:4326', bd09Mercator, projzh.ll2bmerc, projzh.bmerc2ll);\r\naddCoordinateTransforms('EPSG:3857', bd09Mercator, projzh.smerc2bmerc, projzh.bmerc2smerc);\r\n\r\nconst getSource = (options) => {\r\n const {qt} = options;\r\n let bmercResolutions = new Array(19);\r\n for (let i = 0; i < 19; ++i) {\r\n bmercResolutions[i] = Math.pow(2, 18 - i);\r\n }\r\n let urls = [0, 1, 2, 3].map(function (sub) {\r\n return (\r\n `//maponline${sub}.bdimg.com/tile/?qt=${qt || 'vtile'}&x={x}&y={y}&z={z}&styles=pl&scaler=2&udt=20210506&from=jsapi3_0`\r\n );\r\n });\r\n\r\n return new XYZ({\r\n projection: 'BD-09',\r\n maxZoom: 18,\r\n crossOrigin: 'anonymous',\r\n tileUrlFunction: function (tileCoord) {\r\n let x = tileCoord[1];\r\n let y = -tileCoord[2] - 1;\r\n let z = tileCoord[0];\r\n let hash = (x << z) + y;\r\n let index = hash % urls.length;\r\n index = index < 0 ? index + urls.length : index;\r\n if (x < 0) {\r\n x = 'M' + -x;\r\n }\r\n if (y < 0) {\r\n y = 'M' + -y;\r\n }\r\n return urls[index]\r\n .replace('{x}', x)\r\n .replace('{y}', y)\r\n .replace('{z}', z);\r\n },\r\n tilePixelRatio: 2,\r\n tileGrid: new TileGrid({\r\n resolutions: bmercResolutions,\r\n origin: [0, 0],\r\n }),\r\n });\r\n};\r\n\r\n// 获取百度底图\r\nconst getLayer = (options) => {\r\n const { dark } = options;\r\n let mapLayer = new TileLayer({\r\n source: getSource(options),\r\n className: dark && 'ol-map-dark',\r\n zIndex: 0\r\n });\r\n\r\n return [mapLayer];\r\n};\r\n\r\n// 转换方法\r\nconst transform = coordinate => {\r\n return transformProj(coordinate, 'EPSG:4326', 'BD-09');\r\n};\r\n\r\nexport default {\r\n mercator: bd09Mercator,\r\n transform,\r\n getSource,\r\n getLayer,\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI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,CAACC,OAAO,CAAC;IAC1BkC,SAAS,EAAEJ,IAAI,IAAI,aAAa;IAChCK,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,OAAO,CAACJ,QAAQ,CAAC;AACrB,CAAC;;AAED;AACA,IAAMK,SAAS,GAAG,SAAZA,SAASA,CAAGC,UAAU,EAAI;EAC5B,OAAO,IAAAC,eAAa,EAACD,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;AAC1D,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAEa;EACXC,QAAQ,EAAEtD,YAAY;EACtBiD,SAAS,EAATA,SAAS;EACTrC,SAAS,EAATA,SAAS;EACT8B,QAAQ,EAARA;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getSource = exports["default"] = void 0;
7
+ var _layer = require("ol/layer");
8
+ var _source = require("ol/source");
9
+ var _AmapImageryProvider = _interopRequireDefault(require("../amap/AmapImageryProvider"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ 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; } }
14
+ 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; }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
17
+ var getSource = exports.getSource = function getSource(_ref) {
18
+ var mapStyle = _ref.mapStyle,
19
+ url = _ref.url;
20
+ var URL = {
21
+ Community: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}',
22
+ Warm: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}',
23
+ Gray: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}',
24
+ Blue: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}'
25
+ };
26
+ var tileLayer = new _source.XYZ({
27
+ projection: _AmapImageryProvider["default"].mercator,
28
+ url: url || URL[mapStyle || 'Blue'],
29
+ maxZoom: 18,
30
+ crossOrigin: 'anonymous'
31
+ });
32
+ return [tileLayer];
33
+ };
34
+ var getLayer = function getLayer(_ref2) {
35
+ var mapStyle = _ref2.mapStyle,
36
+ tk = _ref2.tk,
37
+ dark = _ref2.dark,
38
+ url = _ref2.url;
39
+ mapStyle = mapStyle || 'Blue';
40
+ var _getSource = getSource({
41
+ mapStyle: mapStyle,
42
+ tk: tk,
43
+ url: url
44
+ }),
45
+ _getSource2 = _slicedToArray(_getSource, 1),
46
+ tileLayerSource = _getSource2[0];
47
+ var tileLayer = new _layer.Tile({
48
+ preload: Infinity,
49
+ // 预加载
50
+ title: '天地图路网',
51
+ name: 'baseMap',
52
+ className: dark && 'ol-map-dark',
53
+ source: tileLayerSource,
54
+ zIndex: 0
55
+ });
56
+ tileLayer.key = '__TDT_TILE';
57
+ return [tileLayer];
58
+ };
59
+ var _default = exports["default"] = {
60
+ // mercator: bd09Mercator,
61
+ // transform,
62
+ getLayer: getLayer,
63
+ getSource: getSource
64
+ };
65
+ //# sourceMappingURL=GeoQImageryProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoQImageryProvider.js","names":["_layer","require","_source","_AmapImageryProvider","_interopRequireDefault","e","__esModule","_slicedToArray","r","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","isArray","getSource","exports","_ref","mapStyle","url","URL","Community","Warm","Gray","Blue","tileLayer","XYZ","projection","AmapImageryProvider","mercator","maxZoom","crossOrigin","getLayer","_ref2","tk","dark","_getSource","_getSource2","tileLayerSource","TileLayer","preload","Infinity","title","className","source","zIndex","key","_default"],"sources":["map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js"],"sourcesContent":["import { Tile as TileLayer } from 'ol/layer';\r\nimport { XYZ } from 'ol/source';\r\nimport AmapImageryProvider from '../amap/AmapImageryProvider';\r\n\r\nexport const getSource = ({ mapStyle, url }) => {\r\n let URL = {\r\n Community: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}',\r\n Warm: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}',\r\n Gray: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}',\r\n Blue: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}',\r\n };\r\n\r\n let tileLayer = new XYZ({\r\n projection: AmapImageryProvider.mercator,\r\n url: url || URL[mapStyle || 'Blue'],\r\n maxZoom: 18,\r\n crossOrigin: 'anonymous',\r\n });\r\n\r\n return [tileLayer];\r\n};\r\n\r\nconst getLayer = ({ mapStyle, tk, dark, url }) => {\r\n mapStyle = mapStyle || 'Blue';\r\n\r\n let [tileLayerSource] = getSource({ mapStyle, tk, url });\r\n\r\n let tileLayer = new TileLayer({\r\n preload: Infinity, // 预加载\r\n title: '天地图路网',\r\n name: 'baseMap',\r\n className: dark && 'ol-map-dark',\r\n source: tileLayerSource,\r\n zIndex: 0\r\n });\r\n tileLayer.key = '__TDT_TILE';\r\n\r\n return [tileLayer];\r\n};\r\n\r\nexport default {\r\n // mercator: bd09Mercator,\r\n // transform,\r\n getLayer,\r\n getSource,\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA8D,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,eAAAC,CAAA,EAAAH,CAAA,WAAAI,eAAA,CAAAD,CAAA,KAAAE,qBAAA,CAAAF,CAAA,EAAAH,CAAA,KAAAM,2BAAA,CAAAH,CAAA,EAAAH,CAAA,KAAAO,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA,2BAAAA,CAAA,SAAAO,iBAAA,CAAAP,CAAA,EAAAM,CAAA,OAAAE,CAAA,MAAAC,QAAA,CAAAC,IAAA,CAAAV,CAAA,EAAAW,KAAA,6BAAAH,CAAA,IAAAR,CAAA,CAAAY,WAAA,KAAAJ,CAAA,GAAAR,CAAA,CAAAY,WAAA,CAAAC,IAAA,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AAE;IACnBC,KAAK,EAAE,OAAO;IACd9C,IAAI,EAAE,SAAS;IACf+C,SAAS,EAAER,IAAI,IAAI,aAAa;IAChCS,MAAM,EAAEN,eAAe;IACvBO,MAAM,EAAE;EACZ,CAAC,CAAC;EACFpB,SAAS,CAACqB,GAAG,GAAG,YAAY;EAE5B,OAAO,CAACrB,SAAS,CAAC;AACtB,CAAC;AAAC,IAAAsB,QAAA,GAAA/B,OAAA,cAEa;EACX;EACA;EACAgB,QAAQ,EAARA,QAAQ;EACRjB,SAAS,EAATA;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getSource = exports["default"] = void 0;
7
+ var _layer = require("ol/layer");
8
+ var _source = require("ol/source");
9
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ 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; } }
12
+ 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; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
+ var getSource = exports.getSource = function getSource(options) {
16
+ var tk = options.tk,
17
+ replaceLabel = options.replaceLabel;
18
+ var mapStyle = options.mapStyle || 'vec';
19
+ var P = {
20
+ vec: {
21
+ img: 'vec_w',
22
+ label: 'cva_w'
23
+ },
24
+ img: {
25
+ img: 'img_w',
26
+ label: 'cia_w'
27
+ }
28
+ };
29
+ var tileLayer = new _source.XYZ({
30
+ url: "//t{0-7}.tianditu.gov.cn/DataServer?T=".concat(P[mapStyle].img, "&tk=").concat(tk, "&x={x}&y={y}&l={z}"),
31
+ maxZoom: 18,
32
+ crossOrigin: 'anonymous'
33
+ });
34
+ var markLayer = new _source.XYZ({
35
+ url: "//t{0-7}.tianditu.gov.cn/DataServer?T=".concat(P[mapStyle].label, "&tk=").concat(tk, "&x={x}&y={y}&l={z}"),
36
+ maxZoom: 18,
37
+ crossOrigin: 'anonymous'
38
+ });
39
+ if (replaceLabel) {
40
+ markLayer.tileLoadFunction = function (imageTile, src) {
41
+ var tile = imageTile.tileCoord.join("_");
42
+ if (replaceLabel[tile]) {
43
+ return imageTile.getImage().src = replaceLabel[tile];
44
+ }
45
+ imageTile.getImage().src = src;
46
+ };
47
+ }
48
+ return [tileLayer, markLayer];
49
+ };
50
+ var getLayer = function getLayer(options) {
51
+ var dark = options.dark;
52
+ var _getSource = getSource(options),
53
+ _getSource2 = _slicedToArray(_getSource, 2),
54
+ tileLayerSource = _getSource2[0],
55
+ markLayerSource = _getSource2[1];
56
+ var tileLayer = new _layer.Tile({
57
+ preload: Infinity,
58
+ // 预加载
59
+ title: '天地图路网',
60
+ name: 'baseMap',
61
+ className: dark && 'ol-map-dark',
62
+ source: tileLayerSource,
63
+ zIndex: 0
64
+ });
65
+ tileLayer.key = '__TDT_TILE';
66
+ var markLayer = new _layer.Tile({
67
+ preload: Infinity,
68
+ // 预加载
69
+ title: '天地图文字标注',
70
+ name: 'baseMap',
71
+ className: dark && 'ol-map-dark-label',
72
+ source: markLayerSource,
73
+ zIndex: 0
74
+ });
75
+ markLayer.key = '__TDT_MARK';
76
+ return [tileLayer, markLayer];
77
+ };
78
+ var _default = exports["default"] = {
79
+ // mercator: bd09Mercator,
80
+ // transform,
81
+ getLayer: getLayer,
82
+ getSource: getSource
83
+ };
84
+ //# sourceMappingURL=TdtImageryProvider.js.map