if (layer != null && layer.FullExtent != null) { if ((layer.FullExtent.Width > 0.0) || (layer.FullExtent.Height > 0.0)) { this.maplegend.Map.ZoomTo(layer.FullExtent); } else { this.maplegend.Map.PanTo(layer.FullExtent.GetCenter()); } }
Solved! Go to Solution.
Hi,
The Map control will re-project graphics layers and feature layers but for all other types of service layer the reprojection is handled on the server. The spatial reference of the service itself and the spatial reference of the full extent property remain unaffected and it is just the image rendered by the server which is re-projected. This means you will need to consider getting the envelope and using a LocalGeometryService or online GeometryServer to perform the reprojection before calling zoom to.
Cheers
Mike