-
Notifications
You must be signed in to change notification settings - Fork 290
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
No way to get features that are displayed on the screen #736
Comments
You can do You can also do See https://tangrams.readthedocs.io/en/latest/API-Reference/Javascript-API/#queryfeatures. |
I've looked through the docs extensively and tried using visible but as you mention, it doesn't solve my problem (I get features that are out of view). I see you closed the issue, is there somewhere else to log feature requests? Do y'all plan to support this at some point in the future? |
Sorry, you're right, this should be open as a feature request. That said, it's not straightforward to add as requested. It probably requires some form of ray-casting outside of the WebGL rendering pipeline, but that's a lot of code for this specific feature, and the engine currently discards the geometry CPU-side for memory/performance reasons. I can think of a potential approach that only includes things that are "truly" visible (based on the rendered framebuffer), meaning it would not include features occluded by other objects (behind buildings) or discarded by collision detection. That's useful in its own right, but has a different set of trade-offs. |
TANGRAM VERSION:
0.19.1
ENVIRONMENT:
Windows 10 firefox
TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:
RESULT:
The above code results in an array of features stored in
features
that includes features that are not visible on the screenEXPECTED RESULT:
I'd hope there is a way to get a list of all features which are shown on the map so that I can display some stats/metrics alongside the map without confusing the user by talking about features of the screen. I understand that
scene.queryFeatures(...)
returns features in the tiles that are used to render the currently visible map which often includes features that are not actually shown on the screen. Is there some other way of accomplishing this?The text was updated successfully, but these errors were encountered: