Interactive interface for browsing global, full-resolution satellite imagery
Fixed bug where the wrong layer was being hidden where there were multiple baselayers
Mike McGannaecaef77a7ce
diff --git a/src/js/map/wv.map.layers.js b/src/js/map/wv.map.layers.jsindex a9140b50a..4a51fdea5 100644--- a/src/js/map/wv.map.layers.js+++ b/src/js/map/wv.map.layers.js@@ -53,7 +53,8 @@ wv.map.layers.set = function(config, projId, layerId) {if ( options && options.time ) {olLayer.mergeNewParams({"time": options.time});}- return olLayer;+ olLayer.wvid = layerId;+ return olLayer;};var createWMS = function(add) {@@ -87,6 +88,7 @@ wv.map.layers.set = function(config, projId, layerId) {}var olLayer = new OpenLayers.Layer.WMS(layer.title, source.url,params, options);+ olLayer.wvid = layerId;return olLayer;};@@ -186,13 +188,15 @@ wv.map.layers.daily = function(map, config, projId, layerId) {cachedLayers[currentDay] = currentLayer;}currentDay = ds;-+ fetchLayer();+ /*// If the layer is hidden, don't fetch anythingif ( self.visible ) {fetchLayer();} else {currentLayer = null;}+ */};self.setOpacity = function(opacity) {diff --git a/src/js/map/wv.map.model.js b/src/js/map/wv.map.model.jsindex c565efc53..2af640f41 100644--- a/src/js/map/wv.map.model.js+++ b/src/js/map/wv.map.model.js@@ -119,8 +119,9 @@ wv.map.model = wv.map.model || function(models, config) {var onLayersChange = function() {var active = models.layers.forProjection();var layers =- _.pluck(active.baselayers, "id")- .concat(_.pluck(active.overlays, "id"));+ _.pluck(active.overlays, "id")+ .concat(_.pluck(active.baselayers, "id"));+ layers.reverse();var visible = models.layers.visible;self.maps.set(layers, visible);};diff --git a/src/js/map/wv.map.set.js b/src/js/map/wv.map.set.jsindex dce774702..68cacc848 100644--- a/src/js/map/wv.map.set.js+++ b/src/js/map/wv.map.set.js@@ -94,6 +94,7 @@ wv.map.set = wv.map.set || function(containerId, mapConfig, component) {units: config.units || "dd"};var blankLayer = new OpenLayers.Layer("Blank", options);+ blankLayer.wvid = "__BLANK";newMap.addLayer(blankLayer);// If a starting location is provided, go there otherwise@@ -256,7 +257,7 @@ wv.map.set = wv.map.set || function(containerId, mapConfig, component) {self.layers = activeLayers[self.projection];var seenBaseLayer = false;- _.each(self.layers, function(layerId) {+ _.eachRight(self.layers, function(layerId) {if ( !visibleLayers[layerId] ) {return;}