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); }
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)); }
public void Update(SimpleMapPoint _center, double _scale, Rectangle currentRect) { MapCenter = _center; scale = _scale; ScreenRect = currentRect; ScreenCenter = new Point(currentRect.Width / 2, currentRect.Height / 2); }
public MapPoint(double _x, double _y) { thispoint = new SimpleMapPoint(_x, _y); ObjectType = SPATIALOBJECTTYPE.POINT; Centroid = new SimpleMapPoint(_x, _y); ObjectExtent = new MapExtent(thispoint, thispoint); }
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) )); }
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(); }
public MapExtent(SimpleMapPoint pt1, SimpleMapPoint pt2) { SetExtent(pt1, pt2); }
public double scale; //how many map units in each pixel public MapView(SimpleMapPoint _center, double _scale, Rectangle currentRect) { Update(_center, _scale, currentRect); }