From f02c017b923296037aa21c7e98d372cf0d22dc59 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Wed, 31 Jan 2024 19:43:39 -0500 Subject: [PATCH] Making unknown locator bands/modes read as "other" on the map. --- htdocs/lib/MapLocators.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/MapLocators.js b/htdocs/lib/MapLocators.js index cf507d0b..d8db5e56 100644 --- a/htdocs/lib/MapLocators.js +++ b/htdocs/lib/MapLocators.js @@ -50,8 +50,12 @@ LocatorManager.prototype.update = function(id, data, map) { // Do not update unless locator present if (!(id in this.locators)) return false; + // Make sure we have valid band and mode names + if (!data.band) data.band = 'other'; + if (!data.mode) data.mode = 'other'; + // Keep track of bands - if(!(data.band in this.bands)) { + if (!(data.band in this.bands)) { this.bands[data.band] = '#000000'; this.assignColors(this.bands); if (this.colorMode === 'band') { @@ -61,7 +65,7 @@ LocatorManager.prototype.update = function(id, data, map) { } // Keep track modes - if(!(data.mode in this.modes)) { + if (!(data.mode in this.modes)) { this.modes[data.mode] = '#000000'; this.assignColors(this.modes); if (this.colorMode === 'mode') {