Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在目标C中限制特定城市的完整搜索api_Objective C_Api_Google Maps_Google Places Api - Fatal编程技术网

Objective c 在目标C中限制特定城市的完整搜索api

Objective c 在目标C中限制特定城市的完整搜索api,objective-c,api,google-maps,google-places-api,Objective C,Api,Google Maps,Google Places Api,我已经限制了一个特定国家(比如孟加拉国)的完整搜索api。现在我想对孟加拉国的达卡市进行限制。下面提供了我的代码 APICommunicator *api = [[APICommunicator alloc] init]; _searchTermArray=[[NSMutableArray alloc]init]; NSDictionary *arr = [api getGoogleAPIArrByPOST:[NSString string

我已经限制了一个特定国家(比如孟加拉国)的完整搜索api。现在我想对孟加拉国的达卡市进行限制。下面提供了我的代码

  APICommunicator *api = [[APICommunicator alloc] init];
             _searchTermArray=[[NSMutableArray alloc]init];


           NSDictionary *arr = [api getGoogleAPIArrByPOST:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/autocomplete/json?input=%@&region=BD&components=country:BD&types=geocode&key=%@",searchTerms,API_KEY]parameter:nil];

            NSString *areaName;
            for (areaName in arr) {
                _searchTermArray=[[arr valueForKey:@"predictions"]valueForKey:@"description"];



            }
请告诉我如何对城市进行限制的方法或代码。在此,您可以通过传递
城市
类型参数,将地点自动完成请求的结果限制为特定类型

cities
类型集合指示Places服务返回与
locality
administration\u area\u level\u 3
匹配的结果

例如:

对包含“Vict”且结果为巴西葡萄牙语的城市的请求:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&types=(cities)&language=pt_BR&key=YOUR_API_KEY
希望这有帮助