Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't record MapBox #6

Open
kushsolitary opened this issue Mar 7, 2022 · 3 comments
Open

Doesn't record MapBox #6

kushsolitary opened this issue Mar 7, 2022 · 3 comments

Comments

@kushsolitary
Copy link

Hi,

I am trying to create a recording with an animated map (powered by Mapbox, runs on Metal) in the background but the map isn't rendered at all.

What I am trying to render:
https://user-images.githubusercontent.com/650476/157033105-54f4a8ea-7274-4d62-89ff-ffe2a85b80f4.mp4

What FlipBook renders:
https://user-images.githubusercontent.com/650476/157033169-fb171864-99fc-4e3d-8105-8102b1d686b5.mov

Is this is a known limitation or a bug?

@kushsolitary
Copy link
Author

Changing the fb_makeViewSnapshot function to this fixed it:

func fb_makeViewSnapshot() -> Image? {
    UIGraphicsBeginImageContextWithOptions(bounds.size, true, 0)
    
    drawHierarchy(in: bounds, afterScreenUpdates: false)
    let rasterizedView = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    return rasterizedView
}

abekert added a commit to abekert/FlipBook that referenced this issue Jun 1, 2022
@abekert
Copy link

abekert commented Jun 1, 2022

Here is the explanation: mapbox/mapbox-gl-native#6070 (comment)

@chatwyn An MGLMapView isn't a normal layer-backed view, but rather based on GLKView for OpenGL rendering. See mapbox/mapbox-gl-native#1701 for more background, but you can probably use a combo of -[GLKView snapshot] and your current approach for the parts atop the GL view for now.

I also faced a crash when I was rendering a MKMapView.

Opened a PR for it.

@hidoon
Copy link

hidoon commented May 28, 2024

@kushsolitary @abekert you guys are the best! thank you so much for the solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants