public ObjectBounds GetMapCenter() { //PointF point1 = new PointF(0, 0); //Size size = mapControl1.ClientSize; //PointF point2 = new PointF(size.Width, size.Height); //ObjectBounds Showboduns = new ObjectBounds(); //Showboduns.LeftTopLatitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point1).Y; //Showboduns.LeftTopLongitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point1).X; //Showboduns.RightButtomLatitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point2).Y; //Showboduns.RightButtomLongitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point2).X; //return Showboduns; Envelope envelop = mapControl1.CurrentMapBox.Map.Envelope; ObjectBounds Showboduns = new ObjectBounds(); Showboduns.LeftTopLatitude = envelop.MinX; Showboduns.LeftTopLongitude = envelop.MinY; Showboduns.RightButtomLatitude = envelop.MaxX; Showboduns.RightButtomLongitude = envelop.MaxY; return(Showboduns); }
public void SetMapshowBounds(ObjectBounds mapBounds) { Envelope envelop = new Envelope(mapBounds.LeftTopLongitude, mapBounds.RightButtomLongitude, mapBounds.LeftTopLatitude, mapBounds.RightButtomLatitude); // this.m_viewBox.Map.Zoom = 3; this.mapBox.Map.ZoomToBox(envelop); this.mapBox.Refresh(); }
public ObjectBounds GetMapCenter() { PointF point1 = new PointF(0, 0); Size size = mapBox.ClientSize; PointF point2 = new PointF(size.Width, size.Height); ObjectBounds Showboduns = new ObjectBounds(); Showboduns.LeftTopLatitude = (float)mapBox.Map.ImageToWorld(point1).Y; Showboduns.LeftTopLongitude = (float)mapBox.Map.ImageToWorld(point1).X; Showboduns.RightButtomLatitude = (float)mapBox.Map.ImageToWorld(point2).Y; Showboduns.RightButtomLongitude = (float)mapBox.Map.ImageToWorld(point2).X; return Showboduns; }
public void ChangedMapCenter(ObjectBounds Bounds,MainControl mainControl) { if (mainControl.mapControl1.CurrentMapBox.Map != null) { // if (Bounds.LeftTopLatitude > 0 && Bounds.RightButtomLatitude > 0 && Bounds.LeftTopLongitude > 0 && Bounds.RightButtomLongitude > 0) // { Envelope envelop = new Envelope(Bounds.LeftTopLatitude, Bounds.RightButtomLatitude, Bounds.LeftTopLongitude, Bounds.RightButtomLongitude); mainControl.mapControl1.CurrentMapBox.Map.ZoomToBox(envelop); mainControl.mapControl1.CurrentMapBox.Refresh(); //} } }
public ObjectBounds GetMapCenter() { //PointF point1 = new PointF(0, 0); //Size size = mapControl1.ClientSize; //PointF point2 = new PointF(size.Width, size.Height); //ObjectBounds Showboduns = new ObjectBounds(); //Showboduns.LeftTopLatitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point1).Y; //Showboduns.LeftTopLongitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point1).X; //Showboduns.RightButtomLatitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point2).Y; //Showboduns.RightButtomLongitude = (float)mapControl1.CurrentMapBox.Map.ImageToWorld(point2).X; //return Showboduns; Envelope envelop = mapControl1.CurrentMapBox.Map.Envelope; ObjectBounds Showboduns = new ObjectBounds(); Showboduns.LeftTopLatitude = envelop.MinX; Showboduns.LeftTopLongitude = envelop.MinY; Showboduns.RightButtomLatitude = envelop.MaxX; Showboduns.RightButtomLongitude = envelop.MaxY; return Showboduns; }