Skip to content

Instantly share code, notes, and snippets.

@frontconnect
Created December 19, 2013 13:26
Show Gist options
  • Save frontconnect/8039047 to your computer and use it in GitHub Desktop.
Save frontconnect/8039047 to your computer and use it in GitHub Desktop.
Create and initialize the GMSMapView programmatically.
@interface ViewController ()
@property (nonatomic) GMSMapView *mapView;
@end
@implementation ViewController
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:41.0109 longitude:28.998 zoom:6];
CGRect mapSize = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y,
self.view.bounds.size.width/2.0,
self.view.bounds.size.height/2.0);
self.mapView = [GMSMapView mapWithFrame:mapSize camera:camera];
[self.view addSubview:self.mapView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment