I have a problem with the Google Maps Autocomplete. When selecting an entry from the dropdown I want to get the detailed data using autocomplete.getData().
In detail I need the country code, which is normally sent in the "short_name" attribute of the "country" type.
Sometimes this doesn't work and I get the normal country name in the "short_name" field, which breaks my programming.
I can confirm this using a Service call like this:
https://maps.googleapis.com/maps/api/geocode/json?address=%C3%96sterreich&key=MY_KEY
And I get this result:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Österreich",
"short_name" : "Österreich",
"types" : [ "country", "political" ]
}
],
...
"place_id" : "ChIJfyqdJZsHbUcRr8Hk3XvUEhA",
"types" : [ "country", "political" ]
}
],
"status" : "OK"
}
According to the Google documentation, the value of the "short_name" should not be "Österreich" (Austria) but the Code "AT".
Is this a change in the Google APIs? Any other cause for this behaviour known?