Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to query features that are not being displayed?

I would like to know if there is a way to query features that are not being displayed on a map.

Both queryRenderedFeatures and querySourceFeatures only work when the features are being displayed on the map.

I tried also to hide the features using setLayoutProperty with visibility and using setFilter. Both don't return features when queried.

example

like image 239
thiagoxvo Avatar asked Jan 16 '17 23:01

thiagoxvo


1 Answers

MapboxGL only requests tiles for the current viewport and zoom level. If it's not available via map#queryRenderedFeatures or map#querySourceFeatures then your MapboxGL map doesn't have the data you are looking for.

like image 99
Danny Delott Avatar answered Nov 03 '22 23:11

Danny Delott