Feature request: expression for string.split(<separator>) #8526
Labels
cross-platform 📺
Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
feature 🍏
Motivation
Underlying problem: The MVT format does not support array properties
I want to send 48 numbers (between 0 and 1) along with every feature. These values represent congestion in electrical grid lines over 48 hours. I want to have a time slider to pick the hour, and style every feature according to their individual congestion at that hour.
A workaround for this that I've used in OpenLayers is to use a string property, which contains all the values separated by semicolon. They are then split up in the style function, and the "current congestion" (according to the slider) is used to style each line individually.
It seems like this is not easily doable in Mapbox GL, which is why I'm making this feature request.
Design Alternatives
It might be the case that there is some good alternative to this approach that I'm not seeing (that does not severely affect performance or scalability).
Design
Proposition: implement the following expression:
Example:
The behavior should essentially be the same as the following (javascript):
The text was updated successfully, but these errors were encountered: