Reputation: 3971
map.querySourceFeatures is returning different number of objects on different zoom levels. Is there a way to get all the data, not only visible? Thanks
var feature = map.querySourceFeatures("mapbox-postcodes", {
sourceLayer: ['Distribution'],
filter: ['==', ['to-string', ['get', 'name']], "someCode"]
});
Upvotes: 4
Views: 1135
Reputation: 126045
No. querySourceFeatures()
always returns features which have been loaded into the current viewport. It can't access anything other than the current zoom level.
The domain of the query includes all currently-loaded vector tiles and GeoJSON source tiles: this function does not check tiles outside the currently visible viewport.
Upvotes: 3