GPS Class
GPS class manages all operations with gps hardware.
Item Index
Events
Methods
this
()
Constructs new GPS object.
Example:
this._gps = new GPS();
this._gps.start(200);
this._gps.onPositionReceived = function(sender, timestamp, params) {
app.actualLat = params[0];
app.actualLon = params[1];
}
dispose
()
Destroy object and release all underlying resources.
isAvailable
()
Function returns true if GPS is available on the device. Otherwise it returns false.
Returns:
Boolean
Example:
if (!GPS.isAvailable())
System.messageBox("No GPS detected in your device!");
pause
()
Pause sending callback data.
resume
()
Resume sending callback data.
start
()
This function starts sending position data. When new data are available, GPS object calls callback functions.
Example:
this._gps = new GPS();
this._gps.start(200);
this._gps.onPositionReceived = function(sender, timestamp, params) {
app.actualLat = params[0];
app.actualLon = params[1];
}
Events
onPositionReceived
GPS object call this callback function, when new position data is available.
Event Payload:
Example:
this._gps = new GPS();
this._gps.start(200);
this._gps.onPositionReceived = function(sender, timestamp, params) {
app.actualLat = params[0];
app.actualLon = params[1];
}
onStateChanged
GPS object call this callback function, when new state data is available.
Event Payload:
Example:
this._gps = new GPS();
this._gps.start(200);
this._gps.onStateChanged = function(sender, timestamp, state) {
console<<"new state: "<<state<<"\n";
}