You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being able to either get information from a Source without it being visible on the map.
What use cases are we trying to accommodate?
Point in polygon tests is one. eg. where the point is the mouse cursor and the polygon is coming from a source not visible/rendered on the map.
Design
In #2402 it was decided that queryRenderedFeatures will not return features not rendered on the map, which rules out solutions like this #2402 (comment).
However the complimentary querySourceFeatures doesn't accept a geometry like queryRenderedFeatures so it won't work for point-in-polygon tests either, as far as I understand.
Current workarounds such as setting the opacity to 0.01 so that it's included in queryRenderedFeatures or obtaining the whole geometries from querySourceFeatures and using turf's point in polygon test, or using the tilequery api, aren't ideal.
Mock-Up
As per #2402 (comment) what about including a geometry option in querySourceFeatures just like queryRenderedFeatures does?
The text was updated successfully, but these errors were encountered:
I'm in favor of adding a geometry argument to querySourceFeatures to make it's signature more similar to queryRenderedFeatures.
That being said, there's no obvious way to implement this feature internally that would be more efficient than filtering the output of querySourceFeatures downstream. Because of this, such a feature will be low priority for the GL JS team. We'd happily consider a PR with tests 😄
Closing as something that didn't get enough interest from users and maintainers to address. Also feels nice to close an issue with an ominous number like that :)
Motivation
What problem are we trying to solve?
Being able to either get information from a Source without it being visible on the map.
What use cases are we trying to accommodate?
Point in polygon tests is one. eg. where the point is the mouse cursor and the polygon is coming from a source not visible/rendered on the map.
Design
In #2402 it was decided that
queryRenderedFeatures
will not return features not rendered on the map, which rules out solutions like this #2402 (comment).However the complimentary
querySourceFeatures
doesn't accept a geometry likequeryRenderedFeatures
so it won't work for point-in-polygon tests either, as far as I understand.Current workarounds such as setting the opacity to 0.01 so that it's included in
queryRenderedFeatures
or obtaining the whole geometries fromquerySourceFeatures
and using turf's point in polygon test, or using the tilequery api, aren't ideal.Mock-Up
As per #2402 (comment) what about including a geometry option in
querySourceFeatures
just likequeryRenderedFeatures
does?The text was updated successfully, but these errors were encountered: