Skip to content

Instantly share code, notes, and snippets.

@JoeThunyathep
Created April 20, 2020 17:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JoeThunyathep/afff8e1379d94357a7d113974d038cff to your computer and use it in GitHub Desktop.
Save JoeThunyathep/afff8e1379d94357a7d113974d038cff to your computer and use it in GitHub Desktop.
Index file for Cesium NYC application
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cesium.com/downloads/cesiumjs/releases/1.68/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.68/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
</head>
<body>
<div id="cesiumContainer" style="width: 100%; height:100%"></div>
<script>
var viewer = new Cesium.Viewer('cesiumContainer');
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: "<link to your 3D Tile dataset (tileset.json)>",
}))
Cesium.when(tileset.readyPromise).then(function (tileset) {viewer.flyTo(tileset)}) // fly to 3D tiles after loading!
</script>
</body>
</html>
@typebrook
Copy link

Many thanks, man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment