日期:2014-05-16 浏览次数:20591 次
{
"results" : [
{
"address_components" : [
{
"long_name" : "上海电视台站",
"short_name" : "上海电视台站",
"types" : [ "bus_station", "transit_station" ]
},
{
"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" ]
},
{
"long_name" : "200041",
"short_name" : "200041",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "中国上海市静安区上海电视台 邮政编码: 200041",
"geometry" : {
"location" : {
"lat" : 31.2308820,
"lng" : 121.464590
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 31.23223098029150,
"lng" : 121.4659389802915
},
"southwest" : {
"lat" : 31.22953301970850,
"lng" : 121.4632410197085
}
}
},
"types" : [ "bus_station", "transit_station" ]
}
],
"status" : "OK"
}
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<meta charset="utf-8">
</head>
<body>
<script>
$.getJSON("http://maps.googleapis.com/maps/api/geocode/json?jsoncallback=?",
{
address: "上海电视台",
sensor: "false",
format: "json"
},
function(data) {
alert( data);
alert("请求完成");
});
</script>
</body>
</html>