iosobjective-cautocompletebaidu-map

How to Implement Map Places autocomplete in Baidu Map for IOS SDK


This is my first time that I am using Baidu API. I am having problem implementing Baidu places auto-complete API in my project. I am using the Baidu developers link to http://lbsyun.baidu.com/index.php?title=iossdk.

someone please give me to some tutorial in this regard?

i am following this tutorial. link

but in this tutorial i can not receive json file, give me a error

{ "Status": 102, "message": "MCODE parameter is not present, mobile type mcode required parameter"}


Solution

  • Seems you should use the POI Search module of BaiduMapKit.Try this.

    BMKCitySearchOption *citySearchOption = [[BMKCitySearchOption alloc]init];
    citySearchOption.pageIndex = curPage;//here is the page index , you can set it to 0
    citySearchOption.pageCapacity = 10;
    citySearchOption.city= @"上海";//here is the city where you want to search the road 
    citySearchOption.keyword = @"淮海路";//here is the road name or someplace name you want to search
    BOOL flag = [_poisearch poiSearchInCity:citySearchOption];
    if(flag) {
       _nextPageButton.enabled = true;
       NSLog(@"success");
    }
    else {
       _nextPageButton.enabled = false;
       NSLog(@"fail");
    }