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

230
Vistas
Mapbox queryRenderedFeatures does not work as expected with bbox

I would like to get all features within a drawn polygon. In order to avoid iterating over all features of my layer, I constrain the queried features with a bbox. I calculate the bbox with the turf library.

However, the returned features do not correspond to the required bbox.

Attached you can see in the picture:

  • In blue: the calculated bbox
  • in red: the returned features from the queryRenderedFeatures() query.

Selected Features in bbox

import bbox from '@turf/bbox';

const bboxGeom = bbox(drawGeometry);

// convert to pixels for queryRenderedFeatures()
const southWest = map.project([bboxGeom[0], bboxGeom[1]]);
const northEast = map.project([bboxGeom[2], bboxGeom[3]]);
const box = [[southWest.x, southWest.y], [northEast.x, northEast.y]];
const features = map.queryRenderedFeatures(
   box, { layers: ['myLayer'] },
);
about 4 years ago · Juan Pablo Isaza
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