1

I have noticed this call:

navigator.geolocation.getCurrentPosition(...)

I am wondering when this function/method is called what does the browser communicate to get the latitude & longitude values.

Please let me know. Thanks N

np.
  • 2,319
  • 4
  • 31
  • 36
  • possible duplicate of [How does HTML5 Geolocation work?](http://stackoverflow.com/questions/4213410/how-does-html5-geolocation-work) – KiL Aug 21 '12 at 12:49

2 Answers2

1

Geolocation is part of HTML5. Details can be found here

doron
  • 27,972
  • 12
  • 65
  • 103
0

All browsers (in devices and on your desktop) are using a few different ways to determine where you are, some more accurate than others. Browsers can get location information based on your IP address, GPS, cell phone triangulation, wifi positioning.

When you call getCurrentPosition or watchPosition you don't know which way is used.

You can use third parameter:

var positionOptions = {
    enableHighAccuracy: false,
    timeout: Infinity,
    maximumAge: 0
}

to tell browser that hight accuracy method should be used.

Bartłomiej Mucha
  • 2,762
  • 1
  • 30
  • 36