TextLayer filled/stroked options and getFillColor/getLineColor accessors
Target Use case
With certain map styles (or if an application supports switching map style) it can be difficult (or impossible) to select a text color that provides good contrast against all areas of the map. A simple workaround can be to render (for example) with a dark font color and a thin light color outline.
Proposed feature
Similar to PolygonLayer supporting filled/stroked props and corresponding color accessor functions, add those same props to TextLayer. For SDF fonts this can be implemented by using a different shader - see e.g. https://stackoverflow.com/questions/26155614/outlining-a-font-with-a-shader-and-using-distance-field
It would be fine if support is dependent on fontSettings.sdf=true.
To Do List
- [ ] Add label and assign to milestone
- [ ] Coding
- [ ] Doc update
- [ ] What’s new update
- [ ] Test
This is now available in 8.5.0-alpha.1: https://github.com/visgl/deck.gl/blob/master/docs/api-reference/layers/text-layer.md#outlinewidth-number-optional
fontSettings: {sdf: true} is required to use this feature.
Closing this issue to consolidate with #4579. If you have any feedback regarding this feature before the 8.5 release, feel free to discuss it in the master feature request thread.