Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
filter a featurelayer for several values of a specific property mapbox gl js

I'd like to filter a feature layer for several values of a specific property, something like

"filter":["==","COUNTY",[array of filter values]]
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

There are three ways to do this:

With match

"filter" : [
  "match",
  ["get", "COUNTY"],
  ["County1", "County2", ... ],
  true,
  false
]

With in:

"filter" : [
  "in", 
  ["get", "COUNTY"],
  ["literal", ["County1", "County2", ... ]]
]

With any:

"filter" : [
  "any", 
  ["==", ["get", "COUNTY"], "County1"],
  ["==", ["get", "COUNTY"], "County2"],
  ...
]
about 4 years ago · Juan Pablo Isaza Denunciar

0

Try this one:

"filter" : [
  "match",
  ["get", "COUNTY"],
  ["County1", "County2",...],
  true,
  false
]

You can read more about Mapbox GJ JS Expression on this page: https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#match

Sometimes you can do the edits in Mapbox Studio as check the code behind to reuse in JS later. Screenshot: https://ibb.co/z5D8rh3

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda