/// <summary> /// Calculates the absolute pixel position for a zoom level and tile size relative to origin /// </summary> /// <param name="Point"> </param> /// <param name="mapSize"> precomputed size of map. </param> /// <returns> the relative pixel position to the origin values (e.g. for a tile) </returns> public static Point GetPixelRelative(Point Point, long mapSize, double x, double y) { double pixelX = MercatorProjection.LongitudeToPixelX(Point.X, mapSize) - x; double pixelY = MercatorProjection.LatitudeToPixelY(Point.Y, mapSize) - y; return(new Point(pixelX, pixelY)); }
public static Point GetPixel(Point Point, long mapSize) { double pixelX = MercatorProjection.LongitudeToPixelX(Point.X, mapSize); double pixelY = MercatorProjection.LatitudeToPixelY(Point.Y, mapSize); return(new Point(pixelX, pixelY)); }