Skip to content

Commit

Permalink
add esridemo
Browse files Browse the repository at this point in the history
  • Loading branch information
bertt committed Apr 8, 2024
1 parent ea8d83d commit 90cdfb7
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
Empty file added index.html
Empty file.
62 changes: 62 additions & 0 deletions samples/esridemo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/cesium/1.116.0/Cesium.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/cesium/1.116.0/Widgets/widgets.min.css" rel="stylesheet">

<style>
html, body, #cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}

.toolbar-left {
display: block;
position: absolute;
top: 5px;
left: 5px;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script type="module">
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNDc1ZjQwMS1hOGI2LTQyNmUtYmYxMi1jODlhNDNlMjViZTkiLCJpZCI6NDc4OSwic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0MTYyNTg3OX0.mNoGLdYuwqsnRRkQtdYNMbJfMBoZF2hPkbc4SRVVqNw';
var viewer = new Cesium.Viewer('cesiumContainer', {
//terrain: Cesium.Terrain.fromWorldTerrain(),
});

var terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl('https://api.pdok.nl/kadaster/3d-basisvoorziening/ogc/v1_0/collections/digitaalterreinmodel/quantized-mesh');
viewer.scene.terrainProvider = terrainProvider;
viewer.scene.globe.depthTestAgainstTerrain=true;

viewer.scene.light = new Cesium.DirectionalLight({
direction: viewer.scene.camera.directionWC,
});
viewer.scene.preRender.addEventListener(function (scene, time) {
viewer.scene.light.direction = Cesium.Cartesian3.clone(
viewer.scene.camera.directionWC,
viewer.scene.light.direction
);
});

const tileset = await Cesium.Cesium3DTileset.fromUrl(
"https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Utrecht_3D_Tiles_Integrated_Mesh/3DTilesServer/tileset.json"
);
viewer.scene.primitives.add(tileset);


// tileset.debugShowBoundingVolume = true;
// tileset.debugColorizeTiles = true;
viewer.scene.globe.depthTestAgainstTerrain = true;
viewer.scene.globe.enableLighting = false;
viewer.scene.highDynamicRange = false;
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0, -0.5, 0));
</script>
</body>
</html>

0 comments on commit 90cdfb7

Please sign in to comment.