Nokia Asha web apps – W3C Geolocation API
This article explains how to use W3C Geolocation API in Series 40 Web Apps
Series 40 Web Apps version 1.5 supports "single-shot" location retrieval in correspondence to W3C Geolocation API . Device location is obtained by using network-based positioning, hence accuracy varies depending on a device features and network configuration in which device is used. Network based positioning offers fast location retrieval even in indoors, making it well suitable for Series 40 web apps.
Following features specified in W3C Geolocation API are not supported in the Series 40 Web Apps version 1.5:
- Repeated location updates, in other words location tracing is not supported. Hence watchPosition() and clearWatch() methods are not supported either.
- Position options attribute enableHighAccuracy is not supported.
- Following attributes of coordinates interface are not supported: altitudeAccuracy, speed and heading .
- Passing anonymous callback methods to getCurrentPosition()
- PositionError interface: err.TIMEOUT, err.PERMISSION_DENIED and err.POSITION_UNAVAILABLE are not defined. Instead, use directly numeric values.
// geolocation API is not available, handle the case here
* handle success here
* use: position.coords.latitude, position.coords.longitude
* position.coords.accuracy and position.timeStamp
* handle failure here
* use: error.code and error.message