Skip to content

Commit

Permalink
fix example and update cesium version
Browse files Browse the repository at this point in the history
  • Loading branch information
jjspace committed Jan 3, 2024
1 parent 2e566a7 commit 345dabc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"root": true,
"extends": ["cesium/browser"],
"plugins": ["html", "es"],
"parserOptions": {
"ecmaVersion": 2023
},
"rules": {
"no-unused-vars": ["error", { "vars": "all", "args": "none" }]
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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({
Expand Down

0 comments on commit 345dabc

Please sign in to comment.