Skip to content

v0.21.0

Compare
Choose a tag to compare
@bcamper bcamper released this 02 Aug 22:43
· 27 commits to master since this release

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 color
      • font.background.alpha: optionally modify box fill alpha
      • font.background.stroke.color: text box stroke color
      • font.background.stroke.alpha: optionally modify box stroke alpha
      • font.background.stroke.width: text box stroke width (defaults to 1px)
    • 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
      

tangram-1596403969461

  • 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>
            ...
      
  • 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

  • Outlines are now properly extruded with their lines #749
  • Remove use of flatMap()
  • Upgrade earcut library to v2.2.2 #755