예제 #1
0
파일: MapDisplay.cs 프로젝트: CPutz/MyMap
 private Coordinate PointToCoord(int x, int y)
 {
     Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));
     return p.PointToCoord(new Point(x, y));
 }
예제 #2
0
파일: MapDisplay.cs 프로젝트: CPutz/MyMap
        private int LonToX(double lon)
        {
            Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));

            Point point = p.CoordToPoint(new Coordinate(lon, 0));
            return point.X;

            //return (int)(this.Width * (lon - bounds.XMin) / bounds.Width);
        }
예제 #3
0
파일: MapDisplay.cs 프로젝트: CPutz/MyMap
        private double LonFromX(int x)
        {
            Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));

            Coordinate c = p.PointToCoord(new Point(x, 0));
            return c.Longitude;

            //return bounds.XMin + bounds.Width * ((double)x / this.Width);
        }
예제 #4
0
파일: MapDisplay.cs 프로젝트: CPutz/MyMap
        private double LatFromY(int y)
        {
            //Projection p = new Projection(bounds.Height, this.Height);
            Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));

            Coordinate c = p.PointToCoord(new Point(0, y));
            return c.Latitude;

            //return bounds.YMin + bounds.Height * ((double)y / this.Height);
        }
예제 #5
0
파일: MapDisplay.cs 프로젝트: CPutz/MyMap
 private Point CoordToPoint(double lon, double lat)
 {
     Projection p = new Projection(bounds.Width, this.Width, new Coordinate(bounds.XMin, bounds.YMax));
     return p.CoordToPoint(new Coordinate(lon, lat));
 }
예제 #6
0
파일: Renderer.cs 프로젝트: CPutz/MyMap
 /// <summary>
 /// Returns a Point in pixel-coordinates from a Node with
 /// geological coordinates. The Point is in coordinates for the
 /// entire map so it should be converted to coordinates for the
 /// specific tile that is drawn.
 /// </summary>
 private Point nodeToTilePoint(BBox box, Bitmap tile, Node node)
 {
     Coordinate c = new Coordinate(node.Longitude, node.Latitude);
     Projection p = new Projection(box.Width, tile.Width, new Coordinate(box.XMin, box.YMax));
     return p.CoordToPoint(c);
 }