tangrams / tangram

WebGL map rendering engine for creative cartography
https://tangram.city
MIT License
2.22k stars 290 forks source link

`text_source` array fails for points labels #672

Closed meetar closed 6 years ago

meetar commented 6 years ago

TANGRAM VERSION:

Tested from v0.12.0 on – works as expected in v0.11.

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

Visit https://tangram.city/play/?#10.4708/37.7991/-122.5005 using this scene file:

sources:
    nextzen:
        type: TopoJSON
        url: https://tile.nextzen.org/tilezen/vector/v1/all/{z}/{x}/{y}.topojson

layers:
    water:
        data: { source: nextzen }
        draw:
            polygons:
                order: 1
                color: lightblue
            points:
                visible: false
                order: 2
                size: 10px
                color: red
                text:
                    text_source: [name, kind]
                    font:
                        size: 10px
                        fill: white
            text:
                text_source: [name, kind]
                font:
                    size: 10px
                    fill: white

…this shows text_source: [name, kind] working as expected for a text style. Then change visible: false to visible:true.

RESULT:

No text labels are drawn for the points style, and the console throws:

Layer 'water': cannot use boundary labels (e.g. 'text_source: { left: ..., right: ... }') for 'text' labels attached to 'points'; provided 'text_source' value was ["name","kind"]

EXPECTED RESULT:

I expect the points style to use the array in text_source as a list of prioritized feature properties to use for the text label.