Weather display: not getting geolocation data?

Weather display: not getting geolocation data?
0

#1

Starting simple, just used the same code as in the exercise to pull geolocation data from the browser, but it isn’t working? Any idea why?


#2

Look in your console. Codepen is loaded in http. geolocation in chrome and other browsers requires https. Try using some other way such as an ip api to get information about the user’s location.

btw, this project gives grief to everyone who does it. At the next curriculum update it will no longer be required. I suggest just skipping it right now.


#3

Hi,

Switch your codepen link to https and it will work.

https://codepen.io/earata15/pen/BQKbqb

You will also have to use an API that supports HTTPS to use geo location across all browsers.

Cheers

Mark

We need a sticky for this!