如何在MAPBOX数据表达中使用过滤器设置圆形彩色?

发布于 2025-02-06 13:35:35 字数 386 浏览 2 评论 0原文

想要使用MAPBOX-GL-JS在地图上显示不同的彩色圆圈。

当前,可以使用以下方式显示不同的颜色

  'circle-color': [
      "case",
      [">=", ["get", 'count'], 12],
      "#000000",
      "#ffffff"
   ]

,但需要执行多个滤镜以进行单个颜色。

需要类似的内容:

[">=", ["get", 'count'], 120], && ["<=", ["get", 'count'], 200],

如果以上结果为true显示红色圆圈。

Want to show different colored circles on the map using mapbox-gl-js.

Currently it is possible to show different colors using:

  'circle-color': [
      "case",
      [">=", ["get", 'count'], 12],
      "#000000",
      "#ffffff"
   ]

, but need to perform multiple filter to be performed for single color.

need something like:

[">=", ["get", 'count'], 120], && ["<=", ["get", 'count'], 200],

and if above results to true show red color circle.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

箜明 2025-02-13 13:35:35

您需要all表达式:

   ["all",
      [">=", ["get", 'count'], 120], 
      ["<=", ["get", 'count'], 200],
   ]

You want the all expression:

   ["all",
      [">=", ["get", 'count'], 120], 
      ["<=", ["get", 'count'], 200],
   ]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文