Shape annotations need to support more features in the exposed API.
Definite:
Maybe:
@friedbunny
"Line/fill image" could also be useful for specifying symbols, like arrows. CartoCSS supported this via marker-type: arrow.
Line stroke would also be nice to have.
Can we expose exactly the set of properties that are in the style spec?
Can we expose exactly the set of properties that are in the style spec?
In C++, sure. We shouldn't do this all the way up in iOS because it would just crap up the delegate protocol, since that's where we configure these things (on a per-annotation basis).
Line stroke would also be nice to have.
BTW, this is in there for polylines already. For polygons, see https://github.com/mapbox/mapbox-gl-native/issues/1737 for why we can't do this right now.
@incanus I suppose I mean "stroke" in the Photoshop sense — an external casing around the filled line. Right now this requires duplicating the line and widening it, unless I'm missing something.
De-prioritizing this in light of https://github.com/mapbox/mapbox-gl-native/pull/1839, which solves the immediate problem at hand.
What about different colors or each shape point? Than there might be the possibility to make color gradients between each point to have something like heat maps for graphs.
@webventil Interesting idea, but not yet supported in the renderer, let alone exposed. Mind opening a new ticket for the feature so we can track?
I created a new issue for it (#2142).
Updating title to reflect that this is not specific to shape annotations -- markers could also benefit from style properties like icon-size and icon-rotate.
This ticket is superseeded by https://github.com/mapbox/mapbox-gl-native/issues/837 which will allow the full range of style properties.
@jfirebaugh Should we close this in favor of #837 then?
Reopening: the runtime styling API (#837, #5626) has landed on iOS and macOS, but something directly compatible with the existing annotation API would be a boon for developers who have to use that API for various reasons.
Per https://github.com/mapbox/mapbox-gl-native/issues/6172#issuecomment-242769482, support for additional annotation properties is mainly a matter of plumbing through style properties that can be applied to the symbol, line, or fill layer that the annotation adds to the style. We want to avoid a proliferation of methods on MGLMapViewDelegate; at the same time, MapKit’s MKOverlayRenderer class hierarchy may be a poor fit for our annotation implementation. Instead, we could introduce the idea of a _prototype style layer_: a single method on MGLMapViewDelegate, -mapView:prototypeStyleLayerForAnnotation: that returns an MGLStyleLayer object. The SDK would extract the underlying mbgl::style::Layer object and use it in mbgl::LineAnnotationImpl::updateStyle().
Re-closing; I feel strongly that we should focus our limited resources on the runtime styling API.