I am trying to implement some Zoom / Pan functions for maps created using the google geotext API. There are several online scripts for enlarging / panning svg images, but I do not succeed in implementing them for SVG created by geochart api.
I am trying to use the SVGPan library http://code.google.com/p/svgpan/
The code I use to add a script to SVG:
google.visualization.events.addListener(chart, 'ready', function () { var script = document.createElementNS('http://www.w3.org/2000/svg', 'script'); script.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'http://www.cyberz.org/projects/SVGPan/SVGPan.js'); var svg = document.getElementsByTagName('svg')[0]; svg.appendChild(script); });
Here's the jsfiddle:
http://jsfiddle.net/cmoreira/CetaA/
With Firebug, I see that the script is on svg, but nothing happens, it does not implement functions in svg, as expected.
I am not sure if this line is correct, since I did not find any examples on the Internet:
var script = document.createElementNS('http://www.w3.org/2000/svg', 'script');
Am I doing something wrong, or what am I trying to do will be impossible?
Thank you for helping! cheers Carlos
source share