-
Notifications
You must be signed in to change notification settings - Fork 7
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 point selection type to selection package #372
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: a8e63fc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@HenFo Overall, this already looks quite good.
a few minor TODOs:
If you have any questions, please feel free to ask, I will be happy to assist. |
I made the requested changes. However, I am not sure about further tests as I just started working with react and trails, so I am not that experienced with UI tests. I extracted the common functions into a helper file, since inheritance would only add complexity for functions that should be some kind of mixin rather than class bound. |
@HenFo Basically, the functionality is fine. Though, I have one concern. const [selKind, setSelKind] = useState<SelectionKind>("extent");
<Selection
sources={sources}
selectionMethods={selKind}
onSelectionComplete={onSelectionComplete}
onSelectionSourceChanged={onSelectionSourceChanged}
/>
</TitledSection>
<Button onClick={() => setSelKind("point")}>switch</Button> In React these "none-reactive" components are sometimes considered to be a anti-pattern. |
@arnevogt didn't see that! Hope this will come with some more experience ;)
I also noticed that I created ambiguous typing with the name SelectionKind, as it already exists. |
@HenFo |
|
I extended the selection package to allow the user to select features using a single click on the map.
It is fully compatible with the extent selection and all sources that already support it.