You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
MGLMapView fails to bind EAGLDrawable when initialised with CGRect with no width and height #1572
Google Maps parityFor feature parity with the Google Maps SDK for Android or iOSMapKit parityFor feature parity with MapKit on iOS or macOScrashiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOS
2015-05-16 16:56:35.782 SomeApp[35232:1946290] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x17403a940> to GL_RENDERBUFFER 12015-05-16 16:56:35.783 SomeApp[35232:1946290] Failed to make complete framebuffer object 8cd62015-05-16 16:56:35.800 SomeApp[35232:1946361] [ERROR] {0}{Map}[Shader]: Program failed to validate: Validation Failed: Current draw framebuffer is invalid.
-[MGLMapView wakeGL:] should guard on CGRectIsEmpty(), and probably CGRectIsInfinite() while we’re at it. -setFrame: and -setBounds: should trigger this check and cause binding to occur if the frame changes from being empty (or infinite) to a reasonable value.
changed the title [-]MGLMapView crash error when initialised with CGRect with no width and height[/-][+]MGLMapView fails to bind EAGLDrawable when initialised with CGRect with no width and height[/+]on Feb 22, 2016
Reopening: it’s very common for a UIView or NSView to be initialized with zero size and given a size at some point before or after being added to the view hierarchy. This crash is a gotcha for many developers.
@brunoabinader proposes that MGLMapView always create mbgl::Map with a minimum size of 64×64 points, even if MGLMapView and EAGLView themselves are smaller than 64×64 points. This might work, although it might also throw off any calculations that are dependent on the screen location of the center coordinate at initialization.
Google Maps parityFor feature parity with the Google Maps SDK for Android or iOSMapKit parityFor feature parity with MapKit on iOS or macOScrashiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOS
Activity
1ec5 commentedon May 27, 2015
Via #1654,
MGLMapViewshould also supportCGRectNull.1ec5 commentedon Jan 26, 2016
-[MGLMapView wakeGL:]should guard onCGRectIsEmpty(), and probablyCGRectIsInfinite()while we’re at it.-setFrame:and-setBounds:should trigger this check and cause binding to occur if the frame changes from being empty (or infinite) to a reasonable value.1ec5 commentedon Feb 22, 2016
Per #4065, initializing the map view with an empty frame no longer crashes. It looks like the validation step that was failing was removed in #2147.
[-]MGLMapView crash error when initialised with CGRect with no width and height[/-][+]MGLMapView fails to bind EAGLDrawable when initialised with CGRect with no width and height[/+]1ec5 commentedon Jun 28, 2016
Per the comments in #5457, the crash has returned. However, I’m unable to reproduce it on either a simulator or a device.
11 remaining items
brunoabinader commentedon Apr 4, 2017
As per #8562, using a zeroed
CGRectwill cause the core to throw a runtime exception.1ec5 commentedon Apr 4, 2017
Reopening: it’s very common for a UIView or NSView to be initialized with zero size and given a size at some point before or after being added to the view hierarchy. This crash is a gotcha for many developers.
1ec5 commentedon Apr 4, 2017
@brunoabinader proposes that MGLMapView always create
mbgl::Mapwith a minimum size of 64×64 points, even if MGLMapView and EAGLView themselves are smaller than 64×64 points. This might work, although it might also throw off any calculations that are dependent on the screen location of the center coordinate at initialization.1ec5 commentedon Apr 10, 2017
#8562 ended up implementing the 64x64-point workaround described above, which should address this crash and console spew.