예제 #1
0
        /// <summary>
        /// Navigates the <see cref="XamGeographicMap"/> in South direction by specified pan factor - percentage of the current window's height
        /// </summary>
        public static void NavigateSouth(this XamGeographicMap geoMap, double panScaleFactor = GeoMapGlobals.MapPanScaleFactor)
        {
            Rect   window   = geoMap.WindowRect;
            double panScale = window.Width * panScaleFactor;

            window.Y = System.Math.Min(1.0 - window.Height, window.Y + panScale);
            geoMap.NavigateTo(window);
        }
예제 #2
0
        /// <summary>
        /// Navigates the <see cref="XamGeographicMap"/> in North direction by specified pan factor - percentage of the current window's height
        /// </summary>
        public static void NavigateNorth(this XamGeographicMap geoMap, double panScaleFactor = GeoMapGlobals.MapPanScaleFactor)
        {
            Rect   window   = geoMap.WindowRect;
            double panScale = window.Width * panScaleFactor;

            window.Y = System.Math.Max(0.0, window.Y - panScale);
            geoMap.NavigateTo(window);
        }
예제 #3
0
        /// <summary>
        /// Zoom out the <see cref="XamGeographicMap"/> by specified zoom factor - percentage of the current window view rectangle
        /// </summary>
        public static void ZoomOut(this XamGeographicMap geoMap, double zoomScaleFactor = GeoMapGlobals.MapZoomScaleFactor)
        {
            Rect   window     = geoMap.WindowRect;
            double zoomScaleH = window.Height * zoomScaleFactor;
            double zoomScaleW = window.Width * zoomScaleFactor;

            //const double zoomWindowMax = 1.0;

            window.Width  = System.Math.Min(GeoMapGlobals.MapWindowMaxZoom, window.Width + (2 * zoomScaleW));
            window.Height = System.Math.Min(GeoMapGlobals.MapWindowMaxZoom, window.Height + (2 * zoomScaleH));

            //if (window.Width < GeoMapAdapter.MapWindowMaxZoo)
            window.X = System.Math.Max(0.0, window.X - zoomScaleW);
            //if (window.Height < GeoMapAdapter.MapWindowMaxZoo)
            window.Y = System.Math.Max(0.0, window.Y - zoomScaleH);

            geoMap.NavigateTo(window);
        }
예제 #4
0
        /// <summary>
        /// Zoom in the <see cref="XamGeographicMap"/> by specified zoom factor - percentage of the current window view rectangle
        /// </summary>
        public static void ZoomIn(this XamGeographicMap geoMap, double zoomScaleFactor = GeoMapGlobals.MapZoomScaleFactor)
        {
            Rect   window     = geoMap.WindowRect;
            double zoomScaleH = window.Height * zoomScaleFactor;
            double zoomScaleW = window.Width * zoomScaleFactor;

            //const double zoomWindowMin = 0.00005;

            window.Width  = System.Math.Max(GeoMapGlobals.MapWindowMinZoom, window.Width - (2 * zoomScaleW));
            window.Height = System.Math.Max(GeoMapGlobals.MapWindowMinZoom, window.Height - (2 * zoomScaleH));

            //if (window.Width > GeoMapAdapter.MapWindowMinZoom)
            window.X = System.Math.Min(1.0, window.X + zoomScaleW);
            //if (window.Height > GeoMapAdapter.MapWindowMinZoom)
            window.Y = System.Math.Min(1.0, window.Y + zoomScaleH);

            geoMap.NavigateTo(window);
        }
예제 #5
0
 /// <summary>
 /// Navigates the <see cref="XamGeographicMap"/> to max window view rectangle
 /// </summary>
 public static void NavigateToFullView(this XamGeographicMap geoMap)
 {
     geoMap.NavigateTo(GeoMapGlobals.MapWindowMaxView);
 }