C# Mapx查看全图
 /// <summary>
        /// 全图显示
        /// </summary>
        private void ZoomEntire()
        {
            if (axMap.Layers.Count == 0)return;
            else if (axMap.Layers.Count == 1)
            {
                axMap.CtlBounds = axMap.Layers[1].Bounds;
            }
            else
            {
                double viewXMin = axMap.Layers[1].Bounds.XMin;
                double viewXMax = axMap.Layers[1].Bounds.XMax;
                double viewYMin = axMap.Layers[1].Bounds.YMin;
                double viewYMax = axMap.Layers[1].Bounds.YMax;
                for (int i = 2; i <= axMap.Layers.Count; i++)
                {
                    double xMin, xMax, yMin, yMax;
                    xMin = axMap.Layers[i].Bounds.XMin;
                    xMax = axMap.Layers[i].Bounds.XMax;
                    yMin = axMap.Layers[i].Bounds.YMin;
                    yMax = axMap.Layers[i].Bounds.YMax;
                    if (xMin < viewXMin)
                    {
                        viewXMin = xMin;
                    }
                    if (yMin < viewYMin)
                    {
                        viewYMin = yMin;
                    }
                    if (xMax > viewXMax)
                    {
                        viewXMax = xMax;
                    }
                    if (yMax > viewYMax)
                    {
                        viewYMax = yMax;
                    }
                }
                MapXLib.Rectangle viewBounds = new MapXLib.Rectangle();
                viewBounds.Set(viewXMin, viewYMin, viewXMax, viewYMax);
                axMap.CtlBounds = viewBounds;
            }
        }
 
                    
                     
                    
                 
                    
                 
         
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号