JavaScript Location Service API

The Location Service API is supported since WRT 1.1.

The Location Service API allows widgets to retrieve information about the physical location of a device and to perform calculations based on location information. The API is integrated into WRT through the device object.

For an overview of the service and the API, see section Accessing device location information.

Using the Location Service API

To use the Location Service API, your widget must first create a service object for it using the device.getServiceObject() method. Use Service.Location to identify the service provider and ILocation to identify the supported interface:

var so = device.getServiceObject("Service.Location", "ILocation");

This service object can then be used to access the services provided by the API:

For the location services to function on an S60 device, the device must be location aware. It must include some location information provider, such as GPS, AGPS, or GPS across Bluetooth.

Emulator support

The S60 5th Edition SDK emulator provides full support for the Location Service API.

GPS data is simulated by using Position System plugins (PSY) as dummy providers. Dummy providers are available on the emulator by default.