Bing映射动画翻译

本文关键字:翻译 动画 映射 Bing | 更新日期: 2023-09-27 18:20:45

我在WinRT中使用bing映射。我想在pushpin_click事件被触发时创建一个翻译,以便它翻译地图中心当前点击的图钉:

private void Pushpin_Click(object sender, TappedRoutedEventArgs e)
{
     var TappedPin = (Pushpin)sender;
     Location currentPinLocation = GetPushpinLocation(TappedPin);
     Map.Center = currentPinLocation;  //How can I make a translation animation?
}

有没有一种方法可以在c#中以编程方式实现这一点?

Bing映射动画翻译

你非常接近。您只需要使用MapLayer类获得图钉的位置,并设置地图的视图,如下所示:

private void Pushpin_Click(object sender, TappedRoutedEventArgs e)
{
     var TappedPin = sender as Pushpin;
     Location currentPinLocation = MapLayer.GetPosition(TappedPin);
     Map.SetView(currentPinLocation);  
}