Search code examples
svgjquery-svg

How to add zoom-in zoom-out control to an SVG file


I'm trying out to bring zoom-in and zoom-out control panel to a .svg file. Basically i'm using the .svg file found in http://upload.wikimedia.org/wikipedia/commons/4/4d/US_weather_service_county_map.svg. I can bring custom style and feature to the map. But how can i bring or alter the svg file to have a zoom-in zoom-out control in it (like the one in google maps and all)

Your help will appreciated greatly

Thanks


Solution

  • Here's an example that shows an SVG file with a zoom/pan control. It sets the currentScale and currentTranslate attributes on the SVG root element to perform zooming/panning.