-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLMapView turns black when returning from another UIViewController. #1003
Comments
+1 |
@kkaefer Do you think this might be related to your recent missing frame fix? @mb12 @robipresotto Can you see if the situation changes without 47ede85, which fixed the above issue recently? |
@incanus Forcing rerender via Map::update from UIViewController::viewDidAppear addresses the issue. I will keep an eye on it and let you know if the issue reappears with this change. I think this also explains why putting breakpoint in asyncRender was causing the issue to disappear. When I had it in viewWillAppear, it wasn't helping until I put a breakpoint in asyncRender. Putting breakPoint in asyncRender was probably forcing render to happen after viewDidAppear. |
[[MGLMapView alloc] initWithFrame: styleJSON: accessToken:]; I receive this error when the user go out of the app and back to the app, The error turns the map view black in my case ideas? |
The StyleURL from this method is empty when you close the app and re-open the app (or push the mapviewcontroller from another view)... void Map::prepare() {
|
@mb12 how are you updating the map from uiviewcontroller? for me still the same problem... |
@mb12 @robipresotto How is this looking to you currently on |
I think the issue that I've reported and the one @robipresotto is referring to are different issues. 1.) From MBXViewController, push/present an new UIViewController. The MapScreen turns black unless touched / re-rendered. I am able to work around it by forcing re-render from viewDidAppear. |
okay, can be! i can open a new issue. |
Doesn’t currently seem to reproduce with push or show segues in storyboards. Let’s see if it reproduces programmatically… |
@mb12, I still can’t reproduce the issue on master (iOS 8.3 iPhone 6 Simulator, iOS 8.2 iPhone 5 Simulator, iOS 8.2 iPhone 6): Can you share the code you’re working with? |
Sorry I misunderstood your question.
I've updated to the latest repo. Let me try by commenting the call to triggerUpdate in viewDidAppear. |
This bug is fixed in the latest repo. Latest MGLMapView uses drawInRect to call renderSync from drawInRect:. Thank you very much for following up on this and fixing it properly. |
Glad to hear it’s working now! |
This consistently reproduces. Here is how to reproduce it.
Screen is black after tapping back.
This is what I have tried to figure out the root cause so far. Please note #2 (Issue disappears when breakpoint inserted inside asyncRender callback function).
1.) I tried forcing rerender via Map::update from viewWillAppear (UIThread) but it does not seem to help.
2.) If I put breakpoint inside asyncRender to debug whether the render is actually happening, the issue disappears.
The text was updated successfully, but these errors were encountered: