1

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

2
  • Focus your question a little more. What platforms are you testing on, and what were the results? What location services did each browser make use of (cell tower triangulation, GPS, IP, etc). Did SafariMobile's accuracy not meet your expectations? What kind of accuracy are you interested in? Mar 19, 2010 at 2:44
  • just updated testing result, i am looking for targeting in correct suburb, safari doesn't return the correct suburb, firefox does. not sure whats location service each browser use, might doing more research on it, cheers.
    – johnz
    Mar 19, 2010 at 3:32

2 Answers 2

0

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

1
  • Safari can use A-GPS though, Firefox can't.
    – unlobito
    Mar 25, 2010 at 1:08
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.