google maps sdk as a subview

First follow getting started steps at google maps sdk developer guide.

Add a new UIView to your project and set its class to GMSMapView. Drag it to your code to set IBOutlet.

MapView.h

[code language=”objc”]

@interface GeoPosicionarViewController : UIViewController{
IBOutlet GMSMapView *MapView;
}

[/code]

MapView.m

[code language=”objc”]

@implementation GeoPosicionarViewController{
GMSMapView *mapView_;
}

– (void)viewDidLoad {

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
longitude:151.20
zoom:6];

mapView_ = [GMSMapView mapWithFrame:MapView.bounds camera:camera];
mapView_.myLocationEnabled = YES;
[MapView addSubview:mapView_];

GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = mapView_;
[super viewDidLoad];

}

[/code]