Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fix tab switching & "add layer" console errors - Change palettesLegend import to reference a function - Add undefined variables to prevent errors when adding layer. - Add check for null variable passed into ui hide function. - Add undefined variables to remove colorbar errors on hover

ZachTRice580286923d9d
diff --git a/web/js/layers/sidebar.js b/web/js/layers/sidebar.js
index 56315406e..0ec263caa 100644
--- a/web/js/layers/sidebar.js
+++ b/web/js/layers/sidebar.js
@@ -3,6 +3,7 @@ import 'jquery-ui/tabs';
import 'jquery-ui/dialog';
import 'perfect-scrollbar/jquery';
import util from '../util/util';
+import {GA as googleAnalytics} from 'worldview-components';
export function layersSidebar(models, config) {
var collapsed = false;
@@ -244,7 +245,7 @@ export function layersSidebar(models, config) {
if (tab === 'active') {
$('.ui-tabs-nav li.first').addClass('ui-state-active');
} else if (tab === 'events') {
- WVC.GA.event('Natural Events', 'Click', 'Events Tab');
+ googleAnalytics.event('Natural Events', 'Click', 'Events Tab');
$('.ui-tabs-nav li.second').addClass('ui-state-active');
} else if (tab === 'download') {
$('.ui-tabs-nav li.third').addClass('ui-state-active');
diff --git a/web/js/palettes/legend.js b/web/js/palettes/legend.js
index 6427f2859..606e97f79 100644
--- a/web/js/palettes/legend.js
+++ b/web/js/palettes/legend.js
@@ -59,6 +59,7 @@ export function palettesLegend(spec) {
};
var renderScale = function ($legendPanel, legend, index, layerId) {
+ var $container, $colorbar;
$container = $('<div></div>')
.addClass('wv-palettes-legend')
.attr('data-index', index);
@@ -214,12 +215,7 @@ export function palettesLegend(spec) {
* @return {void}
*/
var showUnitHover = function (e, index) {
- var rgba;
- var pos;
- var x;
- var y;
- var id;
- var legends;
+ var rgba, pos, x, y, id, legends, offset, hex;
if (!loaded) {
return;
}
diff --git a/web/js/util/load.js b/web/js/util/load.js
index 3d14580f0..5d54665d6 100644
--- a/web/js/util/load.js
+++ b/web/js/util/load.js
@@ -37,7 +37,7 @@ export default (function () {
if (loading === 0) {
clearTimeout(indicatorTimeout);
indicatorTimeout = null;
- wvui.indicator.hide(indicatorId);
+ if (indicatorId) wvui.indicator.hide(indicatorId);
}
})
.fail(wvui.error);