-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make geometries non-movable in the Exploration feature #936
Make geometries non-movable in the Exploration feature #936
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm the presets and the custom geometries are working as expected. Great job @dzole0311 🙌
modes: { | ||
...MapboxDraw.modes, | ||
simple_static: StaticMode, | ||
simple_select: customSimpleSelect, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, what is the difference between simple_static
and simple_select
mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have really named this only static
instead of simple_static
, but it's basically two different modes. simple_static
disables all user interactions (including dragging, and prevents vertices from showing up per polygon) because that's the behavior we want to try out for the presets. The simple_select
mode is almost the same as before, aside from the dragging of the feature as a whole being disabled (but vertices are still shown and can be interacted with).
So simple_static
is only for the presets at the moment, while the simple_select
is for uploaded assets or hand-drawn features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for a clean and concise solution 👏 I left a question to understand more clearly about when to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on your first couple of PRs! lgtm
Got the tiniest of nitpicks - even though user-drawn geometries are not draggable (as intended), the mouse cursor still seems to indicate that it is (four-headed arrow ✥ ish). Not a blocker, though - please go ahead and merge this as-is! |
My apologies that we missed this one bug: US-GHG-Center/veda-config-ghg#372 (review) We can find a fix for this problem in many ways, but the foundational problem is that the state of MapboxDraw and React are not syncing (This problem is stated in this ticket: #710 (comment)) - We assume that any newly added feature is selected and mark it through atom but the feature added through preset is not selected in MapboxGL Draw. Now we have 3 ways of adding AOIs. We should walk-through what is expected for each mean and match the behavior between MapboxGLDraw and React. |
That is on me for rushing this through. 🙇 Let us see what the best resolution is - short-term and longer-term. |
Related Ticket:
Addressing #934
Description of Changes
Two changes made, both affecting only the new map component in the Exploration page:
Notes & Questions About Changes
dragMove
and thedragFeature
methods for thesimple_select
anddirect_select
isPreset
, then it should be handled differently etc.Validation / Testing
static
so that no vertices are visible nor it can be dragged