summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js40
1 files changed, 2 insertions, 38 deletions
diff --git a/threads.js b/threads.js
index 52e1c11..fab05a0 100644
--- a/threads.js
+++ b/threads.js
@@ -2626,51 +2626,15 @@ Process.prototype.reportTimer = function () {
return 0;
};
-Process.prototype.reportLocation = function (name) {
- var myself = this;
-
- if (!myself.context.position) {
- myself.context.position = [];
-
- if (!navigator.geolocation) {
- myself.handleError({name: 'Location',
- message: 'navigator.geolocation is not supported'});
- }
-
- navigator.geolocation.getCurrentPosition(
- function (pos) {
- myself.context.position = [
- pos.coords.latitude, pos.coords.longitude];
- },
- function (err) {
- console.log(err);
- myself.handleError({name: 'Location', message: err.message});
- },
- { enableHightAccuracy: true, timeout: 5000, maximumAge: 0}
- );
- } else {
- if (myself.context.position.length == 2) {
- return new List(myself.context.position);
- }
- }
-
- this.pushContext('doYield');
- this.pushContext();
+Process.prototype.reportUserLocation = function () {
+ return new List([window.geoposition.lat, window.geoposition.lng]);
};
Process.prototype.focusMap = function (pos, zoom) {
- if (pos.contents.length != 2) {
- this.handleError({name: 'Location',
- message: 'expecting a list of latitude/longitude'});
- }
window.map.setView(pos.contents, zoom);
};
Process.prototype.addMarker = function (pos) {
- if (pos.contents.length != 2) {
- this.handleError({name: 'Location',
- message: 'expecting a list of latitude/longitude'});
- }
L.marker(pos.contents).addTo(window.map);
};