Right. But I need to use this information around the webpage. In this case, how to send the variable "result.Placemark" out the function?
Cheers Kelson On 16 out, 01:26, Mike Williams <[email protected]> wrote: > You might consider ditching that reverse geocoder script and using > GClientGeocoder directly. > > var geocoder = new GClientGeocoder(); > > GEvent.addListener(map, 'click', function(overlay, latlng){ > if(latlng){ > geocoder.getLocations(latlng, function (result) { > if (result.Status.code == G_GEO_SUCCESS) { > var html = result.Placemark[0].address; > if (result.Placemark[0].AddressDetails.Country) { > html += "<br><b>Country code:"; > html += > result.Placemark[0].AddressDetails.Country.CountryNameCode; > } > } else { > var html = "Reverse geocode failed: error "+ result.Status.code; > } > map.openInfoWindowHtml(latlng,html); > }); > } > > }); > > -- > Mike Williamshttp://econym.org.uk/gmap --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en -~----------~----~----~----~------~----~------~--~---
