mark1984

Time and FeatureLayers

Discussion created by mark1984 on Jan 7, 2011
Latest reply on Jan 14, 2011 by mark1984
Hi,

I am using a FeatureLayer to map points stored in a SQL Database. When I edit my service to enable Time on the layer the FeatureLayer stops showing anything. I thought perhaps I needed to set a TimeExtent but still nothing.

What do I need to do to get my FeatureLayer working again now that I have enabled Time on the service?

var featureLayer = new esri.layers.FeatureLayer(http://intranet/ArcGIS/rest/services/LORD/MYSERVICE/MapServer/0",{
                mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
                outFields: ["NUMBER, GRID_TYPE"]
});
 
var timeExtent = new esri.TimeExtent();
timeExtent.startTime = new Date("1/1/1999 UTC");
timeExtent.endTime = new Date("12/31/2020 UTC");
featureLayer.setTimeDefinition(timeExtent);
 
map.addLayer(featureLayer);

Many thanks,

Mark

Outcomes