freeCodeCamp: Show the Local Weather - getCurrentPosition not working over http
Challenge Name
Show the Local Weather
https://www.freecodecamp.com/challenges/show-the-local-weather
Issue Description
getCurrentPosition does not work over http. I think that changing the url to codepen.io in that particular challenge would help others campers not thinking their code isn’t correct.
Browser Information
- Browser Name, Version: Chrome 51.0.2704.84 m
- Operating System: Windows 10
- Mobile, Desktop, or Tablet: Desktop
Your Code
// If relevant, paste all of your challenge code in here
Screenshot

About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (7 by maintainers)
Commits related to this issue
- updated to use alternate to openweatherapi The Open Weather Map API was not serving over HTTPS, leading to mixed content issues, since geolocation requires HTTPS. Forecast.io's API is also free, requ... — committed to rarmatei/freeCodeCamp by edm00se 8 years ago
- updated to use alternate to openweatherapi The Open Weather Map API was not serving over HTTPS, leading to mixed content issues, since geolocation requires HTTPS. Forecast.io's API is also free, requ... — committed to mhatout/freeCodeCamp by edm00se 8 years ago
Google will not allow you to get geo location anymore over http. And unfortunately the free version of the suggested API to use (Openweathermap) cannot use https unless you pay for it. Instead I would suggest bypassing google altogether to get geolocation and use http://ip-api.com/json to get the information you need based off the IP address.
@raisedadead Ok? Point is people are trying to complete the challenge going off what they were taught prior to the challenge and they will not be able to unless the pay for open weather map and know that the issue is from using http and not https. Some one with some time on their hands should add that as a note on the challenge in order to ease people’s frustration. I was just pointing out another API that would work with OWM. That was the only one out of several that I tried that was free and got the job done.
I have found another weather api that is free and works over https. https://developer.forecast.io/docs/v2 I found it after doing some research but have no idea how reputable the website is. However, the api seems to work well.
In my opinion, it would be better to encourage campers to use the geolocation tools over https and then a secure api rather than having them use a workaround (the ip lookup api).
Edit: That api doesn’t have a city name. This could be used to find city if necessary. https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452
Right… Which mine does… Like I said not sure why you guys are so against using that API. Works well for on browsers and gets the job done for free. No need to try and make it more complicated then it needs to be. I mean technically your guys approach will only work for Mozilla. Meanwhile everyone with chrome will not be able to use your app. And with cross browser compatabilty being important to web developers I don’t see how how can say just use Mozilla as an answer. Pretty hypocritical statement considering your suggestion.
On Monday, June 20, 2016, Pedro notifications@github.com wrote: