-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
forEachFeatureAtPixel returns wrong layer if feature already selected #3878
Comments
Thanks for the bug report. I'm working on this now. |
@ahocevar For what it is worth, I tested this patch and it got me past the initial bug, but now I am hitting some other issue with attempting to keep track of a clicked feature and mouseover feature that I will have to research some more. |
that should fix it, but I'll take a look later today |
yes, that fixes my issue, thanks. Only situation that might not work with this is if you have unmanaged layers included in the layer filter - not sure whether that's a realistic use case, though. :-) |
I added documentation to make clear that the forEachFeatureAtPixel layer filter does not filter unmanaged layers. |
This problem has returned. Still the same situation of having 2 select interactions on the same layer/feature. Worked fine after this fix up to v3.11.2. Stops working with v3.12 (only just got around to upgrading, which is why I'm just reporting). There have been several versions of this, and I've got a bit confused as to what was changed where and why, but I think that 279eae1 (#4472) is the culprit. Either interaction on its own works fine but, with both together, the 2nd one triggers the interaction but evt.selected is empty. There is no filter function, only a layer option restricting selection to the vector layers. |
Following situation used to work, but no longer does since removal of FeatureOverlay:
This seems to be because map.forEachFeatureAtPixel is returning the wrong layer: the overlay layer not the original vector layer, so it's failing the layer filter. I think the problem is around https://github.com/openlayers/ol3/blob/master/src/ol/renderer/maprenderer.js#L173 which I think should also be applying the layer filter so it only returns features on the original layers, not the overlay layer.
The text was updated successfully, but these errors were encountered: