Is there any way to animate a devpin with respond to the changing of the zoom level?

Feb 16, 2009 at 12:51 PM
I need to know how to animate a Devpin ( or any objects which inherits from the DeepPoint class ) over the map with respond to the changing of the zoom level. As you know there are already some storyboards (scale animations or show info box animation ) for Devpins which are not dynamic over the zoom level and their behavior does not depend on zoom level. But what I need to do is to animate a Devpin (especially when I use translatetransform in my storyboard) over the map with response to the zoom levels or maybe its better to say with response to the real locations (Geographic Points) of the origin and destination of the my translationtransform. For example to move a Devpin from Washengton DC to NewYork city over any zoom level or any location of the map on the screen.
As of my first step, the event of starting the animation is not important to me and could be the easiest. For example by clicking on infobox icon of a devpin.
Thank you in anticipations my friends.
Coordinator
Feb 16, 2009 at 8:02 PM

You should be able too, make your own class that derives from PointBase, here I do the powerlaw thing, where I'm resizing. The _ScaleAdjustment is going to give you a reference to the zoomlevel (sortof, you will see its range is more 2n scale but Zoomlevel can be calculated).
In here you could add logic to change the icon altogether, animate etc. I havn't got to try it yet but if we are missing something you need please let us know us this is very important and we do want to support it.

using System;
using System.Windows;
using DeepEarth.Geometry;

namespace SQLSpatialSL.Controls
{
    public class Pushpin : PointBase
    {

        public Pushpin()
        {
            Style = Application.Current.Resources["PushpinStyle"] as Style;
        }

        /// <summary>
        /// The adjustment scale for the Pin
        /// </summary>
        public override double ScaleAdjustment
        {
            get { return _ScaleAdjustment; }
            set
            {
                _ScaleAdjustment = value;
                if (_IsLoaded)
                {
                    _ScaleTransform.ScaleX = Math.Sqrt(_ScaleAdjustment) * 10;
                    _ScaleTransform.ScaleY = Math.Sqrt(_ScaleAdjustment) * 10;
                }
            }
        }
    }
}