question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show the Local Weather - getCurrentPosition not working over http

See original GitHub issue

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

image

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
strickneincommented, Jun 16, 2016

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.

2reactions
strickneincommented, Jun 17, 2016

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to get local weather - Stack Overflow
Theres a few issues here. Firstly, you don't seem to be calling the getGeoLoc method, so that would be the first fix.
Read more >
can't use geolocation API on insecure server (codepen.io ...
Show the Local Weather - can't use geolocation API on insecure server ... I tried to use freegeoip.net in my code, but the...
Read more >
Geolocation.getCurrentPosition() - Web APIs | MDN
The Geolocation.getCurrentPosition() method is used to get the current position of the device.
Read more >
From Geolocation To Local Weather In React - Medium
However, I wanted a simple app that figures out by itself user's location and shows local weather, with no input from the user....
Read more >
National and Local Weather Radar, Daily Forecast, Hurricane ...
The Weather Channel and weather.com provide a national and local weather forecast for cities, as well as weather radar, report and hurricane coverage....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found