예제 #1
0
        private void _map_ViewChangeEnded(object sender, ViewChangeEndedEventArgs e)
        {
            if (_zoom != _map.ZoomLevel)
            {
                _zoomed = true;
                _zoom   = _map.ZoomLevel;
            }
            else
            {
                _zoomed = false;
            }

            if (_center.Latitude != _map.Center.Latitude || _center.Longitude != _map.Center.Longitude)
            {
                _panned = true;
                _center = _map.Center;
            }
            else
            {
                _panned = false;
            }

            _lastMovement = DateTime.Now;
            _isMoving     = false;
        }
예제 #2
0
        /// <summary>
        /// Fires when map panning is complete, and the current bounds of the map can be accessed to apply the points of interest
        /// (note that using TargetBounds in lieu of the event handler led to different results for the same target location depending ont
        /// the visibilty of the map at the time of invocation - i.e., a navigation initiated from the search results pages reported sligthly
        /// offset TargetBounds
        /// </summary>
        async void TheMap_ViewChangeEndedWithRefreshNeeded(object sender, ViewChangeEndedEventArgs e)
        {
            // refresh the left panel to reflect points of interest in current view
            await LeftPanel.Refresh(new BoundingBox(TheMap.TargetBounds.North, TheMap.TargetBounds.South, TheMap.TargetBounds.West, TheMap.TargetBounds.East));

            // unregister the handler
            TheMap.ViewChangeEnded -= TheMap_ViewChangeEndedWithRefreshNeeded;
        }
예제 #3
0
        /// <summary>
        /// Called when the map view change ends.  Store the map view and if we zoom out far enough,
        /// clear the bus stops.
        /// </summary>
        private void OnMapViewChangeEnded(object sender, ViewChangeEndedEventArgs e)
        {
            this.MapView = new MapView(new Model.Point(map.Center.Latitude, map.Center.Longitude),
                                       map.ZoomLevel,
                                       map.Bounds.Height,
                                       map.Bounds.Width);

            NavigationController.Instance.MapView = this.MapView;
        }
예제 #4
0
        private void MapViewViewChangeEnded(object sender,
                                            ViewChangeEndedEventArgs e)
        {
            if (_lastFocusedMapPin != null && _lastFocusedMapPin.Focused)
            {
                _lastFocusedMapPin.UnFocus();
            }

            if (_focusedMapPin != null && !_focusedMapPin.Focused)
            {
                _focusedMapPin.Focus();
            }
        }
예제 #5
0
        async void _map_ViewChangeEnded(object sender, ViewChangeEndedEventArgs e)
        {
            bool WasUserInitiated = pointerIsDragging;

            if (WasUserInitiated)
            {
                MainMap.SetView(MainMap.Center);
                pointerIsDragging = false;
                await Task.Delay(2000);

                if (helper.hasInternet(false))
                {
                    vm.MyLocation = MainMap.Center;
                    MainMap.SetView(vm.MyLocation);
                    //Tryout
                    //Bing.Maps.LocationRect boundingRect = vm.GetLocationsRect(vm.Pushpins);
                    //MainMap.SetView(boundingRect);
                    await vm.loadPins();
                }
            }
            //MainMap.UpdateLayout();
        }
예제 #6
0
        /// <summary>
        /// Called when the map view change ends.  Store the map view and if we zoom out far enough, 
        /// clear the bus stops.
        /// </summary>
        private void OnMapViewChangeEnded(object sender, ViewChangeEndedEventArgs e)
        {
            this.MapView = new MapView(new Model.Point(map.Center.Latitude, map.Center.Longitude),
                map.ZoomLevel,
                map.Bounds.Height,
                map.Bounds.Width);

            NavigationController.Instance.MapView = this.MapView;

            //if (!this.hasShownOhMyDialog)
            //{
            //    lock (this)
            //    {
            //        if (!this.hasShownOhMyDialog)
            //        {
            //            // If we're zoomed out too far and we haven't shown the oh my dialog yet, show it now:
            //            if (this.RefreshBusStopsOnMapViewChanged && this.MapView.ZoomLevel < UtilitiesConstants.MinBusStopVisibleZoom)
            //            {
            //                this.hasShownOhMyDialog = true;
            //                var messageDialog = new MessageDialog("There are too many results. Try zooming in to street level.", "oh my");
            //                messageDialog.DefaultCommandIndex = 0;
            //                var ignored = messageDialog.ShowAsync().AsTask().ContinueWith(command =>
            //                    {
            //                        ApplicationData.Current.LocalSettings.Values[UtilitiesConstants.OH_MY_KEY] = true;
            //                    });
            //            }
            //        }
            //    }
            //}
        }
        /// <summary>
        /// Called when the map view change ends.  Store the map view and if we zoom out far enough, 
        /// clear the bus stops.
        /// </summary>
        private void OnMapViewChangeEnded(object sender, ViewChangeEndedEventArgs e)
        {
            this.MapView = new MapView(new Model.Point(map.Center.Latitude, map.Center.Longitude),
                map.ZoomLevel,
                map.Bounds.Height,
                map.Bounds.Width);

            NavigationController.Instance.MapView = this.MapView;
        }
예제 #8
0
        private void MapViewViewChangeEnded(object sender,
            ViewChangeEndedEventArgs e)
        {
            if (_lastFocusedMapPin != null && _lastFocusedMapPin.Focused)
                _lastFocusedMapPin.UnFocus();

            if (_focusedMapPin != null && !_focusedMapPin.Focused)
                _focusedMapPin.Focus();
        }
        /// <summary>
        /// Fires when map panning is complete, and the current bounds of the map can be accessed to apply the points of interest
        /// (note that using TargetBounds in lieu of the event handler led to different results for the same target location depending ont 
        /// the visibilty of the map at the time of invocation - i.e., a navigation initiated from the search results pages reported sligthly
        /// offset TargetBounds
        /// </summary>
        async void TheMap_ViewChangeEndedWithRefreshNeeded(object sender, ViewChangeEndedEventArgs e)
        {
            // refresh the left panel to reflect points of interest in current view
            await LeftPanel.Refresh(new BoundingBox(TheMap.TargetBounds.North, TheMap.TargetBounds.South, TheMap.TargetBounds.West, TheMap.TargetBounds.East));

            // unregister the handler
            TheMap.ViewChangeEnded -= TheMap_ViewChangeEndedWithRefreshNeeded;
        }
예제 #10
0
 void Map_ViewChangeEnded(object sender, ViewChangeEndedEventArgs e)
 {
     View_Lo         = Map.Center.Longitude  ;
     View_La         = Map.Center.Latitude   ;
     View_ZoomLevel  = Map.ZoomLevel         ;
 }