-
Notifications
You must be signed in to change notification settings - Fork 40
Support multiple layers on a single map #34
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
Conversation
| "react-map-gl": "^7.1.5" | ||
| }, | ||
| "devDependencies": { | ||
| "@jupyter-widgets/base": "^6.0.6", |
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.
This is a type-only dependency, so I think it's ok to have it as a dev dependency. And probably better this way, as it won't interact with whatever version jupyterlab is using.
| let [subModelState, setSubModelState] = useState< | ||
| Record<string, BaseGeoArrowModel> | ||
| >({}); |
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.
This manually stores the state of all child layers
|
@vgeorge I think this is ready to merge if you'd like to take a look at it! Any feedback is appreciated! It looks like it works, but maybe there's a cleaner way to implement it 🤷♂️ |
|
Merging now to make follow up prs off the main branch, but feedback still welcome |
* attempt async use effect * scratch work * wip * simplify js model * flesh out model * Clean up model state transfer * Remove existing callbacks * Add initial view state to Map * separate function for sub model state * remove empty file * bump version


Change list
WidgetManager.get_model(). In this PR's implementation, it manages asubModelStateobject that contains a mapping from layer id to model data. Each model data now has a class (likeScatterplotModel) that wraps each layer model with strong typing and which also manages instantiating event handlers to update the map when the model data changes.todo:
Follow ups for future prs:
__repr__to make the repr of a layer pass its data intoMap()? Thus making it easy to render just one layer, but directing people to create aMapdirectly for more control.initial_view_statefor the top-levelMapobject.tsxapps for specific layersCloses #33