基于当前位置的附近地址

发布于 2024-12-27 05:50:47 字数 167 浏览 1 评论 0原文

我正在开始开发适用于 Windows Phone 7.5 的应用程序。所以情况是这样的:

  • 我有一个包含几个地址的列表,我想根据我当前的位置获取最近的地址(距离半径将由用户及时确定以进行过滤)。

任何人都可以为我指明如何做到这一点的方向吗?

谢谢!

I'm starting developer a app for windows phone 7.5. So this is the scenario:

  • I have a list with a few addresses and I want get the nearest based in my current location (distance radius will be determine by the user in time to filter).

Anyone can point me a direction in how I do this?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无畏 2025-01-03 05:50:47

您必须找到一些网络服务,可以将地址映射到 GPS 坐标,然后计算距离。我猜 bing 地图 API 和 Google 地图提供了用于地址查找的 api:s。

获得坐标后,您可以通过以下方式计算距离

var addressLocation = new GeoCoordinate(-51.39792, -0.12084);

var yourLocation = new GeoCoordinate(-29.83245, 31.04034);

double distance = addressLocation .GetDistanceTo(yourLocation);

You have to find some web service that can map an address to GPS coordinates and then calculate the distance. I guess bing map API and Google maps provides api:s for address lookup.

Once you have the coordinates you calculate distance by

var addressLocation = new GeoCoordinate(-51.39792, -0.12084);

var yourLocation = new GeoCoordinate(-29.83245, 31.04034);

double distance = addressLocation .GetDistanceTo(yourLocation);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文