我正在使用Google Map和Google Place API的免费服务。我想获取我周围的Google API位置(我当前的位置),这里我设置的半径是14英里,但这不会返回14英里的记录。它要么返回最多2英里的记录,要么只返回来自Google Place API的40-50条记录。
这是请求代码调用14英里半径记录:
FTGooglePlacesAPINearbySearchRequest *request = [[FTGooglePlacesAPINearbySearchRequest alloc] initWithLocationCoordinate:CLLocationCoordinate2DMake(App_Context.currentLocation.coordinate.latitude, App_Context.currentLocation.coordinate.longitude)];
request.rankBy = FTGooglePlacesAPIRequestParamRankByDistance;
request.radius = 14 * 1.6 * 10000;
request.pageToken = currentPagingIndex;
switch (type) {
case Bar:
request.types = @[@"bar"];
break;
case Cafe:
request.types = @[@"cafe"];
break;
case Florist:
request.types = @[@"restaurant"];
break;
case Park:
request.types = @[@"night_club"];
break;
default:
break;
}
if (isCategoryselected) {
request.types = @[[selectedPlaceCategory valueForKey:@"place_type"]];
} else {
request.types = @[@"bar", @"cafe", @"restaurant", @"night_club"];
}
NSAssert(request, @"Provided request cannot be nil");
// request.openNow = YES;
return request;
我正在正确设置地点类型和页面标记。但是在最多3-4次请求之后我得到了page_token nil。
任何帮助都将不胜感激。
谢谢, 阿贾伊