1

I have two vector tile sources A and B and for each one layer. Both sources are loaded initially, the layers are set to not visible and can be toggled to be visible.

When a feature from source A is selected on the map, I want to query features from source B, although the layer from source B is not rendered/visible (but the source is loaded). But I get an empty array as result. When I toggle the layer from source B to be rendered, the resulting array contains elements. But this should be exactly the behavior of querySourceFeatures() to query also the non-visible layers. Otherwise I could also use queryRenderedFeatures().

var related = this.map.querySourceFeatures("source-B",
    {
      sourceLayer: "layer-from-source-B",
      filter: [">", ["get", "temp"], 10]
    })

I checked if source B, the layer and the tiles are all loaded, which is fine.

map.isSourceLoaded(source-B) -> true
map.getLayer(layer-from-source-B) -> true
map.areTilesLoaded() -> true

Any idea why this could happen?

Robbert
  • 109
  • 5

0 Answers0