如何将经度和纬度值转换为Windows Phone中的地址? [英] How to convert longitude and latitude value to address in windows phone?

查看:127
本文介绍了如何将经度和纬度值转换为Windows Phone中的地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

  void _watcher_PositionChanged(object sender,GeoPositionChangedEventArgs< GeoCoordinate> e)$ b $获得经纬度值b {


纬度= e.Position.Location.Latitude;
longitude = e.Position.Location.Longitude;
MessageBox.Show(Latitude& Longitude:+ latitude ++ longitude);
}

结果如下:
Latitude&经度:12.56 77.34



现在我想把这些值转到相关地址。可能吗。请给出简要的解释。提前致谢。 在Windows Phone 8中,您可以轻松使用集成的 ReverseGeocodeQuery 类。例如:

  string address; 
ReverseGeocodeQuery query = new ReverseGeocodeQuery();
query.GeoCoordinate =新的GeoCoordinate(12.56,77.34);
query.QueryCompleted + =(s,e)=>
{
if(e.Error!= null)
return;

address = e.Result [0] .Information.Address.Street;
};
query.QueryAsync();

如此简单。



但是, Windows Phone 7 需要使用 Bing服务


I get the latitude and longitude value using

 void _watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
    {


            latitude = e.Position.Location.Latitude;
            longitude = e.Position.Location.Longitude;
            MessageBox.Show("Latitude & Longitude:" + latitude + "  " + longitude);
    }

Result like: Latitude & Longitude: 12.56 77.34

Now i want to these value to relevant address. Is it possible. Please give the brief explanation. Thanks in advance.

解决方案

In Windows Phone 8 you can do it easily using the integrated ReverseGeocodeQuery class. For example:

string address;
ReverseGeocodeQuery query = new ReverseGeocodeQuery();
query.GeoCoordinate = new GeoCoordinate(12.56, 77.34);
query.QueryCompleted += (s, e) =>
   {
        if (e.Error != null)
            return;

        address = e.Result[0].Information.Address.Street;
    };
query.QueryAsync();

As simple as that.

For Windows Phone 7, however, you would need to use Bing services.

这篇关于如何将经度和纬度值转换为Windows Phone中的地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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