AnsweredAssumed Answered

How to dynamically color VectorTileLayer in JavaScript 4.6?

Question asked by jlchmura on Feb 13, 2018
Latest reply on Feb 14, 2018 by odoe

How does one dynamically style a vector tile layer based on data that is external to the layer?

Filtering clearly works, per George Bochenek example: GitHub - gbochenek/vector-tile-demo-js: Demo Application for switching vector tile styles on the fly  Likewise, the paint.fill-color can be changed to a single color.


However, as soon as I add an expression, the layer disappears. Does ArcGIS Javascript 4.6 not support the full Mapbox spec?  For example, we should be able to use a match expression like this:

tileLayerStyle.paint['fill-color'] = [ "match", [ "get", "Origin"], "ORD", "#FF0000", "DEN", "#FF0000", "#000000" ];

So if that isn't supported, what is the recommended way of doing this type of styling?