I’m quite surprised by this example pen http://codepen.io/FreeCodeCamp/full/bELRjV in the Local Weather project. It recognizes my location even though the browser did not ask me if I approve sharing my location data. Not that there any problem, I just want to understand.
You can look at the source code and see that they used http://ipinfo.io/ to get your location by IP.
Yes. In fact I think you have to use IP info to get user location for this project if you are hosting it on CodePen. Geolocation (preferred method of getting a users location) does not work on insecure origins, like CodePen. This was my experience anyway.