2

I get my position with HTML5 geolocation and getCurrentPosition with enableHighAccuracy: true:

navigator.geolocation.getCurrentPosition(function(position){
        console.log(position.coords.latitude + ', ' + position.coords.longitude)
    }, 
    function(){}, 
    {enableHighAccuracy: true}
);

And then I check where it places me with Google. I tried it on PC and Android device on Google Chrome, in both cases it is very fast. But I am flabbergasted, because:

  • On Moto G II with Android Marshmallow, on newest Chrome, coordinates are very very accurate, with an accuracy of meters
  • On my laptop with Windows 10, and newest Chrome, it finds me tens of kilometers away from place where I am, it is very inaccurate

Of course, both devices are in the same Wi-fi. And I think for iOS I will get similar results to Android, or at least it won't find me tens kilometers away. Probably the reason is that on PC it uses position based on ISP, but is there a way to make PC more accurate, only with JS code (it makes solution independent from platform)? Thank you in advance for every answer. P.S. Code on JS Console.

Radek Anuszewski
  • 1,620
  • 6
  • 28
  • 56

0 Answers0