2017-02-27 57 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 }

並且還檢查用戶交互啓用表視圖。