Visible by default
Queries match only what a user can see: the style's paint is evaluated for each feature.
MapLibre's queryRenderedFeatures also returns features painted with opacity 0, a transparent colour or zero size — so a
naive "the feature exists" check passes on something no user can see. Here queries match only what a user can see: the
layer's paint properties are evaluated for that feature (data-driven expressions, zoom, feature-state), and a failure says
which property hid it ([NOT VISIBLE: circle-opacity evaluates to 0]) and why: its value, the expression branch that
produced it, and the zoom (-> parks#7 is not visible at zoom 11.2: fill-opacity is 0 because the match on ["get","kind"] took its fallback for kind="park"). visible: 'any' opts out; visible: false matches
only the invisible ones. expect(map.feature(q)).toBeVisibleOnMap() adds a pixel probe at one point of the feature
(catches a transparent icon image; what one point misses is in Limits). On a map not wholly inside the browser
window, the probe scrolls the map into view to choose that point and scrolls back in the same task: an assertion leaves the
page where it was (the app's scroll listeners still see a scroll event, with nothing moved). While the page is still
scrolling by itself (the app's own smooth scroll), the probe does not scroll: a feature outside the window then has no
verdict until the scroll ends. Only actions leave the map scrolled into view. A feature in a part of the map that a scrolling panel around it clips gets no verdict either way.
Actions refuse an invisible feature unless { force: true }. How it works: DESIGN — Visibility.
How the paint is evaluated, and why an uncertain answer counts as visible, is explained in What “visible” means.