Hi everyone! I working with Google maps v3, and I want to get the short name of the country where a marker was geocoded. But I can't get the short_name
subchild from the google maps' xml.
The returned xml like this: http://code.google.com/intl/hu/apis/maps/documentation/geocoding/#XML
I would need the "US
" from this example. This is my function:
function codeLatLng(latlng) {
if (geocoder) {
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var str = '';
jq.each(results, function(){
str += this.formatted_address+'|';
});
str = str.split('|');
jq('#address').text(str[0]);
}
});
}
}
But I would need the "short_name
" subchild under the 7th address_component
.
Thanks!
Sorry for my English...