谷歌地图根据经纬度确定地点---JSON解析
JSON解析分为以下几个步骤
1.下载url上的所有的json数据
{ "results" : [ { "address_components" : [ { "long_name" : "1178号", "short_name" : "1178号", "types" : [ "street_number" ] }, { "long_name" : "和平大道", "short_name" : "和平大道", "types" : [ "route" ] }, { "long_name" : "武昌区", "short_name" : "武昌区", "types" : [ "sublocality", "political" ] }, { "long_name" : "武汉", "short_name" : "武汉", "types" : [ "locality", "political" ] }, { "long_name" : "湖北省", "short_name" : "湖北省", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] } ], "formatted_address" : "中国湖北省武汉市武昌区和平大道1178号", "geometry" : { "location" : { "lat" : 30.61071999999999, "lng" : 114.3566410 }, "location_type" : "ROOFTOP", "viewport" : { "northeast" : { "lat" : 30.61206898029149, "lng" : 114.3579899802915 }, "southwest" : { "lat" : 30.60937101970850, "lng" : 114.3552920197085 } } }, "types" : [ "street_address" ] }, { "address_components" : [ { "long_name" : "武昌区", "short_name" : "武昌区", "types" : [ "sublocality", "political" ] }, { "long_name" : "武汉", "short_name" : "武汉", "types" : [ "locality", "political" ] }, { "long_name" : "湖北省", "short_name" : "湖北省", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] } ], "formatted_address" : "中国湖北省武汉市武昌区", "geometry" : { "bounds" : { "northeast" : { "lat" : 30.62807880, "lng" : 114.42031060 }, "southwest" : { "lat" : 30.49578920, "lng" : 114.26042410 } }, "location" : { "lat" : 30.5538990, "lng" : 114.3158970 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 30.62807880, "lng" : 114.42031060 }, "southwest" : { "lat" : 30.49578920, "lng" : 114.26042410 } } }, "types" : [ "sublocality", "political" ] }, { "address_components" : [ { "long_name" : "武汉", "short_name" : "武汉", "types" : [ "locality", "political" ] }, { "long_name" : "湖北省", "short_name" : "湖北省", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] } ], "formatted_address" : "中国湖北省武汉市", "geometry" : { "bounds" : { "northeast" : { "lat" : 31.36126030, "lng" : 115.08257280 }, "southwest" : { "lat" : 29.96907670, "lng" : 113.70228110 } }, "location" : { "lat" : 30.5930870, "lng" : 114.3053570 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 30.78745989999999, "lng" : 114.6189880 }, "southwest" : { "lat" : 30.34877210, "lng" : 113.9817810 } } }, "types" : [ "locality", "political" ] }, { "address_components" : [ { "long_name" : "湖北省", "short_name" : "湖北省", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] } ], "formatted_address" : "中国湖北省", "geometry" : { "bounds" : { "northeast" : { "lat" : 33.27561610, "lng" : 116.13484340 }, "southwest" : { "lat" : 29.02948840, "lng" : 108.36696460 } }, "location" : { "lat" : 30.5458610, "lng" : 114.3419210 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 33.27561610, "lng" : 116.13484340 }, "southwest" : { "lat" : 29.02948840, "lng" : 108.36696460 } } }, "types" : [ "administrative_area_level_1", "political" ] }, { "address_components" : [ { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] } ], "formatted_address" : "中国", "geometry" : { "bounds" : { "northeast" : { "lat" : 53.56097399999999, "lng" : 134.772810 }, "southwest" : { "lat" : 18.15352160, "lng" : 73.49941369999999 } }, "location" : { "lat" : 35.861660, "lng" : 104.1953970 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 53.56097399999999, "lng" : 134.772810 }, "southwest" : { "lat" : 18.15352160, "lng" : 73.49941369999999 } } }, "types" : [ "country", "political" ] } ], "status" : "OK"}