12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <!-- Include the CesiumJS JavaScript and CSS files -->
- <script src="./js/Cesium.js?t=asd"></script>
- <link href="./js/widgets.css" rel="stylesheet">
- <style>
- * {
- margin: 0;
- padding: 0;
- border: 0;
-
- }
- #cesiumContainer {
- width: 100vw;
- height: 100vh;
- }
- .cesium-viewer-toolbar {
- display: none;
- }
- </style>
- </head>
- <body>
- <div id="cesiumContainer"></div>
- <script type="module">
- // https://cesium.com/downloads/cesiumjs/releases/1.123/Build/Cesium/Widgets
- // Your access token can be found at: https://ion.cesium.com/tokens.
- // Replace `your_access_token` with your Cesium ion access token.
- Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxOGJlY2NkYy04NGZiLTQ2MzYtYWJmZi0xNzNlNDk0N2Q2YjAiLCJpZCI6MjUyOTI2LCJpYXQiOjE3MzA3ODY3MTN9.GiCzHsI5RCIWSPp5aiI7mvsu0emeCtjrTNOpwyIK7zw';
- // window.CESIUM_BASE_URL = 'https://sandcastle.cesium.com/CesiumUnminified/';
- // Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
- const viewer = new Cesium.Viewer('cesiumContainer', {
- terrain: Cesium.Terrain.fromWorldTerrain(),
- vrButton:true
- });
-
-
-
-
- viewer.scene.focalLength = 100 //焦距
- viewer.scene.eyeSeparation = 0.06 //瞳距
-
- document.documentElement.addEventListener('fullscreenchange', e => {
- e.stopPropagation()
- e.preventDefault()
- console.log('???')
- })
- viewer.camera.flyTo({
- destination: Cesium.Cartesian3.fromDegrees(-104.9965, 39.74248, 4000)
- });
- // Add Cesium OSM Buildings.
- const buildingsTileset = await Cesium.createOsmBuildingsAsync();
- viewer.scene.primitives.add(buildingsTileset);
- </script>
- </div>
- </body>
- </html>
|