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

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