Select to view content in your preferred language

Animate graphics on panto

562
1
10-05-2010 06:01 PM
xariaD
by
Occasional Contributor
I have a grid which has information about the graphics projected on map.
On selecting a row in the grid, the map Pans To the selected graphic.
To clearly identify the graphic I wish to animate it. Are there any samples I can look into?
0 Kudos
1 Reply
DarinaTchountcheva
Frequent Contributor
Hello xaria,

Here is a sample, that you can see in the Symbol Gallery:

[HTML]
<esri:MarkerSymbol x:Name="CustomSelectRectangleMarkerSymbol" OffsetX="10" OffsetY="10">
    <esri:MarkerSymbol.ControlTemplate>
      <ControlTemplate>
        <Grid Width="20" Height="20" x:Name="RootElement">
          <vsm:VisualStateManager.VisualStateGroups>
            <vsm:VisualStateGroup x:Name="CommonStates">
              <vsm:VisualState x:Name="MouseOver" />
              <vsm:VisualState x:Name="Normal" />
            </vsm:VisualStateGroup>
            <vsm:VisualStateGroup x:Name="SelectionStates">
              <vsm:VisualState x:Name="Selected">
                <Storyboard>
                  <ColorAnimation BeginTime="00:00:00" Storyboard.TargetName="myrectangle" Storyboard.TargetProperty="(Rectangle.Stroke).(SolidColorBrush.Color)" To="Red" Duration="0:0:.25" />
                  <DoubleAnimationUsingKeyFrames Storyboard.TargetName="myrectangle" Storyboard.TargetProperty="StrokeThickness" Duration="0:0:.5" RepeatBehavior="Forever">
                    <LinearDoubleKeyFrame KeyTime="0" Value="3" />
                    <LinearDoubleKeyFrame KeyTime="00:00:0.25" Value="1" />
                    <LinearDoubleKeyFrame KeyTime="00:00:0.5" Value="3" />
                  </DoubleAnimationUsingKeyFrames>
                </Storyboard>
              </vsm:VisualState>
              <vsm:VisualState x:Name="Unselected" />
            </vsm:VisualStateGroup>
          </vsm:VisualStateManager.VisualStateGroups>
          <Rectangle x:Name="myrectangle" RadiusX="4" RadiusY="4" Fill="White" Cursor="Hand" Stroke="Blue" StrokeThickness="3" />
        </Grid>
      </ControlTemplate>
    </esri:MarkerSymbol.ControlTemplate>
  </esri:MarkerSymbol> 
[/HTML]

Look at the SelectionStates - Selected and Unselected.

And here is the link to the Gallery, so you can find some other samples:

http://help.arcgis.com/en/webapi/silverlight/samples/SymbolGalleryWeb/start.htm

Good Luck!
0 Kudos