Hey.
I created a viewcontroller with Google maps, but I need to insert a map not full-size viewcontroller, and I did it (I added the GMSMapView class to the new view), but I need to put markers on this map. An example of my marker:
CLLocationCoordinate2D position2 = CLLocationCoordinate2DMake(59.957069, 30.323013); GMSMarker *london2 = [GMSMarker markerWithPosition:position2]; london2.title = @"my office"; london2.snippet = @"description"; london2.map = mapView_; Question: if I add the line self.view = mapView_; , the map is reflected on the whole screen with the markers I need, if I remove it, it is reflected without markers, but the size I need. How to fix it (make the map the right size and markers)?
- (void)viewDidLoad { [super viewDidLoad]; self.mapView_.mapType = kGMSTypeNormal; self.mapView_.settings.compassButton = YES; self.mapView_.settings.myLocationButton = YES; self.mapView_.delegate = self; [GMSServices provideAPIKey:@"AIzaSyAob82BnXLkqTEKA675GbEveoTQZNBZst4"]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:1]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; mapView_.settings.compassButton = YES; mapView_.settings.myLocationButton = YES; //self.view = mapView_; GMSMarker *london2 = [GMSMarker markerWithPosition:position2]; london2.title = @"my office"; london2.snippet = @"description"; london2.map = mapView_;
[self.view addSubview:mapView_];What happened? - BiMaWa