2013-10-03 17 views
5

iOS用GoogleMaps SDKがついていません...
GoogleマップでGMSMarkerをタップするといくつかの機能を追加したいのですが、仕事はありません。 問題がここにありますか?iOS Google Maps SDK、GMSMarkerタップイベントを聞くことができません

FirstController.h

#import <UIKit/UIKit.h> 
#import <GoogleMaps/GoogleMaps.h> 
#import <CoreLocation/CoreLocation.h> 
#import "sqlite3.h" 

@interface FirstViewController : UIViewController <CLLocationManagerDelegate, 
                GMSMapViewDelegate> 
{ 
    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; 
} 

答えて

18

私はあなたがマップ作成後は、これを必要とするかもしれないと思う:

mapView_.delegate = self; 
+0

が働いていたが、おかげで!私は誤って間違った方法でそのコードを入れました! – Michele

関連する問題