Example #1
0
 void geolocator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
 {
     if (this.IsListening)
     {
         var      position = args.Position;
         Position p        = new Position()
         {
             Accuracy         = position.Coordinate.Accuracy,
             Altitude         = position.Coordinate.Altitude,
             AltitudeAccuracy = position.Coordinate.AltitudeAccuracy,
             Heading          = position.Coordinate.Heading,
             Latitude         = position.Coordinate.Latitude,
             Longitude        = position.Coordinate.Longitude,
             Speed            = position.Coordinate.Speed,
             Timestamp        = position.Coordinate.Timestamp.DateTime
         };
         this.PositionChanged(sender, new PositionEventArgs(p));
     }
 }
 private void Locator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
 {
     Refresh();
 }
Example #3
0
 private void Geolocator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
 {
     if (sender.LocationStatus == Windows.Devices.Geolocation.PositionStatus.Ready)
     {
         MSIoTKiTHoLJP.IoTHoLConfig.Latitude  = args.Position.Coordinate.Point.Position.Latitude;
         MSIoTKiTHoLJP.IoTHoLConfig.Longitude = args.Position.Coordinate.Point.Position.Longitude;
     }
 }
Example #4
0
        private async void Geolocator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                MapGraphics.Graphics.Where(g =>
                {
                    if (g.Attributes.ContainsKey("id"))
                    {
                        return((string)g.Attributes["id"] != "currentLocation");
                    }
                    return(true);
                });

                var currentLocation = MapHelper.CreateRouteStop(
                    args.Position.Coordinate.Point.Position.Latitude,
                    args.Position.Coordinate.Point.Position.Longitude,
                    System.Drawing.Color.Red
                    );
                currentLocation.Attributes.Add("id", "currentLocation");
                MapGraphics.Graphics.Add(currentLocation);
            });
        }
Example #5
0
        private async void Geolocator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                MapGraphics.Graphics.Clear();

                var stopPoint = MapHelper.CreateRouteStop(
                    args.Position.Coordinate.Point.Position.Latitude,
                    args.Position.Coordinate.Point.Position.Longitude,
                    System.Drawing.Color.Red
                    );
                MapGraphics.Graphics.Add(stopPoint);
            });
        }
 /// <summary>
 /// Windows geolocator found a location point.
 /// </summary>
 private void WindowsGeolocator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
 {
     UpdateLocation(args.Position);
 }
Example #7
0
 private void Locator_OnPositionChanged(
     Windows.Devices.Geolocation.Geolocator sender,
     Windows.Devices.Geolocation.PositionChangedEventArgs args)
 {
     this.PositionChanged?.Invoke(this, new PositionChangedEventArgs(args.Position.ToLocalGeoposition()));
 }
Example #8
0
 private void _locator_PositionChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.PositionChangedEventArgs args)
 {
     _positionChanged?.Invoke(this, new PositionChangedEventArgs(args.Position));
 }