0

I'm working on a project that requires an interactive map. I want to use an SVG document with some custom javascript code embedded in it much like this developer has done:

http://treeblurb.com/xmap/svg/melbourne_central.svg

Achieving what I want to do is trivial but I can't tell which browsers would support this level of interaction. Essentially I need to:

  1. Embed custom script tags into the document.
  2. Adjust attributes of nodes (i.e. fill)
  3. Add mouse events to specific elements.

I guess my question is - if a browser supports native SVG, would it allow me to do all of these things?

Jim Jeffers
  • 17,572
  • 4
  • 41
  • 49

2 Answers2

1

Native SVG is supported by most versions of Chrome, Firefox, Opera and Safari. IE8 does not support it, but IE9 and above does. Android supports it from Honeycomb onward.

You may want to take a look at Raphael. It not only makes SVG-like functionality available in IE8 and below (by falling back to VML), it also provides methods to manipulate all objects, which you can even combine with JQuery.

There's also good information comparing Raphael to JQuery SVG here.

Community
  • 1
  • 1
Diego
  • 18,035
  • 5
  • 62
  • 66
0

I.E. 8 and earlier does not support SVG. Android 2.3 and earlier also does not support SVG. Check out more browser compatibility issues here: http://www.caniuse.com/

Travis J
  • 81,153
  • 41
  • 202
  • 273