开发者

How can I store Google Maps search results in an array?

开发者 https://www.devze.com 2022-12-23 03:30 出处:网络
I\'m working on an app where I need to query Google for businesses near a current location. How do I go about storing them in an array? I don\'t want to exit the app 开发者_JAVA技巧and open Google Map

I'm working on an app where I need to query Google for businesses near a current location. How do I go about storing them in an array? I don't want to exit the app 开发者_JAVA技巧and open Google Maps, I want to be able to display the addresses in a list format (Table View, I suppose).

I'm using MapKit.

I send this url to Google:

NSString *url    =  [NSString stringWithFormat: @"http://maps.google.com/maps?q=ChevyDealers&near=%@",
[fullAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

I verified that it works by launching Google Maps with the URL built here. This is not the functionality that I want in the end product though.


MapKit is really only going to let you plot and display the locations. You are most likely going to need to use the Google Maps API in order to get straight results. Once you create your API URL, and get your results back, you can then put them in an array and send that data to a UITableView.

0

精彩评论

暂无评论...
验证码 换一张
取 消