Get City name from GPS co-ordinates

南楼画角 提交于 2019-12-03 20:44:56
John Riselvato

The correct URL is below

http://maps.googleapis.com/maps/api/geocode/xml?latlng=53.244921,-2.479539&sensor=true

In anycase, the xml is perfectly fine to get a city. In this case

<address_component>
    <long_name>Northwich</long_name>
    <short_name>Northwich</short_name>
    <type>postal_town</type>
</address_component>

is what you are looking for. Not sure what language you are wishing to get this information from in though. From the looks of your other questions you work with javascript. So i suggest learning how to XML parse with javascript.

SO has a great post on this here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!