2014-06-20 3 views
0

C'est mon contrôleur de vue que j'ai implémenté dans le UIView.UIView ne montre pas ma carte, montre seulement la carte standard

La ligne que le compilateur met en évidence en jaune est la suivante:

self.vermapa_.delegate=self; 

donc quelque chose de mal avec self?

(.h)

#import <UIKit/UIKit.h> 

@interface appiOSViewController : UIViewController 

@end 

et (.m)

#import "appiOSViewController.h" 
#import <GoogleMaps/GoogleMaps.h> 
@interface appiOSViewController() 
@property (weak,nonatomic) IBOutlet GMSMapView *vermapa_; 
@end 

@implementation appiOSViewController 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    **self.vermapa_.delegate=self;** 

    GMSCameraPosition *pos = [GMSCameraPosition cameraWithLatitude:7.114797 
                 longitude:-73.104932 
                   zoom:15.3]; 

    self.vermapa_ = [GMSMapView mapWithFrame:CGRectZero camera:pos]; 
    self.vermapa_.myLocationEnabled = YES; 
    self.vermapa_.settings.compassButton = YES; 
    self.vermapa_.settings.myLocationButton = YES; 
    self.vermapa_.settings.zoomGestures = YES; 


    GMSMarker *marker = [[GMSMarker alloc] init]; 
    marker.position = CLLocationCoordinate2DMake(7.116309,-73.105713); 
    marker.title = @"Parada frente al edificio L"; 
    marker.snippet = @"UNAB - Jardín"; 
    marker.map = self.vermapa_; 

    GMSMarker *marker1 = [[GMSMarker alloc] init]; 
    marker1.position = CLLocationCoordinate2DMake(7.112412,-73.105134); 
    marker1.title = @"CSU"; 
    marker1.snippet = @"UNAB - Terrazas"; 
    marker1.map = self.vermapa_; 

    GMSMarker *marker2 = [[GMSMarker alloc] init]; 
    marker2.position = CLLocationCoordinate2DMake(7.110863,-73.106075); 
    marker2.title = @"Parada de Bus - Terrazas"; 
    marker2.snippet = @"Terrazas"; 
    marker2.map = self.vermapa_; 

    GMSMarker *marker3 = [[GMSMarker alloc] init]; 
    marker3.position = CLLocationCoordinate2DMake(7.117738,-73.105651); 
    marker3.title = @"Parqueadero UNAB"; 
    marker3.snippet = @"UNAB - Jardín"; 
    marker3.map = self.vermapa_; 


    // Do any additional setup after loading the view, typically from a nib. 
} 

- (void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 
    // Dispose of any resources that can be recreated. 
} 

@end 
+0

J'ai résolu mon problème avec la ligne en surbrillance avec ceci: vermapa_.delegate = (id ) self; Mais l'UIView continue à montrer la carte standard, s'il vous plaît j'ai besoin de votre aide de quelqu'un – anch95

Répondre

0

Vous devriez faire:

@interface appiOSViewController() <GMSMapViewDelegate> 

Si vous serez un délégué pour un objet, vous devez indiquer à la classe que vous allez implémenter des méthodes déléguées.

Questions connexes