2016-06-16 5 views
0

現在のシナリオ Googleマップに関するソリューションが必要です。現在、私はurlとsdkの両方でGoogleマップを開くことができます。私はGoogleマップのマーカーにタイトルを設定したいブラウザ。Googleマップ上のマーカータイトル

NSString *url = [[NSString alloc]initWithFormat:@"http://maps.googleapis.com/maps/api/geocode/xml?address=%@+%@+%@",road_Str,pin_Str,city_Str]; 
    NSLog(@"str%@",url); 
     CLLocationCoordinate2D rdOfficeLocation = CLLocationCoordinate2DMake([[latArr objectAtIndex:0] doubleValue], [[lngArr objectAtIndex:0] doubleValue]); 
     NSString *str = [NSString stringWithFormat:@"comgooglemaps://?q=%@,%@,%@&center=%f,%f",road_Str,city_Str,pin_Str,rdOfficeLocation.latitude,rdOfficeLocation.longitude]; 
     NSURL *url = [NSURL URLWithString:str]; 

答えて

1

マーカーは座標(10,20)に作成され、クリックすると情報ウィンドウに文字列「Hello world」が表示されます。

CLLocationCoordinate2D position = CLLocationCoordinate2DMake(10, 20); 
GMSMarker *marker = [GMSMarker markerWithPosition:position]; 
marker.title = @"Hello World"; 
marker.map = mapView_; 
+0

ありがとうSuraj、しかし、私はブラウザのURLでそれを行う必要があります私はGoogleのAPIを意味します。 – Neha

+0

あなたのコードマーカーでは、指定されたmapView_にブラウザマップ上にプロットされません – Neha

+1

ああ...あなたのポイントを正確に取得しました...ここで読んでください:https://developers.google.com/maps/documentation/static-maps /イントロ –

関連する問題