vue2-openlayers 0.1.3 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. package/package.json +9 -8
  2. package/{vue2-openlayers/vue2-openlayers.common.js → vue2-openlayers.common.js} +121 -96
  3. package/{vue2-openlayers/vue2-openlayers.common.js.map → vue2-openlayers.common.js.map} +1 -1
  4. package/{vue2-openlayers/vue2-openlayers.css → vue2-openlayers.css} +1 -1
  5. package/{vue2-openlayers/vue2-openlayers.umd.js → vue2-openlayers.umd.js} +121 -96
  6. package/{vue2-openlayers/vue2-openlayers.umd.js.map → vue2-openlayers.umd.js.map} +1 -1
  7. package/vue2-openlayers.umd.min.js +2 -0
  8. package/vue2-openlayers.umd.min.js.map +1 -0
  9. package/README.md +0 -24
  10. package/babel.config.js +0 -5
  11. package/dist/css/index.34f0f0b9.css +0 -1
  12. package/dist/favicon.ico +0 -0
  13. package/dist/img/bottom_box.625e42a5.png +0 -0
  14. package/dist/img/car1.dd9a098b.png +0 -0
  15. package/dist/img/complete.2d0fa612.png +0 -0
  16. package/dist/img/diago_content.0d88c929.png +0 -0
  17. package/dist/img/diago_text_box.2e4da66b.png +0 -0
  18. package/dist/img/diago_title.2bd95b7a.png +0 -0
  19. package/dist/img/exception.a1eeefc3.png +0 -0
  20. package/dist/img/info1.829a6d7e.png +0 -0
  21. package/dist/img/info2.09e6e79e.png +0 -0
  22. package/dist/img/info3.3f96f756.png +0 -0
  23. package/dist/img/info4.6adcb927.png +0 -0
  24. package/dist/img/info5.ff3fdd2f.png +0 -0
  25. package/dist/img/info6.6e159d95.png +0 -0
  26. package/dist/img/left_box.40419b36.png +0 -0
  27. package/dist/img/money1.0743e701.png +0 -0
  28. package/dist/img/money2.58610d4d.png +0 -0
  29. package/dist/img/operating_fee.e6523ccc.png +0 -0
  30. package/dist/img/processing.28e46e7f.png +0 -0
  31. package/dist/img/public_content_box.39782fb5.png +0 -0
  32. package/dist/img/public_title_box1.6002afd4.png +0 -0
  33. package/dist/img/right_box.08458fe5.png +0 -0
  34. package/dist/img/success1.0cbc58af.png +0 -0
  35. package/dist/img/success2.af1a7499.png +0 -0
  36. package/dist/img/success3.d74caac5.png +0 -0
  37. package/dist/img/success4.37cc2343.png +0 -0
  38. package/dist/img/top_box.806bc756.png +0 -0
  39. package/dist/img/warehouse_map_popup.fa26d6cd.png +0 -0
  40. package/dist/img/work_error.3c528fdd.png +0 -0
  41. package/dist/img/work_su.0cbc58af.png +0 -0
  42. package/dist/img/work_wait.a2a706c9.png +0 -0
  43. package/dist/index.html +0 -13
  44. package/dist/js/chunk-vendors.901bdf0b.js +0 -8
  45. package/dist/js/chunk-vendors.901bdf0b.js.map +0 -1
  46. package/dist/js/index.29606843.js +0 -2
  47. package/dist/js/index.29606843.js.map +0 -1
  48. package/docs/.vuepress/config.js +0 -25
  49. package/docs/.vuepress/dist/404.html +0 -20
  50. package/docs/.vuepress/dist/assets/css/0.styles.7cfabf05.css +0 -1
  51. package/docs/.vuepress/dist/assets/img/7F8296FF-4A75-4013-BBFC-D482BF5303FF.597ff8a1.png +0 -0
  52. package/docs/.vuepress/dist/assets/img/gateway.98d6c8ec.jpg +0 -0
  53. package/docs/.vuepress/dist/assets/img/mysql_images.07b3a3e5.jpg +0 -0
  54. package/docs/.vuepress/dist/assets/img/nacos.741b050d.jpg +0 -0
  55. package/docs/.vuepress/dist/assets/img/rabbitmq.50b12be7.jpg +0 -0
  56. package/docs/.vuepress/dist/assets/img/redis_images.f0979945.jpg +0 -0
  57. package/docs/.vuepress/dist/assets/img/search.83621669.svg +0 -1
  58. package/docs/.vuepress/dist/assets/img/server-structure.6e0aa81e.png +0 -0
  59. package/docs/.vuepress/dist/assets/js/10.285f55d1.js +0 -1
  60. package/docs/.vuepress/dist/assets/js/11.decff412.js +0 -1
  61. package/docs/.vuepress/dist/assets/js/12.b9ed6e21.js +0 -1
  62. package/docs/.vuepress/dist/assets/js/13.d9c8c7a9.js +0 -1
  63. package/docs/.vuepress/dist/assets/js/14.6495a0e6.js +0 -1
  64. package/docs/.vuepress/dist/assets/js/15.70d64d1a.js +0 -1
  65. package/docs/.vuepress/dist/assets/js/16.a93c018c.js +0 -1
  66. package/docs/.vuepress/dist/assets/js/17.ed91eb16.js +0 -1
  67. package/docs/.vuepress/dist/assets/js/18.d07cd593.js +0 -1
  68. package/docs/.vuepress/dist/assets/js/19.4b8a0f22.js +0 -1
  69. package/docs/.vuepress/dist/assets/js/2.2668fa1b.js +0 -1
  70. package/docs/.vuepress/dist/assets/js/20.52de9326.js +0 -1
  71. package/docs/.vuepress/dist/assets/js/21.2293a5ca.js +0 -1
  72. package/docs/.vuepress/dist/assets/js/3.fd22fded.js +0 -1
  73. package/docs/.vuepress/dist/assets/js/4.ad26b2fa.js +0 -1
  74. package/docs/.vuepress/dist/assets/js/5.a1c97bcb.js +0 -1
  75. package/docs/.vuepress/dist/assets/js/6.32f67120.js +0 -1
  76. package/docs/.vuepress/dist/assets/js/7.99161716.js +0 -1
  77. package/docs/.vuepress/dist/assets/js/8.a0d65864.js +0 -1
  78. package/docs/.vuepress/dist/assets/js/9.2d06e692.js +0 -1
  79. package/docs/.vuepress/dist/assets/js/app.0be82e56.js +0 -15
  80. package/docs/.vuepress/dist/config/config_list.html +0 -58
  81. package/docs/.vuepress/dist/config/index.html +0 -69
  82. package/docs/.vuepress/dist/guide/admin.html +0 -26
  83. package/docs/.vuepress/dist/guide/deepchange.html +0 -213
  84. package/docs/.vuepress/dist/guide/gateway.html +0 -45
  85. package/docs/.vuepress/dist/guide/hystrix.html +0 -26
  86. package/docs/.vuepress/dist/guide/index.html +0 -66
  87. package/docs/.vuepress/dist/guide/nacos.html +0 -26
  88. package/docs/.vuepress/dist/guide/opsdev.html +0 -26
  89. package/docs/.vuepress/dist/guide/rabbitmq.html +0 -26
  90. package/docs/.vuepress/dist/guide/skywarking.html +0 -52
  91. package/docs/.vuepress/dist/guide/summary.html +0 -74
  92. package/docs/.vuepress/dist/help/index.html +0 -28
  93. package/docs/.vuepress/dist/help/markdown.html +0 -33
  94. package/docs/.vuepress/dist/images/7F8296FF-4A75-4013-BBFC-D482BF5303FF.png +0 -0
  95. package/docs/.vuepress/dist/images/gateway.jpg +0 -0
  96. package/docs/.vuepress/dist/images/mysql_images.jpg +0 -0
  97. package/docs/.vuepress/dist/images/nacos.jpg +0 -0
  98. package/docs/.vuepress/dist/images/rabbitmq.jpg +0 -0
  99. package/docs/.vuepress/dist/images/redis_images.jpg +0 -0
  100. package/docs/.vuepress/dist/images/server-structure.png +0 -0
  101. package/docs/.vuepress/dist/index.html +0 -26
  102. package/docs/.vuepress/dist/logo.jpg +0 -0
  103. package/docs/.vuepress/nav.js +0 -34
  104. package/docs/.vuepress/public/images/7F8296FF-4A75-4013-BBFC-D482BF5303FF.png +0 -0
  105. package/docs/.vuepress/public/images/gateway.jpg +0 -0
  106. package/docs/.vuepress/public/images/mysql_images.jpg +0 -0
  107. package/docs/.vuepress/public/images/nacos.jpg +0 -0
  108. package/docs/.vuepress/public/images/rabbitmq.jpg +0 -0
  109. package/docs/.vuepress/public/images/redis_images.jpg +0 -0
  110. package/docs/.vuepress/public/images/server-structure.png +0 -0
  111. package/docs/.vuepress/public/logo.jpg +0 -0
  112. package/docs/.vuepress/sidebar.js +0 -62
  113. package/docs/README.md +0 -15
  114. package/docs/config/README.md +0 -108
  115. package/docs/config/config_list.md +0 -42
  116. package/docs/guide/README.md +0 -79
  117. package/docs/guide/admin.md +0 -25
  118. package/docs/guide/deepchange.md +0 -393
  119. package/docs/guide/gateway.md +0 -40
  120. package/docs/guide/hystrix.md +0 -21
  121. package/docs/guide/nacos.md +0 -7
  122. package/docs/guide/opsdev.md +0 -12
  123. package/docs/guide/rabbitmq.md +0 -15
  124. package/docs/guide/skywarking.md +0 -77
  125. package/docs/guide/summary.md +0 -120
  126. package/docs/help/README.md +0 -29
  127. package/docs/help/markdown.md +0 -165
  128. package/examples/App.vue +0 -21
  129. package/examples/assets/css/map-base.scss +0 -333
  130. package/examples/assets/fonts/pmzd.ttf +0 -0
  131. package/examples/assets/icons/index.js +0 -9
  132. package/examples/assets/icons/svg/404.svg +0 -1
  133. package/examples/assets/icons/svg/bug.svg +0 -1
  134. package/examples/assets/icons/svg/build.svg +0 -1
  135. package/examples/assets/icons/svg/button.svg +0 -1
  136. package/examples/assets/icons/svg/cascader.svg +0 -1
  137. package/examples/assets/icons/svg/chart.svg +0 -1
  138. package/examples/assets/icons/svg/checkbox.svg +0 -1
  139. package/examples/assets/icons/svg/clipboard.svg +0 -1
  140. package/examples/assets/icons/svg/code.svg +0 -1
  141. package/examples/assets/icons/svg/color.svg +0 -1
  142. package/examples/assets/icons/svg/component.svg +0 -1
  143. package/examples/assets/icons/svg/dashboard.svg +0 -1
  144. package/examples/assets/icons/svg/date-range.svg +0 -1
  145. package/examples/assets/icons/svg/date.svg +0 -1
  146. package/examples/assets/icons/svg/dict.svg +0 -1
  147. package/examples/assets/icons/svg/documentation.svg +0 -1
  148. package/examples/assets/icons/svg/download.svg +0 -1
  149. package/examples/assets/icons/svg/drag.svg +0 -1
  150. package/examples/assets/icons/svg/druid.svg +0 -1
  151. package/examples/assets/icons/svg/edit.svg +0 -1
  152. package/examples/assets/icons/svg/education.svg +0 -1
  153. package/examples/assets/icons/svg/email.svg +0 -1
  154. package/examples/assets/icons/svg/example.svg +0 -1
  155. package/examples/assets/icons/svg/excel.svg +0 -1
  156. package/examples/assets/icons/svg/exit-fullscreen.svg +0 -1
  157. package/examples/assets/icons/svg/eye-open.svg +0 -1
  158. package/examples/assets/icons/svg/eye.svg +0 -1
  159. package/examples/assets/icons/svg/form.svg +0 -1
  160. package/examples/assets/icons/svg/fullscreen.svg +0 -1
  161. package/examples/assets/icons/svg/github.svg +0 -1
  162. package/examples/assets/icons/svg/guide.svg +0 -1
  163. package/examples/assets/icons/svg/icon.svg +0 -1
  164. package/examples/assets/icons/svg/input.svg +0 -1
  165. package/examples/assets/icons/svg/international.svg +0 -1
  166. package/examples/assets/icons/svg/job.svg +0 -1
  167. package/examples/assets/icons/svg/language.svg +0 -1
  168. package/examples/assets/icons/svg/link.svg +0 -1
  169. package/examples/assets/icons/svg/list.svg +0 -1
  170. package/examples/assets/icons/svg/lock.svg +0 -1
  171. package/examples/assets/icons/svg/log.svg +0 -1
  172. package/examples/assets/icons/svg/logininfor.svg +0 -1
  173. package/examples/assets/icons/svg/message.svg +0 -1
  174. package/examples/assets/icons/svg/money.svg +0 -1
  175. package/examples/assets/icons/svg/monitor.svg +0 -2
  176. package/examples/assets/icons/svg/nested.svg +0 -1
  177. package/examples/assets/icons/svg/number.svg +0 -1
  178. package/examples/assets/icons/svg/online.svg +0 -1
  179. package/examples/assets/icons/svg/password.svg +0 -1
  180. package/examples/assets/icons/svg/pdf.svg +0 -1
  181. package/examples/assets/icons/svg/people.svg +0 -1
  182. package/examples/assets/icons/svg/peoples.svg +0 -1
  183. package/examples/assets/icons/svg/phone.svg +0 -1
  184. package/examples/assets/icons/svg/post.svg +0 -1
  185. package/examples/assets/icons/svg/qq.svg +0 -1
  186. package/examples/assets/icons/svg/question.svg +0 -1
  187. package/examples/assets/icons/svg/radio.svg +0 -1
  188. package/examples/assets/icons/svg/rate.svg +0 -1
  189. package/examples/assets/icons/svg/redis.svg +0 -1
  190. package/examples/assets/icons/svg/row.svg +0 -1
  191. package/examples/assets/icons/svg/search.svg +0 -1
  192. package/examples/assets/icons/svg/select.svg +0 -1
  193. package/examples/assets/icons/svg/server.svg +0 -1
  194. package/examples/assets/icons/svg/shopping.svg +0 -1
  195. package/examples/assets/icons/svg/size.svg +0 -1
  196. package/examples/assets/icons/svg/skill.svg +0 -1
  197. package/examples/assets/icons/svg/slider.svg +0 -1
  198. package/examples/assets/icons/svg/star.svg +0 -1
  199. package/examples/assets/icons/svg/swagger.svg +0 -1
  200. package/examples/assets/icons/svg/switch.svg +0 -1
  201. package/examples/assets/icons/svg/system.svg +0 -2
  202. package/examples/assets/icons/svg/tab.svg +0 -1
  203. package/examples/assets/icons/svg/table.svg +0 -1
  204. package/examples/assets/icons/svg/textarea.svg +0 -1
  205. package/examples/assets/icons/svg/theme.svg +0 -1
  206. package/examples/assets/icons/svg/time-range.svg +0 -1
  207. package/examples/assets/icons/svg/time.svg +0 -1
  208. package/examples/assets/icons/svg/tool.svg +0 -1
  209. package/examples/assets/icons/svg/tree-table.svg +0 -1
  210. package/examples/assets/icons/svg/tree.svg +0 -1
  211. package/examples/assets/icons/svg/turn-right.svg +0 -1
  212. package/examples/assets/icons/svg/upload.svg +0 -1
  213. package/examples/assets/icons/svg/user.svg +0 -1
  214. package/examples/assets/icons/svg/validCode.svg +0 -1
  215. package/examples/assets/icons/svg/wechat.svg +0 -1
  216. package/examples/assets/icons/svg/zip.svg +0 -1
  217. package/examples/assets/icons/svgo.yml +0 -22
  218. package/examples/assets/images/close_diago.png +0 -0
  219. package/examples/assets/images/red_circle.png +0 -0
  220. package/examples/assets/images/w_mj_map.png +0 -0
  221. package/examples/assets/images/warehouse_map_popup.png +0 -0
  222. package/examples/assets/images/warehouse_map_success.png +0 -0
  223. package/examples/assets/images/warehouse_map_warning.png +0 -0
  224. package/examples/assets/js/gps.js +0 -222
  225. package/examples/assets/logo.png +0 -0
  226. package/examples/components/HelloWorld.vue +0 -273
  227. package/examples/components/MapPopup.vue +0 -80
  228. package/examples/data/510000.js +0 -2056
  229. package/examples/data/510000.json +0 -2055
  230. package/examples/data/testData.js +0 -2088
  231. package/examples/main.js +0 -28
  232. package/examples/utils/echarts/esresize.js +0 -110
  233. package/jsconfig.json +0 -19
  234. package/vue.config.js +0 -54
  235. package/vue2-openlayers/package.json +0 -56
  236. package/vue2-openlayers/vue2-openlayers.umd.min.js +0 -2
  237. package/vue2-openlayers/vue2-openlayers.umd.min.js.map +0 -1
  238. /package/{vue2-openlayers/demo.html → demo.html} +0 -0
@@ -1,222 +0,0 @@
1
- /**
2
- * WGS-84原始坐标系,一般用国际GPS纪录仪记录下来的经纬度,通过GPS定位拿到的原始经纬度
3
- *
4
- * GCJ-02坐标系,又名“火星坐标系”,是我国国测局独创的坐标体系,由WGS-84加密而成
5
- *
6
- * 百度坐标系:bd-09,百度坐标系是在GCJ-02坐标系的基础上再次加密偏移后形成的坐标系,只适用于百度地图
7
- */
8
-
9
- const PI = 3.14159265358979324;
10
-
11
- // const x_pi = 3.14159265358979324 * 3000.0 / 180.0;
12
-
13
- function delta(lat, lon) {
14
- // Krasovsky 1940
15
- //
16
- // a = 6378245.0, 1/f = 298.3
17
- // b = a * (1 - f)
18
- // ee = (a^2 - b^2) / a^2;
19
- var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。
20
- var ee = 0.00669342162296594323; // ee: 椭球的偏心率。
21
- var dLat = transformLat(lon - 105.0, lat - 35.0);
22
- var dLon = transformLon(lon - 105.0, lat - 35.0);
23
- var radLat = lat / 180.0 * PI;
24
- var magic = Math.sin(radLat);
25
- magic = 1 - ee * magic * magic;
26
- var sqrtMagic = Math.sqrt(magic);
27
- dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * PI);
28
- dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * PI);
29
- return { 'lat': dLat + 0.000004, 'lon': dLon + 0.000004 };
30
- }
31
-
32
- function outOfChina(lat, lon) {
33
- if (lon < 72.004 || lon > 137.8347)
34
- return true;
35
- if (lat < 0.8293 || lat > 55.8271)
36
- return true;
37
- return false;
38
- }
39
-
40
- function transformLat(x, y) {
41
- 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));
42
- ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
43
- ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0;
44
- ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0;
45
- return ret;
46
- }
47
-
48
- function transformLon(x, y) {
49
- var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
50
- ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
51
- ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0;
52
- ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0;
53
- return ret;
54
- }
55
-
56
- /**
57
- * gps-->高德
58
- * @param {*} wgsLat lat 纬度
59
- * @param {*} wgsLon lng 经度
60
- */
61
- export function gps2gd(wgsLat, wgsLon) {
62
- if (typeof wgsLat === 'string') wgsLat = Number(wgsLat);
63
- if (typeof wgsLon === 'string') wgsLon = Number(wgsLon);
64
- if (outOfChina(wgsLat, wgsLon))
65
- return { 'lat': wgsLat, 'lng': wgsLon };
66
-
67
- var d = delta(wgsLat, wgsLon);
68
- return { 'lat': wgsLat + d.lat, 'lng': wgsLon + d.lon };
69
- }
70
-
71
- /**
72
- * 高德坐标系转gps
73
- */
74
- export function gd2gps(gcjLat, gcjLon) {
75
- if (typeof gcjLat === 'string') gcjLat = Number(gcjLat);
76
- if (typeof gcjLon === 'string') gcjLon = Number(gcjLon);
77
- if (outOfChina(gcjLat, gcjLon))
78
- return { 'lat': gcjLat, 'lng': gcjLon };
79
- var d = delta(gcjLat, gcjLon);
80
- let lat = gcjLat - d.lat;
81
- let lon = gcjLon - d.lon;
82
- for (let i = 0; i < 1; i++) {
83
- d = delta(lat, lon);
84
- lat = gcjLat - d.lat;
85
- lon = gcjLon - d.lon;
86
- }
87
- return { 'lat': lat, 'lng': lon };
88
-
89
- }
90
-
91
-
92
-
93
-
94
- /**
95
- * 批量gps--->高德
96
- * @param [{ lat :xxx,lng:xxx}] list
97
- */
98
- export function batchGps2gd(list) {
99
- let rlist = [];
100
- for (let i = 0; i < list.length; i++) {
101
- rlist.push(gps2gd(list[i].lat, list[i].lng))
102
- }
103
- return rlist;
104
- }
105
- // gps转高德
106
- export function localConvertListAndSetname(list, lngName, latName) {
107
- if (list instanceof Array) {
108
- //原有点
109
- let locations = list.map((n) => {
110
- return {
111
- lat: n[latName],
112
- lng: n[lngName],
113
- };
114
-
115
- });
116
- // console.info("批量坐标转换数量:" + locations.length);
117
- let results = batchGps2gd(locations);
118
- for (let i = 0; i < results.length; i++) {
119
- list[i].P = results[i].lat;
120
- list[i].R = results[i].lng;
121
- }
122
- } else if (list instanceof Object && list != null && list != undefined) {
123
- let res = gps2gd(list[latName], list[lngName]);
124
- list.P = res.lat || 30.573095;
125
- list.R = res.lng || 104.066143;
126
- }
127
- }
128
- ////无返回 直接处理字段 阻塞型
129
- export function localConvert(list, lngName, latName, usePR) {
130
- if (list instanceof Array) {
131
- //原有点
132
- let locations = list.map(n => { return { lat: n[latName], lng: n[lngName] } });
133
- console.info('批量坐标转换数量:' + locations.length);
134
- let results = batchGps2gd(locations);
135
- if (usePR) {
136
- for (let i = 0; i < results.length; i++) {
137
- list[i].P = results[i].lat;
138
- list[i].R = results[i].lng;
139
- }
140
- } else {
141
- for (let i = 0; i < results.length; i++) {
142
- list[i][latName] = results[i].lat;
143
- list[i][lngName] = results[i].lng;
144
- }
145
- }
146
-
147
- } else if ((list instanceof Object) && list != null && list != undefined) {
148
- console.info('转换坐标1个');
149
- let res = gps2gd(list[latName], list[lngName]);
150
- if (usePR) {
151
- list.P = res.lat;
152
- list.R = res.lng;
153
- } else {
154
- list[latName] = res.lat;
155
- list[lngName] = res.lng;
156
- }
157
-
158
- }
159
- }
160
-
161
- /// gps->Gd 转换 结构如同 [[104.31892600,30.71867200], [104.31836300,30.71835900], [104.31769800,30.71797600]]的数据机构点
162
- export function localConvertArray(arrayList) {
163
- arrayList.forEach(arr => {
164
- let p = gps2gd(arr[1], arr[0])
165
- arr[0] = p.lng;
166
- arr[1] = p.lat;
167
- });
168
- return arrayList;
169
- }
170
-
171
-
172
- export function gpsToGd(wgLon, wgLat) {
173
- var pi = 3.14159265358979324;
174
- var a = 6378245.0;
175
- var ee = 0.00669342162296594323;
176
- var cj, cw;
177
-
178
- if (outOfChina(wgLat, wgLon)) {
179
- return false;
180
- } else {
181
- wgLat = parseFloat(wgLat);
182
- wgLon = parseFloat(wgLon);
183
- var dLat = transformLat(wgLon - 105.0, wgLat - 35.0);
184
- var dLon = transformLon(wgLon - 105.0, wgLat - 35.0);
185
- var radLat = wgLat / 180.0 * pi;
186
- var magic = Math.sin(radLat);
187
- magic = 1 - ee * magic * magic;
188
- var sqrtMagic = Math.sqrt(magic);
189
- dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
190
- dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
191
-
192
- cw = wgLat + dLat;
193
- cj = wgLon + dLon;
194
- return [cj, cw]
195
- }
196
-
197
- // function outOfChina(lat, lon) {
198
- // if (lon < 72.004 || lon > 137.8347)
199
- // return true;
200
- // if (lat < 0.8293 || lat > 55.8271)
201
- // return true;
202
- // return false;
203
- //上面注释为判断经纬度是否在中国
204
- // return false;
205
- // };
206
-
207
- function transformLat(x, y) {
208
- 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));
209
- ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
210
- ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
211
- ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
212
- return ret;
213
- }
214
-
215
- function transformLon(x, y) {
216
- var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
217
- ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
218
- ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
219
- ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 * pi)) * 2.0 / 3.0;
220
- return ret;
221
- }
222
- }
Binary file
@@ -1,273 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="map_index">
4
- <!-- 定义地图容器与相关样式(宽高等) -->
5
- <div id="app">
6
- <yl-map @handleDownEvent="handleDownEvent" ref="map">
7
- <template slot="yl-map-layers">
8
- <yl-line :lineData="lineData" :lineFun="lineFun" v-if="tabIndex==1"></yl-line>
9
- <yl-point :pointData="pointData" :pointFun="pointFun" :pointAnimation="tabIndex==3" v-if="tabIndex==3 || tabIndex == 2" :zIndex="3"></yl-point>
10
- <yl-fiy-line :pointData="pointData" :pointFun="flyPointFun" :lineData="lineDataFiy" :lineFun="flyLineFun" v-if="tabIndex == 4" :zIndex="4"></yl-fiy-line>
11
- <yl-geo-json :geoJsonUrl="geoJsonUrl" v-if="tabIndex==5" :zIndex="2"></yl-geo-json>
12
- </template>
13
- <template slot="yl-map-overlay">
14
- <MapPopup :visible.sync="showDialog">
15
- <template slot="map-popup-title">
16
- {{ popupContent?.nodeName }}
17
- </template>
18
- <template slot="map-popup-main">
19
- {{ popupContent }}
20
- </template>
21
- </MapPopup>
22
- </template>
23
- </yl-map>
24
- </div>
25
- <div class="btn-list">
26
- <div class="btn" @click="changeTab(item, index + 1)" v-for="(item, index) in tableList" :key="index" :class="tabIndex==(index+1)?'active':''">{{ item.name }}</div>
27
- </div>
28
- </div>
29
- </div>
30
- </template>
31
-
32
- <script>
33
- import { sichuan } from "../data/510000";
34
- import { returnFlyingSpotData } from "../data/testData";
35
- let pointDataList = [];
36
- returnFlyingSpotData().data.locationInfo.forEach(el=>{
37
- pointDataList.push({
38
- info: el,
39
- lat: el.latitude,
40
- lng: el.longitude
41
- })
42
- })
43
-
44
- import MapPopup from "./MapPopup";
45
- export default {
46
- name: 'App',
47
- components: {
48
- MapPopup
49
- },
50
- data() {
51
- return {
52
- tabIndex: 0,
53
- tableList: [
54
- {name: '线型示例'},
55
- {name: '点位示例'},
56
- {name: '点位扩散示例'},
57
- {name: '飞线示例'},
58
- {name: 'geoJson数据示例'},
59
- ],
60
- geoJsonUrl: 'http://8.137.153.28:33660/510000.json',
61
- showDialog: false,
62
- popupContent: null,
63
- geoJsonState: true,
64
- lineState: true,
65
- pointState: false,
66
- fiyState: false,
67
- lineDataFiy: returnFlyingSpotData().data.relationship,
68
- pointFun:(element)=>{
69
- return {
70
- style: {
71
- src: element.subType==2?require("@/assets/images/warehouse_map_success.png"):require("@/assets/images/warehouse_map_warning.png"),
72
- scale: 1,
73
- },
74
- type: 'Icon'
75
- }
76
- },//点样式
77
- lineFun:()=>{
78
- return {
79
- color:null,
80
- width:null
81
- }
82
- },//线样式
83
- flyPointFun:(element)=>{
84
- return {
85
- style: {
86
- src: element.subType==2?require("@/assets/images/w_mj_map.png"):require("@/assets/images/red_circle.png"),
87
- scale: 1,
88
- },
89
- type: 'Icon'
90
- }
91
- },//飞点样式
92
- flyLineFun:(element)=>{
93
- if(element){
94
- if(element.status==1){
95
- return {
96
- color: [76, 255, 255, 0.6],
97
- width: 1.5
98
- }
99
- }else{
100
- return {
101
- color: [179, 178, 116, 1],
102
- width: 1.5
103
- }
104
- }
105
- }
106
- return {
107
- color: [76, 255, 255, 0.6],
108
- width: 1.5
109
- }
110
- },//飞线样式
111
- lineData:[
112
- ],//线性数据结构
113
- pointData: pointDataList,//点数据结构
114
- }
115
- },
116
- methods:{
117
- //地图元素点击事件
118
- handleDownEvent(coordinate, value){
119
- this.popupContent = value;
120
- this.$refs.map.showPopup({
121
- position: coordinate,
122
- offset: [5, -5],
123
- positioning: "bottom-center",
124
- duration: 250
125
- });
126
- this.showDialog = true;
127
- },
128
-
129
- //注意:closeOverlay()、refMapData()、fitView()使用: 给地图添加ref
130
-
131
- //关闭弹框
132
- closeOverlay(){
133
- this.$refs.map.close();
134
- this.showDialog = false;
135
- },
136
- //刷新地图叠加层数据
137
- refMapData(){
138
- this.$bus.$emit(this.$refs.map.mapId + "ready", {});
139
- },
140
- //移动焦点位置 传入值features:Array
141
- // fitView(feature){
142
- // this.$refs.map.fitViewfeatures([feature]);
143
- // },
144
- // 切换选项卡
145
- changeTab(item, index) {
146
- if (index == this.tabIndex) {
147
- return;
148
- }
149
- this.tabIndex = index;
150
- this.closeOverlay();
151
- },
152
- },
153
- mounted(){
154
- // 模拟改变线型数据值
155
- this.lineData = [{
156
- data: sichuan().features[0].geometry.coordinates[0],
157
- info: sichuan().features[0].properties.name,
158
- }]
159
- }
160
- }
161
- </script>
162
-
163
- <style lang="scss" scoped>
164
- @import "@/assets/css/map-base.scss";
165
-
166
- :deep() html, body, #app {
167
- height: 100%;
168
- margin: 0px;
169
- }
170
-
171
- ::v-deep ::-webkit-scrollbar {
172
- width: 0.5vh !important;
173
- height: 0.5vh !important;
174
- }
175
-
176
- ::v-deep ::-webkit-scrollbar-thumb {
177
- border-radius: 2px !important;
178
- background: rgba(31, 92, 153, 1) !important;
179
- }
180
-
181
- .map_index {
182
- position: relative;
183
- height: 100vh;
184
- width: 100vw;
185
- overflow: hidden;
186
-
187
- i {
188
- font-size: 1.2vh;
189
- }
190
-
191
- img {
192
- width: 1.5vh;
193
- height: 1.5vh;
194
- }
195
-
196
- #map {
197
- position: absolute;
198
- width: 100%;
199
- top: 0;
200
- left: 0;
201
- height: 100%;
202
- }
203
-
204
- }
205
-
206
-
207
- .map-popup-style{
208
- background: rgba(0, 0, 0, 0.5);
209
- color: #fff;
210
- padding: 5px;
211
- border-radius: 5px;
212
- font-size: 12px;
213
- max-width: 200px;
214
- word-break: break-all;
215
- white-space: normal;
216
- }
217
-
218
- .btn-list{
219
- position: absolute;
220
- top: 10px;
221
- right: 10px;
222
- z-index: 999;
223
- padding: 10px;
224
- border-radius: 5px;
225
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
226
- .btn{
227
- display: flex;
228
- flex: 1;
229
- justify-content: center;
230
- flex-direction: column;
231
- align-items: center;
232
- margin-bottom: 0.8vh;
233
- background: #093159;
234
- color: rgba(184, 203, 229, 1);
235
- font-size: 1.25vh;
236
- padding: 1vh 0.8vh;
237
- border-radius: 2px;
238
- cursor: pointer;
239
- &:hover{
240
- color: #409eff;
241
- }
242
- }
243
- .active{
244
- background: rgba(25, 140, 255, 1);
245
- }
246
- }
247
- :deep() .ol-zoom-in{
248
- background: #093159;
249
- color: #fff !important;
250
- border-radius: 5px;
251
- padding: 5px;
252
- font-size: 12px;
253
- margin-bottom: 10px;
254
- cursor: pointer;
255
- &:hover{
256
- color: #fff;
257
- }
258
- }
259
- :deep() .ol-zoom-out{
260
- background: #093159;
261
- color: #fff !important;
262
- border-radius: 5px;
263
- padding: 5px;
264
- font-size: 12px;
265
- cursor: pointer;
266
- &:hover{
267
- color: #fff;
268
- }
269
- }
270
- :deep() .ol-control{
271
- background: transparent;
272
- }
273
- </style>
@@ -1,80 +0,0 @@
1
- <template>
2
- <div id="warehouse-popup" class="map-popup" v-if="visible">
3
- <img
4
- class="close_diago"
5
- @click="close"
6
- src="../assets/images/close_diago.png"/>
7
- <div class="map-popup-title">
8
- <slot name="map-popup-title"></slot>
9
- </div>
10
- <div class="map-popup-main">
11
- <slot name="map-popup-main"></slot>
12
- </div>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- export default {
18
- name: 'MapPopup',
19
- props: {
20
- visible: {
21
- type: Boolean,
22
- default: false
23
- }
24
- },
25
- data() {
26
- return {
27
- popupShow: false,
28
- };
29
- },
30
- methods: {
31
- close() {
32
- this.$emit('update:visible', false);
33
- }
34
- }
35
- };
36
- </script>
37
-
38
- <style lang="scss" scoped>
39
- .map-popup {
40
- position: relative;
41
- width: 28.43vw;
42
- height: 17.34vw;
43
- background-image: url("../assets/images/warehouse_map_popup.png");
44
- background-repeat: no-repeat;
45
- background-size: 100% 100%;
46
- display: flex;
47
- flex-direction: column;
48
- padding: 0 1.56vw 1.56vw 1.56vw;
49
- // position: absolute;
50
- // left: 50vw;
51
- // top: 50vh;
52
- .map-popup-title{
53
- font-size: 18px;
54
- font-family: Microsoft YaHei, Microsoft YaHei;
55
- font-weight: 700;
56
- color: #ffffff;
57
- height: 2.86vw;
58
- display: flex;
59
- align-items: center;
60
- }
61
- .map-popup-main {
62
- display: flex;
63
- align-items: center;
64
- flex: 1;
65
- font-size: 14px;
66
- margin-top: 0.625vw;
67
- padding: 1vw 1vw 0 1vw;
68
- flex-direction: column;
69
- }
70
- }
71
- .close_diago {
72
- height: 28px;
73
- width: 28px;
74
- margin-right: 20px;
75
- cursor: pointer;
76
- position: absolute;
77
- top: 20px;
78
- right: 5px;
79
- }
80
- </style>