Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

javascript - Why is IE9 geolocation support broken compared to other browsers?

I'm building a map application and have noticed that although IE9 supports the geolocation api it incorrectly calculates the latitude/longitude.

Other users have also noticed this http://social.technet.microsoft.com/Forums/en-IE/ieitprocurrentver/thread/aea4db4e-0720-44fe-a9b8-09917e345080, but no amount of googling brings up any results from developer blogs/more technical readers... which I find just bizarre, is no one testing their geolocation code in IE9!?

Here is my example code: https://gist.github.com/1710256

Does anyone here know why this would be because it makes feature detecting the geolocation api damn near impossible. Also, I noticed that the fallback (as provided in Paul Irish's polyfill) also has the same issues as found in IE9's native implementation?

Has anyone else experienced this issue with geolocation on IE9?

Any help/advice appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

According to this page Firefox uses Google Location Services:

How does it work?

When you visit a location-aware website, Firefox will ask you if you want to share your location.

If you consent, Firefox gathers information about nearby wireless access points and your computer’s IP address. Then Firefox sends this information to the default geolocation service provider, Google Location Services, to get an estimate of your location. That location estimate is then shared with the requesting website.

And according to this page Internet Explorer (rather predictably) uses Microsoft Location Services:

If you allow, Internet Explorer will approximate your location with the help of the Microsoft Location Service

The difference in the reported location will be due to the differences in the underlying databases, for example the Google database may list a WiFi point or IP address that the Microsoft one doesn't (or visa versa).

I can't find any information about changing the location provider for IE, and although Firefox does appear to have provisions for alternative providers I can't at this moment see how to change it.

Note that for me Internet Explorer actually reports my location more accurately (both browsers get my location correctly, however in IE the error radius is around 10 miles whereas in Firefox its around 20 miles).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...