我有一个经度/纬度值。...如何搜索和获取城市?
最佳答案
使用google maps api,这是一个以XML格式获取地址的示例。
http://maps.google.com/maps/api/geocode/xml?latlng={latlng}&sensor={sensor}®ion={region}
其中
latlng
= 0,0 sensor
= false,而region
=国家/地区代码,因此对于我的旧地址,它将是http://maps.google.com/maps/api/geocode/xml?latlng=-43.893792,171.7592620&sensor=false®ion=nz
然后,您可以使用该XML来获取所需的任何详细信息,包括城市