diff --git a/aprsd/cmds/webchat.py b/aprsd/cmds/webchat.py index 85397d2..4bf35f8 100644 --- a/aprsd/cmds/webchat.py +++ b/aprsd/cmds/webchat.py @@ -375,12 +375,9 @@ class SendMessageNamespace(Namespace): # now construct a beacon to send over the client connection txt = ( f"{self._config['aprs']['login']}>APZ100,WIDE2-1" - f":!{lat}{long}#PHG7260 APRSD WebChat Beacon" + f":@{time_zulu}z{lat}/{long}l APRSD WebChat Beacon" ) - txt = f"@{time_zulu}z{lat}1{long}$APRSD WebChat Beacon" - - LOG.debug(f"Sending {txt}") beacon_msg = messaging.RawMessage(txt) beacon_msg.fromcall = self._config["aprs"]["login"] beacon_msg.tocall = "APDW16" diff --git a/aprsd/web/chat/static/js/gps.js b/aprsd/web/chat/static/js/gps.js index e9520c6..dbe0229 100644 --- a/aprsd/web/chat/static/js/gps.js +++ b/aprsd/web/chat/static/js/gps.js @@ -10,7 +10,14 @@ function init_gps() { function getLocation() { if (navigator.geolocation) { console.log("getCurrentPosition"); - navigator.geolocation.getCurrentPosition(showPosition, showError); + try { + navigator.geolocation.getCurrentPosition( + showPosition, showError, + {timeout:3000}); + } catch(err) { + console.log("Failed to getCurrentPosition"); + console.log(err); + } } else { var msg = "Geolocation is not supported by this browser." console.log(msg); @@ -30,7 +37,7 @@ function showError(error) { msg = "Location information is unavailable." break; case error.TIMEOUT: - msg = "The request to get user location timed out." + msg = "The location fix timed out." break; case error.UNKNOWN_ERROR: msg = "An unknown error occurred." @@ -39,9 +46,11 @@ function showError(error) { console.log(msg); $.toast({ title: 'GPS Error', + class: 'warning', + position: 'middle center', message: msg, - showProgress: 'bottom', - classProgress: 'red' + showProgress: 'top', + classProgress: 'blue', }); } @@ -59,5 +68,6 @@ function showPosition(position) { classProgress: 'red' }); + console.log("Sending GPS msg") socket.emit("gps", msg); }