Hi,
I've just dived into the deep end once again - this time it’s SVG that I’m trying out.
Before now, I was producing maps using perl to extracting the relevant data from MySQL, to shade the sectors of the map using GD.pm, and to spit the resulting html at the client. The problem with the sectors I use on my map is that they have no correspondence with county lines, which the client would be familiar with. Therefore, my preferred solution is to place an image map over the map and display the towns in a sector as the mouse passes over it. I was about half way through implementing this when I gave up, as the file size was become ridiculous and it was really, really awkward and time consuming.
Heres an example minus the image map
Anyway, I wish to explore animation this week so I'm trying to implement the above using SVG. So far I have a generic map (no shading), which displays the towns as earlier explained. In order to produce this map, I used the bitmap to svg utility, and this results in svg paths defining each sector.
Now I need to interface this with perl, so that the relevant shading can be done. Therefore, would it be sensible to load the SVG document into perl, parse it (SVG is XML), and simply add fill statements to the SVG doc stored in memory? Then spit this to the client. The reason I don’t think its practical to code everything in perl is because I end up with a large SVG file after the bitmap conversion – and this basically consists of path lists defining the coordinates for each sector.
Thanks,
Barry.
Non Perl Related: I’m also interested in having 2 versions of the same map as part of the one svg document. Just like in my current png versions (linked to above), where I have two identical maps side by side, but with different shading. To do this I could make a bitmap containing the 2 maps, and convert as before. But this will double the size of the file, which I wish to avoid. Is there a better alternative to this?