Menu
  • HOME
  • TAGS

Pan to specific X and Y coordinates and center image svg-pan-zoom

svgpanzoom

I managed to answer my question: I first pan to point 0,0 using the method: panZoom.pan({x:0,y:0}); I then get the 'real Zoom' value by: var realZoom= panZoom.getSizes().realZoom; To pan and centre at specific x and y, use the pan() method and pass x and y coordinates like in the example...

svgpanzoom: beforeZoom on return false doesn't halt

javascript,svgpanzoom

The problem is that when you zoom using mousescroll it is done relatively to the point of mouse pointer position. Thus you don't just scroll, you also pan. In your example only prevents zooming but panning is still working when scrolling using mousescroll. A solution would be to also cancel...

createSVGMatrix is not a function : SVG loading on Firefox but not on Chrome

javascript,angularjs,svg,cross-browser,svgpanzoom

Ok, so the issue came from angularJS : <object id="svgElement" type="image/svg+xml" data="../SVG/{{currentLanguage}}/{{currentCartography}}.svg"> It seems your browser doesn't support SVG. </object> It looks like Chrome doesn't accept the object because at the page loading, my angular variable are not set yet. I resolved this by doing : <object ng-show="currentCartography" id="svgElement" type="image/svg+xml"...

SVG zoom with svg-pan-zoom.js performance issues in Mozilla Firefox

javascript,firefox,svg,svgpanzoom

Check your refreshRate option. Maybe you set a high number. If not then you may set a low number (ex. 10 which means max 10 frames per second) and if may improve your problem. Other than that I don't know of any other problems in svg-pan-zoom. At least if pan...