Initiate new center on load SVG pan zoom

635 Views Asked by At

To change the position of an SVG with SvgPanZoom one has to use

panZoomInstance.pan({x: *value*, y: *value*});

But this causes SvgPanZoom to move the SVG initially from center to the new position, as it will first place the SVG in the middle of the viewport by default.

Is there a way to force a different center point of the SVG onload before SvgPanZoom will place the SVG?

Best, hirschferkel

1

There are 1 best solutions below

2
On

svg-pan-zoom has 3 options that you can disable:

, fit: true
, contain: false
, center: true