2011-12-06 140 views
0

我在我的应用程序中使用搜索位置API,它的工作正常。 但是在API中,我通过API KEY传递参数映射中心坐标和半径。 它的回应。但是,如果我想要搜索任何位置,可以在屏幕中显示其区域,还是不在内置的地图应用程序中。我应该如何去做这件事?有没有不同的查询或API来实现它?Google Map Api iPhone

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

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]; 

非常感谢。

回答

0

的NSString * urlString = [NSString的stringWithFormat:@ “http://maps.google.com/maps/geo?q=%@ &输出= CSV”,[searchPlace.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

你可以尝试这个...可能是它的帮助你...

+0

感谢您的回复 – Sinha