Product expression causes features to not render

▼魔方 西西 提交于 2019-12-24 21:52:14

问题


I have a map with linear features that have an offset in the style:

"line-offset": {
  "stops": [ [ 12, 0 ], [ 16, 2 ] ]
},

If I try to substitute the value 2 with a product expression, the features fail to render.

"line-offset": {
  "stops": [ [ 12, 0 ], [ 16, ["*", 2, 1] ] ]
},

There is no error in the javascript console.

I am using the latest version, v0.49.0.

Am I using the expression correctly?


回答1:


To use expressions, you would need to change the syntax:

"line-offset": [
  "interpolate",
  [ "linear" ],
  [ "zoom" ],
  12, 0,
  16, ["*", 2, 1],
]


来源:https://stackoverflow.com/questions/52397366/product-expression-causes-features-to-not-render

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!