-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
Motivation
As MVT spec does not allow passing arrays or objects as features property, the shortcut is to pass them serialized as string, and parse it later if needed.
The problem here is when trying to use one specific element of that specific property for filtering or styling, it looks back to the original info in the tile and it will find a string. So, no way.
Proposal
Adding new casts to expresions
- to-object (~ JSON.parse(value)):
- use:
["to-object", my_object_like_value <string>]
- example:
- use:
fill-opacity:["get", "myopacity", ["to-object", ["get", "myproperty"]]]
- to-array (~ value.split(separator)):
- use:
["to-array", separator <string>, my_array_like_value <string>]
- example:
- use:
fill-opacity: ["number", ["at", 23, ["to-array", ",", ["get", "myproperty"]]]]
josemazo, Destinyyyy, fminuti, gorshkov-leonid, jstratman and 10 more