Mobile Safari Geolocation API Issues

Posted by sph on Stack Overflow See other posts from Stack Overflow or by sph
Published on 2010-04-06T11:32:21Z Indexed on 2010/04/06 11:33 UTC
Read the original article Hit count: 358

Filed under:
|
|

Hi,

since Mobile Safari's Geolocation API should be an implementation of the W3C Geolocation API I found some bugs. I was wondering if anybody noticed the same.

  1. As specified in the W3C Geolocation API the PositionCallback returns a Position object, which contains a Coordinates object. In this object all attributes are of type double. Using navigator.geolocation.getCurrentPosition and checking the Position object in the successCallback the accuracy attribute is always an object, but should be a double. The heading attribute is always -1 when testing in the iPhone simulator, but should be null or between 0 and 360.

2. Setting the options parameter for navigator.geolocation.watchPosition or navigator.geolocation.getCurrentPosition as specified in the W3C Geolocation API has no effect. No matter what is set as the timeout value, the win callback is called every 10 seconds. For example setting the timeout=1000 should immediately call either the successCallback or errorCallback.

Thanks

© Stack Overflow or respective owner

Related posts about geolocation

Related posts about mobilesafari