fgc
fgc

Reputation: 99

Increase Accuracy IE 11 Geolocation

I have a Google Map (v3) on a website. When a user hits the page, I am reading the geolocation from it´s browser (if it´s supported):

navigator.geolocation.getCurrentPosition(successCallback, errorCallback, {enableHighAccuracy: true, timeout: timeOut, maximumAge: maximumAge })

The function is working, but not always as expected. In Google Chrome it´s working perfectly - the getCurrentPosition function is returning a coordinate object with latitude and longitude as floating points (decimals). Curiously it´s different in IE11. It´s also returning the coordinate object - but here are both latitude and longitude in integers, which means, that the accuracy is very bad, and not really showing the right position on the map.

Is this a bug? And does anyone know if it´s possible to fix this?

Thank you!

Upvotes: 3

Views: 1855

Answers (1)

mvark
mvark

Reputation: 2105

Different browsers use different geolocation service providers to get an estimate of your location and that could explain why you're seeing different results with Google Maps.

Google Chrome similarly uses Google Location Services. The default geolocation service provider of Firefox is Google Location Services as well. Safari uses Skyhook Wireless's service.

Searching on the web, I could not find which specific geolocation service provider IE makes use of but the different results you see between browsers can be attributed to the quality of data provided by the geolocation service provider. So my guess is, you have to wait for the precision of the geolocation calculation in IE to improve as I haven't seen any documented way to change the geolocation service provider that a browser uses. Alternatively, see if Bing Maps works well in IE or try using a commercial IP-based Geolocation detector service like Maxmind to detect coordinates.

Upvotes: 4

Related Questions