2017-02-27 6 views
0

こんにちは、私はiOSのGoogleマップを初めて使っています。UIのGoogleマップTableView

マーカーをどのように表示するか知っていますか?つまり、地図上の場所をクリックするとマーカーが表示されます。

ありがとうございました。

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 
                 longitude:151.20 
                  zoom:6]; 
GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; 
mapView.myLocationEnabled = YES; 
self.view = mapView; 

// Creates a marker in the center of the map. 
GMSMarker *marker = [[GMSMarker alloc] init]; 
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20); 
marker.title = @"Sydney"; 
marker.snippet = @"Australia"; 
marker.map = mapView; 

[mapView setSelectedMarker:marker]; 

答えて

0

あなたのようなのMapView のデリゲートmathod使用することができますしてください:

- (無効)のMapView:(GMSMapView *)のMapView didTapInfoWindowOfMarker:(ID)マーカー { のNSLog( "yes" を@に)。 //何かを行う }

また、テーブルビューでユーザーインタラクションをチェックすることもできます。