Zooming in and out two images at the same time - is it possible? #61
-
Hi! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @kimohyeong, thanks for opening the issue. I think this is outside the scope of the library as it's a very specific use case. It's a cool idea and I'm open to adding a demo using third party libraries to Storybook but don't think it should be built into the library. It's totally possible to do though, you would just need to handle the logic yourself. People have done similar things with Mapbox https://coronavirus.data.gov.uk/details/interactive-map/vaccinations I'd recommend looking at something like https://www.npmjs.com/package/react-zoom-pan-pinch and use their event handlers to keep both images in sync. For example, you could store the state of the current zoom level and position in state and then use that to set the zoom level on both images. I'm going to convert this to a discussion incase you have anymore questions. |
Beta Was this translation helpful? Give feedback.
Hey @kimohyeong, thanks for opening the issue.
I think this is outside the scope of the library as it's a very specific use case. It's a cool idea and I'm open to adding a demo using third party libraries to Storybook but don't think it should be built into the library.
It's totally possible to do though, you would just need to handle the logic yourself. People have done similar things with Mapbox https://coronavirus.data.gov.uk/details/interactive-map/vaccinations
I'd recommend looking at something like https://www.npmjs.com/package/react-zoom-pan-pinch and use their event handlers to keep both images in sync. For example, you could store the state of the current zoom level and position …