2013-07-03 109 views
2

我使用WinRT的Bing地图。我想创建时pushpin_click事件被触发的转换,使之转化当前挖掘图钉在我的地图的中心:Bing地图动画翻译

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#编程的方法吗?

回答

4

你非常接近。您只需要使用MapLayer类获取图钉的位置并像这样设置地图的视图:

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