Select to view content in your preferred language

TimeSlider in Feature Layer with Geometry Type Polyline

2273
1
12-12-2012 06:31 AM
GualbertoHernández_Juárez
Emerging Contributor
Hi,

I need to use timeslider by a service in a feature layer type polyline. So far I have failed, I have drawn the following example from ESRI.

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

My feature layer is as follows:
http://200.4.1.10:6080/arcgis/rest/services/test/test3/MapServer/0


I get my service but I can not run time Slider.
I hope you can suggest me any solution, thank you very much.

Gualberto

This is my code:


<UserControl x:Class="ESRIShowcaseMapApplication1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

    <Grid x:Name="LayoutRoot">

        <Grid.Resources>
            <esri:SimpleMarkerSymbol x:Key="MySmallMarkerSymbol" Color="#FF0098E6" Size="5" Style="Circle" />
            <esri:SimpleMarkerSymbol x:Key="MyMediumMarkerSymbol" Color="#FFFCEC01" Size="8" Style="Circle" />
            <esri:SimpleMarkerSymbol x:Key="MyLargeMarkerSymbol" Color="#FFF60D0B" Size="12" Style="Circle" />
        
        </Grid.Resources>

        <esri:Map x:Name="MyMap" WrapAround="True"
                  TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}">

            <esri:ArcGISTiledMapServiceLayer ID="BaseLayer"
                    Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" />

            <esri:FeatureLayer ID="EarthquakesLayer"
     Initialized="FeatureLayer_Initialized"
                    Url="http://200.4.1.10:6080/arcgis/rest/services/test/test3/MapServer/0"
                  
                    OutFields="*">
                <esri:FeatureLayer.MapTip>
                    <Border CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" Margin="0,0,15,15">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">
                                <GradientStop Color="#FFD1DFF2"/>
                                <GradientStop Color="#FF0088FF" Offset="0.946"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Border.Effect>
                            <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
                        </Border.Effect>
                        <StackPanel Margin="7">
                            <TextBlock Text="{Binding [Name]}" FontWeight="Bold" Foreground="Black"  />
                            <StackPanel Orientation="Vertical">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="tiempo: " Foreground="Black" />
                                    <TextBlock Text="{Binding [tiempo_]}" Foreground="Black" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="tiempo: " Foreground="Black" />
                                    <TextBlock Text="{Binding [tiempo]}" Foreground="Black" />
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </esri:FeatureLayer.MapTip>
            </esri:FeatureLayer>

        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
            <Rectangle Fill="#77919191" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Border Background="#FFFFFFFF" BorderBrush="DarkGray" CornerRadius="5" Margin="10,10,10,15"
                    Width="250" HorizontalAlignment="Center" VerticalAlignment="Top" >
                <StackPanel Margin="5">
                    <TextBlock Text="Earthquakes" FontSize="16" HorizontalAlignment="Center"/>
                    <StackPanel DataContext="{Binding ElementName=MyTimeSlider, Path=Value}" Orientation="Horizontal" Margin="5"
                            HorizontalAlignment="Center">
                        <TextBlock Text="{Binding Start.tiempo}" FontSize="12" />
                        <TextBlock Text=" -&gt; " FontSize="12" />
                        <TextBlock Text="{Binding End.tiempo}" FontSize="12" />
                    </StackPanel>

                    <esri:TimeSlider x:Name="MyTimeSlider" 
      Height="20" TimeMode="TimeExtent"
                        MinimumValue="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent.Start, Mode=OneWay}" 
         MaximumValue="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent.End, Mode=OneWay}"
                        Value="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent, Mode=OneWay}" >
                    </esri:TimeSlider>

                </StackPanel>
            </Border>
        </Grid>
    </Grid>
</UserControl>
0 Kudos
1 Reply
GualbertoHernández_Juárez
Emerging Contributor
0 Kudos