Having 2 select interactions active at the same time #4822

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

Comments

Projects
None yet
2 participants
@probins
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@ahocevar

ahocevar Feb 12, 2016

Member

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

For the documentation issue, I created #4823.

Member

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

This comment has been minimized.

Show comment
Hide comment
@probins

probins Feb 12, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@ahocevar

ahocevar Feb 12, 2016

Member

Can you provide a JSFiddle with your test setup?

Member

ahocevar commented Feb 12, 2016

Can you provide a JSFiddle with your test setup?

@probins

This comment has been minimized.

Show comment
Hide comment
@probins

probins Feb 12, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@ahocevar

ahocevar Feb 16, 2016

Member

@probins I got a fix - see #4854.

Member

ahocevar commented Feb 16, 2016

@probins I got a fix - see #4854.

@probins

This comment has been minimized.

Show comment
Hide comment
@probins

probins Feb 17, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@probins

probins Feb 18, 2016

Contributor

@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. :-)

Contributor

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. :-)

@ahocevar ahocevar closed this in #4854 Feb 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment