How to handle the speed value of the Geolocator Plugin

I was checking out the GeolocatorPlugin on the Android Emulator. The values of Timestamp, Latitude and Longitude just work fine except of the speed value.
I expected to receiving a speed value while chainging the GPS point. But actually the value is 0.

This is the Code:

private async void GetGeolocation() {
 this.locator = CrossGeolocator.Current;
 this.locator.DesiredAccuracy = 50;
 await this.locator.StartListeningAsync(1000, 0);

 this.position = await this.locator.GetPositionAsync(timeoutMilliseconds: 1000);

 this.locator.PositionChanged += (sender, e) => {
       this.position = e.Position;

       this.Status.Text = "Position Status: " + this.position.Timestamp;
       this.Lat.Text = "Position Latitude: " + this.position.Latitude;
       this.Long.Text = "Position Longitude: " + this.position.Longitude;
       this.Speed.Text = "Speed: " + this.position.Speed + " m/s";
    };
 }

Does anyone knows how to handle the speed value correctly?

Answers

  • RichardAmissRichardAmiss USMember ✭✭

    I'm experiencing the the exact same issue with the CrossGeolocator plugin while moving a real device. I suggest calculating your own speed from the long/lat

Sign In or Register to comment.