I created a map with a bunch of different locations, each with a type of marker and a title/description. What I'd like to do is extract from lat/lng the relative address. I found this function which should do what I'm looking for.. but I can't understand how to apply it to my existing code. Here's my fiddle.
I'm looking for a way to output the address here:
infoWindow.setContent('<h3>' + this.title + '</h3>' + data.description);
Should be something like
infoWindow.setContent('<h3>' + this.title + '</h3>' + data.description + results[0].formatted_address);
updated fiddle
Call the reverse geocoder in the click listener for the marker, open the infowindow with the appended address when the callback returns successfully: