In my silverlight apps i am trying to have the map zoom to the results of queries or GP tasks (graphics layers) with the following C# code:MyMap.ZoomTo(graphicsLayer.FullExtent)When i do so, the furthest outlying feature is right on the edge of the map. So I want to zoom to something just greater than the full extent so there is a little space between my furthest out feature and the edge of the map.So I came up with something like this: Envelope myExtent = new Envelope(); myExtent.XMax = ((graphicsLayer.FullExtent.XMax) + 0.02); myExtent.XMin = ((graphicsLayer.FullExtent.XMin) - 0.02); myExtent.YMax = ((graphicsLayer.FullExtent.YMax) + 0.02); myExtent.YMin = ((graphicsLayer.FullExtent.YMin) - 0.02); //MyMap.ZoomTo(graphicsLayer.FullExtent) MyMap.ZoomTo(myExtent);But this only works for zooming in a narrow range of scales. If scales vary greatly this kind of approach does not work well. Have you seen any examples of a better way to do this??
Have you tried :myMap.Zoom();Please check the below linkhttp://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Map~Zoom.htmlhttp://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Map~ZoomFactor.html
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.