private static BoundingBox WorldToScreen(IViewport viewport, BoundingBox boundingBox) { var box = new BoundingBox { Min = viewport.WorldToScreen(boundingBox.Min), Max = viewport.WorldToScreen(boundingBox.Max) }; return box; }
private static Rectangle ToXna(BoundingBox boundingBox) { return new Rectangle { X = (int)boundingBox.Left, Y = (int)boundingBox.Bottom, Width = (int)boundingBox.Width, Height = (int)boundingBox.Height }; }
private static Rectangle ToXna(BoundingBox boundingBox) { return(new Rectangle { X = (int)boundingBox.Left, Y = (int)boundingBox.Bottom, Width = (int)boundingBox.Width, Height = (int)boundingBox.Height }); }
private static BoundingBox WorldToScreen(IViewport viewport, BoundingBox boundingBox) { var box = new BoundingBox { Min = viewport.WorldToScreen(boundingBox.Min), Max = viewport.WorldToScreen(boundingBox.Max) }; return(box); }
public static BoundingBox RoundToPixel(BoundingBox dest) { // To get seamless aligning you need to round the // corner coordinates to pixel. The new width and // height will be a result of that. return new BoundingBox( Math.Round(dest.Left), Math.Round(dest.Top), Math.Round(dest.Right), Math.Round(dest.Bottom)); }
public static BoundingBox RoundToPixel(BoundingBox dest) { // To get seamless aligning you need to round the // corner coordinates to pixel. The new width and // height will be a result of that. return(new BoundingBox( Math.Round(dest.Left), Math.Round(dest.Top), Math.Round(dest.Right), Math.Round(dest.Bottom))); }
/// <summary> /// Centre the map on the last used coordinates (start the map in its last position) /// </summary> public void ReCentreMap() { Task.Run(() => { var positionLat = Preferences.Get("LastPositionLatitude", 47.36); var positionLong = Preferences.Get("LastPositionLongitude", 8.54); Mapsui.Geometries.Point centre = new Mapsui.Geometries.Point(positionLong, positionLat); var BBLLx = Double.Parse(Preferences.Get("BBLLx", "100")); var BBLLy = Double.Parse(Preferences.Get("BBLLy", "100")); var BBURx = Double.Parse(Preferences.Get("BBURx", "100")); var BBURy = Double.Parse(Preferences.Get("BBURy", "100")); if (BBLLx != 100) { var bbox = new Mapsui.Geometries.BoundingBox(BBLLx, BBLLy, BBURx, BBURy); Device.BeginInvokeOnMainThread(() => { VMMapView.Navigator.NavigateTo(bbox, ScaleMethod.Fit); }); } var sphericalMercatorCoordinate = SphericalMercator.FromLonLat(centre.X, centre.Y); }); }
/// <summary> /// Returns the distance between this point and a <see cref="BoundingBox" /> /// </summary> /// <param name="box"></param> /// <returns></returns> public double Distance(BoundingBox box) { return(box.Distance(this)); }
public static Extent ToExtent(this BoundingBox boundingBox) { return(new Extent(boundingBox.MinX, boundingBox.MinY, boundingBox.MaxX, boundingBox.MaxY)); }