-
Notifications
You must be signed in to change notification settings - Fork 166
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
EditMode RFC #212
EditMode RFC #212
Conversation
selectedIndexes: number[], | ||
guides: ?TGuides, | ||
onEdit: (data: TData, editContext: any) => void | ||
onUpdateGuides: (guides: ?TGuides) => void, |
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.
Add more details / descriptions about these parameters.
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.
done. Please review and let me know if there are questions about them.
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.
What does TGuides
look like?
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.
TGuides
is intentionally abstract. For the BaseGeoJsonEditMode, it'll be a GeoJSON feature collection. But another type of edit mode (e.g. h3 hex editing) may use another data type for guides.
handleClick(event: ClickEvent): void {} | ||
handlePointerMove(event: PointerMoveEvent): { cancelMapPan: boolean } {} | ||
handleStartDragging(event: StartDraggingEvent): void {} | ||
handleStopDragging(event: StopDraggingEvent): void {} |
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.
- These methods are all public API? Could you differentiate between private and public ones?
- Is
EditMode
responsible of registering/deregistering events?
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.
- Good idea
- No. The
handle...
functions would be called by something that registers the event handlers (e.g.EditableGeoJsonLayer
)
Pull Request Test Coverage Report for Build 1374
💛 - Coveralls |
This change includes a couple of breaking changes for the `translate` mode. Details are in changelog. This is necessary in order to decouple the `ModeHandler` interface from deck.gl for the upcoming `EditMode` refactor (#212)
|
||
2. It is specific to GeoJSON. But there are desires to support editing other kinds of geometries (e.g. Hexagons using [H3](https://uber.github.io/h3/#/)). | ||
|
||
## API |
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.
Could provide a simple example about how to use EditMode
. I could also help with this since react-map-gl-draw
is going to use this class.
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 think this is achieved now for EditableGeoJsonLayer
* contains `EditableGeoJsonLayer`, a deck.gl `CompositeLayer` | ||
* `@nebula.gl/geojson-modes` | ||
* depends on `@nebula.gl/core` and [turf.js](http://turfjs.org/) | ||
* contains all the modes for editing GeoJSON |
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.
- List all the currently supported modes
- Maybe mention how to create a custom EditMode?
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.
Is this ready to merge? |
@supersonicclay is this ready? |
I want to get a little farther with #222 before merging this one. Specifically I think we may want to document the |
Are we there yet? |
After talking through this in more detail with @xintongxia, we made some tweaks to the interface to make it more stateless and functional. Those tweaks are in #258, so will need to update this RFC after landing #258. |
77704f8
to
d54326c
Compare
d54326c
to
3cf2a11
Compare
No description provided.