Can we access/convert the String value from Expression<StringValue>? #616
Replies: 2 comments
-
You can learn more about style spec expressions here: https://maplibre.org/maplibre-style-spec/expressions/. You can't get the runtime string while building an expression object. This is likely an XY problem; what are you actually trying to accomplish? |
Beta Was this translation helpful? Give feedback.
-
@sargunv thanks for your kind reply. Let me explain
and here is the SymbolLayer with iconImage to load dynamically
Where MapMarkerPainter("E") is Composable, which accepts the string and displays on the marker as we can also see from the above screenshot. My goal is that what I set in properties in icon like S,1,2,3,4... Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for working on mapLibre-compose, which is awesome.
I am using SymbolLayer to show the stops with composables in the iconImage section. in the feature section, I am setting the value of each stop with label like this
in the SymbolLayer, iconImage with switch cases working with feature["icon"].asString() which returns Expression
Is there any extension or way to convert or access to get String from Expression?
Here is SymbolLayer where I added the cases and adding the static hardcoded strings at this moment.
Thanks in Advance
Beta Was this translation helpful? Give feedback.
All reactions