You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried by adding the .js file into my index.html file, and then in my script, changed getCurrentPosition to getAccurateCurrentPosition (as outlined in the readme)
But all I got was a white splash screen with a spinner.
Could you please explain how to use it properly?
The text was updated successfully, but these errors were encountered:
I have created a script which defines the geolocationSuccess, geolocationError, geoprogress functions and optionally an options variable. Then I called navigator.geolocation.getAccurateCurrentPosition at the end.
functionletsGeolocate{varoutput=document.getElementById("output");// the div where messages will appearvaroptions={};functiongeolocationSuccess(position){varlatitude=position.coords.latitude;varlongitude=position.coords.longitude;output.innerHTML='Latitude: '+latitude+'<br/>Longitude: '+longitude}functiongeolocationError(){output.innerHTML="Unable to retrieve your location";}functiongeoprogress(){output.innerHTML='<p>Locating in progress</p>';}navigator.geolocation.getAccurateCurrentPosition(success,error,geoprogress,options);}
How exactly do I use this?
I tried by adding the .js file into my index.html file, and then in my script, changed getCurrentPosition to getAccurateCurrentPosition (as outlined in the readme)
But all I got was a white splash screen with a spinner.
Could you please explain how to use it properly?
The text was updated successfully, but these errors were encountered: