I know this question has already been asked before, but none of the answers were really clear to me and I can't find good tutorial on Internet... So, I want to put Google maps in a different UIView from the principal one in order to be able to show my menu bar on top.
Here is my actual code :
#import "MapViewController.h"
#import <GoogleMaps/GoogleMaps.h>
@implementation MapViewController
- (void)viewDidLoad {
[super viewDidLoad];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:46.809885
longitude:-71.184556
zoom:18];
mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
self.view = mapView;
mapView.mapType = kGMSTypeHybrid;
}
@end
Actually, the map is all over the app. It already set the class of my UIView to GMSKMapView and made an outlet name mapView to link my UIView with the controller.
I use Xcode 4.6.2
Thank you for your help!
First create outlet Of UIView
Add This in .h File
Now add this in .m file in view didload method
I'm using this code:
//header file
//implementation file
UPD
to change map type:
to change again camera view:
don't forget to add in header file: