@@ -1273,7 +1273,7 @@ function formatDistance(distance) {
12731273
12741274AFRAME . registerComponent ( 'gps-projected-camera' , {
12751275 _watchPositionId : null ,
1276- originCoordsProjected : null , // original coords now in Spherical Mercator
1276+ originCoords : null , // original coords now in Spherical Mercator
12771277 currentCoords : null ,
12781278 lookControls : null ,
12791279 heading : null ,
@@ -1320,7 +1320,7 @@ AFRAME.registerComponent('gps-projected-camera', {
13201320 this . currentCoords = localPosition ;
13211321
13221322 // re-trigger initialization for new origin
1323- this . originCoordsProjected = null ;
1323+ this . originCoords = null ;
13241324 this . _updatePosition ( ) ;
13251325 }
13261326 } ,
@@ -1397,7 +1397,7 @@ AFRAME.registerComponent('gps-projected-camera', {
13971397 this . currentCoords
13981398 ) ;
13991399
1400- if ( distMoved >= this . data . gpsMinDistance || ! this . originCoordsProjected ) {
1400+ if ( distMoved >= this . data . gpsMinDistance || ! this . originCoords ) {
14011401 this . _updatePosition ( ) ;
14021402 this . lastPosition = {
14031403 longitude : this . currentCoords . longitude ,
@@ -1503,11 +1503,11 @@ AFRAME.registerComponent('gps-projected-camera', {
15031503 document . body . removeChild ( alertPopup ) ;
15041504 }
15051505
1506- if ( ! this . originCoordsProjected ) {
1506+ if ( ! this . originCoords ) {
15071507 // first camera initialization
1508- // Now store originCoordsProjected as PROJECTED original lat/lon, so that
1508+ // Now store originCoords as PROJECTED original lat/lon, so that
15091509 // we can set the world origin to the original position in "metres"
1510- this . originCoordsProjected = this . _project ( this . currentCoords . latitude , this . currentCoords . longitude ) ;
1510+ this . originCoords = this . _project ( this . currentCoords . latitude , this . currentCoords . longitude ) ;
15111511 this . _setPosition ( ) ;
15121512
15131513 var loader = document . querySelector ( '.arjs-loader' ) ;
@@ -1536,7 +1536,7 @@ AFRAME.registerComponent('gps-projected-camera', {
15361536 this . el . setAttribute ( 'position' , position ) ;
15371537
15381538 // add the sphmerc position to the event (for testing only)
1539- window . dispatchEvent ( new CustomEvent ( 'gps-camera-update-position' , { detail : { position : this . currentCoords , origin : this . originCoordsProjected } } ) ) ;
1539+ window . dispatchEvent ( new CustomEvent ( 'gps-camera-update-position' , { detail : { position : this . currentCoords , origin : this . originCoords } } ) ) ;
15401540 } ,
15411541 /**
15421542 * Returns distance in meters between camera and destination input.
@@ -1580,7 +1580,7 @@ AFRAME.registerComponent('gps-projected-camera', {
15801580 latLonToWorld : function ( lat , lon ) {
15811581 var projected = this . _project ( lat , lon ) ;
15821582 // Sign of z needs to be reversed compared to projected coordinates
1583- return [ projected [ 0 ] - this . originCoordsProjected [ 0 ] , - ( projected [ 1 ] - this . originCoordsProjected [ 1 ] ) ] ;
1583+ return [ projected [ 0 ] - this . originCoords [ 0 ] , - ( projected [ 1 ] - this . originCoords [ 1 ] ) ] ;
15841584 } ,
15851585 /**
15861586 * Converts latitude/longitude to Spherical Mercator coordinates.
@@ -1713,7 +1713,7 @@ AFRAME.registerComponent('gps-projected-camera', {
17131713
17141714 _onGpsEntityPlaceAdded : function ( ) {
17151715 // if places are added after camera initialization is finished
1716- if ( this . originCoordsProjected ) {
1716+ if ( this . originCoords ) {
17171717 window . dispatchEvent ( new CustomEvent ( 'gps-camera-origin-coord-set' ) ) ;
17181718 }
17191719 if ( this . loader && this . loader . parentElement ) {
0 commit comments