diff --git a/.eslintrc.json b/.eslintrc.json index 78bf21b..e5cb154 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,6 +2,9 @@ "root": true, "extends": ["cesium/browser"], "plugins": ["html", "es"], + "parserOptions": { + "ecmaVersion": 2023 + }, "rules": { "no-unused-vars": ["error", { "vars": "all", "args": "none" }] } diff --git a/package.json b/package.json index 3afe06f..ca488c6 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "prettier-check": "prettier --check --no-config \"**/*\"" }, "devDependencies": { - "cesium": "^1.97.0", + "cesium": "^1.113.0", "copy-webpack-plugin": "^9.0.1", "css-loader": "^6.2.0", "eslint": "^8.56.0", diff --git a/src/index.js b/src/index.js index 6936f0e..7d1b039 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,10 @@ import { Ion, Viewer, - createWorldTerrain, - createOsmBuildings, Cartesian3, Math, + Terrain, + createOsmBuildingsAsync, } from "cesium"; import "cesium/Build/Cesium/Widgets/widgets.css"; import "../src/css/main.css"; @@ -16,11 +16,12 @@ Ion.defaultAccessToken = // Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID. const viewer = new Viewer("cesiumContainer", { - terrainProvider: createWorldTerrain(), + terrain: Terrain.fromWorldTerrain(), }); // Add Cesium OSM Buildings, a global 3D buildings layer. -viewer.scene.primitives.add(createOsmBuildings()); +const osmBuildingsTileset = await createOsmBuildingsAsync(); +viewer.scene.primitives.add(osmBuildingsTileset); // Fly the camera to San Francisco at the given longitude, latitude, and height. viewer.camera.flyTo({