diff --git a/MapControl/Shared/MetricGrid.cs b/MapControl/Shared/MetricGrid.cs index 6d583c2f..df69464c 100644 --- a/MapControl/Shared/MetricGrid.cs +++ b/MapControl/Shared/MetricGrid.cs @@ -47,7 +47,7 @@ namespace MapControl var p2 = ParentMap.ViewTransform.MapToView(new Point(x, mapRect.Y + mapRect.Height)); figures.Add(CreateLineFigure(p1, p2)); - var text = string.Format("{0:F0}", x); + var text = x.ToString("F0"); labels.Add(new Label(text, p1.X, p1.Y, 0d, HorizontalAlignment.Left, VerticalAlignment.Bottom)); labels.Add(new Label(text, p2.X, p2.Y, 0d, HorizontalAlignment.Left, VerticalAlignment.Top)); } @@ -58,7 +58,7 @@ namespace MapControl var p2 = ParentMap.ViewTransform.MapToView(new Point(mapRect.X + mapRect.Width, y)); figures.Add(CreateLineFigure(p1, p2)); - var text = string.Format("{0:F0}", y); + var text = y.ToString("F0"); labels.Add(new Label(text, p1.X, p1.Y, 0d, HorizontalAlignment.Left, VerticalAlignment.Bottom)); labels.Add(new Label(text, p2.X, p2.Y, 0d, HorizontalAlignment.Right, VerticalAlignment.Bottom)); } diff --git a/MapProjections/Shared/ProjNetMapProjection.cs b/MapProjections/Shared/ProjNetMapProjection.cs index 85c1dbc9..4b89188e 100644 --- a/MapProjections/Shared/ProjNetMapProjection.cs +++ b/MapProjections/Shared/ProjNetMapProjection.cs @@ -199,6 +199,7 @@ namespace MapControl.Projections { var sign = Math.Sign(LatitudeOfOrigin); var phi = sign * latitude * Math.PI / 180d; + var e = Math.Sqrt((2d - Flattening) * Flattening); var eSinPhi = e * Math.Sin(phi); var t = Math.Tan(Math.PI / 4d - phi / 2d)