問題描述
我正在構(gòu)建一個地圖應(yīng)用程序,并注意到雖然 IE9 支持地理定位 api,但它錯誤地計算了緯度/經(jīng)度.
I'm building a map application and have noticed that although IE9 supports the geolocation api it incorrectly calculates the latitude/longitude.
其他用戶也注意到了這一點 http://social.technet.microsoft.com/Forums/en-IE/ieitprocurrentver/thread/aea4db4e-0720-44fe-a9b8-09917e345080,但沒有多少谷歌搜索可以從開發(fā)者博客中找到任何結(jié)果/更多技術(shù)讀者...我覺得很奇怪,沒有人在 IE9 中測試他們的地理定位代碼!?
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!?
這是我的示例代碼:https://gist.github.com/1710256
這里有沒有人知道為什么會這樣,因為它使檢測地理定位 api 的功能幾乎不可能.另外,我注意到回退(如 Paul Irish 的 polyfill 中提供的)也有與 IE9 的本機實現(xiàn)中發(fā)現(xiàn)的相同的問題?
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?
還有其他人在 IE9 上遇到過這個地理定位問題嗎?
Has anyone else experienced this issue with geolocation on IE9?
任何幫助/建議表示贊賞.
Any help/advice appreciated.
推薦答案
根據(jù)本頁Firefox 使用 Google 位置服務(wù):
According to this page Firefox uses Google Location Services:
它是如何工作的?
當(dāng)您訪問位置感知網(wǎng)站時,F(xiàn)irefox 會詢問您是否想要分享你的位置.
When you visit a location-aware website, Firefox will ask you if you want to share your location.
如果您同意,F(xiàn)irefox 會收集有關(guān)附近無線網(wǎng)絡(luò)的信息接入點和您計算機的 IP 地址.然后 Firefox 發(fā)送這個向默認(rèn)地理位置服務(wù)提供商 Google 提供信息位置服務(wù),以估算您的位置. 該位置然后將估算值與請求網(wǎng)站共享.
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.
并根據(jù)此頁面 Internet Explorer(相當(dāng)可預(yù)測)使用 Microsoft 定位服務(wù):
And according to this page Internet Explorer (rather predictably) uses Microsoft Location Services:
如果您允許,Internet Explorer 將借助 Microsoft 定位服務(wù)估算您的位置
If you allow, Internet Explorer will approximate your location with the help of the Microsoft Location Service
報告位置的差異是由于基礎(chǔ)數(shù)據(jù)庫的差異,例如 Google 數(shù)據(jù)庫可能會列出 Microsoft 沒有的 WiFi 點或 IP 地址(反之亦然).
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).
我找不到任何有關(guān)更改 IE 位置提供程序的信息,盡管 Firefox 似乎確實提供了替代提供程序的規(guī)定,但我目前不知道如何更改它.
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.
請注意,對于我來說,Internet Explorer 實際上更準(zhǔn)確地報告了我的位置(兩種瀏覽器都正確獲取了我的位置,但是在 IE 中錯誤半徑約為 10 英里,而在 Firefox 中約為 20 英里).
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).
這篇關(guān)于與其他瀏覽器相比,為什么 IE9 地理定位支持被破壞?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!