开发者

How to do automatic imagemaps for regions/borders in a map

开发者 https://www.devze.com 2023-04-11 18:17 出处:网络
I\'m searching for an automated way of generating imagemaps for world, country and region maps. Currently I have an imagemap of regions for one country which was generated manually using this tool. B

I'm searching for an automated way of generating imagemaps for world, country and region maps.

Currently I have an imagemap of regions for one country which was generated manually using this tool. By clicking a region you are then presented with a sub-region map which was also manually generated. Clicking in the sub-region would redirect to a different page.

At the moment this works for one country but I would like to expand this to other countries.

Ideally the solution should allow one to easily select a country and the corresponding ima开发者_Go百科gemap would be presented. I've thought of using Google Maps or a similar online tool, but so far I was unable to find enough information or a suitable API to get the task done.

I've also found this tool but it's unclear how to automate the imagemap generation (or if it's even possible to do so).

Any help or suggestions are welcome.

Cheers


Not the perfect solution but what I was able to do so far:

(Using @Lapple solution's, with the modifications below I was able to use the script provided)

I've use the maps available here.

1 - Open the map with inkscape,
2 - File - Inkscape preferences - svg output and remove the option allow relative coordinates,
3 - Select the object and move to right and left,
4 - Save a copy as plain svg,
5 - Next open the svg file with some editor, remove the line saying viewBox and save,
6 - Open again with inkscape, select the object and ungroup,
7 - Resize the object, as you wish, don't forget to rescale proportionally, Object - Transform - Scale,
8 - File - Documents properties - Resize page to content - Resize to drawing,
9 - Select all the regions and group,
10 - File - Vaccum defs,
11 - Finally export as bitmap, png.

With these steps I was able to use the script provided in the comment by Lapple.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号