Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add geometry parameter to querySourceFeatures #3666

Closed
andrewharvey opened this issue Nov 20, 2016 · 2 comments
Closed

add geometry parameter to querySourceFeatures #3666

andrewharvey opened this issue Nov 20, 2016 · 2 comments

Comments

@andrewharvey
Copy link
Collaborator

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 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?

@lucaswoj
Copy link
Contributor

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 😄

@mourner
Copy link
Member

mourner commented Jul 31, 2018

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 :)

@mourner mourner closed this as completed Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants