diff --git a/htdocs/map.js b/htdocs/map.js index 1751089..902c554 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -4,6 +4,18 @@ protocol = 'wss'; } + var query = window.location.search.replace(/^\?/, '').split('&').map(function(v){ + var s = v.split('='); + r = {} + r[s[0]] = s.slice(1).join('=') + return r; + }).reduce(function(a, b){ + return a.assign(b); + }); + + var expectedCallsign; + if (query.callsign) expectedCallsign = query.callsign; + var ws_url = protocol + "://" + (window.location.origin.split("://")[1]) + "/ws/"; if (!("WebSocket" in window)) return; @@ -34,6 +46,12 @@ title: update.callsign }); } + + // TODO the trim should happen on the server side + if (expectedCallsign && expectedCallsign == update.callsign.trim()) { + map.panTo(pos); + delete(expectedCallsign); + } }); } diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 814144d..399a435 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1351,8 +1351,8 @@ function update_metadata(meta) { if (meta.mode && meta.mode != "") { mode = "Mode: " + meta.mode; source = meta.source || ""; - if (meta.lat && meta.lon) { - source = "" + source; + if (meta.lat && meta.lon && meta.source) { + source = "" + source; } up = meta.up ? "Up: " + meta.up : ""; down = meta.down ? "Down: " + meta.down : "";