Getting weather from location

We are going to get the weather status by geolocation – latitude and longtitude.

http://api.openweathermap.org/data/2.5/weather?lat=22.19567&lon=113.549194

How to get location on a map?

  1. We will use Google map.
  2. Be sure to use the classic version. The new Google map removed the feature.
  3. Move the map to you destination.
  4. right click on the map where you want the geolocation.

    Google map whats here

  5. Choose “What’s here” and you will see a lat/lon on the search bar.

    Google map result

  6. Showing the process, in GIF animation:

    Google map get lat lon

With the ability of getting weather from geolacation, we can make the app further by grabbing user’s geolocation and use it to fetch the weather.

What’s next? We’re going to take a look at “Getting user location”.

overlaied image when clicked on thumbnail

Makzan | Mobile web app dev with phonegap | Table of Content