Select to view content in your preferred language

Add animation to Picturemarker symbol

656
4
09-21-2011 10:00 PM
GirishSomesh
Deactivated User
Hi all,

I have a picturemarker symbol and need to rotate the symbol on mouseover. Can any one suggest me how to go forward with this..

Thank you.
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
There are a lot of symbol samples in this gallery.

Look at the 'Custom Marker Symbols' dictionary, there are symbols that rotate when the mouse is over.
0 Kudos
GirishSomesh
Deactivated User
Dominique,
I created an Markersymbol for hurricane image and assigned this to FeatureLayer. The symbol is not displaying.. please find the code and let me know where i am going wrong..
       <esri1:MarkerSymbol x:Key="HurrricaneMarkerSymbol">
                <esri1:MarkerSymbol.ControlTemplate>
                    <ControlTemplate xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
                        <Grid x:Name="RootElement" RenderTransformOrigin="0,0">
                            <Grid.RenderTransform>
                                <RotateTransform Angle="0" CenterX="6" CenterY="10" />
                            </Grid.RenderTransform>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal" />
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="Huricaneimage" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" From="0" To="360" Duration="0:0:3" RepeatBehavior="Forever" />
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Image Source="Images/i_hurricane_red.png" x:Name="Huricaneimage"></Image>
                        </Grid>
                    </ControlTemplate>
                </esri1:MarkerSymbol.ControlTemplate>
            </esri1:MarkerSymbol>

<!--Hurricane FeatureLayer-->
<esri:FeatureLayer ID="MyHurricaneSFeatureLayer"
                    Url="http://esrilabs1.esri.com/ArcGIS/rest/services/LiveFeeds/Hurricane_Active/MapServer/0"
                    Where="FCSTPRD=120 AND DVLBL='S'" Renderer="{StaticResource MyTemporalRenderer}"/>


Thank you.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
<DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="Huricaneimage" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" From="0" To="360" Duration="0:0:3" RepeatBehavior="Forever" />


HurricaneImage has no render transform so that can't work.
Use 'RootElement' instead.

That being said, if you don't see anything, I don't think the rotation is the issue.

<Image Source="Images/i_hurricane_red.png" x:Name="Huricaneimage"></Image>


Verify that the image is well defined in your assembly and compiled as resource.
0 Kudos
GirishSomesh
Deactivated User
Thank you Dominique.. you saved my life... 🙂
0 Kudos