Zooming and panning svg images using raphael.js or some other js library [closed]

限于喜欢 提交于 2019-11-29 20:28:05

If someone is still interested: I just found this implementation of Pan and Zoom for Raphael. Still a very young project, but interesting enough I think:

https://github.com/escobar5/raphael-pan-zoom

Online demo here: http://htmlpreview.github.com/?https://raw.github.com/escobar5/raphael-pan-zoom/master/examples/complete-map/index.html

Raphael is good, but not good enough.

Check out this page: http://code.google.com/p/svgpan/. It does exactly what you asked for.

Daniel Assange

I've derived Andrea's SVGPan into a (hopefully) more friendly Raphäel plugin :)

First you need to learn how to install a function that extends Raphael to support zooming... http://www.irunmywebsite.com/raphael/additionalhelp.html?q=addownmethodstocanvas

Next you want to implement Wout's zooming plugin... http://github.com/wout/raphael-zoom

You can try the scripts from IE9 test page http://ie.microsoft.com/testdrive/Graphics/42OrganizationChart/Default.xhtml Requires a little tweaking with ids but worked fine for me.

I ended up using the svg-pan-zoom which is derived from SVGPan, but allows zoomin/panning of an arbitrary svg element within your HTML, and can add controls.

SVGPan works great if your complete page is just a loaded SVG (like the tiger example), but not if your svg is somewhere deeper in the html.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!