While I am developing a web app, I am using HTML5 Geolocation API. I have done the following steps:
- I turned off my WiFi connection on my desktop computer.
I triggered a position request using :
var params = {enableHighAccuracy: true, timeout:3600, maximumAge:60000}; navigator.geolocation.getCurrentPosition( reportPosition, gpsError, params );
I run my HTML code using Google Chrome Browser [version 41.0.2272.89 (64-bit)] and I found out that
gpsError
function has been called twice. In the first time I got an error codePOSITION_UNAVAILABLE
which makes sense to me since the connection was off. But surprisingly, I found out that the error code in the second time isTIMEOUT
.I run the same code on Safari [version 8.0.4 (10600.4.10.7)] and the
gpsError
function was called only once with error codePOSITION_UNAVAILABLE
I opened the geolocation standard and I found out the following steps:
But in section 5.2 PositionOption interface , it states the following:
So I guess chrome violates the standard of Geolocation API because it does not make sense to me to invoke error callback with TIMEOUT
after knowing the fact that postion is not available i.e. invoking error callback with POSITION_UNAVAILABLE
Which one is considered to be compliant with the standard, the chrome or safari?