2013-07-03 46 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); 
}