Skip to content

Terrain can cause queryRenderedFeatures to not return all results at high zoom levels #6563

@neodescis

Description

@neodescis

When zoomed in far enough, the queryRenderedFeatures() function does not return all results if terrain is enabled.

maplibre-gl-js version: 5.9.0

browser: Chrome 141.0.7390.67

Steps to Trigger Behavior

  1. Add circles layer to the map
  2. Zoom in at least to around 14 or so, with points visible
  3. See results of queryRenderedFeatures() for the layer
  4. Turn on terrain
  5. See results of queryRenderedFeatures() for the layer has changed, sometimes drastically, from what was returned from 3 above, even if all the points are still visible

Link to Demonstration

https://jsbin.com/gehedaluvi/1/edit?html,output

This should already be zoomed and centered to a handful of points. Hit the terrain toggle button to see the rendered feature count change.

Expected Behavior

The queryRenderedFeatures() function should return all visible results when terrain is enabled

Actual Behavior

The queryRenderedFeatures() function does not always return all visible results when terrain is enabled

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions