From 22a447f590f5e44fb6b082dfb778b02977430522 Mon Sep 17 00:00:00 2001
From: Marat Fayzullin
Date: Tue, 29 Nov 2022 21:26:51 -0500
Subject: [PATCH] Added altitude and device info.
---
htdocs/map.js | 34 +++++++++++++++++++++++++++-------
owrx/aprs/__init__.py | 2 +-
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/htdocs/map.js b/htdocs/map.js
index 9e30bc4..8dac88a 100644
--- a/htdocs/map.js
+++ b/htdocs/map.js
@@ -138,10 +138,12 @@ $(function(){
title: update.callsign
}, aprsOptions, getMarkerOpacityOptions(update.lastseen) ));
marker.lastseen = update.lastseen;
- marker.mode = update.mode;
- marker.band = update.band;
- marker.comment = update.location.comment;
- marker.weather = update.location.weather;
+ marker.mode = update.mode;
+ marker.band = update.band;
+ marker.comment = update.location.comment;
+ marker.weather = update.location.weather;
+ marker.altitude = update.location.altitude;
+ marker.device = update.location.device;
if (expectedCallsign && expectedCallsign == update.callsign) {
map.panTo(pos);
@@ -424,6 +426,7 @@ $(function(){
var timestring = moment(marker.lastseen).fromNow();
var commentString = "";
var weatherString = "";
+ var detailsString = "";
var distance = "";
if (marker.comment) {
@@ -453,8 +456,8 @@ $(function(){
);
}
- if (marker.weather.wind.gusts && (marker.weather.wind.gusts>0)) {
- weatherString += makeListItem('Gusts', marker.weather.wind.gusts.toFixed(1) + ' km/h');
+ if (marker.weather.wind.gust && (marker.weather.wind.gust>0)) {
+ weatherString += makeListItem('Gusts', marker.weather.wind.gust.toFixed(1) + ' km/h');
}
if (marker.weather.rain && (marker.weather.rain.day>0)) {
@@ -472,6 +475,23 @@ $(function(){
weatherString += '
';
}
+ if (marker.altitude || marker.device) {
+ detailsString += '' + makeListTitle('Details');
+
+ if (marker.altitude) {
+ detailsString += makeListItem('Altitude', marker.altitude + ' m');
+ }
+
+ if (marker.device) {
+ detailsString += makeListItem('Device',
+ marker.device.device + " by " +
+ marker.device.manufacturer
+ );
+ }
+
+ detailsString += '
';
+ }
+
if (receiverMarker) {
distance = " at " + distanceKm(receiverMarker.position, marker.position) + " km";
}
@@ -479,7 +499,7 @@ $(function(){
infowindow.setContent(
'' + linkifyCallsign(callsign) + distance + '
' +
'' + timestring + ' using ' + marker.mode + ( marker.band ? ' on ' + marker.band : '' ) + '
' +
- commentString + weatherString
+ commentString + weatherString + detailsString
);
infowindow.open(map, marker);
diff --git a/owrx/aprs/__init__.py b/owrx/aprs/__init__.py
index bfa4c96..6dc05a0 100644
--- a/owrx/aprs/__init__.py
+++ b/owrx/aprs/__init__.py
@@ -148,7 +148,7 @@ class AprsLocation(LatLngLocation):
def __dict__(self):
res = super(AprsLocation, self).__dict__()
- for key in ["comment", "symbol", "course", "speed", "weather"]:
+ for key in ["comment", "symbol", "course", "speed", "altitude", "weather", "device"]:
if key in self.data:
res[key] = self.data[key]
return res