//Nearby List Methods***********************************************************************************************************************************************************// private async void getNearbyStops() { if (refreshingNearby == false) { refreshingNearby = true; try { Geocoordinate myCoordinate = await GeoLocator.getMyLocation(); if (myCoordinate != null) { nearbyStops = await OCTranspoStopsData.getCloseStops(myCoordinate.Latitude, myCoordinate.Longitude, currentLocation.ZoomLevel); this.nearbyList.ItemsSource = nearbyStops; setNearbyErrorMessage(true, nearbyStops.Count > 0); } else { nearbySorry.Visibility = nearbyStops.Count == 0 ? Visibility.Visible : Visibility.Collapsed; nearbyFrown.Visibility = nearbyStops.Count == 0 ? Visibility.Visible : Visibility.Collapsed; setNearbyErrorMessage(true, false); } } catch { setNearbyErrorMessage(false, false); } refreshingNearby = false; } }
private void setupMap() { // Map Initialization GeoLocator.centerMapOnCurrentLocation(currentLocation); GeoLocator.drawMapMarkers(currentLocation); // Timer for Map mapTimer = new DispatcherTimer(); mapTimer.Interval = TimeSpan.FromMilliseconds(800); mapTimer.Tick += mapTimer_Tick; }
private void mapTimer_Tick(Object sender, EventArgs args) { if (searching == false) { mapTimer.Stop(); searching = true; //TODO: Called too much, don't get a chance to draw markers before change. GeoLocator.drawMapMarkers(currentLocation); searching = false; loadingProgressBar.IsVisible = false; } }
private void ApplicationBarIconButton_Click_1(object sender, EventArgs e) { loadingProgressBar.Text = "Loading map data ..."; loadingProgressBar.IsVisible = true; mapTimer.Stop(); searching = true; //TODO: Called too much, don't get a chance to draw markers before change. GeoLocator.centerMapOnCurrentLocation(currentLocation); GeoLocator.drawMapMarkers(currentLocation); getNearbyStops(); searching = false; loadingProgressBar.IsVisible = false; }