예제 #1
0
 private void SetExtent(SimpleMapPoint pt1, SimpleMapPoint pt2)
 {
     minx = Math.Min(pt1.x, pt2.x);
     miny = Math.Min(pt1.y, pt2.y);
     maxx = Math.Max(pt1.x, pt2.x);
     maxy = Math.Max(pt1.y, pt2.y);
 }
예제 #2
0
        public Point ToScreenP(SimpleMapPoint mp)
        {
            int sx = ScreenCenter.X - (int)((MapCenter.x - mp.x) / scale);
            int sy = ScreenCenter.Y - (int)((mp.y - MapCenter.y) / scale);

            return(new Point(sx, sy));
        }
예제 #3
0
 public void Update(SimpleMapPoint _center, double _scale, Rectangle currentRect)
 {
     MapCenter    = _center;
     scale        = _scale;
     ScreenRect   = currentRect;
     ScreenCenter = new Point(currentRect.Width / 2, currentRect.Height / 2);
 }
예제 #4
0
 public MapPoint(double _x, double _y)
 {
     thispoint    = new SimpleMapPoint(_x, _y);
     ObjectType   = SPATIALOBJECTTYPE.POINT;
     Centroid     = new SimpleMapPoint(_x, _y);
     ObjectExtent = new MapExtent(thispoint, thispoint);
 }
예제 #5
0
        public void draw(int index, PictureBox pb, SimpleMapPoint location)
        {
            Graphics g = pb.CreateGraphics();

            g.DrawString(values[index].ToString(),
                         new Font("宋体", 20), new SolidBrush(Color.Green),
                         new PointF((float)(location.x), (float)(location.y)
                                    ));
        }
예제 #6
0
 public MapLine(double[] x, double[] y, int startindex, int count)
 {
     points = new SimpleMapPoint[count];
     for (int i = 0; i < count; i++)
     {
         points[i] = new SimpleMapPoint(x[startindex + i], y[startindex + i]);
     }
     Init();
 }
예제 #7
0
 public MapExtent(SimpleMapPoint pt1, SimpleMapPoint pt2)
 {
     SetExtent(pt1, pt2);
 }
예제 #8
0
        public double scale;  //how many map units in each pixel

        public MapView(SimpleMapPoint _center, double _scale, Rectangle currentRect)
        {
            Update(_center, _scale, currentRect);
        }