谷歌地图Api iPhone



我在我的应用程序中使用搜索位置API,其工作良好。但是在Place API中,我用API KEY传递参数映射中心坐标和半径。它给出了回应。但是,如果我想搜索任何位置,其区域是否在屏幕上可见或不像在内置地图应用程序。我该怎么做呢?是否有任何不同的查询或API来实现它?

现在,我正在使用下面的查询。

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=%f,%f&radius=50000&types=&name=%@&sensor=false&key=aaaaaaaaaa",mapView.centerCoordinate.latitude,mapView.centerCoordinate.longitude,searchPlace.text]];
NSURLRequest *request = [[NSURLRequest alloc]initWithURL:url];
NSURLConnection *connect;
connect =  [[NSURLConnection alloc]initWithRequest:request delegate:self];

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv",[searchPlace.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

你可以试试这个…

最新更新