From f4b111097230bbc741e2c49709a64e924ac2e7e3 Mon Sep 17 00:00:00 2001 From: Sambalim Date: Tue, 9 Jun 2020 22:33:12 +0900 Subject: [PATCH 1/3] feature: Add new buttons --- Apps/Sandcastle/gallery/Camera.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Apps/Sandcastle/gallery/Camera.html b/Apps/Sandcastle/gallery/Camera.html index b6787c8cff8f..f2fcc7c11b5a 100644 --- a/Apps/Sandcastle/gallery/Camera.html +++ b/Apps/Sandcastle/gallery/Camera.html @@ -329,7 +329,6 @@ Sandcastle.declare(flyOverLongitudeWithPitch); losAngelesToTokyo(true); } - Sandcastle.addToolbarMenu([ { text: "Camera Options", @@ -427,6 +426,14 @@ }, ]); + Sandcastle.addToolbarButton("Complete Flight", function () { + scene.camera.completeFlight(); + }); + + Sandcastle.addToolbarButton("Cancel Flight", function () { + scene.camera.cancelFlight(); + }); + Sandcastle.reset = function () { scene.completeMorph(); viewer.entities.removeAll(); From a45af53f6cbf9cc220735c5a46b58daee9e3102b Mon Sep 17 00:00:00 2001 From: Sambalim Date: Tue, 9 Jun 2020 22:42:44 +0900 Subject: [PATCH 2/3] fix: Accidentally adding lines --- Apps/Sandcastle/gallery/Camera.html | 1 + 1 file changed, 1 insertion(+) diff --git a/Apps/Sandcastle/gallery/Camera.html b/Apps/Sandcastle/gallery/Camera.html index f2fcc7c11b5a..753e3e8a9bde 100644 --- a/Apps/Sandcastle/gallery/Camera.html +++ b/Apps/Sandcastle/gallery/Camera.html @@ -329,6 +329,7 @@ Sandcastle.declare(flyOverLongitudeWithPitch); losAngelesToTokyo(true); } + Sandcastle.addToolbarMenu([ { text: "Camera Options", From 49fb164110dbeadc42fd639ce4fc47a7cabf8d61 Mon Sep 17 00:00:00 2001 From: Ian Lilley Date: Fri, 12 Jun 2020 10:01:32 -0400 Subject: [PATCH 3/3] calling reset manually in toolbar options to avoid complete and cancel calling reset --- Apps/Sandcastle/gallery/Camera.html | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Apps/Sandcastle/gallery/Camera.html b/Apps/Sandcastle/gallery/Camera.html index 753e3e8a9bde..e3e775ef59d7 100644 --- a/Apps/Sandcastle/gallery/Camera.html +++ b/Apps/Sandcastle/gallery/Camera.html @@ -337,6 +337,7 @@ { text: "Fly in a city", onselect: function () { + reset(); flyInACity(); Sandcastle.highlight(flyInACity); }, @@ -344,6 +345,7 @@ { text: "Fly to San Diego", onselect: function () { + reset(); flyToSanDiego(); Sandcastle.highlight(flyToSanDiego); }, @@ -351,6 +353,7 @@ { text: "Fly to Location with heading, pitch and roll", onselect: function () { + reset(); flyToHeadingPitchRoll(); Sandcastle.highlight(flyToHeadingPitchRoll); }, @@ -358,6 +361,7 @@ { text: "Fly to My Location", onselect: function () { + reset(); flyToLocation(); Sandcastle.highlight(flyToLocation); }, @@ -365,6 +369,7 @@ { text: "Fly to Rectangle", onselect: function () { + reset(); flyToRectangle(); Sandcastle.highlight(flyToRectangle); }, @@ -372,6 +377,7 @@ { text: "View a Rectangle", onselect: function () { + reset(); viewRectangle(); Sandcastle.highlight(viewRectangle); }, @@ -379,6 +385,7 @@ { text: "Set camera reference frame", onselect: function () { + reset(); setReferenceFrame(); Sandcastle.highlight(setReferenceFrame); }, @@ -386,6 +393,7 @@ { text: "Set camera with heading, pitch, and roll", onselect: function () { + reset(); setHeadingPitchRoll(); Sandcastle.highlight(setHeadingPitchRoll); }, @@ -393,6 +401,7 @@ { text: "View in ICRF", onselect: function () { + reset(); viewInICRF(); Sandcastle.highlight(viewInICRF); }, @@ -400,6 +409,7 @@ { text: "Move events", onselect: function () { + reset(); cameraEvents(); Sandcastle.highlight(cameraEvents); }, @@ -407,6 +417,7 @@ { text: "Camera changed event", onselect: function () { + reset(); cameraChanges(); Sandcastle.highlight(cameraChanges); }, @@ -414,6 +425,7 @@ { text: "Fly from Los Angeles to Tokyo via Europe", onselect: function () { + reset(); flyOverLongitude(); Sandcastle.highlight(flyOverLongitude); }, @@ -421,6 +433,7 @@ { text: "Look down during exaggerated flight", onselect: function () { + reset(); flyOverLongitudeWithPitch(); Sandcastle.highlight(flyOverLongitudeWithPitch); }, @@ -435,7 +448,7 @@ scene.camera.cancelFlight(); }); - Sandcastle.reset = function () { + function reset() { scene.completeMorph(); viewer.entities.removeAll(); scene.primitives.remove(referenceFramePrimitive); @@ -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();