Replies: 1 comment
|
Use textOffset = switch(
input = feature["repeat"].asString(),
case("0", offset(0.em, (-0.25).em)),
case("1", offset(2.em, (-0.25).em)),
case("2", offset(4.em, (-0.25).em)),
fallback = offset(0.em, (-0.25).em),
)Those example ratios assume roughly 16 px text, where 32 px is about If you specifically need a paint-time pixel translation that does not change placement/collision behaviour, the portable workaround is to split the features into separate filtered Relevant spec entries: https://maplibre.org/maplibre-style-spec/layers/#text-translate and https://maplibre.org/maplibre-style-spec/layers/#text-offset |
Uh oh!
There was an error while loading. Please reload this page.
What are you trying to achieve?
I'm trying to set the SymbolLayer textTranslate based on feature properties? I've tried switch and step, but neither worked
Affected Platform(s)
Library Version
0.14.0
What have you tried?
Additional context
No response
All reactions