0

How can I get the geolocation of a user, the name of the place he is in, not the coordinates, and then post them in a text box, something like the Yahoo Weather.

Thanks.

Amar Syla
  • 3,523
  • 3
  • 29
  • 69

1 Answers1

2

You can use HTML5 geolocation to get the position of the user. The results will be latitude and longitude.

Next, construct the URL to pass to Yahoo's Placefinder API like below:

var geoAPI = 'http://where.yahooapis.com/geocode?location='+lat+','+lon+'&flags=J&gflags=R&appid='+APPID; 

I hope this helps.