Skip to content

Commit 107b018

Browse files
committed
Allow GPS altitude usage as an option.
1 parent 5d00a73 commit 107b018

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

three.js/src/location-based/js/location-based.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class LocationBased {
1515
this.setGpsOptions(options);
1616
this.initialPosition = null;
1717
this.initialPositionAsOrigin = options.initialPositionAsOrigin || false;
18+
this.useAltitude = options.useAltitude || false;
1819
}
1920

2021
setProjection(proj) {
@@ -143,6 +144,9 @@ class LocationBased {
143144
this._camera,
144145
position.coords.longitude,
145146
position.coords.latitude,
147+
this.useAltitude && position.coords.altitude != null
148+
? position.coords.altitude
149+
: undefined,
146150
);
147151

148152
if (this._eventHandlers["gpsupdate"]) {

0 commit comments

Comments
 (0)