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
ZachTRice65b6a8e1aaae
diff --git a/web/js/layers/active.js b/web/js/layers/active.jsindex 1dc22c7db..5ccc29b4c 100644--- a/web/js/layers/active.js+++ b/web/js/layers/active.js@@ -5,7 +5,7 @@ import util from '../util/util';import wvui from '../ui/ui';import layersInfo from './info';import layersOptions from './options';-import palettesLegend from '../palettes/legend';+import {palettesLegend} from '../palettes/legend';export function layersActive(models, ui, config) {var model = models.layers;diff --git a/web/js/layers/sidebar.js b/web/js/layers/sidebar.jsindex 2ba62855b..7d1a2e3ae 100644--- a/web/js/layers/sidebar.js+++ b/web/js/layers/sidebar.js@@ -1,5 +1,6 @@import $ from 'jquery';import util from '../util/util';+import {GA as googleAnalytics} from 'worldview-components';export function layersSidebar(models, config) {var collapsed = false;@@ -241,7 +242,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.jsindex 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.jsindex 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);