Is This Content Helpful?
We're glad to know this article was helpful.
When you set a filter to a FeatureLayer by calling yourFeatureLayer.setFilterObject(yourFilter) method, this will return a new Recordset which contains the selected features as per filter definition. This article explains about how to get the Bounding Envelope of the individual features as well as Global Envelope of all features from the Recordset.
You may only set Global Envelope to true and leave Bounding Envelope to a default false if you choose not to have Bounding Envelope returned in the Recordset.
int count = yourFeatureLayer.getRecordset().getCount();
Envelope globalEnvelope = yourFeatureLayer.getRecordset().getEnvelope(count);
If you did not set Bounding Envelope to true in the filter, use this code instead:
for (int i=0;i<fLayer.getRecordset().getCount();i++)
env [i] =fLayer.getRecordset().getEnvelope(i);
If you did not set the Bounding Envelope to true in the filter, you won't be able to get the bounding envelope as above.