I'm having trouble of using the geolocation on my website on android phones.
I've got the following javascript code:
if (navigator.geolocation) {
console.log("true"); //gets logged
navigator.geolocation.getCurrentPosition(sucess, error, {timeout: 5000});
}
It always times out with error.code 3 and error.message "Timeout expired".
This happens on version 2.x and 4.x of Android.
Please keep in mind that this is NOT in combination with phonegap or similar. It's a plain old website that's opened in a browser.
The code works fine on iPhones.
Is there sth. wrong with my code or is it a problem on the android side?