Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

show unit hover backup from entries if legend labels do not exist

Taylor Gunnoe3f056a2652f8
diff --git a/web/js/palettes/wv.palettes.legend.js b/web/js/palettes/wv.palettes.legend.js
index 0bfdd11b2..8db50cdba 100644
--- a/web/js/palettes/wv.palettes.legend.js
+++ b/web/js/palettes/wv.palettes.legend.js
@@ -199,6 +199,7 @@ wv.palettes.legend = wv.palettes.legend || function(spec) {
}
var index = _.parseInt($(this).attr("data-index"));
var legend = model.getLegend(layer.id, index);
+ var entry = model.get(layer.id, index).entries;
var $colorbar = $(this);
var x = event.pageX - $colorbar.offset().left;
var width = $colorbar.width();
@@ -210,7 +211,7 @@ wv.palettes.legend = wv.palettes.legend || function(spec) {
}
var color = legend.colors[colorIndex];
- var label = legend.labels[colorIndex];
+ var label = legend.labels[colorIndex] || entry.labels[colorIndex];
$colorbar.tooltip("option", "content",
"<span class='wv-palettes-color-box' style='background: " +
wv.util.hexToRGBA(color) + "'>" + "</span>" + label);