使用raphael.js或其他一些js库缩放和平移svg图像 [英] Zooming and panning svg images using raphael.js or some other js library

查看:367
本文介绍了使用raphael.js或其他一些js库缩放和平移svg图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个小脚本,它将在一个具有2个功能的帧中显示SVG(矢量图像);

I am in need of a small script that will display an SVG (vector image) within a frame that has 2 functions;


  1. 可以平移图像(移动以查看带光标的svg图像的
    的不同部分)与谷歌地图相似。

  1. The image can be panned (moved around to look at different parts of the svg image with the cursor) simmilar to google maps.

SVG图像也可以放大和缩小到谷歌
地图,但不需要加载新图像,因为图像
是矢量。

The SVG image can be zoomed in and out on also simmilar to google maps except there will be no need to load new imagery as the image is a vector.

对于一个simmilar脚本,我看到它适用于普通图像格式,请参阅 http://jibbering.com/routeplanner/

For a simmilar script i have seen that works with normal image formats see http://jibbering.com/routeplanner/

推荐答案

如果有人仍然感兴趣:我刚刚为Raphael找到了Pan和Zoom的实现。还是一个非常年轻的项目,但我觉得很有趣:

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

此处在线演示:
http: //htmlpreview.github.com/?https://raw.github.com/escobar5/raphael-pan-zoom/master/examples/complete-map/index.html

这篇关于使用raphael.js或其他一些js库缩放和平移svg图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆