Skip To Content

Time-aware layers

In this topic

Version 3.7

ArcGIS 10 includes support for time-aware layers, which store information about the changing state of a dataset over time. Time-aware layers allow you to step through periods of time revealing patterns and trends in your data. For example, you can do the following:

  • Track hurricane paths and other meteorological events
  • Explore historic patterns in data through time (for example, population or land use changes)
  • Monitor changes in well production or status
  • Map the progression of a wildfire or flood
  • Visualize the spread of disease over time

The time extent of the map defines the time period for the data that is displayed by the time-aware layers. Setting the map's time extent is similar to setting the spatial extent, because once the time extent is set, the map display updates automatically to conform to the change. Every time the map's time extent is changed, all time-aware layers update to reflect the new time extent.

There are several ways to work with time-aware layers in a web API-based application. The simplest is to use the TimeSlider component because it handles the process of updating the map's time extent for you. You can also build applications that perform temporal queries, filter layers using time definitions, and set the map's time extent.

Making layers time aware

You can make your layers time aware by using the Layer Properties dialog box in ArcMap (right-click the layer in ArcMap and choose Properties to display the dialog box). Make sure the Time Field is of type date. See the following screen shot:

Learn more about time properties

The time information is preserved and accessible through the map service when you publish your map using ArcGIS Server. After publishing, you can work with a time-aware map or feature service using the ArcGISDynamicMapServiceLayer or FeatureLayer classes to perform temporal queries and view changes in data over time.

Time-aware layers have a timeInfo property that provides access to the TimeInfo class. The TimeInfo class provides detailed information about the layer's time properties including the time range and time reference. The following snippet retrieves the time extent for a layer using the timeInfo property:

var timeInfo:TimeInfo = myFeatureLayer.layerDetails.timeInfo;

Creating dates to use with time-aware layers

When working with time-aware layers, you may need to create dates to define a time extent. The server assumes times sent in are in Coordinated Universal Time (UTC), so you should create dates with that in mind. UTC is a time standard based on atomic time and is functionally equivalent to Greenwich Mean Time (GMT).

// UTC
    var decemberTimeExtent:TimeExtent = new TimeExtent
    (new Date("2009/01/01 00:00:00 UTC"),new Date("2009/01/31 23:59:59 UTC"));
    // Local Time
    var decemberLocalTimeExtent:TimeExtent = new TimeExtent
    (new Date("2009/01/01 00:00:00"),new Date("2009/01/31 23:59:59"));

Working with time in the ArcGIS API for Flex

The ArcGIS API for Flex provides a TimeSlider component that simplifies the process of visualizing temporal data. Using the time slider, you can filter the map to display cumulative data up to a point in time, a single point in time, or data that falls within a time range. The benefit of using the time slider is that it handles setting the map's time extent, which filters time-aware layers to only display data for the current time extent.

To set up the time slider, add a time-aware layer to the map using the ArcGISDynamicMapServiceLayer, ArcGISImageServiceLayer, or FeatureLayer class. Next, associate the time slider with the map, then define the time slice to visualize the number of time stops the slider should use:

protected function featurelayer1_loadHandler(event:LayerEvent):void
    var ti:TimeInfo = FeatureLayer(event.layer).layerDetails.timeInfo;
    myTimeSlider.createTimeStopsByTimeInterval(ti.timeExtent, ti.timeInterval, 


 <esri:Map timeSlider="{myTimeSlider}">

 <esri:TimeSlider id="myTimeSlider" thumbCount="1"/>

Slider 'thumbs' denote a location on the slider. Possible values are '1' and '2'. The previous code has the thumb count set to 1; this means that the map will display all features from the first time to the current thumb position. To visualize a time range, set the thumb count to 2. To visualize features for an instant in time, set the thumb count to 1 and set createTimeInstant=true.


It is not recommended to use the time slider with feature layers in on demand mode because this can result in too many requests to the server. If you are not working with a large amount of data, you can use a feature layer in snapshot mode. If your dataset is large, consider using an ArcGISDynamicMapServiceLayer instead.

Filtering data using the map's timeExtent property

There are other ways besides the TimeSlider to visualize time-aware layers in your mapping applications. The map has a timeExtent property that acts as a filter for layers that support time, such as the ArcGISDynamicMapServiceLayer and FeatureLayer. Setting the map's time extent fires the timeExtentChange event. Time-aware layers listen for this event and update themselves to display content for the specified time extent. In the following example, only data that meets the input time definition of December 31, 2010 appears:

var ti:TimeExtent = new TimeExtent();
    ti.startTime = new Date("12/31/2010 UTC");
    myMap.timeExtent = ti;

Filtering data using the layer's time definition using snapshot mode

Feature layers support the ability to set a time definition, which limits the data that is loaded in the initial query. Setting a time definition on a layer is similar to setting a definition expression and restricts the data to only features that match the input time extent. When you set a time definition on a feature layer in snapshot mode, the features that match the time definition are retrieved once the layer is loaded. If you modify the time definition after the layer is loaded, the existing set of features is destroyed and a new request is made to retrieve the new set of features. The current selection is always maintained and will not be destroyed if you set a new time definition.

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

Querying data using a time extent

You can perform temporal queries against time-aware layers using the timeExtent property on the Query object. For example, you might want to know all crimes that occurred during the night shift from 10 p.m. to 6 a.m. on a particular date:

var ti:TimeExtent = new TimeExtent();
    ti.startTime = new Date("06/13/2012 22:00:00");
    ti.endTime = new Date("06/14/2012 06:00:00");
    var myQuery:Query = new Query();
    myQuery.timeExtent = ti;


The ArcGIS API for Flex has several samples that show how to work with time-aware layers including the following: