diff --git a/www/js/home.js b/www/js/home.js index ed7c04a..5d7e3cb 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -78,6 +78,25 @@ function loadQrCode(callback) { }); } +function broadcastLocation() { + getLocation(function (position) { + callAPI("broadcast", { + key: localStorage.getItem("key"), + latitude: position.coords.latitude, + longitude: position.coords.longitude + }, function (success) { + app.toast.create({ + text: " Location sent!", + closeTimeout: 2000 + }).open(); + }, function (error) { + app.dialog.alert(error, "Error"); + }); + }, function (error) { + app.dialog.alert(error, "Location Error"); + }); +} + function loadHomePage(callback) { var done = 0; var total = 2; diff --git a/www/pages/home.html b/www/pages/home.html index cfb1a39..c4c812a 100644 --- a/www/pages/home.html +++ b/www/pages/home.html @@ -93,6 +93,30 @@ + +