views:

609

answers:

2

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: h t t p : / / en.wikipedia.org/wiki/File:India-locator-map-blank.svg

Please advice.

+2  A: 

Hi Srikanth,

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

Skunkie
A: 

For older SVG files the path data will need to be optimized for RaphaelJS. Open the file in Inkspace and save as Optimized AVG. If you have an AVG file that opens as a blank image in Adobe Illustrator, edit the file with a text editor and set the first two values of the viewBox to 0,0. Both steps may be required when working with map AVG files from Wikipedia.

Loren