Interactive interface for browsing global, full-resolution satellite imagery
Some internal documentation for main.js to step through what is happening during startup
Mike McGannc00157852408
diff --git a/src/js/main.js b/src/js/main.jsindex 75b58f144..81805671c 100644--- a/src/js/main.js+++ b/src/js/main.js@@ -3,17 +3,25 @@ $(function() {// Initialize "static" varsvar log = Logging.getLogger();var entryPoint = function() {++ // Error handlersWorldview.Events.errorHandler = function(error) {Worldview.error("Internal error", error);};+ // Place any quirky browser related items in the function called+ // below.Worldview.Support.quirks();-++ // A message can be displayed to the user (for example, notification+ // of a pending outage) by adding a notice.txt file in the web root$.get("notice.txt", function(message) {var html = message.replace(/\n/g, "<br/>");Worldview.notify(html);});+ // Place any resources that should be completely loaded before+ // starting up the UIWorldview.Preloader([{ id: "config", src: "data/config", type:"json" },"images/logo.png",@@ -44,10 +52,16 @@ $(function() {// Initialize "static" vars}};- var init = function(config) {+ var init = function(config) {+ // Convert all parameters found in the query string to an object,+ // keyed by parameter nameconfig.parameters = Worldview.queryStringToObject(location.search);++ // Features that are important for debugging but are not necessary+ // for Worldview to opeerate properlydebuggingFeatures(config);+ // Modelsvar dataDownloadModel = Worldview.DataDownload.Model(config);// Create widgets@@ -126,6 +140,7 @@ $(function() {// Initialize "static" varsWorldview.ddm = dataDownloadModel;Worldview.maps = map.maps;+ // Initialize widgetsvar queryString =Worldview.Permalink.decode(window.location.search.substring(1));@@ -152,6 +167,7 @@ $(function() {// Initialize "static" varsREGISTRY.addAllReadyCallback(testQS);}+ // Console notificationsvar banner = Worldview.NAME + " - Version " + Worldview.VERSION;if ( !Worldview.isDevelopment() ) {banner += " - " + Worldview.BUILD_TIMESTAMP;@@ -159,7 +175,8 @@ $(function() {// Initialize "static" varslog.info(banner);if ( Worldview.isDevelopment() ) {log.warn("Development version");- }+ }+// Do not start the tour if coming in via permalinkif ( !queryString ) {Worldview.Tour.start(false);