Gavin Kistner
8/24/2006 3:09:00 PM
Mariano Kamp wrote:
> I am still wondering how to kickstart the maps. I haven't found any
> simple svg maps to reuse and am not sure how to draw some myself.
If you have Adobe Illustrator and can find free maps in any vector
format (eps, ai, pdf, etc.) you can open them in Illustrator and save
them as SVG files.
> I was more thinking along the lines of using an ordinary xml builder.
> I am not so sure what a library could add on top of that?
Having used the ruby svg library only a little bit, a while ago, my
impression is that it adds convenient classes for common shapes and svg
entities. For example, the <circle .../> element legally has cx, cy,
and r properties in SVG; the SVG library provides convenient accessor
methods for those properties, implicitly preventing you from adding
attributes that are not included in the schema. Using REXML directly
would give you no such nice framework.
It's not a terribly robust SVG library, IMO. For example, it makes no
attempt to provide convenient interface for describing a complex path,
instead providing only raw access to the 'd' attribute. Still, it's a
little better than nothing. (Personally, I wish its classes inherited
from REXML element, providing all the rich flexibility of REXML for
managing the document as may be needed.