Help with Weather App Project

So I am working on my weather app and I have managed to get the longitude/latitude and I have copied this the part (the commented part in the project ) and it is supposed to give me the city name when given the longitude/latitude coordinates but it is just returning an error.???

Project link

This is the post that I retrieved the code from:

The stackoverflow post has java code not javascript

this is the javascript reference to get an address from coordinates

https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse

Thanks guys I got it now .