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

Having 2 select interactions active at the same time #4822

Closed
probins opened this issue Feb 12, 2016 · 7 comments
Closed

Having 2 select interactions active at the same time #4822

probins opened this issue Feb 12, 2016 · 7 comments

Comments

@probins
Copy link
Contributor

@probins probins commented Feb 12, 2016

I reported in #3878 (comment) that the problem I had when 2 select interactions are active at the same time was reoccurring. I've been investigating this further, and it looks like the problem only occurs when there is a 'layers' option. I tried reproducing the problem on the select-features example, and failed, but then noticed that there is no 'layers' option there. I am using the layers option in my code simply to restrict the layers to the vector layers, which should make it marginally faster, but is not essential. If I remove this option, the code works again.

So, strictly speaking, this is a regression: code which was working before 3.12 no longer works, but it's not necessarily an important one. However, if there is a limitation on when the 'layers' option can be used, then this should be documented. There was a release note on forEachFeatureAtPixel, but it's not at all obvious that this also applies to the 'layers' option on the select interaction.

Also, I notice that the docs for the layers option currently say this is 'Required'; this is surely not correct.

@ahocevar
Copy link
Member

@ahocevar ahocevar commented Feb 12, 2016

This issue was probably fixed with #4736. Are you able to test that?

For the documentation issue, I created #4823.

@probins
Copy link
Contributor Author

@probins probins commented Feb 12, 2016

My previous code does not work with master (at least, when I tried a couple of days ago), so, no, #4736 doesn't fix the issue.

@ahocevar
Copy link
Member

@ahocevar ahocevar commented Feb 12, 2016

Can you provide a JSFiddle with your test setup?

@probins
Copy link
Contributor Author

@probins probins commented Feb 12, 2016

http://jsfiddle.net/4exzxbr3/ adapted from select-features example.

Hover correctly selects, click select is triggered but e.selected is 0.
Comment out line 30, and click e.selected is correct: 1
Remove the layers option on both interactions, and e.selected is correct.

@ahocevar
Copy link
Member

@ahocevar ahocevar commented Feb 16, 2016

@probins I got a fix - see #4854.

@probins
Copy link
Contributor Author

@probins probins commented Feb 17, 2016

I'm off on my travels again on Friday, and have a lot to do before then. I'll try and find time to test this with my code. However, if my fiddle above works with the new patch, then it's likely my code will too, so I'd be fine with merging your change.

@probins
Copy link
Contributor Author

@probins probins commented Feb 18, 2016

@ahocevar just tested this on my code. Can confirm that my code both with and without layers option seems to work now. Thanks a lot. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants