origo-map / multiselect-plugin

Multiselect plugin for Origo
MIT License
2 stars 10 forks source link

Configurable behaviour for selection tool #21

Closed jokd closed 1 year ago

jokd commented 1 year ago

It should be possible to change the behaviour of the selection tool when clicking items. As of now the selection tool adds new items to the selection. (Unless they already are added and featureinfoOptions:{toggleSelectOnClick: true} is set then they will be removed when clicked.) Instead of adding/removing features, you may want to do a new selection by clear and select. Proposed solution is to either set the behaviour in the config or add a new "toggle"-button that sets how the selection tool should work.

asemoller commented 1 year ago

So how is this different if you add the feature in issue # 20? Then you can add by click, buffer or any other method and with a trash button remove all the selected items without closing the infowindow, right? Isn't this the same as above with clear and select? I guess I'm missing something here 😃

Just one thing, by default, you can just use ctrl+click on a selected item to remove it. So you don't need featureinfoOptions:{toggleSelectOnClick: true} to remove a selected item in the infowindow.

jokd commented 1 year ago

What i meant was that the tool makes a clear-and-select every time (if that is the way it is configured). Then you don't have to clear it manually. The toggle button would add a possibility to add to selection instead of make a new selection just like the present behaviour.

asemoller commented 1 year ago

Aha! Thanks for the explanation! Go for it! 😃