-
Notifications
You must be signed in to change notification settings - Fork 11
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 geoJSON source and layer #30
Conversation
I believe we'll have two cases:
In the first case, your approach is good I think. We can also provide the ability to embed the JSON into our file, but we should probably not do it by default. The second case will appear if the user tries to add a geojson from the Python API in the notebook, something like: # in-memory JSON creation
geojson = {"features": [...]}
jgis_document.add_json_source(geojson) |
f4c7c2b
to
b65a34e
Compare
This PR also updates the toolbar to display some categories. |
Looks great! I will give a review. Just a comment from your screencast, it seems you could use |
I think it looks great as-is. My comments can be resolved in follow-up PRs. |
I feel like it overloads the toolbar indeed. Also, from a UX point of view it would feel better to create the source and the layer at the same time in one click, similar to what we've done for custom raster sources. |
examples/boundaries.json
Outdated
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.
ezgif-3-3aca4e2c99.mp4
I can help with the conflicts if needed |
…source properties
Co-authored-by: martinRenou <[email protected]>
Co-authored-by: martinRenou <[email protected]>
@martinRenou I added commits to use only one form to create both the GeoJSON source and the vector layer. |
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.
Let's merge and iterate! Thanks a lot
This PR will add geoJSON sources and vector layers.
Discussion:
Do we want to save the data in the shared document ?
Currently the file path is saved as a source in the shared document, and the data are read when creating the source in the map tool.
The main advantage of saving the data is to be more easily reactive to changes in the data (no need to manually reload the file).
The main drawback is probably the size of the shared document if several geoJSON data are used. Also other kind of data (not geoJSON) might need a parser to be correctly included in the shared document. To avoid this, we could add some kind of "listener" on data file, and update the source in the map tool automatically.
Follow up