-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 returns duplicate results #3099
Comments
@sleepycat There's a caveat mentioned in the docs that may be the reason you're seeing this:
|
@davidtheclark: Thanks for pointing that out. I had read that at some point and it had slipped my mind. These are just single points, so I wouldn't expect them to span tiles. If I turn on |
@sleepycat The intent of |
With 65 points in bounds in my "markers" layer and 5 rendered I get: map.querySourceFeatures("markers", {filter: ["has", "address"]}).length
Array[258]
map.queryRenderedFeatures({layers: ["markers"]}).length
14 I'm expecting The fact that the features are sometimes split across tiles and therefore shows up multiple times seems to be a detail/side-effect of the underlying implementation. I guess what's being questioned here is the value of exposing those implementation details to the callers of Does having the same point show up 2-4 times in the results array impart some information that they can act on? My particular usecase (you can decide how representative of the average that is), is that I want to generate a summary chart of the various types of markers within the current bounds. If the current behaviour of Thoughts? |
The reasons that
Mapbox GL JS is primarily a rendering library. The implementation of |
Please see the JSbin that reproduces this issue.
mapbox-gl-js version: 0.23.0
Steps to Trigger Behavior
Expected Behavior
With a single feature rendered, the expected behaviour is that queryRenderedFeatures returns a single copy of that feature.
Actual Behavior
QueryRenderedFeatures returns between 0 and 4 copies of the same feature.
This issue may be related to #2647. That issue is reporting that sometimes no data is returned. At issue here is that when data is returned, it's multiple copies of the same data.
If you feel this is a duplicate (oh the irony) feel free to close or fold it into #2647 .
The text was updated successfully, but these errors were encountered: