-
Notifications
You must be signed in to change notification settings - Fork 38
combine text and icons into symbol render type #67
Comments
@ansis I suggested the first approach earlier mapbox/mapbox-gl-js#319 (comment), and I'm up for it. :) Relatively simple and should be a great improvement. The only problem with this is that having type "symbol", but different prefixes ("text-" and "icon-", and potentially "circle-") deviates from all other types and breaks consistency, which may cause confusion. But if we can document and explain it well, it'll be fine. |
@mourner you're right! I knew I had seen the idea mentioned somewhere Having different prefixes is a bit weird, but I think this would be the only case. circle-* should be a completely separate render type. |
Would we be able to incorporate the concept of shields into this as well? #36 |
I don't think so, since we need to place labeled circles (like icons) as well. |
What is a circle? Is this comparable to the default marker in carto (i.e. if you don't specify a marker icon file, a filled circle gets drawn)? If so, I prefer circles and icons to be specified similarly, since conceptually they are the same. |
Comparable, the only styling difference being that circle radius is flexible and can be transitioned. |
Yes, the image kind. The rectangular type might need something special. |
done in #79 |
I think we need to replace the text and icon render types with a combined symbol render type. This would allow us to place text and points only if they can both be placed, and more importantly allow placement to be interwoven. Both the icon and text for a feature would be placed before moving onto the next feature. If all icons are placed for a group of features before all text is (or the other way around), then the layer placed first blocks too much from the second. Every gl style so far has this problem.
Styles would change very little. The render type for both text and icons layers would change to "symbol". These layers would then be able to specify both text-* and icon-* render and style properties.
@kkaefer @yhahn @mourner
Other approaches that seem worse:
Multiple render types per layer. This makes layers more complex just to handle a single special case.
Having only text-* and letting icons be used in text-field. This makes text field replacement way more complicated. Getting the right offsets would be hacky. It also isn't flexible enough to allow different relative positions, for example a point on the exact feature with text s/n/e/w of it.
Handle the interweaving problem by letting later layers change the placement values for earlier layers' features. You'd need to add some priority value to each item that would get compared against colliding items' priorities. The priority would get incremented for each feature in the layer to simulate interweaving. This seems complicated.
The text was updated successfully, but these errors were encountered: