【发布时间】: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¢er=" + 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');
}
。 .
【问题讨论】:
-
多关注你的问题。您在哪些平台上进行测试,结果如何?每个浏览器使用了哪些位置服务(蜂窝塔三角测量、GPS、IP 等)。 SafariMobile 的准确性没有达到您的预期吗?您对哪种精度感兴趣?
-
刚刚更新了测试结果,我正在寻找正确郊区的目标,safari 不会返回正确的郊区,firefox 会。不确定每个浏览器使用什么位置服务,可能会做更多的研究,干杯。
标签: iphone firefox safari geolocation