Bing Maps marker marker for Metro apps

I have a Bing Map control and I want to animate the location of the output drawn on the map.

Ideally, I would like to write code like this:

// Image myPin = some Image on the map layer;

var sb = new Storyboard();
var duration = DurationHelper.FromTimeSpan(System.TimeSpan.FromMilliseconds(1000));
sb.Duration = duration;

LocationAnimation ani = new LocationAnimation();
ani.To = new Location(33.3, 11.1); // destination lat, lng
ani.Duration = duration;

sb.Children.Add(ani);
Storyboard.SetTarget(ani, myPin);
Storyboard.SetTargetProperty(ani, "MapLayer.Position");

Resources.Add("moveMyPin", sb);
sb.Begin();

Of course, there is no class in the structure LocationAnimation. There are a couple of similar ones: it PointAnimationworks with a type Point, but it DoubleAnimationworks with individual values double.

I suggested that I should implement the Timeline-derived class , but the documentation I have found so far does not help in this regard, and I do not know where to start.

How to animate a property for which there is no * Animation class ready? Did I miss something?

Update . I think I can do something like

// let aniX and aniY be two DoubleAnimation objects
StoryBoard.SetTargetProperty(aniX, "(MapLayer.Position).Latitude")
StoryBoard.SetTargetProperty(aniY, "(MapLayer.Position).Longitude")

, , " TargetProperty (MapLayer.Position).Latitude ".

, : ?

. , "SetTargetProperty", (. ). ?

3: , RenderTransform . , . :

  • RepositionThemeAnimation, , . : -, lat/lng , ( , ). -, / . , . , , .
  • RepositionThemeTransition /. , . lat/lng ( MapLayer.SetPosition). . ( ) . , , .
+3
2

, . :

http://www.charlespetzold.com/blog/2007/09/080231.html

, , (Location) ( ).

, , . ? , ? , RenderTransform X Y . , RenderTransform , .

, , . , , :

<Button Content="Transitioning Button">
     <Button.Transitions>
         <TransitionCollection> 
             <EntranceThemeTransition/>
         </TransitionCollection>
     </Button.Transitions>
</Button>

.:

http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh452703.aspx

0

All Articles