Repository

GPS

Extends:

Component → GPS

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

true if the GPS is available on the device, false otherwise

public
public
public
Private Members
private
private

location: {"latitude": *, "longitude": *, "altitude": *, "accuracy": *, "altitudeAccuracy": *, "heading": *, "speed": *, "timestamp": *}

Object containing the informations given by the GPS.

Method Summary

Public Methods
public

returns the most recent location data.

public

off()

Deactivate the component

public

on()

Activates the component

public

Set the GPS up.

Private Methods
private
this method was deprecated.

reset the location object to avoid bugs

private

Listener for the update of the location object with the most recent data.

private

Listener for the update errors of the location object with the most recent data.

Inherited Summary

From class Component
public
public
public

events: *

public

id: *

public

name: *

private

_nexts: *[]

private
public
public

chain(component: Component)

Adds a component to this chained component array

public

Returns the array of attached children components

public

off()

Deactivate the component

public

on()

Activate the component A call to this method calls the setup method if it has not been run yet

public

Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism

public

preLoad the component This empty method is usually overriden to perform preLoad actions for the component.

public

Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism

public

prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server.

public

Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly

public

Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism

Public Constructors

public constructor(params: Object) source

Override:

Component#constructor

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.enableHighAccuracyBoolean

Boolean to activate accurate location (eats more battery and takes time)

params.maximumAgeNumber

Number of millisecond to define the maximum age of the geolocation data (default = 500000)

params.timeoutNumber

timeout of the location service in millisecond

Public Members

public available: Boolean source

true if the GPS is available on the device, false otherwise

public enableHighAccuracy: * source

public maximumAge: * source

public timeout: * source

Private Members

private _watchID: * source

private location: {"latitude": *, "longitude": *, "altitude": *, "accuracy": *, "altitudeAccuracy": *, "heading": *, "speed": *, "timestamp": *} source

Object containing the informations given by the GPS. Used internally.

Properties:

NameTypeAttributeDescription
_locationObject

Public Methods

public getLocation(): Object source

returns the most recent location data. Location service MUST be activated on the device, or errors will get out from the callbacks! The return objects contains the standard HTML5 properties for geolocation :

location.longitude
location.latitude
location.altitude
location.accuracy
location.altitudeAccuracy
location.heading
location.speed
location.timestamp

Return:

Object

the location object updated with the most recent data.

public off() source

Deactivate the component

Override:

Component#off

public on() source

Activates the component

Override:

Component#on

public setup() source

Set the GPS up.

Override:

Component#setup

Private Methods

private resetLocation() source

this method was deprecated.

reset the location object to avoid bugs

private updateLocationCallBack(position: Object) source

Listener for the update of the location object with the most recent data.

Params:

NameTypeAttributeDescription
positionObject

the HTML5 position object to use for the Mobilizing location object's update

private updateLocationErrorCallBack(error: *) source

Listener for the update errors of the location object with the most recent data.

Params:

NameTypeAttributeDescription
error*