Day 42 – Current Weather

When I started out today I had no clue what to do.

I wanted to show the weather depending on the user’s location. Some googling lead me to geolocation. It was super exciting when I first saw the pop-up asking for permission to access my location! But I had a problem, geolocation only returned the coordinates and not the city. I could try to find the city using the coordinates but I decided to use to get the city name. I then ran into another problem, the Javascript object returned was missing the city name.

Luckily, openweathermap only needs coordinates to find the weather! I set it up with freegeoip and openweathermap, then realized I could go back to using geolocation. Yay! A big part of today’s page was reading the documentations and looking at how to access the different property values of returned objects. I also wrote my “first” callback function and did some more reading. There’s so much to learn and a lot of it boggles my mind!
Screen Shot 2015-02-26 at 9.43.09 PMIsn’t this little cloud cute? Blue and a cloud for rainy Vancouver!

Day 42 – Current Weather