简体   繁体   English

Snap.svg的缩放和窗格UI元素

[英]Zoom and Pane UI Elements for Snap.svg

I'm using Snap.svg for the presentation of my svg on a webpage. 我正在使用Snap.svg在网页上演示我的svg。 This works fine and I already implemented a zoom and a pane modus of the map by using the scroll wheel and the "dragging" technique. 效果很好,我已经通过使用滚轮和“拖动”技术实现了地图的缩放和窗格方式。
In case of no availability of a mouse, I would like to integrate ui elements for zooming and panning. 在没有鼠标的情况下,我想集成用于缩放和平移的ui元素。

As implementing them by using input-range elements and custom arrows seems not to be the best option, I would like to ask if someone knows a library or something else, where such map ui elements are provided. 由于使用input-range元素和自定义箭头来实现它们似乎不是最佳选择,因此我想问一问,是否有人知道图书馆或其他提供此类地图ui元素的地方。 I only found those in combination of the use of the respective system (leaflet,mapbox,google, etc.), but not for general use cases. 我仅在结合使用各个系统(传单,地图框,谷歌等)的情况下才发现它们,但在一般用例中却找不到。

You can actually use leaflet for svg presentation surprisingly easily. 实际上,您可以轻松地将传单用于svg演示。 Take a look at this example: 看一下这个例子:

http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html

Then replace the URL in that example to your local svg. 然后将该示例中的URL替换为本地svg。 Instant pan/zoom for your svg! 即时平移/缩放您的svg!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM