Nav apraksta

anyangMap2.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. function initSecondMap(uploadedDataURL,mapWorkOrder,points,num){
  2. let myChart = echarts.init(document.getElementById('regionMap'));
  3. var option = null;
  4. $.getJSON(uploadedDataURL, function(geoJson) {
  5. console.log(geoJson)
  6. echarts.registerMap('js', geoJson);
  7. myChart.hideLoading();
  8. option = {
  9. // tooltip: {
  10. // trigger: 'item',
  11. // textStyle: {
  12. // color: '#fff',
  13. // fontSize: '16',
  14. // fontWeight: '600'
  15. // },
  16. // position: 'top',
  17. // backgroundColor: 'rgba(250,250,250,0)',
  18. // transitionDuration: 0.4,
  19. // formatter: function(params) {
  20. // return '<div class="frame" style="background: url(image/hotline_pie.png) no-repeat;width:208px;height:100px;background-size: 100% 100%;text-align:center;top:20px;"><div class="frameC">' +
  21. // params.name + '今日受理量<br>'+params.value+'</div></div>';
  22. // }
  23. // },
  24. visualMap: {
  25. show: true,
  26. max: 2653,
  27. seriesIndex: [0],
  28. right: 100,
  29. bottom:100,
  30. calculable: true,
  31. inRange: {
  32. color: ['#fffb00', '#ff0100']
  33. }
  34. },
  35. geo: [{
  36. map: 'js',
  37. roam: false, //是否允许缩放
  38. zoom: num, //默认显示级别
  39. right: 100,
  40. // bottom:200,
  41. scaleLimit: {
  42. min: 0,
  43. max: 3
  44. }, //缩放级别
  45. itemStyle: {
  46. normal: {
  47. // areaColor: '#013C62',
  48. shadowColor: '#013C62',
  49. shadowBlur: 20,
  50. shadowOffsetX: -5,
  51. shadowOffsetY: 15,
  52. }
  53. },
  54. tooltip: {
  55. show: false
  56. }
  57. }],
  58. series: [
  59. //地图
  60. {
  61. type: 'map',
  62. mapType: 'js',
  63. geoIndex: -1,
  64. zoom: num, //默认显示级别
  65. right: 100,
  66. // bottom:200,
  67. label: {
  68. show: false,
  69. color: '#222',
  70. offset: [-20, -20],
  71. emphasis: {
  72. color: 'white',
  73. show: false
  74. }
  75. },
  76. itemStyle: {
  77. normal: {
  78. borderColor: '#2980b9',
  79. borderWidth: 1,
  80. areaColor: '#12235c'
  81. },
  82. emphasis: {
  83. // areaColor: '#FA8C16',
  84. borderWidth: 0,
  85. color: 'green'
  86. }
  87. },
  88. data: mapWorkOrder
  89. },
  90. {
  91. type: 'effectScatter',
  92. coordinateSystem: 'geo',
  93. showEffectOn: 'render',
  94. rippleEffect: {
  95. period: 2,
  96. scale: 3,
  97. brushType: 'fill'
  98. },
  99. // symbol:'none',
  100. hoverAnimation: true,
  101. label: {
  102. formatter: '{b}',
  103. position: 'right',
  104. offset: [-20, -20],
  105. color: '#000000',
  106. fontWeight:600,
  107. show: true
  108. },
  109. itemStyle: {
  110. opacity:1,
  111. color: 'rgba(250,250,250,0)',
  112. // normal: {
  113. // color: '#00fcff',
  114. // shadowBlur: 1,
  115. // borderWidth:1,
  116. // shadowColor: '#00fcff'
  117. // }
  118. },
  119. emphasis: {
  120. show: false,
  121. itemStyle: {
  122. opacity: 1, //线条宽度
  123. }
  124. },
  125. data: points
  126. }
  127. ]
  128. };
  129. myChart.setOption(option);
  130. })
  131. }