You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to get the current line-color value (or any other property) of a feature which was queried using queryRenderedFeatures? I think of a method which evaluates the data-driven styling of the layer against the current feature?
Thats the data-driven styling for the line-color property: {"line-color":{"stops":[["NONE","#1f91ef"],["360","#00d150"]],"property":"projection","type":"categorical"}}
The text was updated successfully, but these errors were encountered:
bloigge
changed the title
Display line-color of clicked feature
Query line-color of clicked feature
Aug 8, 2019
A combination of queryRenderedFeatures and getPaintProperty on the feature's layer will return the layer's line-color. But if that value is a data-driven style or an expression, there is no way to evaluate either within mbxgl.
But if it's a categorical data-driven rule like you have above, it's easy to implement your own conditional logic, by accessing the relevant property in the queried feature (in your example it would be projection) and translating it to the output color.
Is it possible to get the current line-color value (or any other property) of a feature which was queried using
queryRenderedFeatures
? I think of a method which evaluates the data-driven styling of the layer against the current feature?Thats the data-driven styling for the line-color property:
{"line-color":{"stops":[["NONE","#1f91ef"],["360","#00d150"]],"property":"projection","type":"categorical"}}
The text was updated successfully, but these errors were encountered: