Lock two maps to same center and zoom

Hi Dashers,

I have two maps that show different aspects of the same data (a transit statistic per census tract on the left, and a population figure on the right). I’ve used uirevision = "The User is always right" to maintain the state of zoom and center across revisions.

I’d like to add a toggle button that also lets the user decide whether to lock the two zooms and centers together, but I’m not sure how to share state across two objects.

Any thoughts on how to achieve this?

James