当前位置: 首页>>代码示例>>C#>>正文


C# GeoPositionChangedEventArgs类代码示例

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


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

示例1: watcher_PositionChanged

        private void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            Logger.Log(String.Format("Position changed: Unknown: {2}, Lat: {0}, Long: {1}", e.Position.Location.Latitude.ToString(), e.Position.Location.Longitude.ToString(), e.Position.Location.IsUnknown));
            this.currentGeoLocation = e.Position.Location;

            OnNewLocationAvailable();
        }
开发者ID:Saldash,项目名称:ProxySwitcher,代码行数:7,代码来源:LocationManager.cs

示例2: GeoWatcherPositionChanged

        private void GeoWatcherPositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            var accuracy = e.Position.Location.HorizontalAccuracy;

            loadData(e.Position.Location.Latitude.ToString(), e.Position.Location.Longitude.ToString());
            _geoWatcher.Stop();
        }
开发者ID:cameronwebbable,项目名称:HotelSonar,代码行数:7,代码来源:MenuView.xaml.cs

示例3: watcher_PositionChanged

 void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
     {
         tb_Latitude.Text = e.Position.Location.Latitude.ToString();
         tb_Longitude.Text = e.Position.Location.Longitude.ToString();
 
 
 }
开发者ID:poczans,项目名称:mojeapki,代码行数:7,代码来源:MainPage.xaml.cs

示例4: WatcherOnPositionChanged

        private void WatcherOnPositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            try
            {
                if (DateTime.Now.TimeOfDay.Subtract(_lastTimeSend) >= _minSendTime)
                {
                    _geozoneRequest.Lat = e.Position.Location.Latitude;
                    _geozoneRequest.Lon = e.Position.Location.Longitude;

                    WebClient webClient = new WebClient();
                    webClient.UploadStringCompleted += (o, args) =>
                                                           {
                                                                   if (args.Error == null)
                                                                   {
                                                                       JObject jRoot = JObject.Parse(args.Result);

                                                                       if (JsonHelpers.GetStatusCode(jRoot) == 200)
                                                                       {
                                                                           double dist = jRoot["response"].Value<double>("distance");
                                                                           if (dist > 0)
                                                                               LazyWatcher.MovementThreshold = dist / 2;
                                                                       }
                                                                   }
                                                           };
                    string request = string.Format("{{\"request\":{0}}}", JsonConvert.SerializeObject(_geozoneRequest));
                    webClient.UploadStringAsync(Constants.GeozoneUrl, request);

                    _lastTimeSend = DateTime.Now.TimeOfDay;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Error when handling position change: " + ex.ToString());
            }
        }
开发者ID:no7boy,项目名称:push-notifications-sdk,代码行数:35,代码来源:GeozoneService.cs

示例5: MyPositionChanged

        void MyPositionChanged(GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            // Update the TextBlocks to show the current location
            //textBlock4.Text = e.Position.Location.Latitude.ToString("0.000000000");
            //textBlock5.Text = e.Position.Location.Longitude.ToString("0.000000000");
            map1.Center = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);
            pin1.Location = e.Position.Location;
            map1.SetView(pin1.Location, 18);

            //textBox4.Text = e.Position.Location.VerticalAccuracy.ToString();

            if (e.Position.Location.HorizontalAccuracy < 30 && e.Position.Location.VerticalAccuracy < 30)
            {
                textBlock3.Text = "GPS Locked, Press Start to Begin";
                locked = true;
            }
            else
            {
                if (locked==false)
                textBlock3.Text = "Please Wait, GPS Locking";
            }

            if (start == true)
            {
                _joggingPolyLine.Locations.Add(new Location() { Latitude = e.Position.Location.Latitude, Longitude = e.Position.Location.Longitude });
                path = path + var;
                if (speed < e.Position.Location.Speed)
                    speed = e.Position.Location.Speed;
                textBlock1.Text = "Distance: " + path.ToString() + " m";
            }
        }
开发者ID:pragyansen,项目名称:workout-assistant,代码行数:31,代码来源:MainPage.xaml.cs

示例6: _watcher_PositionChanged

        void _watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            var position = e.Position.Location;

            lblLatidude.Text = position.Latitude.ToString("0.0000");
            lblLongitude.Text = position.Longitude.ToString("0.0000");
        }
开发者ID:lhlima,项目名称:CollaborationProjects,代码行数:7,代码来源:PageGPS.xaml.cs

示例7: _watcher_PositionChanged

 //What to do if position change is tracked.
 private void _watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
 {
     TrackPosition(e);
     GetKilometres();
     GetCalories();
     GetMoney();
 }
开发者ID:KristofColpaert,项目名称:BikeToWork,代码行数:8,代码来源:Tracking.cs

示例8: watcher_PositionChanged

 void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
 {
     latitudeTextBlock.Text = e.Position.Location.Latitude.ToString("0.000");
     longitudeTextBlock.Text = e.Position.Location.Longitude.ToString("0.000");
     MyMap.Center = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);
     MyMap.ZoomLevel = 5;
 }
开发者ID:emilija-boshkova,项目名称:JMM_Lab_Vezbi,代码行数:7,代码来源:Location.xaml.cs

示例9: geoWatcher_PositionChanged

 void geoWatcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         map1.Center = e.Position.Location;
     });
 }
开发者ID:r0llup,项目名称:PhoneApp1,代码行数:7,代码来源:Page2.xaml.cs

示例10: watcher_PositionChanged

 private void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> args)
 {
     if (LocationChanged != null)
         LocationChanged(sender, new LocationChangedEventArgs(
             new Location(args.Position.Location.Latitude, args.Position.Location.Longitude, args.Position.Timestamp)
             ));
 }
开发者ID:253525306,项目名称:myfriendsaround,代码行数:7,代码来源:LocationService.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: Watcher_PositionChanged

    private void Watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
    {
      var coord = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);

      if (_line.Path.Count > 0)
      {
        var previousPoint = _line.Path.Last();
        var distance = coord.GetDistanceTo(previousPoint);
        var millisPerKilometer = (1000.0 / distance) * (System.Environment.TickCount - _previousPositionChangeTick);
        _kilometres += distance / 1000.0;

        paceLabel.Text = TimeSpan.FromMilliseconds(millisPerKilometer).ToString(@"mm\:ss");
        distanceLabel.Text = string.Format("{0:f2} km", _kilometres);
        caloriesLabel.Text = string.Format("{0:f0}", _kilometres * 65); // an average of 65 calories burned per kilometer

                PositionHandler handler = new PositionHandler();
        var heading = handler.CalculateBearing(new Position(previousPoint), new Position(coord));
        Map.SetView(coord, Map.ZoomLevel, heading, MapAnimationKind.Parabolic);

        ShellTile.ActiveTiles.First().Update(new IconicTileData()
        {
          Title = "WP8Runner",
          WideContent1 = string.Format("{0:f2} km", _kilometres),
          WideContent2 = string.Format("{0:f0} calories", _kilometres * 65), // an average of 65 calories burned per kilometer
        });
      }
      else
      {
        Map.Center = coord;
      }

      _line.Path.Add(coord);
      _previousPositionChangeTick = System.Environment.TickCount;
    }
开发者ID:padmick,项目名称:WindowsPhoneProject,代码行数:34,代码来源:MainPage.xaml.cs

示例13: watcher_PositionChanged

 private void watcher_PositionChanged(object sender, 
                 GeoPositionChangedEventArgs<GeoCoordinate> e)
 {
     var location = e.Position.Location;
     var lat = location.Latitude;
     var lon = location.Longitude;
 }
开发者ID:follesoe,项目名称:WP7Demos,代码行数:7,代码来源:Location.xaml.cs

示例14: 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

示例15: watcher_PositionChanged

 private void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
 {
     if (!e.Position.Location.IsUnknown)
     {
         CurrentPosition = e.Position.Location;
         Watcher.Stop();
     }
 }
开发者ID:FaisalNahian,项目名称:311NYC,代码行数:8,代码来源:LocationHelper.cs


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