• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Maps.Pushpin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Phone.Controls.Maps.Pushpin的典型用法代码示例。如果您正苦于以下问题:C# Pushpin类的具体用法?C# Pushpin怎么用?C# Pushpin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Pushpin类属于Microsoft.Phone.Controls.Maps命名空间,在下文中一共展示了Pushpin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ViewMap

        public ViewMap()
        {
            InitializeComponent();
            GeoCoordinateWatcher gcw;
            gcw = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
            // gcw.PositionChanged += new EventHandler( "");
            gcw.Start();
            GeoCoordinate co;
            co = gcw.Position.Location;
            if (thisApp.Long == -1000 && thisApp.Lat == -1000) { MessageBox.Show("Geographical coordinates have not been set yet."); }
            else { co = new GeoCoordinate((double)thisApp.Lat, (double)thisApp.Long);

            var pushPin = new Pushpin();

            var location = co;
            PushpinLayer.AddChild(pushPin, location);
            
            
            }
            // co.Latitude = 45;
            // co.Longitude = 25;

            map1.SetView(co, 10);


        }
开发者ID:evelinad,项目名称:TaskNotifier,代码行数:26,代码来源:ViewMap.xaml.cs


示例2: WorkoutMapStatisticsPage

        public WorkoutMapStatisticsPage()
        {
            InitializeComponent();
            routeLine = new MapPolyline();
            routeLine.Locations = selectedWorkout.routeLine.Locations; // Where the magic happens: Note: ALL routes MUST have a polyline, otherwise the application WILL ofcourse, CRASH!
            routeLine.Stroke = new SolidColorBrush(Colors.Blue);
            routeLine.StrokeThickness = 5;
            Pushpin pStart = new Pushpin();
            pStart.Content = "Start";
            pStart.Background = new SolidColorBrush(Colors.Green);
            Pushpin pFinish = new Pushpin();
            pFinish.Content = "Finish";
            pFinish.Background = new SolidColorBrush(Colors.Red);
            layer.AddChild(pStart, new GeoCoordinate(routeLine.Locations.First().Latitude, routeLine.Locations.First().Longitude));
            layer.AddChild(pFinish, new GeoCoordinate(routeLine.Locations.Last().Latitude, routeLine.Locations.Last().Longitude));
            map2.Children.Add(routeLine);
            map2.Children.Add(layer);
            textBlock5.Text = selectedWorkout.workoutName;
            textBlock6.Text = selectedWorkout.startTime;
            textBlock7.Text = String.Format("{0:F2}", selectedWorkout.distanceRan);
            textBlock8.Text = string.Format("{0:00}:{1:00}:{2:00}",
               selectedWorkout.elapsedTimeTS.Hours,
                selectedWorkout.elapsedTimeTS.Minutes,
                selectedWorkout.elapsedTimeTS.Seconds); ;

            double latitude;
            double longitude;
            getWorkoutRouteLocation(out latitude, out longitude);

            map2.Center = new GeoCoordinate(latitude, longitude);
            map2.ZoomLevel = 16;
        }
开发者ID:bemk,项目名称:wp7app,代码行数:32,代码来源:WorkoutMapStatisticsPage.xaml.cs


示例3: drawConcertToMap

        void drawConcertToMap()
        {
            map1.Children.Clear();

            //map1.Mode = new AerialMode();

            Pushpin pin = new Pushpin();
            pin.Location = new GeoCoordinate(Double.Parse(concert.Latitude, CultureInfo.InvariantCulture), Double.Parse(concert.Longitude, CultureInfo.InvariantCulture));
            pin.MouseLeftButtonUp += new MouseButtonEventHandler(pinMouseLeftButtonUp);
            pin.Template = (ControlTemplate)this.Resources["PinTemplate"];
            pin.Name = concert.Title;
            map1.Children.Add(pin);

            //Se hace un setView para encuadrar el Mapa. Para esto, se ponen todos los puntos en un IEnumerable y el sistema hace el encuadre solo
            List<GeoCoordinate> l = new List<GeoCoordinate>();
            foreach (Pushpin p in map1.Children)
            {
                l.Add(p.Location);
            }

            loc = l;
            map1.SetView(LocationRect.CreateLocationRect(loc));

            map1.ZoomLevel = 15;
        }
开发者ID:joanromano,项目名称:O-Valiant-Hearts,代码行数:25,代码来源:Map.xaml.cs


示例4: MainPage

        // Constructor
        public MainPage()
        {
            InitializeComponent();

            bikePaths = new BikePaths();
            trees = Tree.ParseCsv();

            map = new Map();
            map.CredentialsProvider = new ApplicationIdCredentialsProvider("Atvj6eBBbDS6-dL7shp9KmzY-0v0NL2ETYCFoHIDzQwK8_9bJ2ZdRgeMAj0sDs_F");

            // Set the center coordinate and zoom level
            GeoCoordinate mapCenter = new GeoCoordinate(45.504693, -73.576494);
            int zoom = 14;

            // Create a pushpin to put at the center of the view
            Pushpin pin1 = new Pushpin();
            pin1.Location = mapCenter;
            pin1.Content = "McGill University";
            map.Children.Add(pin1);

            bikePaths.AddPathsToMap(map);

            // Set the map style to Aerial
            map.Mode = new Microsoft.Phone.Controls.Maps.AerialMode();

            // Set the view and put the map on the page
            map.SetView(mapCenter, zoom);
            ContentPanel.Children.Add(map);
        }
开发者ID:TryCatch22,项目名称:Project-Beaver,代码行数:30,代码来源:MainPage.xaml.cs


示例5: Pushpins

        public void Pushpins(Collection<Marker> markers)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                //this.pushpinCollection.Clear();
                Style style = this.Resources["PushpinMarkerStyle"] as Style;
                //foreach (var item in this.googlemap.Children)
                //{
                //    if (item is Pushpin)
                //    {
                //        this.googlemap.Children.Remove(item);
                //    }
                //}
                foreach (Marker item in markers)
                {
                    Pushpin locationPushpin = new Pushpin();
                    locationPushpin.Background = new SolidColorBrush(Colors.Gray);
                    locationPushpin.Content = Math.Round(item.db);
                    locationPushpin.Location = new GeoCoordinate(item.lat, item.lng);

                    this.googlemap.Children.Add(locationPushpin);
                    //locationPushpin.Style = style;

                    //PushpinModel model = new PushpinModel();
                    //model.Content = Math.Round(item.db).ToString();
                    //model.Location = new GeoCoordinate(item.lat, item.lng);

                    //this.pushpinCollection.Add(model);

                }

                //this.pushpins.DataContext = this.pushpinCollection;
            });
        }
开发者ID:airbai,项目名称:NoiseMap,代码行数:34,代码来源:GoogleMap.xaml.cs


示例6: Tick

        void Tick(object sender, EventArgs e)
        {
            try
            {
                var response = new WebClient();

                response.DownloadStringCompleted += (s, ea) =>
                {
                    JObject parsejson = JObject.Parse(ea.Result);
                    double lat = double.Parse( parsejson["latitude"]["DMS"]["value"].ToString());
                    double lon = double.Parse( parsejson["longitude"]["DMS"]["value"].ToString());

                   // double lat = 35.88923;
                   // double lon = 14.51721;

                    map.Center.Latitude = lat;
                    map.Center.Longitude = lon;

                    Pushpin mypin = new Pushpin();
                    mypin.Location = new GeoCoordinate(lat,lon);
                    map.Children.Add(mypin);

                };

                response.DownloadStringAsync(new Uri(ip + "gps/coordinates"));
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Connection error. Please try again. " + ex.Message);
            }
        }
开发者ID:marssa,项目名称:demonstrator-windowsphone7,代码行数:31,代码来源:NavDisplay.xaml.cs


示例7: GetElement

        /// <summary>
        /// Gets the visual representation of the contents of this container. If it is 
        /// a single pushpin, the pushpin itself is returned. If multiple pushpins are present
        /// a pushpin with the given clusterTemplate is returned.
        /// </summary>
        public FrameworkElement GetElement(DataTemplate clusterTemplate)
        {
            if (_pushpins.Count == 1)
            {
                return _pushpins[0];
            }
            else
            {
                Pushpin retPin = new Pushpin()
                {
                    Location = _pushpins.First().Location,
                    Content = _pushpins.Select(pin => pin.DataContext).ToList(),
                    ContentTemplate = clusterTemplate,
                    Background = new SolidColorBrush((Color)Application.Current.Resources["PhoneAccentColor"])

                };

                retPin.MouseLeftButtonUp += new MouseButtonEventHandler(
                        (object sender, MouseButtonEventArgs e) =>
                        {
                            _map.Center = retPin.Location;
                            _map.ZoomLevel = _map.ZoomLevel + 3;
                        });
                return retPin;
            }
        }
开发者ID:madisp,项目名称:Omnibuss,代码行数:31,代码来源:PushpinContainer.cs


示例8: MapCalls

                public MapCalls()
                {
                        this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentUICulture.Name);
                        InitializeComponent();
                    ((MapCallsViewModel)DataContext).StartLocationService();

                        var bw = new BackgroundWorker();

                        bw.RunWorkerCompleted += (o, e) => {
                                _rvList = ReturnVisitsInterface.GetReturnVisits(SortOrder.DateNewestToOldest, -1);
                                for (_index = 0; _index < _rvList.Length; _index++) {
                                        if (_rvList[_index].Latitude == 0 || _rvList[_index].Longitude == 0){
                                                MakeGeocodeRequest(GetGeocodeAddress(_rvList[_index]));
                                                break;
                                        }
                                    var p = new Pushpin
                                    {
                                        Location = new Location
                                        {
                                            Longitude = _rvList[_index].Longitude,
                                            Latitude = _rvList[_index].Latitude
                                        },
                                        Content = _rvList[_index]
                                    };
                                    p.DoubleTap += POnDoubleTap;
                                        mRvMaps.Children.Add(p);
                                }
                        };
                        bw.RunWorkerAsync();
                }
开发者ID:darthcaedus58,项目名称:my-time-wp7,代码行数:30,代码来源:MapCalls.xaml.cs


示例9: draw_ClockToMap

        //Función para abrir el detalle de una oficina
        //void showOfficeInfo(office o)
        //{
        //    (App.Current as App).selectedOffice = o;
        //    NavigationService.Navigate(new Uri("/officeDetails.xaml", UriKind.Relative));
        /*officeDetails root = Application.Current.RootVisual as officeDetails;
            root.o = o;*/
        //MessageBox.Show(o.nombre);
        //}
        //Dibujamos las oficinas descargadas en el Mapa (y el punto donde nos encontramos
        void draw_ClockToMap()
        {
            map1.Children.Clear();

            //map1.Mode = new AerialMode();

            Pushpin pin = new Pushpin();
            pin.Location = new GeoCoordinate(clock.Lat,  clock.Lng);
            pin.MouseLeftButtonUp += new MouseButtonEventHandler(pin1_MouseLeftButtonUp);
            pin.Template = (ControlTemplate)this.Resources["PushpinClock"];
            pin.Name = clock.City;
            map1.Children.Add(pin);

            //Se hace un setView para encuadrar el Mapa. Para esto, se ponen todos los puntos en un IEnumerable y el sistema hace el encuadre solo
            List<GeoCoordinate> l = new List<GeoCoordinate>();
            foreach (Pushpin p in map1.Children)
            {
                l.Add(p.Location);
            }

            loc = l;
            map1.SetView(LocationRect.CreateLocationRect(loc));

            map1.ZoomLevel = 8;
        }
开发者ID:jordigaset,项目名称:GeoWorld-Clock,代码行数:35,代码来源:map.xaml.cs


示例10: OnNavigatedTo

        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            SystemTray.IsVisible = true;
            _centerId = NavigationContext.QueryString["CenterId"];
            _centerName = NavigationContext.QueryString["CenterName"];

            pivot.Title = _centerName;

            try
            {
                txtNoPacients.Visibility = Visibility.Collapsed;
                txtNoNeeds.Visibility = Visibility.Collapsed;

                _center = (await Service.GetTable<Center>()
                    .Where(t => t.Id == _centerId).ToListAsync()).FirstOrDefault();

                if (e.NavigationMode == NavigationMode.New)
                {
                    var isAttending = (await Service.GetTable<DisasterAttend>()
                    .Where(t => t.DisasterId == _center.DisasterId && t.ParticipantId == App.User.Id)
                    .ToListAsync()).FirstOrDefault();

                    if (App.User.Type == UserType.Medic && isAttending != null)
                    {
                        var button = new ApplicationBarIconButton
                        {
                            IconUri = new Uri("/Assets/AppBar/add.png", UriKind.RelativeOrAbsolute),
                            IsEnabled = true,
                            Text = "add patient"
                        };
                        button.Click += AddPatient_Click;
                        ApplicationBar.Buttons.Add(button);
                    }
                }

                var pin = new Pushpin()
                {
                    Location = new GeoCoordinate(_center.Latitude, _center.Longitude),
                    Content = _centerName,
                };
                map.Children.Add(pin);
                map.Center = new GeoCoordinate(_center.Latitude, _center.Longitude);

                var patients = await Service.GetTable<Pacient>().Where(t => t.CenterId == _centerId).ToListAsync();
                if (patients.Count == 0)
                    txtNoPacients.Visibility = Visibility.Visible;
                else lstPacients.ItemsSource = patients;

                var needs = await Service.GetTable<Needs>().Where(t => t.CenterId == _centerId).ToListAsync();
                if (needs.Count == 0)
                    txtNoNeeds.Visibility = Visibility.Visible;
                else 
                    lstNeeds.ItemsSource = needs;

            }
            catch (Exception ex)
            {
                MessageBox.Show("Something went wrong!");
            }
        }
开发者ID:radu-ungureanu,项目名称:DisasterHelp,代码行数:60,代码来源:ViewCenterDetailsPage.xaml.cs


示例11: watcher_PositionChanged

        void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            if (e.Position.Location.IsUnknown)
            {
                MessageBox.Show("Please wait while your prosition is determined....");
                return;
            }

            this.map.Center = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);

            if (this.map.Children.Count != 0)
            {
                var pushpin = map.Children.FirstOrDefault(p => (p.GetType() == typeof(Pushpin) && ((Pushpin)p).Tag == "locationPushpin"));

                if (pushpin != null)
                {
                    this.map.Children.Remove(pushpin);
                    
                }
            }

            Pushpin locationPushpin = new Pushpin();
            locationPushpin.Background = new SolidColorBrush(Colors.Purple);
            locationPushpin.Content = "You are here";
            locationPushpin.Tag = "locationPushpin";
            locationPushpin.Location = watcher.Position.Location;
            this.map.Children.Add(locationPushpin);
            this.map.SetView(watcher.Position.Location, 10.0);
            locationPushpin.Location = new GeoCoordinate(8.570515, 8.308844);
        }
开发者ID:BarkaBoss,项目名称:MedicNaijaWP7,代码行数:30,代码来源:Map.xaml.cs


示例12: JobMapView_Loaded

        void JobMapView_Loaded(object sender, RoutedEventArgs e)
        {
            mapJobLocation.CredentialsProvider = new ApplicationIdCredentialsProvider(AppResources.BingMapsApiKey);

            // Set the center coordinate and zoom level
            GeoCoordinate mapCenter = new GeoCoordinate(App.JobVM.JobInfo.LocationLatitude, App.JobVM.JobInfo.LocationLongitude);
            int zoom = 15;

            // Create a pushpin to put at the center of the view
            Pushpin pin1 = new Pushpin();
            pin1.Location = mapCenter;
            pin1.Style = (Style)App.Current.Resources["PushpinStyle"];
            TextBlock pinContent = new TextBlock
            {
                Text = App.JobVM.JobInfo.Ranking.ToString(),
                FontSize = 18.667,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
				Style = (Style)App.Current.Resources["PhoneTextYellowStyle"]
            };
            pin1.Content = pinContent;
            mapJobLocation.Children.Add(pin1);

            // Set the map style to Aerial
            mapJobLocation.Mode = new RoadMode();
            isRoadMode = true;

            // Set the view and put the map on the page
            mapJobLocation.SetView(mapCenter, zoom);
        }
开发者ID:deleolowoyo,项目名称:Job-Compass,代码行数:30,代码来源:JobMapView.xaml.cs


示例13: GetElement

        /// <summary>
        /// Gets the visual representation of the contents of this container. If it is 
        /// a single pushpin, the pushpin itself is returned. If multiple pushpins are present
        /// a pushpin with the given clusterTemplate is returned.
        /// </summary>
        public FrameworkElement GetElement(DataTemplate clusterTemplate)
        {
            if (_pushpins.Count == 1)
              {
            return _pushpins[0];

              }
              else
              {
              Pushpin pp = new Pushpin()
            {
              Location = _pushpins.First().Location,
              Content = /*_pushpins.Select(pin => pin.DataContext).Count().ToString()*/_pushpins.Count.ToString(),
              ContentTemplate = clusterTemplate,
              Tag =  _pushpins,
              Background = new SolidColorBrush(Colors.Red)

            };

              pp.MouseLeftButtonUp += (s, e) => {
                                              Pushpin p  = (Pushpin)s;
                                                List<Pushpin> lp = (List<Pushpin>)p.Tag;
                                              MessageBox.Show(lp.Count().ToString());
              };
              return pp;
              }
        }
开发者ID:doddoindan,项目名称:GeoGallery,代码行数:32,代码来源:PushpinContainer.cs


示例14: setupMap

        private void setupMap()
        {
            if (App.ViewModel.Settings.Locations.Count > 0)
            {
                //set the Bing maps key
                map.CredentialsProvider = new ApplicationIdCredentialsProvider(App.ViewModel.Settings.BingMapsKey);

                // Set the center coordinate and zoom level
                GeoCoordinate mapCenter = new GeoCoordinate(App.ViewModel.Settings.Locations[0].Latitude, App.ViewModel.Settings.Locations[0].Longitude);
                int zoom = 15;

                // create a pushpins for each location
                Pushpin pin = null;
                for (int i = 0; i < App.ViewModel.Settings.Locations.Count; i++)
                {
                    pin = new Pushpin();
                    pin.Location = new GeoCoordinate(App.ViewModel.Settings.Locations[i].Latitude, App.ViewModel.Settings.Locations[i].Longitude);
                    pin.Content = App.ViewModel.Settings.Locations[i].Title;
                    map.Children.Add(pin);
                }

                // Set the map style to Aerial
                map.Mode = new RoadMode();

                // Set the view and put the map on the page
                map.SetView(mapCenter, zoom);
            }
            else
            {
                //notify user
            }
        }
开发者ID:ChrisKoenig,项目名称:UTAustin,代码行数:32,代码来源:MapPage.xaml.cs


示例15: OnNavigatedTo

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string stopCoords = "";
            if (NavigationContext.QueryString.TryGetValue("stopCoords", out stopCoords))
            {

                coordsArray = stopCoords.Split(new Char[] { '|' });

                System.Diagnostics.Debug.WriteLine("stopCoords:" + stopCoords);
            }

            for (int i = 0; i < coordsArray.Length; i++)
            {
                String coordStr = coordsArray[i];
                String[] coordTempArray = coordStr.Split(',');

                System.Diagnostics.Debug.WriteLine("coordStr:" + coordStr + "," + coordTempArray[0] + "," + coordTempArray[1]);


                Pushpin p = new Pushpin();
                p.Template = this.Resources["pinStop"] as ControlTemplate;
                p.Location = new GeoCoordinate(Convert.ToDouble(coordTempArray[1]), Convert.ToDouble(coordTempArray[0]));
                mapControl.Items.Add(p);

                //set the first one as the center
                if (i == coordsArray.Length/2)
                {
                    map1.SetView(p.Location, 13.0);
                }
            }

        }
开发者ID:dajaywang,项目名称:hsl-windowsphone,代码行数:34,代码来源:MapDetailPage.xaml.cs


示例16: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.RestoreState();
            string meetingIdToLoad = "0";

            if (NavigationContext.QueryString.TryGetValue("MeetingId", out meetingIdToLoad))
            {
                var foundMeeting = App.ViewModel.UpcomingMeetings.FirstOrDefault(m => m.MeetingId == int.Parse(meetingIdToLoad)) ??
                                   App.ViewModel.PastMeetings.FirstOrDefault(m => m.MeetingId == int.Parse(meetingIdToLoad));

                if (foundMeeting != null)
                {
                    DataContext = foundMeeting;
                    //LocationMap.ZoomBarVisibility = Visibility.Visible;
                    LocationMap.Center = new GeoCoordinate(Convert.ToDouble(33.65467), Convert.ToDouble(-112.17849));
                    LocationMap.ZoomLevel = 11.00;

                    var pin1 = new Pushpin
                                   {
                                       Location = LocationMap.Center,
                                       Content= "Foothills Rec Center",
                                   };
                    LocationMap.Children.Add(pin1);
                }
            }
        }
开发者ID:nwvdnug,项目名称:NWVDNUG-WP7-App,代码行数:26,代码来源:MeetingDetails.xaml.cs


示例17: OnLoadJobComplete

        private void OnLoadJobComplete(bool payload)
        {
            if (payload)
            {
                BuildAppBar();
                // Set the center coordinate and zoom level
                GeoCoordinate mapCenter = new GeoCoordinate(App.JobVM.JobInfo.LocationLatitude, App.JobVM.JobInfo.LocationLongitude);
                int zoom = 15;

                // Create a pushpin to put at the center of the view
                Pushpin pin1 = new Pushpin();
                pin1.Location = mapCenter;
                pin1.Style = (Style)App.Current.Resources["PushpinStyle"];
                TextBlock pinContent = new TextBlock
                {
                    Text = App.JobVM.JobInfo.Ranking.ToString(),
                    FontSize = 18.667,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment = VerticalAlignment.Center
                };
                pin1.Content = pinContent;
                mapJobLocation.Children.Add(pin1);

                // Set the map style to Aerial
                mapJobLocation.Mode = new Microsoft.Phone.Controls.Maps.RoadMode();

                // Set the view and put the map on the page
                mapJobLocation.SetView(mapCenter, zoom);

                //Show or hide application app bar btn
                //appBarApply.IsEnabled = !String.IsNullOrWhiteSpace(App.JobVM.JobInfo.ApplyURL);

            }
        }
开发者ID:deleolowoyo,项目名称:Job-Compass,代码行数:34,代码来源:JobDetailsView.xaml.cs


示例18: SelectDestination

        public SelectDestination()
        {
            InitializeComponent();
            street.Visibility = Visibility.Visible;
            (ApplicationBar.Buttons[1] as ApplicationBarIconButton).IsEnabled = true;
              
            GeoCoordinate geo = new GeoCoordinate();
            geo = MainPage.bookingData.current_location;
            googlemap.Center = geo;
            googlemap.ZoomLevel = 16;

            zzoom.IsEnabled = true;
            positionLoaded = true;

            Microsoft.Phone.Controls.Maps.Pushpin new_pushpin = new Microsoft.Phone.Controls.Maps.Pushpin();
            new_pushpin.Location = geo;

            pushPinCurrentLocation = new MapLayer();

            new_pushpin.Content = "Current Location:\n ";
            new_pushpin.Content += MainPage.bookingData.current_location_address;
            new_pushpin.Visibility = Visibility.Visible;

            googlemap.Children.Add(pushPinCurrentLocation);
            pushPinCurrentLocation.AddChild(new_pushpin, geo, PositionOrigin.BottomLeft);

            
                if (MainPage.bookingData.isDesSet == true)
                {
                    AddressMapping();
                }

 
            
        }
开发者ID:RazaChohan,项目名称:Cab9,代码行数:35,代码来源:SelectDestination.xaml.cs


示例19: watcher_PositionChanged

        void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {



            if (e.Position.Location.IsUnknown)
            {
                MessageBox.Show("Please wait while your prosition is determined....");
                return;
            }

            this.map.Center = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);

            if (this.map.Children.Count != 0)
            {
                var pushpin = map.Children.FirstOrDefault(p => (p.GetType() == typeof(Pushpin) && ((Pushpin)p).Tag == "locationPushpin"));

                if (pushpin != null)
                {
                    this.map.Children.Remove(pushpin);
                    
                }
            }

            Pushpin locationPushpin = new Pushpin();
            locationPushpin.Background = new SolidColorBrush(Colors.Purple);
            locationPushpin.Content = "You are here";
            locationPushpin.Tag = "locationPushpin";
            locationPushpin.Location = watcher.Position.Location;
            this.map.Children.Add(locationPushpin);
            this.map.SetView(watcher.Position.Location, 10.0);
            
            Pushpin hospitalPushpin = new Pushpin();
            Pushpin hospital_Pushpin = new Pushpin();
            Pushpin hospital__Pushpin = new Pushpin();
            
            //hospitalPushpin.Location = watcher.Position.Location;

            String phoneNo = "07069779250";
            hospitalPushpin.Content = "Bingham University Clinic"+"\n"+phoneNo;
            hospitalPushpin.Location = new GeoCoordinate(8.957914, 7.699131);
            //hospitalPushpin.Template = (ControlTemplate)(this.Resources["images/MapPin.png"]);
            hospitalPushpin.MouseLeftButtonUp += new MouseButtonEventHandler(hospitalPushpin_MouseLeftButtonUp);
            this.map.Children.Add(hospitalPushpin);

            String phone_No = "08139698896";
            hospital_Pushpin.Content = "General Hospital Wuse" + "\n" + phone_No;
            hospital_Pushpin.Location = new GeoCoordinate(9.062964, 7.469072);
            //hospitalPushpin.Template = (ControlTemplate)(this.Resources["images/MapPin.png"]);
            hospital_Pushpin.MouseLeftButtonUp += new MouseButtonEventHandler(hospitalPushpin_MouseLeftButtonUp);
            this.map.Children.Add(hospital_Pushpin);

            String phone__No = "08139698896";
            hospital__Pushpin.Content = "General Hospital Karu" + "\n" + phone__No;
            hospital__Pushpin.Location = new GeoCoordinate(9.026158, 7.61304);
            //hospitalPushpin.Template = (ControlTemplate)(this.Resources["images/MapPin.png"]);
            hospital__Pushpin.MouseLeftButtonUp += new MouseButtonEventHandler(hospitalPushpin_MouseLeftButtonUp);
            this.map.Children.Add(hospital__Pushpin);
            }
开发者ID:BarkaBoss,项目名称:MedicNaijaWP7,代码行数:59,代码来源:Map.xaml.cs


示例20: OnNavigatedTo

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string fromToAddress = "";
            //var fromToAddress = NavigationContext.QueryString["fromToAddress"];
            if (NavigationContext.QueryString.TryGetValue("fromToAddress", out fromToAddress))
            {
                addressArray = fromToAddress.Split(new Char[] {'|'});
                fromToListBox.ItemsSource = addressArray;

                System.Diagnostics.Debug.WriteLine("fromToAddress:" + fromToAddress);
            }

            string fromToCoords = "";
            if (NavigationContext.QueryString.TryGetValue("fromToCoords", out fromToCoords))
            {

                coordsArray = fromToCoords.Split(new Char[] { '|' });

                System.Diagnostics.Debug.WriteLine("fromToCoords:" + fromToCoords);
            }

            string latitude = "";
            if (NavigationContext.QueryString.TryGetValue("latitude", out latitude))
            { }

            string longitude = "";
            if (NavigationContext.QueryString.TryGetValue("longitude", out longitude))
            {
                System.Diagnostics.Debug.WriteLine("latitude:" + latitude + ",longitude:" + longitude);

                Pushpin p = new Pushpin();
                p.Template = this.Resources["pinMyLoc"] as ControlTemplate;
                p.Location = new GeoCoordinate(Convert.ToDouble(latitude), Convert.ToDouble(longitude));
                mapControl.Items.Add(p);
            }

            for (int i = 0; i < coordsArray.Length; i++)
            {
                String coordStr = coordsArray[i];
                String [] coordTempArray = coordStr.Split(',');

                System.Diagnostics.Debug.WriteLine("coordStr:" + coordStr + "," + coordTempArray[0] + "," + coordTempArray[1]);


                Pushpin p = new Pushpin();
                p.Template = this.Resources["pinStop"] as ControlTemplate;
                p.Location = new GeoCoordinate(Convert.ToDouble(coordTempArray[1]), Convert.ToDouble(coordTempArray[0]));
                mapControl.Items.Add(p);

                //set the first one as the center
                if (i == 0)
                {
                    map1.SetView(p.Location, 14.0);
                }
            }

        }
开发者ID:dajaywang,项目名称:hsl-windowsphone,代码行数:59,代码来源:FromToAddressResult.xaml.cs



注:本文中的Microsoft.Phone.Controls.Maps.Pushpin类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.Map类代码示例发布时间:2022-05-26
下一篇:
C# Controls.WebBrowser类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap