Mobile Safari Geolocation API Issues
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.
- As specified in the W3C Geolocation API the PositionCallback returns a Position object, which contains a Coordinate开发者_开发知识库s 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.
- 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
I don't have the cycles right now to verify your tests or your interpretation of the spec, but assuming you're right, go ahead and file bugs!
http://developer.apple.com/bugreporter/
It's possible that these issues are already known about internally: the API is still in draft form and has been changing substantially so we shouldn't assume that they'll always be up to date. But I'm sure they'll be happy to have the external report.
精彩评论