Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add 'showSubdaily' mock URL parameter #866

ZachTRice99cc6fe85339
diff --git a/web/js/date/config.js b/web/js/date/config.js
index 1beddaa46..1a735f0a0 100644
--- a/web/js/date/config.js
+++ b/web/js/date/config.js
@@ -37,11 +37,16 @@ export function timelineConfig(models, config, ui) {
// Needs reworked. Repeated from layers/active/toggleSubdaily
var activeLayers = models.layers.active;
var subdailyFound = false;
- for (var i = 0; i < activeLayers.length; i++) {
- switch (activeLayers[i].period) {
- case 'subdaily':
- subdailyFound = true;
- break;
+ var showSubdaily = config.parameters.showSubdaily;
+ if (showSubdaily === 'true') {
+ subdailyFound = true;
+ } else {
+ for (var i = 0; i < activeLayers.length; i++) {
+ switch (activeLayers[i].period) {
+ case 'subdaily':
+ subdailyFound = true;
+ break;
+ }
}
}
diff --git a/web/js/debug.js b/web/js/debug.js
index 5522c18bc..936773335 100644
--- a/web/js/debug.js
+++ b/web/js/debug.js
@@ -21,6 +21,7 @@ export var debug = (function () {
return;
}
}
+
if (parameters.showError) {
$(function () {
util.error();
diff --git a/web/js/layers/active.js b/web/js/layers/active.js
index fb04b16cb..ed2c238f3 100644
--- a/web/js/layers/active.js
+++ b/web/js/layers/active.js
@@ -372,12 +372,18 @@ export function layersActive(models, ui, config) {
var subdailyCheck = function () {
var activeLayers = models.layers.active;
var currentProjection = models.proj.selected.id;
+ var showSubdaily = config.parameters.showSubdaily;
var check;
- lodashEach(activeLayers, function(activeLayer) {
- if (Object.keys(activeLayer.projections).some(function(k) { return ~k.indexOf(currentProjection); })) {
- if (activeLayer.period === 'subdaily' && activeLayer.projections[currentProjection]) check = true;
- }
- });
+
+ if (showSubdaily === 'true') {
+ check = true;
+ } else {
+ lodashEach(activeLayers, function(activeLayer) {
+ if (Object.keys(activeLayer.projections).some(function(k) { return ~k.indexOf(currentProjection); })) {
+ if (activeLayer.period === 'subdaily' && activeLayer.projections[currentProjection]) check = true;
+ }
+ });
+ }
return check;
};