diff --git a/htdocs/map.js b/htdocs/map.js index 6a1c7793..7075e960 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -142,6 +142,7 @@ $(function(){ }, aprsOptions, getMarkerOpacityOptions(update.lastseen) )); marker.lastseen = update.lastseen; marker.mode = update.mode; + marker.direct = update.direct; marker.band = update.band; marker.comment = update.location.comment; marker.weather = update.location.weather; @@ -446,6 +447,7 @@ $(function(){ var commentString = ""; var weatherString = ""; var detailsString = ""; + var indirect = ""; var distance = ""; if (marker.comment) { @@ -546,10 +548,15 @@ $(function(){ distance = " at " + distanceKm(receiverMarker.position, marker.position) + " km"; } + if (!marker.direct) { + indirect = 'indirect '; + } + infowindow.setContent( '

' + linkifyCallsign(callsign) + distance + '

' + - '
' + timestring + ' using ' + marker.mode + ( marker.band ? ' on ' + marker.band : '' ) + '
' + - commentString + weatherString + detailsString + '
' + timestring + ' using ' + indirect + + marker.mode + ( marker.band ? ' on ' + marker.band : '' ) + + '
' + commentString + weatherString + detailsString ); infowindow.open(map, marker); diff --git a/owrx/aprs/__init__.py b/owrx/aprs/__init__.py index 21ac15a6..61c5e336 100644 --- a/owrx/aprs/__init__.py +++ b/owrx/aprs/__init__.py @@ -177,6 +177,8 @@ class AprsParser(PickleModule): return self.metrics[category] def isDirect(self, aprsData): + if "source" in aprsData and aprsData["source"] == "AIS": + return True; if "path" in aprsData and len(aprsData["path"]) > 0: hops = [host for host in aprsData["path"] if widePattern.match(host) is None] if len(hops) > 0: @@ -206,6 +208,7 @@ class AprsParser(PickleModule): def updateMap(self, mapData): mode = mapData["mode"] if "mode" in mapData else "APRS" + direct = self.isDirect(mapData) if "type" in mapData and mapData["type"] == "thirdparty" and "data" in mapData: mapData = mapData["data"] if "lat" in mapData and "lon" in mapData: @@ -216,7 +219,7 @@ class AprsParser(PickleModule): source = mapData["item"] elif mapData["type"] == "object": source = mapData["object"] - Map.getSharedInstance().updateLocation(source, loc, mode, self.band) + Map.getSharedInstance().updateLocation(source, loc, mode, self.band, direct) def hasCompressedCoordinates(self, raw): return raw[0] == "/" or raw[0] == "\\" diff --git a/owrx/map.py b/owrx/map.py index 8c95ea55..0b59b02c 100644 --- a/owrx/map.py +++ b/owrx/map.py @@ -77,7 +77,7 @@ class Map(object): except ValueError: pass - def updateLocation(self, callsign, loc: Location, mode: str, band: Band = None): + def updateLocation(self, callsign, loc: Location, mode: str, band: Band = None, direct: bool = True): ts = datetime.now() with self.positionsLock: self.positions[callsign] = {"location": loc, "updated": ts, "mode": mode, "band": band} @@ -89,6 +89,7 @@ class Map(object): "lastseen": ts.timestamp() * 1000, "mode": mode, "band": band.getName() if band is not None else None, + "direct": direct, } ] )