Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting path data from an SVG map to use in RaphaelJs

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

like image 674
Srikanth Avatar asked Nov 23 '09 02:11

Srikanth


1 Answers

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

like image 106
Skunkie Avatar answered Sep 23 '22 13:09

Skunkie