1

i have a question about this topic. navigator.geolocation.getCurrentPosition does not seems to work for me on Android 4.2.2 on many browsers and 4 devices. It ask about my location, I can accept or decline but whatever I pick it does not fire success or errorr function.

My sample code:

function GoogleMap(){
    this.initialize = function(){
        if(navigator.geolocation){
            navigator.geolocation.getCurrentPosition(geolocationSuccess,geolocationError);
        } else {
            geolocationError();
        }
    }
}
function geolocationSuccess(position){
    alert(position);
}
function geolocationError(){
    alert('Geolocation disabled');
}

Can You help me with that?

Community
  • 1
  • 1
Tomasz Majerski
  • 199
  • 2
  • 7
  • 1
    You can find details in this link [getcurrentposition-sometimes-works-sometimes-doesnt](http://stackoverflow.com/questions/3397585/navigator-geolocation-getcurrentposition-sometimes-works-sometimes-doesnt). I would suggest you to use **timeout** and handle it in error function. – Sai Feb 26 '14 at 17:21
  • Thanks, I did a timeout() and it does work for some devices. – Tomasz Majerski Feb 27 '14 at 14:36

0 Answers0