ThinkGeo.com    |     Documentation    |     Premium Support

Is a FeatureLayer or LayerOverlay in the CurrentExtent

Hey all,

Just wondering the best way to check to see if a layer, or any portion of, say, a feature in a layer, is in the CurrentExtent of a map.

Thanks,
Dib

I may have answered my own question. I decided to loop the layers in the overlay, then the features in each layer. If map.CurrentExtent.Contains(theFeature) = true then that gave me my answer.

If there is an even faster way, I’d love to hear it.

Hi Dib,

If you want to know whether a feature is in current extent, you can use Contains to make sure that.

If you want to know whether a featureLayer is in current extent, please get its bouding box, then use contains or intersect between thsi bouding box and current extent.

Regards,

Don