如何使用嵌套值来使用 case == 运算符?就像是:
this.map.setPaintProperty("somelayer", "fill-color",
["case",
["==", ["properties:some_prop"], someval],
"#34c0dd",
"#499bbc"]
Run Code Online (Sandbox Code Playgroud)
其中属性是字典:
properties = {
some_prop: 1,
some_prop2: 2,
// and so on
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试过["properties.some_prop"],["properties"]["some_prop"]但效果并不好。
以及如何打印 mapbox 查询(例如 console.log 或其他内容)?