@@ -812,6 +812,9 @@ AFRAME.registerComponent('gps-camera', {
812812
813813 window . addEventListener ( eventName , this . _onDeviceOrientation , false ) ;
814814
815+ } ,
816+
817+ play : function ( ) {
815818 this . _watchPositionId = this . _initWatchGPS ( function ( position ) {
816819 var localPosition = {
817820 latitude : position . coords . latitude ,
@@ -855,11 +858,14 @@ AFRAME.registerComponent('gps-camera', {
855858 this . _updateRotation ( ) ;
856859 } ,
857860
858- remove : function ( ) {
861+ pause : function ( ) {
859862 if ( this . _watchPositionId ) {
860863 navigator . geolocation . clearWatch ( this . _watchPositionId ) ;
861864 }
862865 this . _watchPositionId = null ;
866+ } ,
867+
868+ remove : function ( ) {
863869
864870 var eventName = this . _getDeviceOrientationEventName ( ) ;
865871 window . removeEventListener ( eventName , this . _onDeviceOrientation , false ) ;
@@ -1371,7 +1377,9 @@ AFRAME.registerComponent('gps-projected-camera', {
13711377 }
13721378
13731379 window . addEventListener ( eventName , this . _onDeviceOrientation , false ) ;
1374-
1380+ } ,
1381+
1382+ play : function ( ) {
13751383 this . _watchPositionId = this . _initWatchGPS ( function ( position ) {
13761384 var localPosition = {
13771385 latitude : position . coords . latitude ,
@@ -1415,12 +1423,14 @@ AFRAME.registerComponent('gps-projected-camera', {
14151423 this . _updateRotation ( ) ;
14161424 } ,
14171425
1418- remove : function ( ) {
1426+ pause : function ( ) {
14191427 if ( this . _watchPositionId ) {
14201428 navigator . geolocation . clearWatch ( this . _watchPositionId ) ;
14211429 }
14221430 this . _watchPositionId = null ;
1431+ } ,
14231432
1433+ remove : function ( ) {
14241434 var eventName = this . _getDeviceOrientationEventName ( ) ;
14251435 window . removeEventListener ( eventName , this . _onDeviceOrientation , false ) ;
14261436 window . removeEventListener ( 'gps-entity-place-added' , this . onGpsEntityPlaceAdded ) ;
0 commit comments