Esempio n. 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);
 }
Esempio n. 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));
        }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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)
                                    ));
        }
Esempio n. 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();
 }
Esempio n. 7
0
 public MapExtent(SimpleMapPoint pt1, SimpleMapPoint pt2)
 {
     SetExtent(pt1, pt2);
 }
Esempio n. 8
0
        public double scale;  //how many map units in each pixel

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