Accessor: services/GeoLocation

services/GeoLocation

GeoLocation accessor that outputs the coordinates. Location retieval parameters needs to be set.

Version:
  • $$Id: GeoLocation.js 1137 2017-07-19 22:13:55Z chadlia.jerad $$
Author:
  • Chadlia Jerad
Source:
Inputs:
Name Type Description
trigger The trigger to get the location
Outputs:
Name Type Description
location The location object. It error attribute is a boolean, if set to true, then an error accured. If set to false, then the location object may have the aditionnal following attributes: ** latitude: Latitude (float, unit: degree). This attribute is mandatory. ** longitude: Longitude (float, unit: degree). This attribute is mandatory. ** accuracy: String that describes, in a fuzzy way the accuracy level. That is, if the swarmlet is running in a device that is equiped with GPS, then the accuracy will be set to 'high'. If it uses an ip address based lookup, the it will be set to 'low'. These values are set at the module level. ** timestamp: Creation timestamp of the coordiantes (Number, unit: milliseconds). Example usage: var geoLoc = instantiate('geoLoc','services/GeoLocation'); geoLoc.initialize(); geoLoc.provideInput('trigger', true); geoLoc.react(); latestOutput('location');