如何对地图中的区域/边界进行自动图像映射
我正在寻找一种自动生成世界、国家和地区地图图像地图的方法。
目前,我有一个国家/地区的区域图像地图,它是使用此 工具 手动生成的。通过单击某个区域,您将看到一个子区域地图,该地图也是手动生成的。单击子区域将重定向到不同的页面。
目前这适用于一个国家,但我想将其扩展到其他国家。
理想情况下,该解决方案应该允许人们轻松选择一个国家,并显示相应的图像地图。我曾考虑过使用 Google 地图或类似的在线工具,但到目前为止我无法找到足够的信息或合适的 API 来完成任务。
我还找到了这个工具,但不清楚如何自动生成图像地图(或者是否有可能)这样做)。
欢迎任何帮助或建议。
干杯
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 imagemap 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是完美的解决方案,但到目前为止我能够做的:(
使用@Lapple解决方案,通过下面的修改,我能够使用提供的脚本)
我已经使用了可用的地图 此处。
1 - 使用 inkscape 打开地图,
2 - 文件 - Inkscape 首选项 - svg 输出并删除允许相对坐标的选项,
3 - 选择对象并左右移动,
4 - 将副本另存为纯 svg,
5 - 接下来用一些编辑器打开 svg 文件,删除 viewBox 行并保存,
6 - 使用 inkscape 再次打开,选择对象并取消分组,
7 - 根据需要调整对象大小,不要忘记按比例重新缩放,对象 - 变换 - 缩放,
8 - 文件 - 文档属性 - 调整页面大小以适应内容 - 调整大小到绘图,
9 - 选择所有区域和组,
10 - 文件 - 真空定义,
11 - 最后导出为位图、png。
通过这些步骤,我能够使用 Lapple 评论中提供的脚本。
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.