Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Checked if there's a description, only output info button if there is

ZachTRicebdb093aa2528
diff --git a/web/js/layers/wv.layers.active.js b/web/js/layers/wv.layers.active.js
index 17a8eb651..bb62bc555 100644
--- a/web/js/layers/wv.layers.active.js
+++ b/web/js/layers/wv.layers.active.js
@@ -229,7 +229,16 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {
var $infoIcon = $("<i></i>")
.addClass("fa fa-info-circle wv-layers-info-icon");
- $infoButton.append($infoIcon);
+ // Only output a info button if there is a description.
+ _.each(config.measurements, function( measurement, measurementKey ) {
+ _.each(measurement.sources, function( source, sourceKey ) {
+ _.each(source.settings, function( setting, settingKey ) {
+ if(layer.id == setting && source.description.length > 1) {
+ $infoButton.append($infoIcon);
+ }
+ });
+ });
+ });
var $editButton = $("<a></a>")
.attr("data-layer", layer.id)
diff --git a/web/js/layers/wv.layers.info.js b/web/js/layers/wv.layers.info.js
index d2a0a1fdf..321b1d382 100644
--- a/web/js/layers/wv.layers.info.js
+++ b/web/js/layers/wv.layers.info.js
@@ -14,7 +14,10 @@ wv.layers = wv.layers || {};
wv.layers.info = wv.layers.info || function(config, models, layer) {
- //TODO: Add this information into the DialogBox
+ var $dialog;
+ var self = {};
+ var canvas;
+ var description;
var $d = $("#wv-layers-options-dialog");
var $layerMeta = $( '<div></div>' )
.addClass('layer-metadata source-metadata');
@@ -28,11 +31,6 @@ wv.layers.info = wv.layers.info || function(config, models, layer) {
var $showMore = $('<div></div>')
.addClass('metadata-more');
- var $dialog;
- var self = {};
- var canvas;
- var description;
-
var init = function() {
loaded();
};