v0.21.0
New Features + Improvements
- Add support for text highlight boxes + underlines on point labels #761 #724 #723
- Add an optional box behind text labels via the following parameters in a new
font.background
block:font.background.color
: text box fill colorfont.background.alpha
: optionally modify box fill alphafont.background.stroke.color
: text box stroke colorfont.background.stroke.alpha
: optionally modify box stroke alphafont.background.stroke.width
: text box stroke width (defaults to1px
)
- Optional underline for text labels via new parameter
font.underline
underline: true
to enable text underline
- Text box fill, stroke, and underline are independent options which can be mixed and matched as desired. Example with all 3:
draw: text: font: ... background: color: white stroke: color: red width: 2px underline: true
- Add an optional box behind text labels via the following parameters in a new
- Support variable font weight ranges + JS function weights #757
- Variable fonts allow multiple variants of a font to be stored in a single file. Supporting these can streamline the Tangram font definition, reduces network requests, and introduces new cartographic flexibility for dynamically-driven font weights.
- Example supporting font weights of 200 through 800:
fonts: Open Sans: url: fonts/Open Sans.woff2 weight: 200 800
- Example of JS function-based font
weight
, e.g. mapping font weight to building heights:weight: | function() { return (feature.height||0) * 2 + 400; }
- Automatically add Leaflet attribution controls based on data source property #763
- Adds a new
attribution
property on data sources, which when present will add a Leaflet attribution control. Thanks @bdon! - Example:
sources: tilezen: type: MVT url: https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt attribution: Tiles by <a href="https://www.nextzen.org/" target="_blank">Nextzen</a> ...
- Adds a new
- Improved proxy tile handling for better coverage when zooming in/out (thanks @bdon!) #762
- Support for MultiPoint geometries in MVT data sources 8554c27
Bug Fixes / Internal