0
votes

Let's say that the source 'composite' is on the Mapbox server. Source has sourceLayer 'points'.
How can I get all the features in the 'points' layer?

If we write:

var features = map.querySourceFeatures('composite', {
    sourceLayer: 'points'
  });  

This will not give the desired result on all zoom lavels. Because this function does not check tiles outside the currently visible viewport.
How to request all features in vector sourceLayer from Mapbox server?

1

1 Answers

2
votes

You can't. If you want all points from a vector layer, you should either:

  1. Store it as a dataset, and download the dataset.
  2. Store a local copy of it before you upload to Mapbox and use that somehow.