iOS Google Maps SDK,无法收听GMSMarker点击事件
我坚持使用适用于iOS的GoogleMaps SDK …
我想在Google地图上点击GMSMarker时添加一些function,但它不起作用。 有什么不对?
FirstController.h
#import #import #import #import "sqlite3.h" @interface FirstViewController : UIViewController { sqlite3 *db; }
FirstController.m
[...] -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { camera = [GMSCameraPosition cameraWithLatitude:newLocation.coordinate.latitude longitude:newLocation.coordinate.longitude zoom:(12)]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; for(GMSMarker *currentMarker in _locationMarkers) { currentMarker.map = mapView_; } self.view = mapView_; } -(BOOL) mapView:(GMSMapView *) mapView didTapMarker:(GMSMarker *)marker { NSLog(@"try"); return YES; }
在您创建地图后,我认为您可能需要这样:
mapView_.delegate = self;
- 使用javascriptclosuresUIWebView:window.close();
- 如何在XCode 4 Interface Builder中将窗口方向更改为横向?
- 错误:在iPad上运行时无法启动
- 如何从UITextView的粘贴板上粘贴图像?
- 核心数据获取记录按关系分组?
- 应用已获批准,但未显示AdMob广告
- Objective-C中Android的“Spannable”相当于什么
- PresentViewController是一个非全屏UIViewController,里面有UINavigationController
- 使用UIPageView图像打开ViewController w / NavigationController