Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved Viewer functionality to CesiumWidget class #12202

Merged
merged 9 commits into from
Oct 30, 2024
Next Next commit
feat: moved Viewer functionality to CesiumWidget class
  • Loading branch information
jfayot committed Oct 25, 2024
commit 66512beb76a05789012df2abe82877216d0d52c5
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
Loading