I am doing a query against an ESRI service and am getting back a feature set with a number of features.I want to zoom on my map so that all of these features. To do this, I used the following code:
map.ZoomTo(new Envelope(featureSet.Features.Min(x => x.Geometry.Extent.XMin), featureSet.Features.Min(x => x.Geometry.Extent.YMin),
featureSet.Features.Max(x => x.Geometry.Extent.XMax), featureSet.Features.Max(x => x.Geometry.Extent.YMax)));
In some cases some of the map that should be shown whenever a zoom happens is not on the screen. I usually have to roll my mouse wheel back a level to see the rest of the map that should be shown. I am guessing that because my map didn't have a scale level to that particular zoom, it rounded down and zoomed in a little farther than it should have. Is there some way I can do a check of some sort to insure that all my features are shown on the map when I zoom?