输入: http://maps.googleapis.com/maps/api/geocode/xml?address=SFO&sensor=false 可看到 xml格式数据
<?xml version="1.0" encoding="UTF-8" ?>
<
status
>
OK
</
status
>
<
type
>
airport
</
type
>
<
type
>
airport
</
type
>
<
type
>
establishment
</
type
>
<
formatted_address
>
旧金山国际机场 (SFO), 旧金山, 加利福尼亚州 94128, 美国
</
formatted_address
>
<
long_name
>
旧金山国际机场
</
long_name
>
<
short_name
>
旧金山国际机场
</
short_name
>
<
type
>
establishment
</
type
>
</
address_component
>
<
long_name
>
旧金山
</
long_name
>
<
short_name
>
SF
</
short_name
>
<
type
>
locality
</
type
>
<
type
>
political
</
type
>
</
address_component
>
<
long_name
>
南旧金山
</
long_name
>
<
short_name
>
南旧金山
</
short_name
>
<
type
>
administrative_area_level_3
</
type
>
<
type
>
political
</
type
>
</
address_component
>
<
long_name
>
圣马刁县
</
long_name
>
<
short_name
>
圣马刁县
</
short_name
>
<
type
>
administrative_area_level_2
</
type
>
<
type
>
political
</
type
>
</
address_component
>
<
long_name
>
加利福尼亚州
</
long_name
>
<
short_name
>
CA
</
short_name
>
<
type
>
administrative_area_level_1
</
type
>
<
type
>
political
</
type
>
</
address_component
>
<
long_name
>
美国
</
long_name
>
<
short_name
>
US
</
short_name
>
<
type
>
country
</
type
>
<
type
>
political
</
type
>
</
address_component
>
<
long_name
>
94128
</
long_name
>
<
short_name
>
94128
</
short_name
>
<
type
>
postal_code
</
type
>
</
address_component
>
<
lat
>
37.6152230
</
lat
>
<
lng
>
-122.3899790
</
lng
>
</
location
>
<
location_type
>
APPROXIMATE
</
location_type
>
</
geometry
>
</
result
>
</
GeocodeResponse
>
{ "status": "OK", "results": [ { "types": [ "airport", "airport", "establishment" ], "formatted_address": "旧金山国际机场 (SFO), 旧金山, 加利福尼亚州 94128, 美国", "address_components": [
{ "long_name": "旧金山国际机场","short_name": "旧金山国际机场","types": [ "establishment" ]},
{"long_name": "旧金山","short_name": "SF", "types": [ "locality", "political" ]},
{"long_name": "南旧金山","short_name": "南旧金山","types": [ "administrative_area_level_3", "political" ] },
{"long_name": "圣马刁县","short_name": "圣马刁县","types": [ "administrative_area_level_2", "political" ]},
{"long_name": "加利福尼亚州","short_name": "CA","types": [ "administrative_area_level_1", "political" ] },
{"long_name": "美国","short_name": "US","types": [ "country", "political" ]},{"long_name": "94128", "short_name": "94128","types": [ "postal_code" ]}], "geometry": {"location": {"lat": 37.6152230,"lng": -122.3899790},
"location_type": "APPROXIMATE","viewport": {
"southwest": {"lat": 37.5975438,"lng": -122.4219938}, "northeast": {"lat": 37.6328980,"lng": -122.3579642}}, "bounds": {"southwest": {"lat": 37.6043769, "lng": -122.4014108}, "northeast": {"lat": 37.6392104,"lng": -122.3549166}} } } ] }