【html】絢麗的HTML5地圖分佈動畫DEMO演示

ringoo_ming發表於2017-03-28




  1. <html lang="en">
  2. <head>
  3. <meta charset="utf-8">
  4. <title>超絢麗的HTML5地圖分佈動畫DEMO演示</title>
  5. </head>

  6. <body style="background:#1B1B1B">
  7. <!--Step:1 Prepare a dom for ECharts which (must) has size (width & hight)-->
  8. <!--Step:1 為ECharts準備一個具備大小(寬高)的Dom-->

  9. <div id="mainMap" style="height:400px;width: 700px;padding:10px;background:#1B1B1B">
  10. </div>
  11. <!--Step:2 Import echarts.js-->
  12. <!--Step:2 引入echarts.js-->

  13. <script type="text/javascript" src="js/jquery-1.8.0.js"></script>
  14. <script src="js/echarts.js" charset="UTF-8"></script>
  15. <script type="text/javascript">
  16.     $('#document').ready(function(){
  17.          getEcharts();
  18.      });
  19. </script>

  20. <script type="text/javascript">
  21. function getEcharts(){
  22.     // Step:3 conifg ECharts's path, link to echarts.js from current page.
  23.     // Step:3 為模組載入器配置echarts的路徑,從當前頁面連結到echarts.js,定義所需圖表路徑
  24.     require.config({
  25.         paths: {
  26.             echarts: './js'
  27.         }
  28.     });
  29.     
  30.     // Step:4 require echarts and use it in the callback.
  31.     // Step:4 動態載入echarts然後在回撥函式中開始使用,注意保持按需載入結構定義圖表路徑
  32.     require(
  33.         [
  34.             'echarts',
  35.             'echarts/chart/map'
  36.         ],
  37.         function (ec) {
  38.             // --- 地圖 ---
  39.             var myChart2 = ec.init(document.getElementById('mainMap'));
  40.             myChart2.setOption({
  41.                 dataRange: {
  42.                     min : 0,
  43.                     max : 100,
  44.                     calculable : true,
  45.                     color: ['#ff3333', 'orange', 'yellow','lime','aqua'],
  46.                     textStyle:{
  47.                         color:'#fff'
  48.                     }
  49.                 },
  50.                 series : [
  51.                     {
  52.                         name: '全國',
  53.                         type: 'map',
  54.                         roam: true,
  55.                         hoverable: false,
  56.                         mapType: 'china',
  57.                         itemStyle:{
  58.                             normal:{
  59.                                 borderColor:'rgba(100,149,237,1)',
  60.                                 borderWidth:0.5,
  61.                                 areaStyle:{
  62.                                     color: '#1b1b1b'
  63.                                 }
  64.                             }
  65.                         },
  66.                         data:[],
  67.                         markLine : {
  68.                             smooth:true,
  69.                             symbol: ['none', 'circle'],
  70.                             symbolSize : 1,
  71.                             itemStyle : {
  72.                                 normal: {
  73.                                     color:'#fff',
  74.                                     borderWidth:1,
  75.                                     borderColor:'rgba(30,144,255,0.5)'
  76.                                 }
  77.                             },
  78.                             data : [
  79.                             ],
  80.                         },
  81.                         geoCoord: {
  82.                             '上海': [121.4648,31.2891],
  83.                             '東莞': [113.8953,22.901],
  84.                             '東營': [118.7073,37.5513],
  85.                             '中山': [113.4229,22.478],
  86.                             '臨汾': [111.4783,36.1615],
  87.                             '臨沂': [118.3118,35.2936],
  88.                             '丹東': [124.541,40.4242],
  89.                             '麗水': [119.5642,28.1854],
  90.                             '烏魯木齊': [87.9236,43.5883],
  91.                             '佛山': [112.8955,23.1097],
  92.                             '保定': [115.0488,39.0948],
  93.                             '蘭州': [103.5901,36.3043],
  94.                             '包頭': [110.3467,41.4899],
  95.                             '北京': [116.4551,40.2539],
  96.                             '北海': [109.314,21.6211],
  97.                             '南京': [118.8062,31.9208],
  98.                             '南寧': [108.479,23.1152],
  99.                             '南昌': [116.0046,28.6633],
  100.                             '南通': [121.1023,32.1625],
  101.                             '廈門': [118.1689,24.6478],
  102.                             '台州': [121.1353,28.6688],
  103.                             '合肥': [117.29,32.0581],
  104.                             '呼和浩特': [111.4124,40.4901],
  105.                             '咸陽': [108.4131,34.8706],
  106.                             '哈爾濱': [127.9688,45.368],
  107.                             '唐山': [118.4766,39.6826],
  108.                             '嘉興': [120.9155,30.6354],
  109.                             '大同': [113.7854,39.8035],
  110.                             '大連': [122.2229,39.4409],
  111.                             '天津': [117.4219,39.4189],
  112.                             '太原': [112.3352,37.9413],
  113.                             '威海': [121.9482,37.1393],
  114.                             '寧波': [121.5967,29.6466],
  115.                             '寶雞': [107.1826,34.3433],
  116.                             '宿遷': [118.5535,33.7775],
  117.                             '常州': [119.4543,31.5582],
  118.                             '廣州': [113.5107,23.2196],
  119.                             '廊坊': [116.521,39.0509],
  120.                             '延安': [109.1052,36.4252],
  121.                             '張家口': [115.1477,40.8527],
  122.                             '徐州': [117.5208,34.3268],
  123.                             '德州': [116.6858,37.2107],
  124.                             '惠州': [114.6204,23.1647],
  125.                             '成都': [103.9526,30.7617],
  126.                             '揚州': [119.4653,32.8162],
  127.                             '承德': [117.5757,41.4075],
  128.                             '拉薩': [91.1865,30.1465],
  129.                             '無錫': [120.3442,31.5527],
  130.                             '日照': [119.2786,35.5023],
  131.                             '昆明': [102.9199,25.4663],
  132.                             '杭州': [119.5313,29.8773],
  133.                             '棗莊': [117.323,34.8926],
  134.                             '柳州': [109.3799,24.9774],
  135.                             '株洲': [113.5327,27.0319],
  136.                             '武漢': [114.3896,30.6628],
  137.                             '汕頭': [117.1692,23.3405],
  138.                             '江門': [112.6318,22.1484],
  139.                             '瀋陽': [123.1238,42.1216],
  140.                             '滄州': [116.8286,38.2104],
  141.                             '河源': [114.917,23.9722],
  142.                             '泉州': [118.3228,25.1147],
  143.                             '泰安': [117.0264,36.0516],
  144.                             '泰州': [120.0586,32.5525],
  145.                             '濟南': [117.1582,36.8701],
  146.                             '濟寧': [116.8286,35.3375],
  147.                             '海口': [110.3893,19.8516],
  148.                             '淄博': [118.0371,36.6064],
  149.                             '淮安': [118.927,33.4039],
  150.                             '深圳': [114.5435,22.5439],
  151.                             '清遠': [112.9175,24.3292],
  152.                             '溫州': [120.498,27.8119],
  153.                             '渭南': [109.7864,35.0299],
  154.                             '湖州': [119.8608,30.7782],
  155.                             '湘潭': [112.5439,27.7075],
  156.                             '濱州': [117.8174,37.4963],
  157.                             '濰坊': [119.0918,36.524],
  158.                             '煙臺': [120.7397,37.5128],
  159.                             '玉溪': [101.9312,23.8898],
  160.                             '珠海': [113.7305,22.1155],
  161.                             '鹽城': [120.2234,33.5577],
  162.                             '盤錦': [121.9482,41.0449],
  163.                             '石家莊': [114.4995,38.1006],
  164.                             '福州': [119.4543,25.9222],
  165.                             '秦皇島': [119.2126,40.0232],
  166.                             '紹興': [120.564,29.7565],
  167.                             '聊城': [115.9167,36.4032],
  168.                             '肇慶': [112.1265,23.5822],
  169.                             '舟山': [122.2559,30.2234],
  170.                             '蘇州': [120.6519,31.3989],
  171.                             '萊蕪': [117.6526,36.2714],
  172.                             '菏澤': [115.6201,35.2057],
  173.                             '營口': [122.4316,40.4297],
  174.                             '葫蘆島': [120.1575,40.578],
  175.                             '衡水': [115.8838,37.7161],
  176.                             '衢州': [118.6853,28.8666],
  177.                             '西寧': [101.4038,36.8207],
  178.                             '西安': [109.1162,34.2004],
  179.                             '貴陽': [106.6992,26.7682],
  180.                             '連雲港': [119.1248,34.552],
  181.                             '邢臺': [114.8071,37.2821],
  182.                             '邯鄲': [114.4775,36.535],
  183.                             '鄭州': [113.4668,34.6234],
  184.                             '鄂爾多斯': [108.9734,39.2487],
  185.                             '重慶': [107.7539,30.1904],
  186.                             '金華': [120.0037,29.1028],
  187.                             '銅川': [109.0393,35.1947],
  188.                             '銀川': [106.3586,38.1775],
  189.                             '鎮江': [119.4763,31.9702],
  190.                             '長春': [125.8154,44.2584],
  191.                             '長沙': [113.0823,28.2568],
  192.                             '長治': [112.8625,36.4746],
  193.                             '陽泉': [113.4778,38.0951],
  194.                             '青島': [120.4651,36.3373],
  195.                             '韶關': [113.7964,24.7028]
  196.                         },
  197.                         markPoint : {
  198.                             symbol:'emptyCircle',
  199.                             symbolSize : function (v){
  200.                                 return 10 + v/10
  201.                             },
  202.                             effect : {
  203.                                 show: true,
  204.                                 shadowBlur : 0
  205.                             },
  206.                             itemStyle:{
  207.                                 normal:{
  208.                                     label:{show:false}
  209.                                 },
  210.                                 emphasis: {
  211.                                     label:{position:'top'}
  212.                                 }
  213.                             },
  214.                             data : [
  215.                                 {name:'上海',value:95},
  216.                                 {name:'廣州',value:90},
  217.                                 {name:'大連',value:80},
  218.                                 {name:'南寧',value:70},
  219.                                 {name:'南昌',value:60},
  220.                                 {name:'惠州',value:50},
  221.                                 {name:'西寧',value:40},
  222.                                 {name:'包頭',value:30},
  223.                                 {name:'重慶',value:20},
  224.                                 {name:'常州',value:10}
  225.                             ]
  226.                         }
  227.                     },
  228.                     {
  229.                         name: '北京 Top10',
  230.                         type: 'map',
  231.                         mapType: 'china',
  232.                         data:[],
  233.                         markLine : {
  234.                             smooth:true,
  235.                             effect : {
  236.                                 show: true,
  237.                                 scaleSize: 1,
  238.                                 period: 30,
  239.                                 color: '#fff',
  240.                                 shadowBlur: 10
  241.                             },
  242.                             itemStyle : {
  243.                                 normal: {
  244.                                     label:{show:false},
  245.                                     borderWidth:1,
  246.                                     lineStyle: {
  247.                                         type: 'solid',
  248.                                         shadowBlur: 10
  249.                                     }
  250.                                 }
  251.                             },
  252.                             data : [
  253.                                 [{name:'上海'}, {name:'北京',value:95}],
  254.                                 [{name:'廣州'}, {name:'北京',value:90}],
  255.                                 [{name:'大連'}, {name:'北京',value:80}],
  256.                                 [{name:'南寧'}, {name:'北京',value:70}],
  257.                                 [{name:'南昌'}, {name:'北京',value:60}],
  258.                                 [{name:'惠州'}, {name:'北京',value:50}],
  259.                                 [{name:'西寧'}, {name:'北京',value:40}],
  260.                                 [{name:'包頭'}, {name:'北京',value:30}],
  261.                                 [{name:'重慶'}, {name:'北京',value:20}],
  262.                                 [{name:'常州'}, {name:'北京',value:10}]
  263.                             ]
  264.                         },
  265.                         markPoint : {
  266.                             symbol:'emptyCircle',
  267.                             symbolSize : function (v){
  268.                                 return 0.1
  269.                             },
  270.                             effect : {
  271.                                 show: false,
  272.                                 shadowBlur : 0
  273.                             },
  274.                             itemStyle:{
  275.                                 normal:{
  276.                                     label:{show:true,
  277.                                          position:'top',
  278.                                          textStyle: {
  279.                                                     fontSize: 14
  280.                                                 }
  281.                                          }
  282.                                 },
  283.                                 emphasis: {
  284.                                     label:{show:false}
  285.                                 }
  286.                             },


  1. data : [
  2.                                 {name:'上海',value:95},
  3.                                 {name:'廣州',value:90},
  4.                                 {name:'大連',value:80},
  5.                                 {name:'南寧',value:70},
  6.                                 {name:'南昌',value:60},
  7.                                 {name:'惠州',value:100},
  8.                                 {name:'包頭',value:30},
  9.                                 {name:'重慶',value:20},
  10.                                 {name:'常州',value:10}
  11.                             ]
  12.                         }
  13.                     }
  14.                 ]
  15.         });
  16.     });
  17. }
  18.     </script>

  19. <div style="text-align:center;clear:both;margin-top:30px">
  20. <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
  21. <script src="/follow.js" type="text/javascript"></script>
  22. </div>
  23. </body>
  24. </html>

下載地址:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31442725/viewspace-2136171/,如需轉載,請註明出處,否則將追究法律責任。

相關文章