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

queryRenderedFeatures and layer visibility #2402

Closed
ansis opened this issue Apr 6, 2016 · 7 comments
Closed

queryRenderedFeatures and layer visibility #2402

ansis opened this issue Apr 6, 2016 · 7 comments

Comments

@ansis
Copy link
Contributor

ansis commented Apr 6, 2016

Does queryRenderedFeatures return features if their layer's visibility is none?
Should it return features if that's the case?

@mourner
Copy link
Member

mourner commented Apr 6, 2016

Maybe make this an option of queryRenderedFeatures? hidden: true, turned off by default, which would also include features with 0 opacity, and otherwise exclude.

@jfirebaugh
Copy link
Contributor

Non-visible layers are, by definition, not rendered. Therefore they shouldn't be returned by queryRenderedFeatures.

@mourner
Copy link
Member

mourner commented Apr 6, 2016

The main use case would probably be something like #2400. If we never return hidden features, there's just no workaround for this.

@mcwhittemore
Copy link
Contributor

queryRenderedFeatures reminds me a lot of ray-picking and would thus not return things that don't make up what is seen by the user. It sounds like 'querySourceFeatures' should have a geospatial param.

We talked about this a bit on #2106

@roelvanhintum
Copy link

I ran into this same problem, as a workaround i've set circle-opacity to 0.01. It's enough to make it invisible. This works for now, but a nicer solution would be welcome.

@jordandudley
Copy link

Should the interactive property of layers have any effect on the results of queryRenderedFeatures? I apologize if this is considered too far off topic.

@ansis ansis self-assigned this Apr 19, 2016
@jfirebaugh
Copy link
Contributor

Closing per #2402 (comment).

@jordandudley The introduction of queryRenderedFeatures obsoleted the interactive property. The code no longer uses it in any way.

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

6 participants