2011-08-11 4 views
0

私のアプリケーションでは、自分の現在地の座標を取得できます。しかし Googleの場所にクエリ座標を渡すクエリ文字列

"https://maps.googleapis.com/maps/api/place/search/xml?location=52.577798767,-2.124885567&radius=500&types=bank&sensor=false&key=AIzaSyCcC9pmri9XGOgydfsaadq37cmcb6fsd80" 

今どのように私は私のダイナミック座標(私は私の場所を変更した場合、私の座標が新しいでしょう)の代わりに、固定座標を渡すことができ

などのGoogleプレイスの文字列はありますか?

私は、AとBは、そこに見るのは難しいかもしれませんが、私は場所に "%Fを" 追加

a = [NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude]; 
//b = [NSString stringWithFormat:@"LONGITUDE: %f", location.coordinate.longitude]; 

答えて

1
NSString *urlString = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/xml?location=%f,%f&radius=500&types=bank&sensor=false&key=AIzaSyCcC9pmri9XGOgydfsaadq37cmcb6fsd80", longAsFloat, latAsFloat]; 

ある

NSURL *googlePlacesURL = [NSURL URLWithString:googleUrl]; 

NSData *xmlData = [NSData dataWithContentsOfURL:googlePlacesURL]; 

にこの文字列を使用したいですあなたの長いと緯度の文字列にそれらを渡すことができます。その後、新しいカスタム文字列からURLを構築できます。お役に立てれば。