Skip to content

Commit

Permalink
Merge pull request #12202 from jfayot/feat_11967
Browse files Browse the repository at this point in the history
Moved Viewer functionality to CesiumWidget class
  • Loading branch information
jjspace authored Oct 30, 2024
2 parents ea6e34f + bb0d73d commit aa6a1c7
Show file tree
Hide file tree
Showing 6 changed files with 2,126 additions and 1,712 deletions.
22 changes: 21 additions & 1 deletion Apps/Sandcastle/gallery/Cesium Widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,27 @@
// it does not include the animation, imagery selection,
// and other widgets, nor does it depend on the third-party
// Knockout library.
const widget = new Cesium.CesiumWidget("cesiumContainer");
const widget = new Cesium.CesiumWidget("cesiumContainer", {
shouldAnimate: true,
});

const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 500);
const heading = Cesium.Math.toRadians(135);
const pitch = 0;
const roll = 0;
const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);

const entity = widget.entities.add({
position: position,
orientation: orientation,
model: {
uri: "../../SampleData/models/CesiumAir/Cesium_Air.glb",
minimumPixelSize: 128,
maximumScale: 20000,
},
});
widget.trackedEntity = entity;
//Sandcastle_End
};
if (typeof Cesium !== "undefined") {
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
- Updated default 3D Tiles and Model lighting when using PBR in order to create a more realistic appearance. Added `DynamicEnvironmentMapManager` to control lighting parameters. These can be accessed via `Cesium3DTileset.environmentMapManager` and `Model.environmentMapManager`. [#12129](https://github.com/CesiumGS/cesium/pull/12129)
- Added `ScreenSpaceCameraController.maximumTiltAngle` to limit how much the camera can tilt. [#12169](https://github.com/CesiumGS/cesium/pull/12169)
- Update Japan Buildings sandcastle to use Japan Regional Terrain [#12259](https://github.com/CesiumGS/cesium/pull/12259)
- Moved `Viewer` functionality to `CesiumWidget` to increase usability, see the full list added to the `CesiumWidget` below. No functionality was removed from the `Viewer` but convenience helpers like the `entities` collection were added to the `CesiumWidget`. The `CesiumWidget` should be closer to a drop in replacement for the `Viewer` when not utilizing the extra Viewer widgets. [#11967](https://github.com/CesiumGS/cesium/issues/11967).
- New constructor options: `options.shouldAnimate`, `options.automaticallyTrackDataSourceClocks`, `options.dataSources`
- New properties: `dataSourceDisplay`, `entities`, `dataSources`, `allowDataSourcesToSuspendAnimation`, `trackedEntity`, `trackedEntityChanged`, `clockTrackedDataSource`
- New functions: `zoomTo()`, `flyTo()`
- Update Bing Maps attribution link [#12229] (https://github.com/CesiumGS/cesium/pull/12265)

##### Fixes :wrench:
Expand Down
Loading

0 comments on commit aa6a1c7

Please sign in to comment.