如何在C#中获取点击地图上的点击地理位置

是否可以获得我在c#中点击bing Map的点的地理位置?

好吧,因为你在C#中使用WinRT,所以你正在使用Bing Maps Windows Store App控件。 将地图添加到XAML标记中:

      

然后,您可以执行此操作以在已单击的位置添加图钉:

 public MainPage() { this.InitializeComponent(); this.MyMap.PointerPressedOverride += MyMap_PointerPressedOverride; } void MyMap_PointerPressedOverride(object sender, PointerRoutedEventArgs e) { Bing.Maps.Location l = new Bing.Maps.Location(); this.MyMap.TryPixelToLocation(e.GetCurrentPoint(this.MyMap).Position, out l); Bing.Maps.Pushpin pushpin = new Bing.Maps.Pushpin(); pushpin.SetValue(Bing.Maps.MapLayer.PositionProperty, l); this.MyMap.Children.Add(pushpin); } 

Bing Maps API使这很容易。

          

Click the map to display the coordinate values at that point.
Latitude, Longitude:

资料来源: MSDN上的Bing Maps API