Reputation: 117
I would like to show the two letter state code on states in the United States of America in mapbox. I've taken a look at the state-label
editor shown here:
The closest option is iso_3166_2
but this prepends all the labels with a US-
like US-OH
. Is there a way to just have OH
? any information would be helpful.
Thanks!
Upvotes: 0
Views: 608
Reputation: 131
I found out that we can use string operators to modify the string as well. https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/
In your case, slice(coalesce(iso_3166_2), 3, 5)
seems to work
Upvotes: 2