<!DOCTYPE html> <html lang="en"> <head> <!-- Use correct character set. --> <meta charset="utf-8"> <!-- Tell IE to use the latest, best version. --> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <!-- Make the app on mobile take up the full browser screen and disable user scaling. --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <title>wall</title> <!-- The Cesium library. --> <script src="../ThirdParty/Cesium/Cesium.js"></script> <!-- Style our app. --> <style> @import url(../ThirdParty/Cesium/Widgets/widgets.css); html, body, #cesiumContainer { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; } </style> </head> <body> <div id="cesiumContainer"></div> <script> Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNDhhYmQxOC1mYzMwLTRhYmEtOTI5Ny1iNGExNTQ3ZTZhODkiLCJpZCI6NTQ1NCwic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0MzM3Mzc0NH0.RU6ynAZcwQvdfygt_N_j2rb2lpsuyyROzdaLQg0emAg'; let viewer = new Cesium.Viewer('cesiumContainer'); let redWall = viewer.entities.add({ name : 'Red wall at height', wall : { positions : Cesium.Cartesian3.fromDegreesArrayHeights([ -115.0, 44.0, 200000.0, -90.0, 44.0, 200000.0]), // 指定墙壁顶部的cartesian 3位置数组 minimumHeights : [100000.0, 100000.0], // 指定墙底部要使用的高度数组 material : Cesium.Color.RED } }); let greenWall = viewer.entities.add({ name : 'Green wall from surface with outline', wall : { positions : Cesium.Cartesian3.fromDegreesArrayHeights([ -107.0, 43.0, 100000.0, -97.0, 43.0, 100000.0, -97.0, 40.0, 100000.0, -107.0, 40.0, 100000.0, -107.0, 43.0, 100000.0]), material : Cesium.Color.GREEN, outline : true } }); let blueWall = viewer.entities.add({ name : 'Blue wall with sawtooth heights and outline', wall : { positions : Cesium.Cartesian3.fromDegreesArray([ -115.0, 50.0, -112.5, 50.0, -110.0, 50.0, -107.5, 50.0, -105.0, 50.0, -102.5, 50.0, -100.0, 50.0, -97.5, 50.0, -95.0, 50.0, -92.5, 50.0, -90.0, 50.0]), // 指定墙体的每个特征点的最大高度。 maximumHeights : [100000, 200000, 100000, 200000, 100000, 200000, 100000, 200000, 100000, 200000, 100000], // 指定墙体的每个特征点的最小高度。 minimumHeights : [0, 100000, 0, 100000, 0, 100000, 0, 100000, 0, 100000, 0], material : Cesium.Color.BLUE.withAlpha(0.5), outline : true, outlineColor : Cesium.Color.BLACK } }); viewer.zoomTo(viewer.entities); </script> </body> </html>
cesium 1.52 demo - wall.html
猜你喜欢
转载自blog.csdn.net/weixin_42193179/article/details/85637659
今日推荐
周排行