sync view state, move over code from #113, refs #112 #444
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created a new PR toward #112, essentially copying over the code from #113, but applying it against
main.@kylebarron this seems to work!! It does seem to make the map a bit slow for me, and we should investigate that, but in principle, this for me works as expected.
On the javascript, I can move and zoom the map around and then in python call:
Where
mis aMapinstance, and I get the currentviewStateas it is on the map.Conversely, to modify the view state on the map, in Python I can do something like:
The above code works to set the
zoomon the map to 8.I think it will still be great to get eyes on this from React folks, and maybe think about if we could upstream the
useModelStateDebouncedmethod or so, but in principle, this seems to work!