我如何获取管理类型_管理区_区域_1、2等的名称 [英] How do I get the name of the type of administrative_area_level_1, 2, etc

查看:47
本文介绍了我如何获取管理类型_管理区_区域_1、2等的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Google Maps API.我了解如何进行查询并解析返回的JSON.

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

我想做的是获取管理类区域名称的类型的名称.例如,在美国,administration_area_level_1是州,在加拿大,则是省. (严格来说,它可以是一个省或地区,就像在美国有州和地区一样.)

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.)

我要查找州"或省"一词,或者该位置在其第一,第二和第三行政区域使用的位置.因此,这甚至可能不是Google Maps API问题,而是本地化问题,但我认为它与Google Maps API有关,除非该API当然只是在实施公认的标准.

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.

谢谢!

推荐答案

不幸的是,这不容易访问.地理编码器返回的内容基本上与Google对该几何的内部表示形式相匹配. administrative_area之间的映射因国家而异.

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.

这篇关于我如何获取管理类型_管理区_区域_1、2等的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆