点击bingmap时如何获取位置? [英] How to I get location when click bingmap ?

查看:444
本文介绍了点击bingmap时如何获取位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone!

我必须使用Windows 8.1商店项目,我必须使用bingmap或其他地图进行此项目(我尝试了Bing Map)。当我点击地图时,我想采取这一点的位置(Latidude,Longtitude)。



我该怎么办?如果帮助我,我会很开心。



感谢您的答案..:)

Hello Everyone !
I have to a Windows 8.1 store project and I must use bingmap or other maps for this project( I tried Bing Map). When I click on the map I want to take location(Latidude , Longtitude) of the this point.

How can I do? If help me, I will be very happy.

Thanks for answers.. :)

推荐答案

试试这个

添加一个抽头事件到Bing地图,例如

Try this
Add a tapped event to the Bing Map like
xmlns:Maps="using:Bing.Maps"
<maps:map credentials="{StaticResource BingCredentials}" tapped="MapTapped" xmlns:maps="#unknown" /> 



Tapped就像这样


The Tapped is like this

private void MapTapped(object sender, TappedRoutedEventArgs e)
{
    var pos = e.GetPosition(map);
    Location location;
    map.TryPixelToLocation(pos, out location);
    var latitude= location.Latitude;
    var longitude= location.Longitude;
}





参考:



https://diptimayapatra.wordpress.com/2012 / 11/29 / custom-pushpin-in-bing-map-for-windows-store-app-xaml / [ ^ ]



使用Bing Maps for Windows 8 Metro Apps - C#/ JavaScript [ ^ ]


Naz_Firdouse 非常感谢您的回答。这是我的解决方案。
Naz_Firdouse Thank you so much your answer. This is solution for me.


Hello Naz_Firdouse 。我的问题是类似的第一个问题。我需要上面的代码用于windows phone 8.1 app的silverlight。
Hello Naz_Firdouse . My problem is simular first problem. I need same of the above code for silverlight for windows phone 8.1 app.


这篇关于点击bingmap时如何获取位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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