How to zoom to features

612
3
04-12-2013 06:58 AM
GeoAticoPUJ
New Contributor
Hi guys,

I´m developing an application that uses the time slider and I need to zoom to features that correspond to the selected time extent.  I don't know if time slider returns an array of features or graphics so i can use it for setting the map extent or something like that.

Thanks for your help.
0 Kudos
3 Replies
by Anonymous User
Not applicable
Hi mcubides,

Here are some samples that may help: samples

You could zoom to the selected features, or graphics by using this: esri.graphicsExtent(graphics)
0 Kudos
GeoAticoPUJ
New Contributor
Thanks Chris, but how can i get the array of graphics corresponding to the time extent selected in time slider.

Any ideas, thanks.
0 Kudos
by Anonymous User
Not applicable
In the Feature Layer class there are some methods you can use to query the data, check out the selectFeatures method as well as esri.layers.FeatureLayer.MODE_SELECTION.

dojo.connect(yourTimeSlider, "onTimeExtentChange", function(timeExtent) {
   yourFeatureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {
       // do something with the features here
   });
});
0 Kudos