Help with geolocation on the local Weather app?

Hi there, campers! From what I’ve read, this seems to be a pretty common problem, but I read through several threads and I’m still not sure how to solve my own version.

My twist on the weather app, inspired by the bonechilling weather we’ve had here lately, is to compare the user’s local weather with the weather in my childhood home, Kailua-Kona. I can call the data for Kailua-Kona, but I can’t figure out how to get the user’s location. If anyone has any hints on where my code is off, I’d appreciate it!

You can use navigator.geolocation.getCurrentPosition to get the user latitude and longitude.

1 Like