border - How to Automatically Create ImageMaps of Grey Maps from Wikipedia? -
i have project using various members of wikipedia's grey maps: http://en.wikipedia.org/wiki/wikipedia:blank_maps. fill them in colors depending on countries, states or provinces user selects clicking on shape or checking checkbox.
i write script creates imagemaps automatically of each country, state or province somehow getting x , y pixel location of borders of country, state or province albeit without names of these entities, fill in later. have done world map hand , found open source map image map demo. create maps more rapidly.
i use php , gd floodfill shapes, guess use 1 central pixel location of shapes well. suggestions? script possibility still manual: http://abhinavsingh.com/blog/2009/03/using-image-maps-in-javascript-a-demo-application/. mapedit, http://www.boutell.com/mapedit/, has magic wand feature works pretty well, again have feeling can done automatically.
an perfect solution issue using svg images , translator of svg code imagmap area tags: http://www.electricfairground.com/polygonator/. result appropriate image map, although svg image may need resized, , countries or provinces seem offset , jumbled up. require opening page generated svg image or exported png copy of svg file, in wysiwig editor allows move imagemap elements.
i'm trying figure out pattern of offset , if i'll post here: http://wherehaveibeen.info/images/polye.html. author of "polygonator" clued me service , using svg map images article here: http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/. advocates there, tracing of png images svg images via inkscape. since wikipedia has maps in svg format, why not go straight code? turns out svg files have polygons separated , border regions speciied, @ least in wikipedia grey maps, http://en.wikipedia.org/wiki/wikipedia:blank_maps, need cleaning polygonator.
i found if opened svg code in notepad++ copy , paste in entire contents of svg file , polygonator remove unneeded code. little clean of imagemap area tags required afterwards not much. biggest problem mentioned generated area tags regions offests , occasionl jumbled overlapping locations of imagemap areas in generated code.
Comments
Post a Comment