[英]Map view shows my location and destination but doesn't show directions between them
[英]UIView doesn't show my map, only shows the standard map
这是我在UIView中实现的视图控制器。
编译器以黄色突出显示的行是:
self.vermapa_.delegate=self;
self
吗?
(。H)
#import <UIKit/UIKit.h>
@interface appiOSViewController : UIViewController
@end
还有他们)
#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
您应该这样做:
@interface appiOSViewController () <GMSMapViewDelegate>
如果您将成为某个对象的委托,则应告诉类您将实现委托方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.