久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='HGtS8'></bdo><ul id='HGtS8'></ul>

  • <legend id='HGtS8'><style id='HGtS8'><dir id='HGtS8'><q id='HGtS8'></q></dir></style></legend>

        <tfoot id='HGtS8'></tfoot>

        <i id='HGtS8'><tr id='HGtS8'><dt id='HGtS8'><q id='HGtS8'><span id='HGtS8'><b id='HGtS8'><form id='HGtS8'><ins id='HGtS8'></ins><ul id='HGtS8'></ul><sub id='HGtS8'></sub></form><legend id='HGtS8'></legend><bdo id='HGtS8'><pre id='HGtS8'><center id='HGtS8'></center></pre></bdo></b><th id='HGtS8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HGtS8'><tfoot id='HGtS8'></tfoot><dl id='HGtS8'><fieldset id='HGtS8'></fieldset></dl></div>
      1. <small id='HGtS8'></small><noframes id='HGtS8'>

      2. CLLocation 返回負速度

        CLLocation returning negative speed(CLLocation 返回負速度)
          <tbody id='a4LcR'></tbody>

        1. <small id='a4LcR'></small><noframes id='a4LcR'>

          1. <i id='a4LcR'><tr id='a4LcR'><dt id='a4LcR'><q id='a4LcR'><span id='a4LcR'><b id='a4LcR'><form id='a4LcR'><ins id='a4LcR'></ins><ul id='a4LcR'></ul><sub id='a4LcR'></sub></form><legend id='a4LcR'></legend><bdo id='a4LcR'><pre id='a4LcR'><center id='a4LcR'></center></pre></bdo></b><th id='a4LcR'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='a4LcR'><tfoot id='a4LcR'></tfoot><dl id='a4LcR'><fieldset id='a4LcR'></fieldset></dl></div>
              • <bdo id='a4LcR'></bdo><ul id='a4LcR'></ul>
                • <legend id='a4LcR'><style id='a4LcR'><dir id='a4LcR'><q id='a4LcR'></q></dir></style></legend>
                • <tfoot id='a4LcR'></tfoot>
                  本文介紹了CLLocation 返回負速度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在啟動一個使用 coreLocation 和 mapkit 框架的新應用程序.

                  I'm starting a new app which uses the coreLocation and the mapkit frameworks.

                  我的問題是試圖獲得當前速度總是給我一個負值,我帶著我的 iPhone 到了 3g 信號良好的地方,沒關系,location.speed 值總是 -1.

                  My problem is trying to get the current speed always returns me a negative value, i have take my iPhone with me to places with a good 3g signal and it doesn't matter, location.speed value is always -1.

                  這是重要的代碼:

                  #define kRequiredAccuracy 1500.0 //meters
                  #define kMaxAge 60.0 //seconds
                  

                  在init方法中:

                  self.locationManager=[[CLLocationManager alloc] init];
                  self.locationManager.delegate=self;
                  self.locationManager.desiredAccuracy=kCLLocationAccuracyNearestTenMeters;
                  

                  然后didUpdateToLocation:

                  then didUpdateToLocation:

                  - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
                  
                      NSTimeInterval ageInSeconds = [newLocation.timestamp timeIntervalSinceNow];
                      NSLog(@"Location: %@", [newLocation description]);
                  
                      if( newLocation.horizontalAccuracy > kRequiredAccuracy || fabs(ageInSeconds) > kMaxAge )
                      {
                          NSLog(@"inacurate position");
                          [self.delegate inacuratePosition];
                  
                      }
                      else {
                  
                      [self.delegate locationUpdate:newLocation andOldLocation:oldLocation];
                      location=newLocation.coordinate;
                  
                  
                      }
                  
                  
                      if(tracking)
                      {   
                      [self updatePosition];
                      }
                      if(firstTime)
                      {
                          [self placeStartMark];
                          firstTime=FALSE;
                      }
                  
                  
                  
                  }
                  

                  最后在我實現協議的視圖控制器中:

                  and finally in the view controller in which I'm implementing the protocol:

                  - (void)locationUpdate:(CLLocation *)newLocation andOldLocation:(CLLocation*)oldLocation{
                  
                      double speed = [newLocation speed] *3.6;
                  
                  
                  
                      double altitude= [newLocation altitude];
                      [self checkMaxSpeedAndAltitude:speed :altitude];
                      if(speed< 0)
                          speed=0;
                  
                  
                  
                      locationLabel.text=[NSString stringWithFormat:@"speed: %f km/h   altitude: %f m", speed,altitude];
                  }
                  

                  我快瘋了,所以如果有人知道任何解決方案,那肯定會有所幫助.謝謝

                  Im getting crazy so if anyone knows any solution it will be helpful for sure. Thanks

                  推薦答案

                  通常,如果使用的位置檢測機制不支持,您會得到負高度和速度.例如,當使用 Wi-Fi 或小區三角測量時.你確定,你正在獲取 GPS 更新,所以你是在自由的天空下測試嗎?即便如此,您仍會收到 WiFi 和手機信號塔位置更新,因此您必須將它們過濾掉.

                  Usually, you get negative altitude and speed if the used location detection mechanism doesn't support it. For instance, when Wi-Fi or cell triangulation is used. Are you sure, you're getting GPS updates, so are you testing under the free sky? Even then, you'll still receive WiFi and cell tower location updates so you've to filter them out.

                  Wi-Fi 位置更新的典型水平精度為 65 m.

                  65 m horizontal accuracy is typical for Wi-Fi location updates.

                  這篇關于CLLocation 返回負速度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經度計算 X 和 Y)
                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Locations in Core Data sorted by distance via NSFetchedResultsController?(通過 NSFetchedResultsController 按距離排序的核心數據中的位置?)
                    <bdo id='hsZ2O'></bdo><ul id='hsZ2O'></ul>
                    <legend id='hsZ2O'><style id='hsZ2O'><dir id='hsZ2O'><q id='hsZ2O'></q></dir></style></legend>
                    <tfoot id='hsZ2O'></tfoot>
                    <i id='hsZ2O'><tr id='hsZ2O'><dt id='hsZ2O'><q id='hsZ2O'><span id='hsZ2O'><b id='hsZ2O'><form id='hsZ2O'><ins id='hsZ2O'></ins><ul id='hsZ2O'></ul><sub id='hsZ2O'></sub></form><legend id='hsZ2O'></legend><bdo id='hsZ2O'><pre id='hsZ2O'><center id='hsZ2O'></center></pre></bdo></b><th id='hsZ2O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hsZ2O'><tfoot id='hsZ2O'></tfoot><dl id='hsZ2O'><fieldset id='hsZ2O'></fieldset></dl></div>
                  • <small id='hsZ2O'></small><noframes id='hsZ2O'>

                          <tbody id='hsZ2O'></tbody>

                            主站蜘蛛池模板: 中文字幕在线不卡播放 | 91视频电影 | 欧美一级在线 | 精品国产欧美 | 午夜精品一区二区三区在线视频 | 青青久草| 国产91精品网站 | 台湾a级理论片在线观看 | 国产欧美一区二区三区在线看 | 99精品国产一区二区青青牛奶 | 亚洲国产一区二区视频 | 精品免费在线 | 久久精品高清视频 | 在线观看黄免费 | 殴美成人在线视频 | 欧美视频一区二区三区 | 国产精品成人国产乱一区 | 亚洲在线视频 | 五月天婷婷综合 | 日本啊v在线 | 女人牲交视频一级毛片 | 久久国产区 | 日韩欧美专区 | 亚洲免费在线视频 | 日本a视频 | 久久久女女女女999久久 | 日韩免费av | 涩涩视频在线看 | 中文字幕精品一区 | 成人精品久久 | 天天爽天天操 | 国产高清在线观看 | 欧美一级片久久 | 91中文字幕在线观看 | 伊人网99| 91久久久久久 | 91免费电影 | www.色.com| 成人在线视频网址 | 久久久久久成人 | 精品国产一区二区三区四区在线 |