| <!doctype html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <title>Buildings - ECHARTS-GL</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> |
| <meta name="apple-mobile-web-app-capable" content="yes"> <!-- Fullscreen Landscape on iOS --> |
| <link rel="stylesheet" href="../common/reset.css"> |
| </head> |
| <body> |
| <div id="main"></div> |
| <script src="../common/echarts.min.js"></script> |
| <script src="../common/jquery.min.js"></script> |
| <script src="../common/echarts-gl.js"></script> |
| <script src="../data/buildings.json.js"></script> |
| <script src="../texture/woods.jpg.js"></script> |
| <script src="../texture/oakfloor2_basecolor.jpg.js"></script> |
| <script src="../texture/canyon.hdr.js"></script> |
| |
| <script> |
| echarts.registerMap('buildings', buildingsGeoJSON); |
| var chart = echarts.init(document.getElementById('main'), null, { |
| devicePixelRatio: 1 |
| }); |
| |
| var regions = buildingsGeoJSON.features.map(function (feature) { |
| return { |
| name: feature.properties.name, |
| height: Math.max(Math.sqrt(feature.properties.height), 0.1) |
| }; |
| }); |
| |
| // console.profile('render'); |
| chart.setOption({ |
| series: [{ |
| type: 'map3D', |
| map: 'buildings', |
| shading: 'realistic', |
| realisticMaterial: { |
| roughness: 0.6, |
| baseTexture: floorBaseColorTexture, |
| textureTiling: 40 |
| }, |
| postEffect: { |
| enable: true, |
| bloom: { |
| enable: false |
| }, |
| SSAO: { |
| enable: true, |
| quality: 'low', |
| radius: 4, |
| intensity: 1.2 |
| }, |
| depthOfField: { |
| enable: true, |
| focalRange: 5, |
| fstop: 1, |
| blurRadius: 4, |
| quality: 'low' |
| } |
| }, |
| groundPlane: { |
| show: true |
| }, |
| light: { |
| main: { |
| intensity: 4, |
| shadow: true, |
| shadowQuality: 'high', |
| alpha: 30 |
| }, |
| ambient: { |
| intensity: 0 |
| }, |
| ambientCubemap: { |
| texture: canyonUrl, |
| exposure: 2, |
| diffuseIntensity: 1, |
| specularIntensity: 0.2 |
| } |
| }, |
| viewControl: { |
| distance: 50 |
| }, |
| |
| itemStyle: { |
| areaColor: '#bbb' |
| // borderColor: '#222', |
| // borderWidth: 1 |
| }, |
| |
| label: { |
| textStyle: { |
| color: 'white' |
| } |
| }, |
| |
| silent: true, |
| |
| instancing: true, |
| |
| boxWidth: 200, |
| boxHeight: 1, |
| |
| data: regions |
| }] |
| }); |
| // console.profileEnd('render'); |
| |
| window.onresize = chart.resize; |
| </script> |
| </body> |
| </html> |