File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed
aframe/examples/new-location-based/show-distance Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change 1- /*
21AFRAME . 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- */
Original file line number Diff line number Diff line change 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-
101window . 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.' ) ;
You can’t perform that action at this time.
0 commit comments