从传递给服务器的地址检索经度和纬度
我提出一个有趣的问题。我想要实现的是我有一个商家列表及其地址。我想要它们的经度和纬度,以便我可以确定用户(使用位置侦听器)是否在该商家的一公里半径范围内。我已经完成了代码来确定它们是否在该半径内。
我需要的是我所说的商家经纬度。是否有肥皂服务可以用来传递商家的地址并以经度和纬度进行响应?或者我可以以某种方式将其发送到 google place API 吗?
I pose an interesting question. What I'm trying to achieve is I have a list of merchants and their address. I want their longitude and latitude so I can determine if the user (using location listener) is within a one kilometre radius of that merchant. I have done the code to determine if they are within that radius.
What I need is the merchants longitude and latitude as I said. Is there a soap service that I can use to pass the address of the merchant and it responds with the longitude and latitude? Or can I send that to google places API somehow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 Google 地图 API 通过其地理编码支持可以满足您的需求。
http://code.google.com/apis/maps /documentation/javascript/v2/services.html#Geocoding
I think that the Google Maps API does what you need via their GEOCODING support.
http://code.google.com/apis/maps/documentation/javascript/v2/services.html#Geocoding
既然你已经在 Android 下标记了这个问题,我会接受并假设“我如何在 java 中使用它”,你实际上是指我如何在 android 平台上做到这一点。
幸运的是,android 提供了 Geocoder API,您可以使用它们将地址地理编码为经/纬度坐标,通过执行以下操作:
(上面引用自 AndDev 教程)
一旦获得了 lon/lats,您就可以可以创建一个GeoPoint 并拍打它们在地图上,链接此处了解如何执行此操作。
Since you've tagged the question under Android, I'm going to take a hit and assume that by "how do I use this with java", you actually mean how can I do this on the android platform.
Luckily, android provides the Geocoder APIs that you can use for geocoding addresses into lon/lat co-ordinates, by doing the following :
(above quoted from AndDev tutorial)
Once you've got the lon/lats, you can create a GeoPoint and slap them on a map, link here on how to do that.