Having a bit of trouble with my SVG and background image. I've managed to set up zooming and panning for the SVG, but the background image is not cooperating. When I move horizontally, the background image moves along with the SVG, but it doesn't follow when I move vertically.
I'm trying to achieve this without using any libraries like svg-pan-zoom. The final setup will involve touch screen functionality with onclick events replaced by touchstart events linked to a different SVG. But for now, I'm testing it out with simple buttons.
It's important for me to add the background image using CSS instead of including it inline with the SVG to avoid bloating its file size.
Additionally, I need to maintain the fixed size of the div to support panning effectively.
Is there a way to scale both the SVG and background image uniformly?
You can check out my JSFiddle here. (Note: The script may not work in JSFiddle, but should run fine on a server).