Extracting path data from an SVG map to use in RaphaelJs

Srikanth picture Srikanth · Nov 23, 2009 · Viewed 13.1k times · Source

I'm trying to build an an interactive map using RaphaelJS (e.g. http://raphaeljs.com/australia.html). Please check the source. It requires map path data to input. There is no clear explanation anywhere about how to obtain this information, other than the fact that illustrator or inkscape are capable of doing it. I'm looking to obtain "States" path data from this India map: http://en.wikipedia.org/wiki/File:India-locator-map-blank.svg

Answer

Skunkie picture Skunkie · Dec 7, 2009

well, this one is easy. SVG is just a simple XML file. So you don't have to "extract" anything via Illustrator.

Just open the SVG in any text editor and it's all there! (the path data string you can use with RaphaelJS path-function is held in the d-attribute of the path nodes).

Watch our for copyright issues when using SVG files of others ;)

Skunks