Search code examples
ibm-mobilefirstworklight-geolocation

IBM Worklight 6.0 - GeoLocation API Documentation


I'm using the WL.Device.Geo API. actually, only the WL.Device.Geo.acquirePosition. method documented here: http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fapiref%2Fr_wl_location_geoAcquirePosition.html

For the onSuccess method it states:

A callback function that is invoked when a position is acquired successfully. The position is passed as a parameter to the callback function.

Is it documented anywhere the parameters that are passed to the callback function? I can use, for example, the JSON.stringify method for getting the content but this situation is something I have faced more times with the API documentation and I do not know whether or not is it documented, or if there is more detailed API documentation.


Solution

  • The callback receives a W3C position object (http://www.w3.org/TR/geolocation-API/#position_interface). The timestamp is always the number of milliseconds elapsed since Jan 1, 1970 (the W3C specifies the use of DOMTimestamp - on some platforms this is implemented as the number of milliseconds elapsed, on others it is a Date object. WL.Device.Geo.acquirePosition and updates to the device context when using WL.Device.startAcquisition always use the former).