The steps are as follows:
I have added a feature layer to the map and retrieved the bounding box using: featureLayer.GetBoundingBox();
Next, I combine this bounding box retrieved with the current extent of the map to get a new bounding box.
Then I use this new bounding box as the map’s current extent. After refreshing the map, it does not zoom or pan to the new features. I do see the features on the map but it is not centered around these features. The code looks somewhat like this:
if (featureLayer.IsOpen)
{
bbox = featureLayer.GetBoundingBox();
featureLayer.Close();
// i just chose a random width of 5. This should depend on projection.
if (bbox.Width > 5)
{
var nextExtent = MapView.CurrentExtent.Union(bbox).GetBoundingBox();
MapView.CurrentExtent = nextExtent;
}
}
Somewhere later in the code, I do refresh the map.
What am I missing guys?