I have a custom layer that derives from a FeatureLayer. I need to get the bounding box for this layer. I was expecting the following to work:
GrowerLayer.Open();
RectangleShape r = GrowerLayer.GetBoundingBox();
GrowerLayer.Close();
However, this throws an exception on the GetBoundingBox call, indicating that there is no bounding box for the layer.
I can execute the following, though, and I'm fine:
GrowerLayer.FeatureSource.Open();
RectangleShape r = GrowerLayer.FeatureSource.GetBoundingBox();
GrowerLayer.FeatureSource.Close();
I can override the Layer.GetBoundingBoxCore() method, but I was expecting the base FeatureLayer implementation to open my FeatureSource and get teh BoundingBox automatically.
Maybe the issue (if there is one) is in the HasBoundingBox implementation instead? I assume that's used inside the GetBoundingBox function, to determine if an error should be thrown.
Can you confirm that 1) I have an error in my implementation, 2) that this is behavior as designed, or 3) it is a bug that will be addressed?
Thanks!