Geolocation is so slow! what I'm doing wrong?
this is my simple code I'm using in a test page: but it takes ages to find the address...how come? am i doing something wrong?
I've found that the speeds are a lot different depending on the browser. I've been testing my geolocation with chrome, because that is almost instant. Firefox is slow as hell (lots of the time it doesnt even work), and safari is in second. Hopefully in time they will fix their implementation so it's as fast as chrome's
Well - it's actually doing geolocation!
To speed it up, consider providing the extra parameters for utilising cached results, and a timeout.
Check your mobile device's Location service mode. Make sure the accuracy is in High status on your devide. The High accuracy mode uses GPS, WIFI or Mobile network to find the location.
If you choose Low or GPS only mode it takes forever.
Also play with the geo location option and give the timeout and cache options.
A couple of your calls might take some seconds to finish, for example navigator.geolocation.getCurrentPosition takes up to 5 sec (when working) for me in Safari.
I've been struggling with that for a couple of hours now and it turned out that it is a different result for each browser aka it is something that code can't fully control but you can do some progress by adding these options to getlocation.getCurrentPosition function call:
enableHighAccuracy: false, timeout: 5000, maximumAge: Infinity
You can read more about the meaning of each option here