keenkapotlj 2017-09-16 14:48 采纳率: 0%
浏览 994

谷歌地图API的json问题

我知道怎么获取,但是我想获取其中的中文地级市 "long_name" : "甲米", 这个值,但是每一个json格式都不一样,,请问怎么获取呢?搞了一天了

{
"results" : [
{
"address_components" : [
{
"long_name" : "4203",
"short_name" : "4203",
"types" : [ "route" ]
},
{
"long_name" : "Tambon Ao Nang",
"short_name" : "Tambon Ao Nang",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Amphoe Mueang Krabi",
"short_name" : "Amphoe Mueang Krabi",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Chang Wat Krabi",
"short_name" : "จ.กระบี่",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "泰国",
"short_name" : "TH",
"types" : [ "country", "political" ]
},
{
"long_name" : "81000",
"short_name" : "81000",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "4203, Tambon Ao Nang, Amphoe Mueang Krabi, Chang Wat Krabi 81000泰国",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 8.0370574,
"lng" : 98.8187643
},
"southwest" : {
"lat" : 8.0363249,
"lng" : 98.8186267
}
},
"location" : {
"lat" : 8.036692,
"lng" : 98.8186996
},
"location_type" : "GEOMETRIC_CENTER",
"viewport" : {
"northeast" : {
"lat" : 8.038040130291503,
"lng" : 98.82004448029151
},
"southwest" : {
"lat" : 8.035342169708498,
"lng" : 98.81734651970849
}
}
},
"place_id" : "ChIJkVryNgrAUTARwjQ1NZprrlg",
"types" : [ "route" ]
},
{
"address_components" : [
{
"long_name" : "奧南",
"short_name" : "奧南",
"types" : [ "locality", "political" ]
},
{
"long_name" : "甲米府治縣",
"short_name" : "甲米府治縣",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "甲米",
"short_name" : "จ.กระบี่",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "泰国",
"short_name" : "TH",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "泰国甲米甲米府治縣奧南",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 8.090847499999999,
"lng" : 98.86611119999999
},
"southwest" : {
"lat" : 7.611651299999999,
"lng" : 98.7558902
}
},
"location" : {
"lat" : 8.0362834,
"lng" : 98.83281409999999
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 8.090847499999999,
"lng" : 98.86611119999999
},
"southwest" : {
"lat" : 7.611651299999999,
"lng" : 98.7558902
}
}
},
"place_id" : "ChIJuWMdUPq_UTAREB44LLwjAgQ",
"types" : [ "locality", "political" ]
},
{
"address_components" : [
{
"long_name" : "81180",
"short_name" : "81180",
"types" : [ "postal_code" ]
},
{

  • 写回答

1条回答

  • 代码的灵魂是bug! 2017-09-17 09:55
    关注

    android studio中 有一个gsonformat插件,把json数据复制进去,点ok就行了

    评论

报告相同问题?

悬赏问题

  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 如何提取csv文件中需要的列,将其整合为一篇完整文档,并进行jieba分词(语言-python)
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置