internal void FullExtent() { if (myMap.LayerNum != 0) { MyRectangle mbr = myMap.GetMBR(); centerLngLat = new PointF(((float)mbr.MaxX + (float)mbr.MinX) * 0.5F, ((float)mbr.MaxY + (float)mbr.MinY) * 0.5F); double x = ETCProjection.Longitude2X(mbr.MaxX) - ETCProjection.Longitude2X(mbr.MinX); double y = ETCProjection.Latitude2Y(mbr.MaxY) - ETCProjection.Latitude2Y(mbr.MinY); double scale1 = x / Width; double scale2 = y / Height; Ratio = Math.Max(scale1, scale2); scaleIndex = maxZoomLevel; UpdateMapImg(); } }