Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Core Graphics–driven style layer #7823

Closed
1ec5 opened this issue Jan 23, 2017 · 4 comments
Closed

Core Graphics–driven style layer #7823

1ec5 opened this issue Jan 23, 2017 · 4 comments
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

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jan 23, 2017

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.

/cc @jfirebaugh @lucaswoj @lbud

@1ec5 1ec5 added 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 labels Jan 23, 2017
@1ec5
Copy link
Contributor Author

1ec5 commented Jan 24, 2017

This feature and #7471 would probably eliminate any demand to make MGLOpenGLStyleLayer an officially supported API.

@stale
Copy link

stale bot commented 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.

@stale stale bot closed this as completed Nov 24, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented 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.

@1ec5 1ec5 reopened this Mar 12, 2019
@stale stale bot removed the archived Archived because of inactivity label Mar 12, 2019
@stale stale bot added the archived Archived because of inactivity label Sep 8, 2019
@stale
Copy link

stale bot commented 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.

@stale stale bot closed this as completed Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

1 participant