stamen / chartographer

https://stamen.github.io/chartographer/
MIT License
19 stars 4 forks source link

Fix line and typography section bugs #43

Closed aparlato closed 2 years ago

aparlato commented 2 years ago

Closes https://github.com/stamen/chartographer/issues/39

The line chart wasn't rendering because we were letting conditionals through expandLayers without evaluating them since we weren't expecting conditionals to be nested unless they were nested inside of scales. They can also be nested in math expressions which were tripping us up.

In addition, text-font receives an array as a value, but when that array is in a larger expression (like a scale), it has to be wrapped in a literal expression so the parser knows it's not trying to be another expression. This was tripping us up where we rebuild scale expressions for all values. You can always give a text-font array value a literal wrapper, so we do that now just in case.

Last thing regarding the openstreetmap-americana style is that it is intended for MapLibre, so because we use Mapbox GL to parse expressions and render, you'll still see errors for the text-rotation-alignment value of viewport-glyph which is valid in MapLibre and not Mapbox. This won't get fixed here (and maybe never unless we choose to support MapLibre explicitly).