相关疑难解决方法(0)

如何在嵌套属性上使用mapbox“case”表达式?

如何使用嵌套值来使用 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 或其他内容)?

mapbox mapbox-gl mapbox-gl-js

4
推荐指数
1
解决办法
2820
查看次数

标签 统计

mapbox ×1

mapbox-gl ×1

mapbox-gl-js ×1