Skip to content

Commit 4e68242

Browse files
committed
fix
1 parent 588ea35 commit 4e68242

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
/*
21
AFRAME.registerComponent("clicker", {
32
init: function() {
43
this.el.addEventListener("click", e=> {
5-
alert(this.el.components["gps-new-entity-place"].distance);
4+
const dist = this.el.components["gps-new-entity-place"].distance;
5+
alert(dist === undefined ? "Please move to a new location to obtain the distance" : `This object is ${dist} metres away.`);
66
});
77
}
88
});
9-
*/

aframe/examples/new-location-based/show-distance/index.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
AFRAME.registerComponent("clicker", {
2-
init: function() {
3-
this.el.addEventListener("click", e=> {
4-
const dist = this.el.components["gps-new-entity-place"].distance;
5-
alert(dist === undefined ? "Please move to a new location to obtain the distance" : `This object is ${dist} metres away.`);
6-
});
7-
}
8-
});
9-
101
window.onload = () => {
112
let testEntitiesAdded = false;
123
alert('If testing the lat/lon manual input on a mobile device, please turn off your GPS to avoid the real location being detected.');

0 commit comments

Comments
 (0)