Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda