久久久久久久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>

                            主站蜘蛛池模板: a免费视频 | 国产人成精品一区二区三 | 伊人春色成人网 | 国产精品久久久久无码av | 久久i | 在线男人天堂 | 四虎午夜剧场 | 日韩一区二区三区视频 | 亚洲精品久久 | 日韩在线xx | www.玖玖玖 | 精品久久久久国产 | 成人影院午夜 | 成人免费视频播放 | 成人激情视频在线 | 国产综合久久 | 亚洲一区二区日韩 | 欧美日韩国产一区二区三区 | 91视频88av | 久优草| 日韩精品在线一区 | 中文天堂在线一区 | 国产精品美女久久久久久免费 | 久久久久久久久国产精品 | 日本在线免费看最新的电影 | 精品一区二区电影 | 国内精品免费久久久久软件老师 | 在线观看国产www | 久久四虎 | 精品欧美一区二区三区久久久 | 色本道 | 免费成人午夜 | 亚洲日本一区二区 | 日韩一区二区在线免费观看 | 资源首页二三区 | 久久人人国产 | 91精品一区二区三区久久久久久 | 欧美国产在线一区 | 国产精品中文字幕在线播放 | 欧美freesex黑人又粗又大 | 国产免费福利小视频 |