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
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
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.