Utilizes the device’s GPS, giving you geographic location of the device.

 

altitude

The altitude in meters.


Syntax:

lg.location.altitude;

Returns:

  • (float) Altitude.


Example:

var altitude = lg.location.altitude;

Back to Top

 

 

direction

Direction device is moving.


Syntax:

lg.location.direction;

Returns:

  • (float) Direction.


Example:

var direction = lg.location.direction;

Back to Top

 

 

error

Error object can be retrieved from this property if an error occurs.


Syntax:

lg.location.error;

Returns:

  • (object) Error object.


Example:

var error = lg.location.error;

Back to Top

 

 

latitude

The geographical latitude.


Syntax:

lg.location.latitude;

Returns:

  • (float) Latitude.


Example:

var latitude = lg.location.latitude;

Back to Top

 

 

longitude

The geographical longitude.


Syntax:

lg.location.longitude;

Returns:

  • (float) Longitude.


Example:

var longitude = lg.location.longitude;

Back to Top

 

 

speed

The instantaneous speed of the device.


Syntax:

lg.location.speed;

Returns:

  • (float) Speed.


Example:

var speed = lg.location.speed;

Back to Top

 

 

start

Starts updating the GPS location. An update interval may be used, otherwise .5 seconds is used.


Syntax:

lg.location.start(update);

Arguments:

  1. update – (float) Update interval.

Back to Top

 

 

stop

Stops updating the GPS location.


Syntax:

lg.location.stop();

Back to Top