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 draw control component #767
Conversation
[WIP] add draw control Switch to eventManager add style callback add styling add delete operation add testing geometries rebase
@georgios-uber @supersonicclay FYI, lightweight "alternative" to nebula.gl being added to react-map-gl, would be nice to see if any alignment of API / semantics could be done such that this could be thought of as a "nebula light". |
You may look at naming the prop Another thing that was super useful in nebula was to support custom modes that can be provided by a consuming application. Nebula calls them import {DrawPolygonHandler, ModeHandler, EditableGeoJsonLayer} from 'nebula.gl';
class MyAwesomeModeHandler extends ModeHandler {
// override onClick, onDrag, etc
}
// ...
new EditableGeoJsonLayer({
modeHandlers: {
'drawPolygon': DrawPolygonHandler, // DrawPolygonHandler is a built-in mode supported by nebula
'myAwesomeMode': MyAwesomeModeHandler // a custom mode that is either specific to their app or one that we didn't think of or haven't built yet in nebula
},
mode: 'myAwesomeMode'
}); |
It isn't documented really well, but here's the base And here are the built-in modes that nebula provides: |
mode={mode} | ||
features={features} | ||
selectedId={selectedId} | ||
onSelect={this._onSelect} |
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.
Might rename this to onSelectionChanged
so it can support select and deselect and, in the future, multi-select.
@xintongxia @supersonicclay Do you think this can import and use nebula's mode-handlers? |
This component has been moved into https://github.com/uber/nebula.gl/tree/master/modules/react-map-gl-draw |
for #734