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

Core Graphics–driven style layer #7823

Closed

Description

@1ec5

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

Activity

  1. added
    iOS
    macOS
    MapKit parity
    on Jan 23, 2017
  2. 1ec5 commented on Jan 24, 2017

    @1ec5
    ContributorAuthor

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

  3. added
    archived
    on Nov 15, 2018
  4. stale commented on Nov 24, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  5. 1ec5 commented on Mar 12, 2019

    @1ec5
    ContributorAuthor

    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.

  6. reopened this on Mar 12, 2019
  7. removed
    archived
    on Mar 12, 2019
  8. added
    archived
    on Sep 8, 2019
  9. stale commented on Sep 8, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MapKit parityarchivedfeatureiOSmacOSruntime styling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions