Mapbox GL JS querySourceFeatures 到矢量切片层

Mapbox GL JS querySourceFeatures to vector tile layer

假设源 'composite' 在 Mapbox 服务器上。来源有 sourceLayer 'points'.
如何获取'points'层的所有特征?

如果我们写:

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

这不会在所有缩放级别上提供所需的结果。因为此函数不会检查当前可见视口之外的图块。
如何从 Mapbox 服务器请求 vector sourceLayer 中的所有功能?

你不能。如果你想要一个矢量图层的所有点,你应该:

  1. 将其存储为数据集,并下载数据集。
  2. 在上传到 Mapbox 并以某种方式使用之前存储它的本地副本。