From 04e3e05598dd0ae8ccbe3f4b26a06207bbf10dce Mon Sep 17 00:00:00 2001 From: Rob L Date: Thu, 7 Jul 2016 13:39:25 -0400 Subject: [PATCH] Add reset button --- mapview/js/mapviewgl.js | 7 +++++++ mapview/webviewgl.htm | 3 +++ 2 files changed, 10 insertions(+) diff --git a/mapview/js/mapviewgl.js b/mapview/js/mapviewgl.js index 3907b59..49fb1b2 100644 --- a/mapview/js/mapviewgl.js +++ b/mapview/js/mapviewgl.js @@ -14,6 +14,7 @@ render(); }); } + function loadData(_callback) { // Load Data (hopefully) before the rest of the place loads. var xmlhttp = new XMLHttpRequest(); @@ -31,6 +32,12 @@ function loadData(_callback) { } +function reset_view() { + camera.position.set(-9300,50,550); + controls.target.x = jsonEmpire['UFP'].cenx; + controls.target.y = jsonEmpire['UFP'].ceny; + controls.target.z = jsonEmpire['UFP'].cenz; +} function init() { scene = new THREE.Scene(); diff --git a/mapview/webviewgl.htm b/mapview/webviewgl.htm index 5afcb74..5afbce6 100644 --- a/mapview/webviewgl.htm +++ b/mapview/webviewgl.htm @@ -9,10 +9,13 @@
+
Reset