Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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)));
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 6
0
 /// <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);
 }