2

Google Places API を iOS アプリに統合しようとしています。私はこのブログを参照しています: http://iphonebyradix.blogspot.com/2011/07/working-with-google-places-api.html

現在、iPhone の現在の位置を調べています。取得した経度と緯度を、"location=34.0522222,-118.2427778" の代わりに次の URL に埋め込むにはどうすればよいですか。

#define PlacesURL @"https://maps.googleapis.com/maps/api/place/search/xml?location=34.0522222,-118.2427778&radius=500&types=restaurants&sensor=false&key=Your_API_Key"

コードで指定されたハードコードされた場所の近くではなく、現在の場所の近くのレストランの場所を取得するようにします。

ありがとうございます。

4

1 に答える 1

1
CLLocation *location = [[AppHelper appDelegate] mLatestLocation];//custom code to get latestPosition of user


NSString *url=[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/xml?location=%f,%f&radius=500&types=restaurants&sensor=false&key=Your_API_Key"
,location.coordinate.longitude,location.coordinate.latitude]];
于 2011-12-26T12:20:47.190 に答える