自写地图全图功能

public static void ShowFullEextent(Map map)
    {
        ESRI.ArcGIS.ADF.Web.Geometry.Envelope fullExtent = null;
        foreach (IMapFunctionality imf in map.GetFunctionalities())
        {
            MapFunctionality mf = imf as MapFunctionality;
            ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapDescription = mf.MapDescription;
            ESRI.ArcGIS.ADF.ArcGISServer.Envelope envServer = mapDescription.MapArea.Extent;
            ESRI.ArcGIS.ADF.Web.Geometry.Envelope env = null;
            env = ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToAdfGeometry(
                envServer) as ESRI.ArcGIS.ADF.Web.Geometry.Envelope;
            if (fullExtent == null)
            {
                fullExtent = env;
            }
            else
            {
                fullExtent.Union(env);
            }
        }

        map.Extent = fullExtent;
        map.Refresh();
    }
一起学习GIS及其二次开发,一起进步!
原文地址:https://www.cnblogs.com/tuncaysanli/p/1507745.html