The runtime styling API is in many ways more powerful than the MapKit-inspired annotation API, which consists of MGLAnnotation subclasses and styling methods on MGLMapViewDelegate. However, at least at the SDK level, the annotation API needs to stick around in some form to service annotation views, and having a MapKit-like, highly object-oriented API is desirable where feasible, because it’s more direct, focused, and discoverable than the runtime styling API. But over time, we should allow the runtime styling API to subsume the annotation API. Developers should be able to think of the annotation API as nothing more than a shortcut for runtime styling functionality, rather than an entirely separate code path.
As an alternative to or as part of #1734, we could migrate the SDK’s annotation API to MGLSource and MGLStyleLayer. MGLSource is basically a level of indirection around MGLAnnotation and subclasses. MGLStyleLayer serves essentially the same purpose as MKOverlayRenderer.
Per #5626 (comment) et seq., this work is blocked by:
This work would be complicated by:
/cc @incanus @jfirebaugh @frederoni @boundsj
The runtime styling API is in many ways more powerful than the MapKit-inspired annotation API, which consists of MGLAnnotation subclasses and styling methods on MGLMapViewDelegate. However, at least at the SDK level, the annotation API needs to stick around in some form to service annotation views, and having a MapKit-like, highly object-oriented API is desirable where feasible, because it’s more direct, focused, and discoverable than the runtime styling API. But over time, we should allow the runtime styling API to subsume the annotation API. Developers should be able to think of the annotation API as nothing more than a shortcut for runtime styling functionality, rather than an entirely separate code path.
As an alternative to or as part of #1734, we could migrate the SDK’s annotation API to MGLSource and MGLStyleLayer. MGLSource is basically a level of indirection around MGLAnnotation and subclasses. MGLStyleLayer serves essentially the same purpose as MKOverlayRenderer.
Per #5626 (comment) et seq., this work is blocked by:
Add paint property for icon image URL (Add paint property for icon image URL mapbox-gl-style-spec#485) for MGLAnnotationImage(fixed in [ios, macos] possibility to set custom images to style #6637)This work would be complicated by:
fill-outline-color(Remove "fill-outline-color" mapbox-gl-js#4088)/cc @incanus @jfirebaugh @frederoni @boundsj