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.
Subclassing MGLOpenGLStyleLayer requires skill with OpenGL, but a developer may want to be able to programmatically generate a style layer using familiar Core Graphics or Core Animation APIs. As far as I can tell, if you attempt to use Core Graphics within MGLOpenGLStyleLayer, a crash occurs (but correct me if I’m wrong). A more natural approach to custom style layers would allow the developer to subclass MGLRasterStyleLayer and implement -drawInRect: or similar. (-drawInRect: is the standard way to implement a custom-drawn view in Cocoa and Cocoa Touch.)
Perhaps the developer could also implement -isAnimated. If it returns false, or perhaps even if it returns true, the SDK can upload a static MGLRasterStyleLayer to an OpenGL texture. @incanus previously experimented with a similar approach for layer-backed annotations in #1125 (comment).
Unlike the programmatically generated raster source proposed in #7471, a Core Graphics–driven style layer would redraw on every frame, not just when moving between integer zoom levels. I have no idea what this feature would look like at the mbgl level, but I believe it makes more sense as a Layer than as a Source. As with MGLOpenGLStyleLayer and the MGLComputedShapeSource being introduced in #6940, I don’t think we should expose this feature in the style specification in any form. So I don’t think this feature would integrate with mapbox/mapbox-gl-style-spec#656.
Activity
1ec5 commentedon Jan 24, 2017
This feature and #7471 would probably eliminate any demand to make MGLOpenGLStyleLayer an officially supported API.
stale commentedon Nov 24, 2018
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
1ec5 commentedon Mar 12, 2019
MGLOpenGLStyleLayer is still too hard to use for the average developer. An API based on Core Graphics would have much, much less of a learning curve.
stale commentedon Sep 8, 2019
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.