My webpage includes the following JavaScript code to obtain the user's location:
state.currentTimer = navigator.geolocation.watchPosition(success, error, { enableHighAccuracy: true, maximumAge: 5000 });
The page is designed to be accessed from a mobile browser. However, I am experiencing issues with the watchPosition method being unreliable. At times, it fails to retrieve the location at all or provides inaccurate results. It also occasionally works perfectly and then abruptly stops functioning.
I have attempted to troubleshoot by testing the signal strength in an area with good mobile reception.
Are there alternative methods for obtaining accurate location data from a mobile device through a browser?