我尝试使用以下代码更改 line-dasharray 设置,
'line-dasharray': [
"case",
['==', ['get', "user_class_id"], 'laneway'],[0.2,2],[0.3,2]
]
它给出了这个错误,
Error: layers.gl-draw-line-active.hot.paint.line-dasharray[2][0]: Expression name must be a string, but found number instead. If you wanted a literal array, use ["literal", [...]].
所以我根据错误建议修复了代码,
'line-dasharray': [
"case",
['==', ['get', "user_class_id"], 'laneway'],['literal',[0.2,2]],['literal',[0.3,2]]
]
它给了我这个错误,
evented.js:136 Error: layers.gl-draw-line-active.hot.paint.line-dasharray: data expressions not supported
有谁知道如何解决这个问题?