iOS 百度地圖反檢索地址的問題

來源:互聯網
上載者:User

標籤:

今天碰到了這樣一個問題,我從伺服器端擷取了目前使用者的軌跡資料列表,想通過反向檢索擷取使用者的軌跡地址,邏輯代碼基本上是這樣

BMKGeoSearch *signleSearch;

for(location in locationArray)

{

  CLLocationCoordinate2d pt = xxxxx;

   BMKReverseGeoCodeOption *reverseGeocodeSearchOption = [[BMKReverseGeoCodeOption alloc]init];

         reverseGeocodeSearchOption.reverseGeoPoint = pt;

            BOOL flag = [serch reverseGeoCode:reverseGeocodeSearchOption];

            if(flag)

            {

                BMKPointAnnotation *item = [[BMKPointAnnotation alloc]init];

                item.coordinate = pt;

                [BMapView addAnnotation:item];

            }

            else

            {

                NSLog(@"反geo檢索發送失敗");

            }

 }

代碼運行每次只能擷取一個經緯度的地址,其他經緯度的地址都擷取不到,查了很久,試了很多方法毫無用處,最後review了一下代碼,覺得可能是 一個BMKGeoSearch 執行個體同一時間只能適配一次檢索,然後修改了一下代碼,為每個檢索都重新分配了一個Search執行個體,結果就成功了。但是這樣就會造成同一時間內的記憶體爆發,這個問題待後續修改

iOS 百度地圖反檢索地址的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.