-
-
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
Add "action type" select to select-features example #2276
Conversation
worth adding an |
Yes, possibly. Also, by default, the select interaction uses a singleClick condition. This means that there's some delay between the click and the actual feature selection. We could also add ol.events.condition.click for people who want the feature selection to be more responsive, and don't care if feature selection triggers on double-clicks. We could even make the interaction use ol.events.condition.click by default. I think I tried that in the past but ran into problems. I can't remember what these problems were. I'll maybe give it another try. |
See #1946 for an old pull request of mine that adds a click condition. The reason why singleclick is used in the examples is to avoid selection on doubleclick-zoom. Having said that, I never was a fan of this, and this is why I created the above pull request to use click in my own applications, where doubleclick zoom is disabled. |
Thanks @ahocevar. See my new commits. |
I would add a note to select-features.html explaining the difference between click and single-click. In this example, large parts of the viewport are covered by features; if you just have a few points, the click/dbl-click issue doesn't really arise, as people are unlikely to dbl-click on a point anyway. |
I think the new conditions miss the I agree with @probins that the types in the examples should have a description. Btw. when assigning the Otherwise this looks great to me. |
well spotted! how come Travis doesn't consider this an error, if they're not exported? |
AFAICT, the |
No, it also makes the symbol exportable. |
Because we don't de-reference ol.events.condition.click. I was just passing |
Review comments taken into account. Please tell me if my changes do address all of your comments. Thanks. |
Making it possible to choose between three select interactions, one that works on "singleclick", one that works on "click", and one that works on "mousemove".
lgtm |
Add "action type" select to select-features example
Making it possible to choose between two select interactions, one that works on singleclick ("click") and another one that works on mousemove ("hover").
See https://groups.google.com/d/msg/ol3-dev/JWpcS_31zeg/UTfypkXqBl0J.