echartsGL_ShanghaiBuildingPrice.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <html>
  5. <head>
  6. <meta charset='utf-8'/>
  7. <title data-i18n="resources.title_ShanghaiBuildingPrice"></title>
  8. <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no'/>
  9. <style>
  10. body {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. #map {
  15. position: absolute;
  16. top: 0;
  17. bottom: 0;
  18. width: 100%;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <div id='map'></div>
  24. <script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
  25. <script type="text/javascript" include="echarts,echarts-gl" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
  26. <script type="text/javascript">
  27. var data;
  28. var attribution = "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" +
  29. "| Image <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a> | </span>" +
  30. "<a href='https://echarts.baidu.com' target='_blank'>© 2018 " + resources.title_3baidu + " ECharts Echarts-gl</a>";
  31. var host = window.isLocal ? window.server : "https://iserver.supermap.io";
  32. var tileURL = host + "/iserver/services/map-china400/rest/maps/ChinaDark/zxyTileImage.png?z={z}&x={x}&y={y}";
  33. var uploadedDataURL = "../data/ShanghaiBuildingPrice.json";
  34. var myChart = echarts.init(document.getElementById('map'));
  35. $.getJSON(uploadedDataURL, function (linedata) {
  36. myChart.setOption({
  37. visualMap: {
  38. show: false,
  39. calculable: true,
  40. realtime: false,
  41. inRange: {
  42. color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
  43. },
  44. outOfRange: {
  45. colorAlpha: 0
  46. },
  47. max: linedata[1]
  48. },
  49. toolBox: {
  50. feature: {
  51. dataZoom: {
  52. show: true,
  53. }
  54. }
  55. },
  56. mapbox: {
  57. center: [121.4693, 31.123070],
  58. zoom: 10,
  59. pitch: 50,
  60. bearing: -10,
  61. style: {
  62. "version": 8,
  63. "sources": {
  64. "raster-tiles": {
  65. "attribution": attribution,
  66. "type": "raster",
  67. "tiles": [tileURL],
  68. "tileSize": 256,
  69. },
  70. },
  71. "layers": [{
  72. "id": "simple-tiles",
  73. "type": "raster",
  74. "source": "raster-tiles",
  75. "minzoom": 0,
  76. "maxzoom": 22
  77. }]
  78. },
  79. boxHeight: 50,
  80. // altitudeScale: 3e2,
  81. postEffect: {
  82. enable: true,
  83. SSAO: {
  84. enable: true,
  85. radius: 2,
  86. intensity: 1.5
  87. }
  88. },
  89. light: {
  90. main: {
  91. intensity: 1,
  92. shadow: true,
  93. shadowQuality: 'high'
  94. },
  95. ambient: {
  96. intensity: 0.
  97. },
  98. ambientCubemap: {
  99. texture: '../data/ShanghaiBuildingPrice.hdr',
  100. exposure: 1,
  101. diffuseIntensity: 0.5
  102. }
  103. },
  104. },
  105. series: [{
  106. type: 'bar3D',
  107. roam: true,
  108. shading: 'realistic',
  109. coordinateSystem: 'mapbox',
  110. barSize: 0.2,
  111. silent: true,
  112. data: linedata[0]
  113. }]
  114. });
  115. //获取mapbox对象
  116. var mapbox = myChart.getModel().getComponent('mapbox3D').getMapbox();
  117. mapbox.addControl(new mapboxgl.NavigationControl(), 'top-left');
  118. });
  119. </script>
  120. </body>
  121. </html>