Brak opisu

map2 - 副本.html 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. </head>
  7. <body>
  8. <div id="main" style="width: 1700px;height: 800px;"></div>
  9. </body>
  10. <script src="js/echarts.min.js"></script>
  11. <script src="js/jquery.min.js"></script>
  12. <script>
  13. var uploadedDataURL = "format.1629790904713.json";
  14. var myChart = echarts.init(document.getElementById('main'));
  15. var points = [{
  16. name: '安阳县',
  17. value: [114.295989,36.231785]
  18. },
  19. {
  20. name: '北关区',
  21. value: [114.379621,36.137115]
  22. },
  23. {
  24. name: '滑县',
  25. value: [ 114.667181,35.465867]
  26. },
  27. {
  28. name: '龙安区',
  29. value: [114.254489,36.044375]
  30. },
  31. {
  32. name: '林州市',
  33. value: [113.854634,36.010256]
  34. },
  35. {
  36. name: '内黄县',
  37. value: [114.8165,35.900576]
  38. },
  39. {
  40. name: '汤阴县',
  41. value: [ 114.455689,35.902302]
  42. },
  43. {
  44. name: '文峰区',
  45. value: [114.418257,36.034251]
  46. },
  47. {
  48. name: '殷都区',
  49. value:[114.289197,36.133648]
  50. }
  51. ];
  52. // let colors = ['#FF8C00', '#00acea', '#1DE9B6'];
  53. $.getJSON(uploadedDataURL, function(geoJson) {
  54. echarts.registerMap('anyang', geoJson);
  55. option = {
  56. // color: ['#FF8C00', '#00acea', '#1DE9B6'],
  57. tooltip: {
  58. trigger: 'item',
  59. formatter: '{b}'
  60. },
  61. visualMap: {//visualMap 是视觉映射组件,用于进行『视觉编码』,也就是将数据映射到视觉元素(视觉通道)。
  62. show: true,//是否显示组件
  63. max: 20,//指定 visualMapContinuous 组件的允许的最大值
  64. left: '5%',
  65. top: 'bottom',
  66. bottom:'5%',
  67. text: ['高', '低'],//两端的文本,如 ['High', 'Low']
  68. calculable: true,//是否显示拖拽用的手柄(手柄能拖拽调整选中范围)。
  69. // inRange: {//定义 在选中范围中 的视觉元素。
  70. // color: [ '#416cbb' ,'#00b4ff', '#00deff' ,'#00ffe4', '#79fff1', '#fff17b', '#ffd200'],//图元的颜色。
  71. // },
  72. textStyle: {//设置文字颜色(Demo左下组件)
  73. color: '#eee'
  74. }
  75. },
  76. geo: {
  77. map: 'anyang',
  78. show: true
  79. },
  80. series: [{
  81. type: 'map',
  82. map: 'anyang',
  83. aspectScale: 0.75,
  84. // backgroundColor: ,
  85. itemStyle: {
  86. borderColor: 'rgba(100,149,237,1)',
  87. borderWidth: 0.5,
  88. areaColor: '#0ff'
  89. },
  90. // label: {
  91. // show: true,
  92. // textStyle: {
  93. // color: '#fff'
  94. // },
  95. // emphasis: {
  96. // textStyle: {
  97. // color: '#fff'
  98. // }
  99. // }
  100. // },
  101. emphasis: {
  102. label: {
  103. show: false
  104. },
  105. itemStyle: {
  106. areaColor: 'rgba(0,0,0,0)',
  107. }
  108. }
  109. }, {
  110. type: 'effectScatter',
  111. coordinateSystem: 'geo',
  112. // showEffectOn: 'render',
  113. // rippleEffect: {
  114. // period: 5,
  115. // scale: 5,
  116. // brushType: 'fill'
  117. // },
  118. // hoverAnimation: true,
  119. // label: {
  120. // formatter: '{b}',
  121. // position: 'right',
  122. // offset: [15, 0],
  123. // color: '#fff',
  124. // show: true
  125. // },
  126. // itemStyle: {
  127. // normal: {
  128. // color: '#f0f',
  129. // shadowBlur: 10,
  130. // shadowColor: '#ff0'
  131. // }
  132. // },
  133. // itemStyle: {
  134. // color: (param) => {
  135. // return colors[param.dataIndex % colors.length];
  136. // },
  137. // shadowBlur: 10,
  138. // shadowColor: '#333',
  139. // opacity: 0.75
  140. // },
  141. // emphasis: {
  142. // itemStyle: {
  143. // opacity: 1, //线条宽度
  144. // }
  145. // },
  146. data: points
  147. }, {
  148. name: '供应商A',
  149. type: 'lines',
  150. zlevel: 2,
  151. symbol: ['none', 'arrow'],
  152. symbolSize: 7,
  153. effect: {
  154. show: true,
  155. period: 4,
  156. trailLength: 0.02,
  157. symbol: 'circle',
  158. symbolSize: 4,
  159. color: '#fff'
  160. },
  161. lineStyle: {
  162. width: 0.5, //线条宽度
  163. opacity: 0.5, //尾迹线条透明度
  164. curveness: .3, //尾迹线条曲直度
  165. shadowBlur: 10,
  166. },
  167. emphasis: {
  168. lineStyle: {
  169. width: 2, //线条宽度
  170. }
  171. },
  172. data: [{
  173. name: '供应商A->BossSoft',
  174. value: 40,
  175. coords: [
  176. [113.854634,36.010256],
  177. [114.418257,36.034251]
  178. ],
  179. }]
  180. }, {
  181. name: '供应商B',
  182. type: 'lines',
  183. zlevel: 2,
  184. symbol: ['none', 'arrow'],
  185. symbolSize: 7,
  186. effect: {
  187. show: true,
  188. period: 4,
  189. trailLength: 0.02,
  190. symbol: 'circle',
  191. symbolSize: 4,
  192. color: '#fff'
  193. },
  194. lineStyle: {
  195. width: 0.5, //线条宽度
  196. opacity: 0.5, //尾迹线条透明度
  197. curveness: 0.3, //尾迹线条曲直度
  198. shadowBlur: 10,
  199. },
  200. emphasis: {
  201. lineStyle: {
  202. width: 2, //线条宽度
  203. }
  204. },
  205. data: [{
  206. name: '供应商B->BossSoft',
  207. value: 80,
  208. coords: [
  209. [114.295989,36.231785],
  210. [114.418257,36.034251]
  211. ]
  212. }]
  213. }]
  214. };
  215. myChart.setOption(option);
  216. });
  217. </script>
  218. </html>