Skip to content

Commit

Permalink
calling reset manually in toolbar options to avoid complete and cance…
Browse files Browse the repository at this point in the history
…l calling reset
  • Loading branch information
IanLilleyT committed Jun 12, 2020
1 parent a45af53 commit 49fb164
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Apps/Sandcastle/gallery/Camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,90 +337,103 @@
{
text: "Fly in a city",
onselect: function () {
reset();
flyInACity();
Sandcastle.highlight(flyInACity);
},
},
{
text: "Fly to San Diego",
onselect: function () {
reset();
flyToSanDiego();
Sandcastle.highlight(flyToSanDiego);
},
},
{
text: "Fly to Location with heading, pitch and roll",
onselect: function () {
reset();
flyToHeadingPitchRoll();
Sandcastle.highlight(flyToHeadingPitchRoll);
},
},
{
text: "Fly to My Location",
onselect: function () {
reset();
flyToLocation();
Sandcastle.highlight(flyToLocation);
},
},
{
text: "Fly to Rectangle",
onselect: function () {
reset();
flyToRectangle();
Sandcastle.highlight(flyToRectangle);
},
},
{
text: "View a Rectangle",
onselect: function () {
reset();
viewRectangle();
Sandcastle.highlight(viewRectangle);
},
},
{
text: "Set camera reference frame",
onselect: function () {
reset();
setReferenceFrame();
Sandcastle.highlight(setReferenceFrame);
},
},
{
text: "Set camera with heading, pitch, and roll",
onselect: function () {
reset();
setHeadingPitchRoll();
Sandcastle.highlight(setHeadingPitchRoll);
},
},
{
text: "View in ICRF",
onselect: function () {
reset();
viewInICRF();
Sandcastle.highlight(viewInICRF);
},
},
{
text: "Move events",
onselect: function () {
reset();
cameraEvents();
Sandcastle.highlight(cameraEvents);
},
},
{
text: "Camera changed event",
onselect: function () {
reset();
cameraChanges();
Sandcastle.highlight(cameraChanges);
},
},
{
text: "Fly from Los Angeles to Tokyo via Europe",
onselect: function () {
reset();
flyOverLongitude();
Sandcastle.highlight(flyOverLongitude);
},
},
{
text: "Look down during exaggerated flight",
onselect: function () {
reset();
flyOverLongitudeWithPitch();
Sandcastle.highlight(flyOverLongitudeWithPitch);
},
Expand All @@ -435,7 +448,7 @@
scene.camera.cancelFlight();
});

Sandcastle.reset = function () {
function reset() {
scene.completeMorph();
viewer.entities.removeAll();
scene.primitives.remove(referenceFramePrimitive);
Expand Down Expand Up @@ -463,10 +476,10 @@
clock.multiplier = 1.0;
scene.postUpdate.removeEventListener(icrf);
scene.globe.enableLighting = false;
};
}

scene.morphComplete.addEventListener(function () {
Sandcastle.reset();
reset();
});
//Sandcastle_End
Sandcastle.finishedLoading();
Expand Down

0 comments on commit 49fb164

Please sign in to comment.