forked from cory/tildefriends
Cory McWilliams
f08b564755
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3294 ed5197a5-7fde-0310-b194-c3ffbd925b24
19 lines
493 B
JavaScript
19 lines
493 B
JavaScript
"use strict";
|
|
|
|
core.register("geolocation", function(event) {
|
|
terminal.print("hi");
|
|
terminal.cork();
|
|
if (event.position) {
|
|
for (let field in event.position.coords) {
|
|
let value = event.position.coords[field];
|
|
terminal.print(field, ": ", value != null ? value.toString() : "null");
|
|
}
|
|
} else if (event.error) {
|
|
terminal.print(event.error.message);
|
|
terminal.clearWatch();
|
|
}
|
|
terminal.uncork();
|
|
});
|
|
|
|
terminal.watchPosition({enableHighAccuracy: true});
|
|
//terminal.watchPosition();
|