Reverse geocoding with Google API

Reverse geocoding with Google API
0

#1

Hi,

I try to find an address based on their geolocation (reverse geocoding) using Google Map API.

Somehow my script got stuck somewhere, but I’m not sure where I can solve the problem. Can you help me to find it out what is wrong the script?

Where is my address? without button

It supposed to be working like this one Where is my address? with button

Thanks


#2

The variable latlng isn’t available to the function geocodeLatLng unless you pass it in. Once I did that, the geocoding worked fine.

Defined on line 23

function geocodeLatLng(geocoder, map, infowindow, latlng)

Called on line 19

geocodeLatLng(geocoder, map, infowindow, latlng);

#3

thank you very much @PortableStick