views:

330

answers:

2

I just tested Geolocation on Firefox 3.6 and iPhone Safari (os 3.1.3), the result is interesting, firefox is more accurate than safari. any one got idea how to make iPhone Safari result more accurate.

Testing Resul

  • Windows Vista Firefox 3.6: ------------- Accuracy: 150
  • iPhone 3G (os 3.1.3) Safari: ----------- Accuracy: 828

this is the code for testing:

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&amp;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

A: 

Firefox uses Googles Database of locations while Safari Uses Skyhook, so there really isn't anything you can do

SeanDowney
Safari can use A-GPS though, Firefox can't.
Henri Watson
A: 

Try using navigator.geolocation.watchPosition to track the current location -- maybe the accuracy will improve with multiple updates. See Safari Web Content Guide - Getting Geographic Locations

David Gelhar