Timeslider with feature layer so slow.

2068
5
09-07-2011 10:59 PM
wintab
by
New Contributor
I have a time aware layer. When i use it as a map service(ArcGISDynamicMapServiceLayer) it loads fast and the time slider works. When i render my features with a feature layer instead, it is extremely slow but eventually loads and time slider doesn't work anymore. But when i use a service as a feature layer from the sample server it works perfectly and isn't slow. What am i missing?
0 Kudos
5 Replies
JenniferNery
Esri Regular Contributor
Dynamic map layer will load images on the fly, while Feature layer will contain graphic objects. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Layer.html. I cannot comment how sample server feature service loads faster than your own feature service though.

Are you saying Timeslider introduces a delay?
0 Kudos
wintab
by
New Contributor
I tried using the same feature layer even without omitting the TimeExtent property on my map but removing the timeslider and it works. But as soon as i add the timeslider it goes back to being slow again. Here is the code i am using

<esri:Map x:Name="MyMap" TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}">
<esri:FeatureLayer ID="MyFeatureLayer" Initialized="MyFeatureLayer_Initialized"  Url="...../TemporalData/MapServer/0"/>
</esri:Map>
  <esri:TimeSlider x:Name="MyTimeSlider" TimeMode="TimeExtent"
      MinimumValue="{Binding ElementName=MyMap, Path=Layers[MyFeatureLayer].TimeExtent.Start, Mode=OneWay}"
     MaximumValue="{Binding ElementName=MyMap, Path=Layers[MyFeatureLayer].TimeExtent.End, Mode=OneWay}"
                        Value="{Binding ElementName=MyMap, Path=Layers[MyFeatureLayer].TimeExtent, Mode=OneWay}" >
                    </esri:TimeSlider>


private void MyFeatureLayer_Initialized(object sender, EventArgs e)
        {
List<DateTime> intervals = new List<DateTime>();
            DateTime dt = MyTimeSlider.MinimumValue;
            while (dt < MyTimeSlider.MaximumValue)
            {
                intervals.Add(dt);
                dt = dt.AddYears(1);
            }

            MyTimeSlider.Intervals = intervals;

        }
0 Kudos
wintab
by
New Contributor
Any ideas please?

I tried using the same feature layer even without omitting the TimeExtent property on my map but removing the timeslider and it works. But as soon as i add the timeslider it goes back to being slow again. Here is the code i am using

<esri:Map x:Name="MyMap" TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}">
<esri:FeatureLayer ID="MyFeatureLayer" Initialized="MyFeatureLayer_Initialized"  Url="...../TemporalData/MapServer/0"/>
</esri:Map>
  <esri:TimeSlider x:Name="MyTimeSlider" TimeMode="TimeExtent"
      MinimumValue="{Binding ElementName=MyMap, Path=Layers[MyFeatureLayer].TimeExtent.Start, Mode=OneWay}"
     MaximumValue="{Binding ElementName=MyMap, Path=Layers[MyFeatureLayer].TimeExtent.End, Mode=OneWay}"
                        Value="{Binding ElementName=MyMap, Path=Layers[MyFeatureLayer].TimeExtent, Mode=OneWay}" >
                    </esri:TimeSlider>


private void MyFeatureLayer_Initialized(object sender, EventArgs e)
        {
List<DateTime> intervals = new List<DateTime>();
            DateTime dt = MyTimeSlider.MinimumValue;
            while (dt < MyTimeSlider.MaximumValue)
            {
                intervals.Add(dt);
                dt = dt.AddYears(1);
            }

            MyTimeSlider.Intervals = intervals;

        }
0 Kudos
JenniferNery
Esri Regular Contributor
What version of the API are you using? Your code looks the same as this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TimeFeatureLayer.

I don't see any performance gain/loss when running the sample with or without the TimeSlider. These are other ways you can set your TimeSlider.Intervals (you can do either):
MyTimeSlider.Intervals = TimeSlider.CreateTimeStopsByCount(MyMap.TimeExtent, 8);
MyTimeSlider.Intervals = TimeSlider.CreateTimeStopsByTimeInterval(MyMap.TimeExtent, TimeSpan.FromDays(365));


Also note that in your code, you will not be able to see the FeatureLayer if it is the only layer in your map unless you specify an Extent. I know you may have pasted just the relevant code here but please test your FeatureLayer with TimeSlider separately from your application.

You can try the following and try again with your service but adjust the interval to suit your service.
   xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

 <Grid x:Name="LayoutRoot">
  <esri:Map x:Name="MyMap" WrapAround="True"
                  TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}" Extent="-179.984, -62.877, 179.1, 70.78">   
   <esri:FeatureLayer ID="EarthquakesLayer"
     Initialized="FeatureLayer_Initialized"
                    Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0"/>
  </esri:Map>
  <esri:TimeSlider x:Name="MyTimeSlider" HorizontalAlignment="Center" VerticalAlignment="Top"
      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>
 </Grid>
</UserControl>

private void FeatureLayer_Initialized(object sender, EventArgs e)
{
 MyTimeSlider.Intervals = TimeSlider.CreateTimeStopsByTimeInterval(MyMap.TimeExtent, TimeSpan.FromDays(365));
}
0 Kudos
PaulCote
New Contributor III

I have another data point on this.  I have a project with several thousand multipatches, each with a time extent.  On my newer computer (specs below) I can slidt the timeslider back and forth smoothly.  On my old alienware laptop the lag is a couple of MINUTES!

Specs:

Newer DELL XPS Tower

Processor: Core i7-6700, 24g ram,  

Video Nvidia Gforce GT-730 (2gb video ram)  everything is smooth.

Old Alienware  Laptop, which has

Processor an older core-7 running at 1.87ghz, and 8 gigs of Ram

Video: GTX-260m with 1gb vram

0 Kudos