【问题标题】:Geolocation Firefox accurate than iPhone Safari?地理位置 Firefox 比 iPhone Safari 准确吗?
【发布时间】:2010-03-19 02:38:36
【问题描述】:

我刚刚在 Firefox 3.6 和 iPhone Safari (os 3.1.3) 上测试了 Geolocation,结果很有趣,firefox 比 safari 更准确。任何人都知道如何使 iPhone Safari 结果更准确。

测试结果

  • Windows Vista Firefox 3.6:------------- 精度:150
  • iPhone 3G (os 3.1.3) Safari:----------- 准确度:828

这是测试代码:

navigator.geolocation.getCurrentPosition(handler, {enableHighAccuracy: true});

function handler(location) {
    var message = document.getElementById("message");
    message.innerHTML = "<img src='http://maps.google.com/staticmap?sensor=true&center=" + location.coords.latitude + "," + location.coords.longitude + "&size=300x300&maptype=street&zoom=16&key=ABQIAAAAZrVtlT2df2pkfI_RZB_6WBRWTAkRKJS7h1XjKaOTqACHuw1n0BT5cATkkKFnZNGHmrwUw9IilQK0Eg' />";
    message.innerHTML+="<p>Longitude: " + location.coords.longitude + "</p>";
    message.innerHTML+="<p>Latitude: " + location.coords.latitude + "</p>";
    message.innerHTML += "<p>Accuracy: " + location.coords.accuracy + "</p>";

    // call the function with my current lat/lon
    getPlaceFromFlickr(location.coords.latitude, location.coords.longitude, 'output');
}

。 .

test from here

【问题讨论】:

  • 多关注你的问题。您在哪些平台上进行测试,结果如何?每个浏览器使用了哪些位置服务(蜂窝塔三角测量、GPS、IP 等)。 SafariMobile 的准确性没有达到您的预期吗?您对哪种精度感兴趣?
  • 刚刚更新了测试结果,我正在寻找正确郊区的目标,safari 不会返回正确的郊区,firefox 会。不确定每个浏览器使用什么位置服务,可能会做更多的研究,干杯。

标签: iphone firefox safari geolocation


【解决方案1】:

Firefox 使用 Google 的位置数据库,而 Safari 使用 Skyhook,所以你真的无能为力

【讨论】:

  • Safari 可以使用 A-GPS,但 Firefox 不能。
【解决方案2】:

尝试使用 navigator.geolocation.watchPosition 来跟踪当前位置 - 多次更新可能会提高准确性。见Safari Web Content Guide - Getting Geographic Locations

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-03
    • 2023-01-28
    • 2019-03-03
    • 2015-01-29
    • 2018-09-27
    相关资源
    最近更新 更多