From eee4a99b7dc47cb29dae04c4086eb321e0e9ec7e Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sat, 24 Feb 2024 16:46:59 -0500 Subject: [PATCH] Fixed APRS weather rain reports. --- htdocs/lib/MapMarkers.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/lib/MapMarkers.js b/htdocs/lib/MapMarkers.js index 77b31710..c54d4fec 100644 --- a/htdocs/lib/MapMarkers.js +++ b/htdocs/lib/MapMarkers.js @@ -502,12 +502,15 @@ AprsMarker.prototype.getInfoHTML = function(name, receiverMarker = null) { } } - if (this.weather.rain && (this.weather.rain.day>0)) { - weatherString += Utils.makeListItem('Rain', - this.weather.rain.hour.toFixed(0) + ' mm/h, ' + - this.weather.rain.day.toFixed(0) + ' mm/day' + if (this.weather.rain) { + var rain = this.weather.rain.hour>0? this.weather.rain.hour.toFixed(0) + ' mm/h' : ''; + if (this.weather.rain.day>0) { + rain += (rain!=''? ', ' : '') + this.weather.rain.day.toFixed(0) + ' mm/day'; + } // this.weather.rain.sincemidnight + ' mm since midnight' - ); + if (rain!='') { + weatherString += Utils.makeListItem('Rain', rain); + } } if (this.weather.snowfall) {