2017-02-27 83 views
0

嗨我是iOS的谷歌地图的新手。谷歌地图在用户界面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的 像的代表马托:

- (空)的MapView:(GMSMapView中*)的MapView didTapInfoWindowOfMarker:(ID)标记 { 的NSLog(@ “是”); // do something }

并且还检查用户交互启用表视图。