简体   繁体   中英

How to set circle-color using filters in mapbox data-expression?

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.

You want the all expression:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM