9

Searching for this problem only gave me posts that were regarding opengl stuff that I have no knowledge of whatsoever.

On my Storyboard, I've got 1 view in which I put another slightly smaller UIView object to act as a container for my map. This works fine, not much code at all. I set the class of the UIView to be GMSMapView. I CTRL-drag it to create a outlet to the corresponding viewController. After this I create a GMSCameraPosition to a specific location. I set self.mapView, which is the outlet, to [GMSMapView mapWithFrame:CGRectZero camera:camera]; camera being the camera position I specified.

This seems to work, the app starts without errors and the map is shown in the UIView that I created, but, the camera position is not where I specified. And I know that the position is valid because if I use self.viewinstead of self.mapViewthe map shows up on the whole screen at the correct position.

In the log I get the error Failed to make complete framebuffer object 8cd6 and as I said, posts regarding this made no sense whatsoever to me, and I am clueless to what problem this is.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Millenjo
  • 461
  • 7
  • 16

5 Answers5

13

I wonder if it might be because you initialize the map view with a frame of CGRectZero. I think using CGRectZero is meant to be used when the view is the view controller's root view, meaning it will be resized to the full size of the screen. Maybe you need to set a size, eg:

[GMSMapView mapWithFrame:CGRectMake(0, 0, 300, 300) camera:camera];
Saxon Druce
  • 17,406
  • 5
  • 50
  • 71
  • as i said in the answer i provided, this line wasn't needed at all! Thank you for helping though! – Millenjo Feb 27 '13 at 14:09
  • This solved the "Failed to make complete framebuffer object 8cd6" error for me. But since my app uses OpenGL, I have other issues to solve now (The map displays and works perfectly, but textures in the rest of the app are disappearing). Thanks for the tip. – aiham Mar 27 '13 at 03:39
2

For me, this gets the map working/loading the proper coordinates, but still throws the 8cd6 error. Setup: Xcode 4.6.1 iOS 6.1 using storyboard

I have a view inside of a main view/viewcontroller.

Make sure the UIView (the sub view that is to be the map) under the attribute tab -->class = GMSMapView and is linked to the property *mapView below

YourViewController.h:

#import <UIKit/UIKit.h>
#import <GoogleMaps/GoogleMaps.h>
@interface YourViewController : UIViewController

//other @properties
@property (strong, nonatomic) IBOutlet GMSMapView *mapView;//linked to storyboard

@end

YourViewController.m:

#import "YourViewController.h"
#import <GoogleMaps/GoogleMaps.h> 
@interface YourViewController()
@end

/*.. ..other setup code ..*/

-(void)viewDidLoad{
    [super viewDidLoad];
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.8683 longitude:151.2086 zoom:10];
    self.mapView.camera = camera;
}

the 8cd6 error has to do with the frame/bounds (obviously). Something isn't getting called (or set?) if you try to initWithFrame. Loading the view hangs and then defaults to the place near London. I did not edit the setMapView for this solution, I merely skipped setting the bounds and let storyboard take care of that.

Still hope someone finds a fix that clears up the 8cd6 error though.

mcm
  • 655
  • 9
  • 10
0

I too have been experiencing this problem. My solution isn't very elegant, but it works. First, @sythnesize your outlet in viewController.m (@synthesize mapView = _mapView;). Then write a custom setter:

- (void)setMapView:(GMSMapView *)mapView {
    if (!mapView) {
        mapView = [[GMSMapView alloc] initWithFrame:CGRectZero];
    }
    _mapView = mapView;
}

This will still give you the error that you saw, but then in the viewDidLoad (or somewhere else that will be called after the view loaded) method, set the camera:

self.mapView.camera = [GMSCameraPosition cameraWithLatitude:3 longitude:27 zoom:13];

For a split second, the map would be wrong, but I don't think it is visible to the user.

user2105505
  • 686
  • 1
  • 9
  • 18
0

Had a friend over who helped me out, thank you for answering but those answers aren't the way i eventually solved it.

The code we used:

CLLocationDegrees lat = 59.34702;
CLLocationDegrees lon = 18.04053;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:lat longitude:lon zoom:10];
[self.mapView setCamera:camera];

We aren't fiddleing with that frame at all since, as it seems, the view automatically sets up a map at a position not specified by me, using the size it has in the storyboard. So all we had to do was to add the camera as in this example. This got rid of that error i talked about.

If someone has a better answer that can explain this more throughly it would be good. But this works, just ctrl drag a View with the class set to GMSMapView as an outlet and add the code i wrote.

Millenjo
  • 461
  • 7
  • 16
0

This error appeared to me when I subclass GMSMapView. I basically declared all the "did*"/ "will*" methods and I found that the error was appearing between willMoveToWindow and didMoveToWindow. Debugging willMoveToWindow I found that the frame was (0,0,0,0). I basically added this and the error disappeared.

- (void)willMoveToWindow:(UIWindow *)newWindow
{
   self.bounds = self.superview.bounds ;
   [super willMoveToWindow:newWindow] ;
}
user2101384
  • 375
  • 1
  • 3
  • 14