heatmap-map.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <script src="esl.js"></script>
  5. <script src="config.js"></script>
  6. <meta name="viewport" content="width=device-width, initial-scale=1" />
  7. </head>
  8. <body>
  9. <style>
  10. html, body, #main {
  11. width: 100%;
  12. height: 100%;
  13. margin: 0;
  14. }
  15. </style>
  16. <div id="main"></div>
  17. <script>
  18. require([
  19. 'echarts',
  20. 'echarts/chart/heatmap',
  21. 'echarts/component/geo',
  22. 'echarts/component/legend',
  23. 'echarts/component/visualMap',
  24. 'echarts/component/grid',
  25. 'echarts/component/polar',
  26. 'echarts/component/tooltip'
  27. ], function (echarts) {
  28. require(['map/js/china'], function () {
  29. var chart = echarts.init(document.getElementById('main'));
  30. var geoCoordMap = {
  31. "海门":[121.15,31.89],
  32. "鄂尔多斯":[109.781327,39.608266],
  33. "招远":[120.38,37.35],
  34. "舟山":[122.207216,29.985295],
  35. "齐齐哈尔":[123.97,47.33],
  36. "盐城":[120.13,33.38],
  37. "赤峰":[118.87,42.28],
  38. "青岛":[120.33,36.07],
  39. "乳山":[121.52,36.89],
  40. "金昌":[102.188043,38.520089],
  41. "泉州":[118.58,24.93],
  42. "莱西":[120.53,36.86],
  43. "日照":[119.46,35.42],
  44. "胶南":[119.97,35.88],
  45. "南通":[121.05,32.08],
  46. "拉萨":[91.11,29.97],
  47. "云浮":[112.02,22.93],
  48. "梅州":[116.1,24.55],
  49. "文登":[122.05,37.2],
  50. "上海":[121.48,31.22],
  51. "攀枝花":[101.718637,26.582347],
  52. "威海":[122.1,37.5],
  53. "承德":[117.93,40.97],
  54. "厦门":[118.1,24.46],
  55. "汕尾":[115.375279,22.786211],
  56. "潮州":[116.63,23.68],
  57. "丹东":[124.37,40.13],
  58. "太仓":[121.1,31.45],
  59. "曲靖":[103.79,25.51],
  60. "烟台":[121.39,37.52],
  61. "福州":[119.3,26.08],
  62. "瓦房店":[121.979603,39.627114],
  63. "即墨":[120.45,36.38],
  64. "抚顺":[123.97,41.97],
  65. "玉溪":[102.52,24.35],
  66. "张家口":[114.87,40.82],
  67. "阳泉":[113.57,37.85],
  68. "莱州":[119.942327,37.177017],
  69. "湖州":[120.1,30.86],
  70. "汕头":[116.69,23.39],
  71. "昆山":[120.95,31.39],
  72. "宁波":[121.56,29.86],
  73. "湛江":[110.359377,21.270708],
  74. "揭阳":[116.35,23.55],
  75. "荣成":[122.41,37.16],
  76. "连云港":[119.16,34.59],
  77. "葫芦岛":[120.836932,40.711052],
  78. "常熟":[120.74,31.64],
  79. "东莞":[113.75,23.04],
  80. "河源":[114.68,23.73],
  81. "淮安":[119.15,33.5],
  82. "泰州":[119.9,32.49],
  83. "南宁":[108.33,22.84],
  84. "营口":[122.18,40.65],
  85. "惠州":[114.4,23.09],
  86. "江阴":[120.26,31.91],
  87. "蓬莱":[120.75,37.8],
  88. "韶关":[113.62,24.84],
  89. "嘉峪关":[98.289152,39.77313],
  90. "广州":[113.23,23.16],
  91. "延安":[109.47,36.6],
  92. "太原":[112.53,37.87],
  93. "清远":[113.01,23.7],
  94. "中山":[113.38,22.52],
  95. "昆明":[102.73,25.04],
  96. "寿光":[118.73,36.86],
  97. "盘锦":[122.070714,41.119997],
  98. "长治":[113.08,36.18],
  99. "深圳":[114.07,22.62],
  100. "珠海":[113.52,22.3],
  101. "宿迁":[118.3,33.96],
  102. "咸阳":[108.72,34.36],
  103. "铜川":[109.11,35.09],
  104. "平度":[119.97,36.77],
  105. "佛山":[113.11,23.05],
  106. "海口":[110.35,20.02],
  107. "江门":[113.06,22.61],
  108. "章丘":[117.53,36.72],
  109. "肇庆":[112.44,23.05],
  110. "大连":[121.62,38.92],
  111. "临汾":[111.5,36.08],
  112. "吴江":[120.63,31.16],
  113. "石嘴山":[106.39,39.04],
  114. "沈阳":[123.38,41.8],
  115. "苏州":[120.62,31.32],
  116. "茂名":[110.88,21.68],
  117. "嘉兴":[120.76,30.77],
  118. "长春":[125.35,43.88],
  119. "胶州":[120.03336,36.264622],
  120. "银川":[106.27,38.47],
  121. "张家港":[120.555821,31.875428],
  122. "三门峡":[111.19,34.76],
  123. "锦州":[121.15,41.13],
  124. "南昌":[115.89,28.68],
  125. "柳州":[109.4,24.33],
  126. "三亚":[109.511909,18.252847],
  127. "自贡":[104.778442,29.33903],
  128. "吉林":[126.57,43.87],
  129. "阳江":[111.95,21.85],
  130. "泸州":[105.39,28.91],
  131. "西宁":[101.74,36.56],
  132. "宜宾":[104.56,29.77],
  133. "呼和浩特":[111.65,40.82],
  134. "成都":[104.06,30.67],
  135. "大同":[113.3,40.12],
  136. "镇江":[119.44,32.2],
  137. "桂林":[110.28,25.29],
  138. "张家界":[110.479191,29.117096],
  139. "宜兴":[119.82,31.36],
  140. "北海":[109.12,21.49],
  141. "西安":[108.95,34.27],
  142. "金坛":[119.56,31.74],
  143. "东营":[118.49,37.46],
  144. "牡丹江":[129.58,44.6],
  145. "遵义":[106.9,27.7],
  146. "绍兴":[120.58,30.01],
  147. "扬州":[119.42,32.39],
  148. "常州":[119.95,31.79],
  149. "潍坊":[119.1,36.62],
  150. "重庆":[106.54,29.59],
  151. "台州":[121.420757,28.656386],
  152. "南京":[118.78,32.04],
  153. "滨州":[118.03,37.36],
  154. "贵阳":[106.71,26.57],
  155. "无锡":[120.29,31.59],
  156. "本溪":[123.73,41.3],
  157. "克拉玛依":[84.77,45.59],
  158. "渭南":[109.5,34.52],
  159. "马鞍山":[118.48,31.56],
  160. "宝鸡":[107.15,34.38],
  161. "焦作":[113.21,35.24],
  162. "句容":[119.16,31.95],
  163. "北京":[116.46,39.92],
  164. "徐州":[117.2,34.26],
  165. "衡水":[115.72,37.72],
  166. "包头":[110,40.58],
  167. "绵阳":[104.73,31.48],
  168. "乌鲁木齐":[87.68,43.77],
  169. "枣庄":[117.57,34.86],
  170. "杭州":[120.19,30.26],
  171. "淄博":[118.05,36.78],
  172. "鞍山":[122.85,41.12],
  173. "溧阳":[119.48,31.43],
  174. "库尔勒":[86.06,41.68],
  175. "安阳":[114.35,36.1],
  176. "开封":[114.35,34.79],
  177. "济南":[117,36.65],
  178. "德阳":[104.37,31.13],
  179. "温州":[120.65,28.01],
  180. "九江":[115.97,29.71],
  181. "邯郸":[114.47,36.6],
  182. "临安":[119.72,30.23],
  183. "兰州":[103.73,36.03],
  184. "沧州":[116.83,38.33],
  185. "临沂":[118.35,35.05],
  186. "南充":[106.110698,30.837793],
  187. "天津":[117.2,39.13],
  188. "富阳":[119.95,30.07],
  189. "泰安":[117.13,36.18],
  190. "诸暨":[120.23,29.71],
  191. "郑州":[113.65,34.76],
  192. "哈尔滨":[126.63,45.75],
  193. "聊城":[115.97,36.45],
  194. "芜湖":[118.38,31.33],
  195. "唐山":[118.02,39.63],
  196. "平顶山":[113.29,33.75],
  197. "邢台":[114.48,37.05],
  198. "德州":[116.29,37.45],
  199. "济宁":[116.59,35.38],
  200. "荆州":[112.239741,30.335165],
  201. "宜昌":[111.3,30.7],
  202. "义乌":[120.06,29.32],
  203. "丽水":[119.92,28.45],
  204. "洛阳":[112.44,34.7],
  205. "秦皇岛":[119.57,39.95],
  206. "株洲":[113.16,27.83],
  207. "石家庄":[114.48,38.03],
  208. "莱芜":[117.67,36.19],
  209. "常德":[111.69,29.05],
  210. "保定":[115.48,38.85],
  211. "湘潭":[112.91,27.87],
  212. "金华":[119.64,29.12],
  213. "岳阳":[113.09,29.37],
  214. "长沙":[113,28.21],
  215. "衢州":[118.88,28.97],
  216. "廊坊":[116.7,39.53],
  217. "菏泽":[115.480656,35.23375],
  218. "合肥":[117.27,31.86],
  219. "武汉":[114.31,30.52],
  220. "大庆":[125.03,46.58]
  221. };
  222. var convertData = function (data) {
  223. var res = [];
  224. for (var i = 0; i < data.length; i++) {
  225. var geoCoord = geoCoordMap[data[i].name];
  226. if (geoCoord) {
  227. res.push(geoCoord.concat(data[i].value));
  228. }
  229. }
  230. return res;
  231. };
  232. chart.setOption({
  233. backgroundColor: '#404a59',
  234. visualMap: {
  235. min: 0,
  236. max: 500,
  237. splitNumber: 5,
  238. inRange: {
  239. color: ['#d94e5d','#eac736','#50a3ba'].reverse()
  240. },
  241. textStyle: {
  242. color: '#fff'
  243. }
  244. },
  245. geo: {
  246. map: 'china',
  247. label: {
  248. emphasis: {
  249. show: false
  250. }
  251. },
  252. roam: true,
  253. itemStyle: {
  254. normal: {
  255. areaColor: '#323c48',
  256. borderColor: '#111'
  257. },
  258. emphasis: {
  259. areaColor: '#2a333d'
  260. }
  261. }
  262. },
  263. series: [{
  264. name: 'AQI',
  265. type: 'heatmap',
  266. coordinateSystem: 'geo',
  267. data: convertData([
  268. {name: "海门", value: 9},
  269. {name: "鄂尔多斯", value: 12},
  270. {name: "招远", value: 12},
  271. {name: "舟山", value: 12},
  272. {name: "齐齐哈尔", value: 14},
  273. {name: "盐城", value: 15},
  274. {name: "赤峰", value: 16},
  275. {name: "青岛", value: 18},
  276. {name: "乳山", value: 18},
  277. {name: "金昌", value: 19},
  278. {name: "泉州", value: 21},
  279. {name: "莱西", value: 21},
  280. {name: "日照", value: 21},
  281. {name: "胶南", value: 22},
  282. {name: "南通", value: 23},
  283. {name: "拉萨", value: 24},
  284. {name: "云浮", value: 24},
  285. {name: "梅州", value: 25},
  286. {name: "文登", value: 25},
  287. {name: "上海", value: 25},
  288. {name: "攀枝花", value: 25},
  289. {name: "威海", value: 25},
  290. {name: "承德", value: 25},
  291. {name: "厦门", value: 26},
  292. {name: "汕尾", value: 26},
  293. {name: "潮州", value: 26},
  294. {name: "丹东", value: 27},
  295. {name: "太仓", value: 27},
  296. {name: "曲靖", value: 27},
  297. {name: "烟台", value: 28},
  298. {name: "福州", value: 29},
  299. {name: "瓦房店", value: 30},
  300. {name: "即墨", value: 30},
  301. {name: "抚顺", value: 31},
  302. {name: "玉溪", value: 31},
  303. {name: "张家口", value: 31},
  304. {name: "阳泉", value: 31},
  305. {name: "莱州", value: 32},
  306. {name: "湖州", value: 32},
  307. {name: "汕头", value: 32},
  308. {name: "昆山", value: 33},
  309. {name: "宁波", value: 33},
  310. {name: "湛江", value: 33},
  311. {name: "揭阳", value: 34},
  312. {name: "荣成", value: 34},
  313. {name: "连云港", value: 35},
  314. {name: "葫芦岛", value: 35},
  315. {name: "常熟", value: 36},
  316. {name: "东莞", value: 36},
  317. {name: "河源", value: 36},
  318. {name: "淮安", value: 36},
  319. {name: "泰州", value: 36},
  320. {name: "南宁", value: 37},
  321. {name: "营口", value: 37},
  322. {name: "惠州", value: 37},
  323. {name: "江阴", value: 37},
  324. {name: "蓬莱", value: 37},
  325. {name: "韶关", value: 38},
  326. {name: "嘉峪关", value: 38},
  327. {name: "广州", value: 38},
  328. {name: "延安", value: 38},
  329. {name: "太原", value: 39},
  330. {name: "清远", value: 39},
  331. {name: "中山", value: 39},
  332. {name: "昆明", value: 39},
  333. {name: "寿光", value: 40},
  334. {name: "盘锦", value: 40},
  335. {name: "长治", value: 41},
  336. {name: "深圳", value: 41},
  337. {name: "珠海", value: 42},
  338. {name: "宿迁", value: 43},
  339. {name: "咸阳", value: 43},
  340. {name: "铜川", value: 44},
  341. {name: "平度", value: 44},
  342. {name: "佛山", value: 44},
  343. {name: "海口", value: 44},
  344. {name: "江门", value: 45},
  345. {name: "章丘", value: 45},
  346. {name: "肇庆", value: 46},
  347. {name: "大连", value: 47},
  348. {name: "临汾", value: 47},
  349. {name: "吴江", value: 47},
  350. {name: "石嘴山", value: 49},
  351. {name: "沈阳", value: 50},
  352. {name: "苏州", value: 50},
  353. {name: "茂名", value: 50},
  354. {name: "嘉兴", value: 51},
  355. {name: "长春", value: 51},
  356. {name: "胶州", value: 52},
  357. {name: "银川", value: 52},
  358. {name: "张家港", value: 52},
  359. {name: "三门峡", value: 53},
  360. {name: "锦州", value: 54},
  361. {name: "南昌", value: 54},
  362. {name: "柳州", value: 54},
  363. {name: "三亚", value: 54},
  364. {name: "自贡", value: 56},
  365. {name: "吉林", value: 56},
  366. {name: "阳江", value: 57},
  367. {name: "泸州", value: 57},
  368. {name: "西宁", value: 57},
  369. {name: "宜宾", value: 58},
  370. {name: "呼和浩特", value: 58},
  371. {name: "成都", value: 58},
  372. {name: "大同", value: 58},
  373. {name: "镇江", value: 59},
  374. {name: "桂林", value: 59},
  375. {name: "张家界", value: 59},
  376. {name: "宜兴", value: 59},
  377. {name: "北海", value: 60},
  378. {name: "西安", value: 61},
  379. {name: "金坛", value: 62},
  380. {name: "东营", value: 62},
  381. {name: "牡丹江", value: 63},
  382. {name: "遵义", value: 63},
  383. {name: "绍兴", value: 63},
  384. {name: "扬州", value: 64},
  385. {name: "常州", value: 64},
  386. {name: "潍坊", value: 65},
  387. {name: "重庆", value: 66},
  388. {name: "台州", value: 67},
  389. {name: "南京", value: 67},
  390. {name: "滨州", value: 70},
  391. {name: "贵阳", value: 71},
  392. {name: "无锡", value: 71},
  393. {name: "本溪", value: 71},
  394. {name: "克拉玛依", value: 72},
  395. {name: "渭南", value: 72},
  396. {name: "马鞍山", value: 72},
  397. {name: "宝鸡", value: 72},
  398. {name: "焦作", value: 75},
  399. {name: "句容", value: 75},
  400. {name: "北京", value: 79},
  401. {name: "徐州", value: 79},
  402. {name: "衡水", value: 80},
  403. {name: "包头", value: 80},
  404. {name: "绵阳", value: 80},
  405. {name: "乌鲁木齐", value: 84},
  406. {name: "枣庄", value: 84},
  407. {name: "杭州", value: 84},
  408. {name: "淄博", value: 85},
  409. {name: "鞍山", value: 86},
  410. {name: "溧阳", value: 86},
  411. {name: "库尔勒", value: 86},
  412. {name: "安阳", value: 90},
  413. {name: "开封", value: 90},
  414. {name: "济南", value: 92},
  415. {name: "德阳", value: 93},
  416. {name: "温州", value: 95},
  417. {name: "九江", value: 96},
  418. {name: "邯郸", value: 98},
  419. {name: "临安", value: 99},
  420. {name: "兰州", value: 99},
  421. {name: "沧州", value: 100},
  422. {name: "临沂", value: 103},
  423. {name: "南充", value: 104},
  424. {name: "天津", value: 105},
  425. {name: "富阳", value: 106},
  426. {name: "泰安", value: 112},
  427. {name: "诸暨", value: 112},
  428. {name: "郑州", value: 113},
  429. {name: "哈尔滨", value: 114},
  430. {name: "聊城", value: 116},
  431. {name: "芜湖", value: 117},
  432. {name: "唐山", value: 119},
  433. {name: "平顶山", value: 119},
  434. {name: "邢台", value: 119},
  435. {name: "德州", value: 120},
  436. {name: "济宁", value: 120},
  437. {name: "荆州", value: 127},
  438. {name: "宜昌", value: 130},
  439. {name: "义乌", value: 132},
  440. {name: "丽水", value: 133},
  441. {name: "洛阳", value: 134},
  442. {name: "秦皇岛", value: 136},
  443. {name: "株洲", value: 143},
  444. {name: "石家庄", value: 147},
  445. {name: "莱芜", value: 148},
  446. {name: "常德", value: 152},
  447. {name: "保定", value: 153},
  448. {name: "湘潭", value: 154},
  449. {name: "金华", value: 157},
  450. {name: "岳阳", value: 169},
  451. {name: "长沙", value: 175},
  452. {name: "衢州", value: 177},
  453. {name: "廊坊", value: 193},
  454. {name: "菏泽", value: 194},
  455. {name: "合肥", value: 229},
  456. {name: "武汉", value: 273},
  457. {name: "大庆", value: 279}
  458. ])
  459. }]
  460. });
  461. });
  462. });
  463. </script>
  464. </body>
  465. </html>