protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); BusStopAll receiveData = (BusStopAll)e.Parameter; if (receiveData != null) { latitude = receiveData.Lat; longitude = receiveData.Lon; id = receiveData.BusStopId; stop = receiveData.BusStopName; title.Text = stop; GetStopBusTimesAsync(id); // Async refresh if (MainPage.isMapElementsLayersAPIPresent) { MapElementsLayer layer = new MapElementsLayer { ZIndex = 1 }; map.Layers.Add(layer); List <MapElement> BusStopMarkers = new List <MapElement>(); BasicGeoposition stopPosition = new BasicGeoposition { Latitude = latitude, Longitude = longitude }; map.Center = new Geopoint(stopPosition); map.ZoomLevel = 17; BusStopMarkers.Add(new MapIcon { Location = new Geopoint(stopPosition), NormalizedAnchorPoint = new Point(0.5, 1.0), ZIndex = 0, Title = stop } ); layer.MapElements = BusStopMarkers; } } }
private void NearbyBusStop_ItemClick(object sender, ItemClickEventArgs e) { BusStopLineDirection clickedMenuItem = (BusStopLineDirection)e.ClickedItem; if (clickedMenuItem != null) { BusStopAll stopInfo = clickedMenuItem.BusStopInfo; if (stopInfo != null) { Debug.WriteLine(stopInfo.BusStopName); Frame root = Window.Current.Content as Frame; root.Navigate(typeof(StopDetail), stopInfo); } } }