Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
forEachFeatureAtPixel returns wrong layer if feature already selected #3878
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.
This was referenced
Sep 21, 2015
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.