Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-1139: Map is now initialized before the data download model is created

Mike McGannb71f50998f42
diff --git a/web/js/data/wv.data.model.js b/web/js/data/wv.data.model.js
index c4fd537bd..c2dd3c818 100644
--- a/web/js/data/wv.data.model.js
+++ b/web/js/data/wv.data.model.js
@@ -99,7 +99,7 @@ wv.data.model = wv.data.model || function(models, config) {
var init = function() {
models.layers.events.on("change", updateLayers);
- models.proj.events.on("select", updateProjectionInfo);
+ models.proj.events.on("select", updateProjection);
models.date.events.on("select", updateDate);
updateLayers();
updateProjection();
diff --git a/web/js/wv.main.js b/web/js/wv.main.js
index af2f8e2e9..6c3d92aad 100644
--- a/web/js/wv.main.js
+++ b/web/js/wv.main.js
@@ -108,16 +108,19 @@ $(function() {
events: wv.util.events()
}
};
+ var ui = {};
models.proj = wv.proj.model(config);
models.palettes = wv.palettes.model(models, config);
models.layers = wv.layers.model(models, config);
models.date = wv.date.model({ initial: initialDate });
+ models.map = wv.map.model(models, config);
+ models.link = wv.link.model(config);
+ // HACK: Map needs to be created before the data download model
+ ui.map = wv.map.ui(models, config);
if ( config.features.dataDownload ) {
models.data = wv.data.model(models, config);
}
- models.map = wv.map.model(models, config);
- models.link = wv.link.model(config);
// Export for debugging
wvx.models = models;
@@ -138,9 +141,6 @@ $(function() {
elapsed("ui");
// Create widgets
- var ui = {};
-
- ui.map = wv.map.ui(models, config);
ui.anim = wv.date.anim(models.date, ui.map, {
debug: parameters.debug === "anim"
});