The Three.js scene to use.
The Three.js camera to use. Should usually be a THREE.PerspectiveCamera.
Initialisation options for the GPS; see setGpsOptions() below.
an object which can optionally log GPS position to a server for debugging. null by default, so no logging will be done. This object should implement a sendData() method to send data (2nd arg) to a given endpoint (1st arg). Please see source code for details. Ensure you comply with privacy laws (GDPR or equivalent) if implementing this.
Add a new AR object at a given latitude, longitude and elevation.
the object
the longitude.
the latitude.
Optionalelev: numberthe elevation in metres (if not specified, 0 is assigned)
properties describing the object (for example, the contents of the GeoJSON properties field).
Convert projected east/north coordinates to three.js/WebGL world coordinates. Negates the northing (in typical projections, northings increase northwards, but in the WebGL coordinate system, we face negative z if the camera is at the origin with default rotation). Must not be called until an initial position is determined. It is assumed that the projected position is in the correct projection - no check for this is made.
the projected position.
a two member array containing the WebGL x and z coordinates
Emit an event.
the event to emit.
Send a fake GPS signal. Useful for testing on a desktop or laptop.
The longitude.
The latitude.
The elevation in metres. (optional, set to null for no elevation).
The accuracy of the GPS reading in metres. May be ignored if lower than the specified minimum accuracy.
Obtain the last known GPS location.
object containing latitude and longitude fields, or null if no previous GPS location.
Convert longitude and latitude to three.js/WebGL world coordinates. Uses the specified projection, and negates the northing (in typical projections, northings increase northwards, but in the WebGL coordinate system, we face negative z if the camera is at the origin with default rotation). Must not be called until an initial position is determined.
The longitude.
The latitude.
a two member array containing the WebGL x and z coordinates
Remove an event handler.
the event to remove a handler from.
the event handler function to remove.
Add an event handler.
the event to handle.
the event handler function.
Set the elevation (y coordinate) of the camera.
the elevation in metres.
Start the GPS on a real device
code indicating whether the GPS was started successfully. GPS errors can be handled by handling the gpserror event.
Stop the GPS on a real device
true if the GPS was stopped, false if it could not be stopped (i.e. it was never started).
Statichaversine
The main engine class for the LocAR.js system. Can be obtained either via App.start() - which resolves with a LocAR object - or on its own. If you use this class without App, you must set up the three.js scene yourself, as you did with locar.js 0.1.x.