Hello again,
I am stuck on this project and need some guidance on what to do next, also the Lon and Lat sometimes say undefined and sometimes gives me a number. project here
Hello again,
I am stuck on this project and need some guidance on what to do next, also the Lon and Lat sometimes say undefined and sometimes gives me a number. project here
This should always be failing. If it’s sometimes succeeding, there’s something weird going on. getCurrentPosition
is asynchronous, so any synchronous code outside of its callbacks should be called before userLat
or userLong
are set.
See https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition