lines-symbol.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <html>
  2. <head>
  3. <meta charset='utf-8'>
  4. <script src='esl.js'></script>
  5. <script src='config.js'></script>
  6. <script src='lib/jquery.min.js'></script>
  7. <script src='http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM'></script>
  8. <meta name='viewport' content='width=device-width, initial-scale=1' />
  9. </head>
  10. <body>
  11. <style>
  12. html, body, #main {
  13. width: 100%;
  14. height: 100%;
  15. margin: 0;
  16. }
  17. </style>
  18. <div id='main'></div>
  19. <script>
  20. require([
  21. 'echarts',
  22. 'echarts/chart/lines',
  23. 'echarts/chart/effectScatter',
  24. 'echarts/component/legend',
  25. 'echarts/component/geo'
  26. ], function (echarts) {
  27. $.get('../map/json/china.json', function (chinaJson) {
  28. echarts.registerMap('china', chinaJson);
  29. var myChart = echarts.init(document.getElementById('main'));
  30. var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
  31. var option = {
  32. geo: {
  33. map: 'china',
  34. roam: true
  35. },
  36. series: [{
  37. type: 'lines',
  38. coordinateSystem: 'geo',
  39. polyline: true,
  40. effect: {
  41. show: true,
  42. period: 8,
  43. color: '#4433aa',
  44. symbolSize: 20,
  45. symbol: planePath
  46. },
  47. zlevel: 1,
  48. lineStyle: {
  49. normal: {
  50. width: 4,
  51. opacity: 0.2
  52. }
  53. },
  54. data: [{
  55. coords: [
  56. [100.5107, 23.2196],
  57. [120.5107, 23.2196]
  58. ],
  59. lineStyle: {
  60. normal: {
  61. curveness: 0.2
  62. }
  63. }
  64. }, {
  65. coords: [
  66. [100.5107, 30.2196],
  67. [100.5107, 32.2196],
  68. [110.5107, 34.2196],
  69. [112.5107, 38.2196],
  70. [104.5107, 30.2196],
  71. [100.5107, 30.2196]
  72. ]
  73. }]
  74. },
  75. {
  76. type: 'lines',
  77. coordinateSystem: 'geo',
  78. effect: {
  79. show: true,
  80. period: 4,
  81. color: '#4433aa',
  82. symbolSize: 20,
  83. symbol: planePath
  84. },
  85. zlevel: 1,
  86. data: [{
  87. coords: [
  88. [100.5107, 23.2196],
  89. [120.5107, 23.2196]
  90. ],
  91. lineStyle: {
  92. normal: {
  93. curveness: 0.2,
  94. width: 4,
  95. opacity: 0.4
  96. }
  97. }
  98. }]
  99. }]
  100. }
  101. myChart.setOption(option);
  102. });
  103. });
  104. </script>
  105. </body>
  106. </html>