Google Maps API - 获取地址坐标 [英] Google Maps API - Get Coordinates of address

查看:26
本文介绍了Google Maps API - 获取地址坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将地址转换为长/纬度.

I would like to convert addresses into long/lat.

有没有不使用 JavaScript 的方法来做到这一点?因为在我的情况下不需要显示任何东西,因为转换是在后台进行的.

Is there any way to do this without using JavaScript? Because in my case there is no need to display anything since the conversion is in the background.

推荐答案

您要查找的内容称为 Geocoding.

What you are looking for is called Geocoding.

Google 提供了一个 地理编码网络服务,它应该可以满足您的需求寻找.您将能够在您的服务器上进行地理编码.

Google provides a Geocoding Web Service which should do what you're looking for. You will be able to do geocoding on your server.

JSON 示例:

http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA

XML 示例:

http://maps.google.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA

<小时>

请注意,此方法现已弃用,您必须提供自己的 Google API 密钥才能访问此数据.

Please note that this is now a deprecated method and you must provide your own Google API key to access this data.

这篇关于Google Maps API - 获取地址坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆