Skip to content

Commit 0259764

Browse files
authored
Merge pull request #560 from AR-js-org/issue500
Allow real GPS position to be used, even after fake GPS has been set
2 parents 8609ac9 + b069f2a commit 0259764

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

aframe/build/aframe-ar-new-location-only.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aframe/build/aframe-ar-nft.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aframe/build/aframe-ar.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aframe/src/new-location-based/gps-new-camera.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ AFRAME.registerComponent("gps-new-camera", {
3636
init: function () {
3737
this._testForOrientationControls();
3838

39+
this.fakeGpsStarted = false;
40+
3941
this.threeLoc = new THREEx.LocationBased(
4042
this.el.sceneEl.object3D,
4143
this.el.object3D,
@@ -96,6 +98,7 @@ AFRAME.registerComponent("gps-new-camera", {
9698
maximumAge: this.data.gpsTimeInterval,
9799
});
98100
if (
101+
!this.fakeGpsStarted &&
99102
(this.data.simulateLatitude !== 0 || this.data.simulateLongitude !== 0) &&
100103
(this.data.simulateLatitude != oldData.simulateLatitude ||
101104
this.data.simulateLongitude != oldData.simulateLongitude)
@@ -105,8 +108,7 @@ AFRAME.registerComponent("gps-new-camera", {
105108
this.data.simulateLongitude,
106109
this.data.simulateLatitude
107110
);
108-
this.data.simulateLatitude = 0;
109-
this.data.simulateLongitude = 0;
111+
this.fakeGpsStarted = true;
110112
}
111113
if (this.data.simulateAltitude > -Number.MAX_VALUE) {
112114
this.threeLoc.setElevation(this.data.simulateAltitude + 1.6);

0 commit comments

Comments
 (0)