Ejemplo n.º 1
0
 private static BoundingBox WorldToScreen(IViewport viewport, BoundingBox boundingBox)
 {
     var box = new BoundingBox
         {
             Min = viewport.WorldToScreen(boundingBox.Min),
             Max = viewport.WorldToScreen(boundingBox.Max)
         };
     return box;
 }
Ejemplo n.º 2
0
 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
     };
 }
Ejemplo n.º 3
0
 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
     });
 }
Ejemplo n.º 4
0
        private static BoundingBox WorldToScreen(IViewport viewport, BoundingBox boundingBox)
        {
            var box = new BoundingBox
            {
                Min = viewport.WorldToScreen(boundingBox.Min),
                Max = viewport.WorldToScreen(boundingBox.Max)
            };

            return(box);
        }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 6
0
 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)));
 }
Ejemplo n.º 7
0
        /// <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);
            });
        }
Ejemplo n.º 8
0
Archivo: Point.cs Proyecto: xivk/Mapsui
 /// <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));
 }
Ejemplo n.º 9
0
 public static Extent ToExtent(this BoundingBox boundingBox)
 {
     return(new Extent(boundingBox.MinX, boundingBox.MinY, boundingBox.MaxX, boundingBox.MaxY));
 }