我正在努力获得运动的速度,但它不起作用,我不知道为什么。这是我试过的
async private void locator_PositionChanged(Geolocator sender, PositionChangedEventArgs e)
{
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
Geoposition geoPosition = e.Position;
GeolocatorPositionChanged(geoPosition);
var speed = e.Position.Coordinate.Speed; // en metres
speed = speed * 3600 / 1000;
speedTextBlock.Text = "speed : " + Convert.ToString(speed) ;
});
}
但是coordinate.speed总是返回5.8(米/秒)!