Domanda

I'm using the Google Maps API. I understand how to make queries and parse the JSON that comes back.

What I'd like to be able to do is get name of the administrative_area_level_1's type. For example, in the United States administrative_area_level_1 is a state, in Canada, it is a Province. (Strictly speaking, it can be a Province or a Territory, just like in the USA we have States and Territories.)

I'm looking for the word "State" or "Province" or whatever the location uses for its 1st, 2nd, and 3rd administrative areas. So this might not even be a Google Maps API question, but rather a localization question, but i think it pertains to Google Maps API, unless, of course, the API is just implementing an recognized standard.

Thanks!

È stato utile?

Soluzione

Unfortunately this is not easily accessible. Basically what is returned by the geocoder matches Google's internal representation of that geometry. The mapping between administrative_area differs for each country.

Altri suggerimenti

Your best shot is to formalize the data you find on the wiki page, which is the collection of names and terms in postal addresses around the world:

https://en.wikipedia.org/wiki/Table_of_administrative_divisions_by_country

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top