Skip to content

Conversation

sufyanAbbasi
Copy link

@sufyanAbbasi sufyanAbbasi commented Aug 12, 2023

…tream serialization.

- Fix for jupyter-widgets#1119

- The main issue is that a `style()` function is added to the GeoJSON object in `create_obj()`, which triggers an error at serialization time: https://github.com/jupyter-widgets/ipywidgets/blob/e1718c2b3bf0b143580ef87f71c55fbc6ed50a77/packages/base/src/widget.ts#L587

- This is because `structuredClone` throws an error for functions: https://web.dev/structured-clone/#features-and-limitations. While the article mentions drawbacks for using `JSON.parse(JSON.stringify(...))`, I believe that this component does not produce any non-primitive properties, so will remove any offending lines.

- Tested by placing a breakpoint and testing directly on the browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Draw control can't stop drawing after draw more than one shape
1 participant