예제 #1
0
        private void pin_Tapped(object sender, TappedRoutedEventArgs e)
        {
            BusStationsPushPin selected = sender as BusStationsPushPin;

            StaticData.SelectedStationTotal = selected.Tag as StationTotal;

            //StationDetailFlyout stationDetailFlyout = new StationDetailFlyout();
            //stationDetailFlyout.Show();

            CustomControlGrid.Children.Clear();

            StationDetailControl stationDetailControl = new StationDetailControl(map);

            stationDetailControl.HorizontalAlignment = HorizontalAlignment.Right;
            CustomControlGrid.Children.Add(stationDetailControl);

            CloseControl cc = new CloseControl();

            cc.VerticalAlignment   = VerticalAlignment.Top;
            cc.HorizontalAlignment = HorizontalAlignment.Right;
            CustomControlGrid.Children.Add(cc);
        }
예제 #2
0
        private void AddPushPin()
        {
            pushPin = new MapLayer();
            UTMConverter utmConverter = new UTMConverter();

            foreach (StationTotal temp in StaticData._stationCollection)
            {
                BusStationsPushPin pin = new BusStationsPushPin();
                utmConverter.ToLatLon(temp.latitude, temp.longitude, 48, 0);

                Location location = new Location(utmConverter.Latitude, utmConverter.Longitude);

                string pushPinContent = "";
                string busNumTemp     = "";

                foreach (Bus busTemp in temp.busList)
                {
                    if (busNumTemp != busTemp.busNumber)
                    {
                        pushPinContent = pushPinContent + " - " + busTemp.busNumber;
                        busNumTemp     = busTemp.busNumber;
                    }
                }

                pin.TextContent = pushPinContent;
                pin.Width       = double.NaN;
                pin.Tag         = temp;
                pin.Tapped     += pin_Tapped;

                pushPin.Children.Add(pin);

                MapLayer.SetPosition(pin, location);
            }

            map.Children.Add(pushPin);
        }