V
V
voyager-studio2021-05-05 14:50:13
JavaScript
voyager-studio, 2021-05-05 14:50:13

How to scale svg map when scrolling through viewbox?

Hello! I have a svg map of the world. I want to implement zooming when scrolling, taking into account the coordinates of the cursor, so that it is easier to click on small countries. I googled that it is necessary to change the viewbox values ​​​​of svg, but I don’t know how to write such a function. Maybe there is a plugin or an example of such code?
Here you can see the map

Thank you in advance for your answer)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
igumenov, 2021-05-06
@voyager-studio

https://github.com/timmywil/panzoom
there is also information on how to hang on the scroll

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question