Dynamic Layer and Year Change / Time Slider Update

04-27-2012 08:28 AM
New Contributor II
Using a Dynamic Layer and a time slider.

Currently I have a time slider responding with my month to month data using a dynamic layer. I based the code off the sample script from:


I would like to add in the option to switch between years in a drop down list and have the time slider update to the data only from the chosen year.
I see there is an example that displays this at:


However this example is utilizing a feature layer. I would really like to use the Dynamic layer.

So my question is can the year change / time slider update be done using a Dynamic layer? 
If so, maybe there is an example or a logic to work from.

Thank you so much!
0 Kudos
1 Reply
New Contributor
Hi Nicole,

The Time Slider control requires that the geometries are on the client in order to work, so a Feature Layer is required.

If you wanted to do this with a Dynamic Map Service layer you'd have to create your own slider control and use it in conjunction with a Query Task to retrieve the features from the Server and symbolise on the Graphics Layer ... which is basically what the Feature Layer is doing on your behalf!

If you insist on having the features rendered Server-side, you could apply layer definitions to the Dynamic Map Service layer, but either of these methods could become very 'chatty'.

Is there any reason why you don't want to use a Feature Layer? You don't need to do anything special to set it up - just create one from an existing layer in your Dynamic Map Service.

HTH? Or am I missing something?

Best regards,

Mark Lewin
0 Kudos