This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
Core Graphics–driven style layer #7823
Labels
archived
Archived because of inactivity
feature
iOS
Mapbox Maps SDK for iOS
macOS
Mapbox Maps SDK for macOS
MapKit parity
For feature parity with MapKit on iOS or macOS
runtime styling
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 aSource
. 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./cc @jfirebaugh @lucaswoj @lbud
The text was updated successfully, but these errors were encountered: