【问题标题】:CLLocation not giving actual speedCLLocation 没有给出实际速度
【发布时间】:2015-05-14 09:42:43
【问题描述】:

这是我的位置管理器委托代码。

当我们使用汽车移动时它没有给出速度,所以至少速度值应该改变。

它总是给出常数值-1.00。

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    CLLocation *crnLoc = [locations lastObject];
    self.speedometerCurrentValue=crnLoc.speed;
    self.lblSpeed.text=[NSString stringWithFormat:@"%f",crnLoc.speed];
}

【问题讨论】:

  • CLLocation 将为您提供以米/秒为单位的速度,如果它获得足够准确的位置(即它从 GPS 芯片获得它的位置)。你希望它给你什么?
  • 嗨,james Snook。我每次的速度都在 -1.0。每次都是负速度。
  • 您要求的准确度是多少,您是如何测试的?还有你实际得到的准确度是多少?
  • 实际上在使用汽车移动时它不给速度。总是给负速度。
  • 我要求在我们使用汽车移动时不要给出速度。所以至少速度值应该改变。它总是给出恒定值-1.00。

标签: ios iphone cllocationmanager


【解决方案1】:

请查看苹果解释中的截图。你的速度无效。

【讨论】:

  • 速度有时总是返回-1.0
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-04-08
  • 2022-01-11
  • 1970-01-01
  • 2018-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多