Select to view content in your preferred language

Filter by Date Picker Range

1301
6
11-08-2010 07:21 AM
JimWelsh
Deactivated User
Hello all.  I hope I am not repeating another thread, but I have been unsuccessful in finding what I am looking for.

Flex 2.1 / ArcServer 10

I currently have a Flex application map with time aware layers, with a working time slider.  Instead of using the slider I would prefer to have two date picker windows pop up, allowing the user to pick a beginning and ending date.  These dates would then filter the map data based on the date range selected, which I would like to limit to less than one year.

Can anyone help me with an example of this?  Thank you in advance.
Tags (2)
0 Kudos
6 Replies
DasaPaddock
Esri Regular Contributor
You'll need to set the Map's timeExtent instead of timeSlider:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Map.html#timeExtent
0 Kudos
JimWelsh
Deactivated User
Dasa,

I appreciate your response, but I guess I'm having one of those days.

Do you have an example of how to hard code a beginning and ending date?  I've seen the following, but I don't really know where to insert it.  If there is something better, I'd be happy for that also.

    var myTimeDef:TimeExtent = new TimeExtent();
    myTimeDef.startTime = new Date("2003/09/25 UTC");
    myTimeDef.endTime = new Date("2005/10/25 UTC");
    myFeatureLayer.timeDefinition = myTimeDef;

If I can get the hard coded extents to work I would be happy, then would be able to get the pickers to work.

Thanks again.
0 Kudos
DasaPaddock
Esri Regular Contributor
The FeatureLayer's timeDefinition is used to filter the features that are loaded when the FeatureLayer is in snapshot mode.

If this isn't what you're using, then you should be able to set the TimeExtent you've created on the Map's timeExtent property instead of setting the Map's timeSlider property.
0 Kudos
R__CraigHolmes
Emerging Contributor
Jim any luck with this?
0 Kudos
JimWelsh
Deactivated User
Unfortunately no...  I just don't understand where to place the timeextent code.  I am fairly new to the flex world and haven't quite figured out how everything works together.  I can't wait to get this working.
0 Kudos
R__CraigHolmes
Emerging Contributor
The next release is supposed have more time aware functionality so opted not to hit off the xml Time Info: but rather filter from a single crime occurrence date field on my app
0 Kudos