Skip to content

Creating map widgets #292

Answered by manzt
giswqs asked this question in JavaScript
Discussion options

You must be logged in to vote

Would you mind me asking a follow-up question?

Sure thing.

EDIT: I have moved and edited the prior content from here to Jupyter Widgets: The Good Parts in the anywidget documentation. I have left the recommendation for your use case below, but recommend reading the new docs.

Recommendation

Traitlets should be preferred over custom messages since widget state can be fully serialized and recreated without Python running. Write logic that treats your view.model as the source of truth (see the anywidget Two-Way Data-Binding Example.

For your MapWidget I'd recommend thinking about representing the layers as a traitlet and then writing a render function that creates and modifies the map objec…

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by manzt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #25 on September 17, 2023 16:41.