説明なし

map2.html 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. , {
  111. type: 'effectScatter',
  112. coordinateSystem: 'geo',
  113. showEffectOn: 'render',
  114. rippleEffect: {
  115. period: 5,
  116. scale: 5,
  117. brushType: 'fill'
  118. },
  119. hoverAnimation: true,
  120. label: {
  121. formatter: '{b}',
  122. position: 'right',
  123. offset: [15, 0],
  124. color: '#fff',
  125. show: true
  126. },
  127. itemStyle: {
  128. normal: {
  129. color: '#f0f',
  130. shadowBlur: 10,
  131. shadowColor: '#ff0'
  132. }
  133. },
  134. itemStyle: {
  135. color: '#fff',
  136. shadowBlur: 10,
  137. shadowColor: '#333',
  138. opacity: 0.75
  139. },
  140. emphasis: {
  141. itemStyle: {
  142. opacity: 1, //线条宽度
  143. }
  144. },
  145. data: points
  146. }, {
  147. name: '供应商A',
  148. type: 'lines',
  149. zlevel: 2,
  150. symbol: ['none', 'arrow'],
  151. symbolSize: 7,
  152. effect: {
  153. show: true,
  154. period: 4,
  155. trailLength: 0.02,
  156. symbol: 'circle',
  157. symbolSize: 4,
  158. color: '#fff'
  159. },
  160. lineStyle: {
  161. width: 0.5, //线条宽度
  162. opacity: 0.5, //尾迹线条透明度
  163. curveness: .3, //尾迹线条曲直度
  164. shadowBlur: 10,
  165. },
  166. emphasis: {
  167. lineStyle: {
  168. width: 2, //线条宽度
  169. }
  170. },
  171. data: [{
  172. name: '供应商A->BossSoft',
  173. value: 40,
  174. coords: [
  175. [113.854634,36.010256],
  176. [114.418257,36.034251]
  177. ],
  178. }]
  179. }, {
  180. name: '供应商B',
  181. type: 'lines',
  182. zlevel: 2,
  183. symbol: ['none', 'arrow'],
  184. symbolSize: 7,
  185. effect: {
  186. show: true,
  187. period: 4,
  188. trailLength: 0.02,
  189. symbol: 'circle',
  190. symbolSize: 4,
  191. color: '#fff'
  192. },
  193. lineStyle: {
  194. width: 0.5, //线条宽度
  195. opacity: 0.5, //尾迹线条透明度
  196. curveness: 0.3, //尾迹线条曲直度
  197. shadowBlur: 10,
  198. },
  199. emphasis: {
  200. lineStyle: {
  201. width: 2, //线条宽度
  202. }
  203. },
  204. data: [{
  205. name: '供应商B->BossSoft',
  206. value: 80,
  207. coords: [
  208. [114.295989,36.231785],
  209. [114.418257,36.034251]
  210. ]
  211. }]
  212. }]
  213. };
  214. myChart.setOption(option);
  215. });
  216. </script>
  217. </html>