This sample demonstrates how to query data using a time extent. This workflow can be used to return records that are between a specified start and end date. For example, you could specify to only show records that are before September 16, 2000.
Run the sample, and a subset of records will be displayed on the map.
- An instance of
ServiceFeatureTable
is created by passing a URL to the REST endpoint of a time-enabled service. Time-enabled services will have TimeInfo defined in the service description. This information is specified in ArcMap or ArcGIS Pro prior to publishing the service. - The feature request mode of the
ServiceFeatureTable
is set toManualCache
, so that the developer can control how and when the feature table is populated with data. - A
FeatureLayer
is created by passing in the instance of theServiceFeatureTable
. - A
TimeExtent
object is created by specifying start and end date/time objects. - A
QueryParmaters
object is created with theTimeExtent
. ServiceFeatureTable.PopulateFromService
is executed by passing in theQueryParameters
.- The feature table is populated with data that matches the provided query.
- QueryParameters
- ServiceFeatureTable.PopulateFromService
- TimeExtent
Query, Time, Time Extent