我正在使用“http://maps.googleapis.com/maps/api/geocode/xml?address="+address+"&sensor=true" 来获取某个位置的纬度和经度。从这里我得到如下回应:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>OK</status>
<result>
<type>locality</type>
<type>political</type>
<formatted_address>Chicago, IL, USA</formatted_address>
<address_component>
<long_name>Chicago</long_name>
<short_name>Chicago</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Cook</long_name>
<short_name>Cook</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Illinois</long_name>
<short_name>IL</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>United States</long_name>
<short_name>US</short_name>
<type>country</type>
<type>political</type>
</address_component>
<geometry>
<location>
<lat>41.8781136</lat>
<lng>-87.6297982</lng>
</location>
<location_type>APPROXIMATE</location_type>
<viewport>
<southwest>
<lat>41.7450495</lat>
<lng>-87.8859170</lng>
</southwest>
<northeast>
<lat>42.0109012</lat>
<lng>-87.3736794</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>41.6443350</lat>
<lng>-87.9402669</lng>
</southwest>
<northeast>
<lat>42.0231310</lat>
<lng>-87.5236609</lng>
</northeast>
</bounds>
</geometry>
</result>
</GeocodeResponse>
响应中有很多关于位置的 lng 和 lat 值。那么我必须考虑哪一个?