private Point64 LatLongZoomToPixel(LatLonZoom p) { double num = Math.Sin(CoordinateSystemUtilities.DegreesToRadians(p.lat)); double num2 = 6378137.0 * CoordinateSystemUtilities.DegreesToRadians(p.lon); double num3 = 3189068.5 * Math.Log((1.0 + num) / (1.0 - num)); double num4 = this.MetersPerPixel(p.zoom); return(new Point64((long)Math.Round((20037508.342789244 + num2) / num4), (long)Math.Round((20037508.342789244 - num3) / num4))); }
public static LatLon LatLonToMercator(LatLon latlon) { double num = Math.Sin(CoordinateSystemUtilities.DegreesToRadians(latlon.lat)); double num2 = 6378137.0 * CoordinateSystemUtilities.DegreesToRadians(latlon.lon); double num3 = 3189068.5 * Math.Log((1.0 + num) / (1.0 - num)); double num4 = 40075016.685578488; return(new LatLon((20037508.342789244 - num3) / num4, (20037508.342789244 + num2) / num4)); }