2

I'm using bing maps with WinRT. I want to create a translation when pushpin_click event is fired, so that it translates the current tapped pushpin in the center of my map:

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?
}

Is there a way to realize that programmatically in c#?

4

1 回答 1

4

你很亲密。您只需要使用 MapLayer 类获取图钉的位置并像这样设置地图的视图:

private void Pushpin_Click(object sender, TappedRoutedEventArgs e)
{
     var TappedPin = sender as Pushpin;
     Location currentPinLocation = MapLayer.GetPosition(TappedPin);
     Map.SetView(currentPinLocation);  
}
于 2013-07-03T16:52:39.893 回答