javascript 插画自动映射到图像映射?或者,还有更好的方法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3833052/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
illustrator map to imagemap automatically? or is there a better way?
提问by liz
I have a vector illustrator file with all the counties of California as distinct paths. I need to have these counties be links to other pages online. is there a way to automatically generate an HTML imagemap from this file? illustrator provides an export as a jpg function that has options for polygonal imagemap shapes, but it isn't working.
我有一个矢量插画文件,其中包含加利福尼亚州的所有县作为不同的路径。我需要将这些县链接到其他在线页面。有没有办法从此文件自动生成 HTML 图像映射?illustrator 提供导出为 jpg 函数,该函数具有多边形图像映射形状的选项,但它不起作用。
alternatively, do you have an opinion about the usage these days of imagemaps at all and whether I should approach this another way?
或者,您是否对这些天图像映射的使用有任何看法,以及我是否应该以另一种方式处理这种情况?
yes, I know I could do this in flash but I want to avoid that.
是的,我知道我可以在 flash 中做到这一点,但我想避免这种情况。
thanks!
谢谢!
回答by LHMathies
You can use the Attributes panel to set a link on each path, and then use Save for Web and Devices to save as HTML or HTML+Image -- that creates an imagemap in the HTML file.
您可以使用“属性”面板在每个路径上设置链接,然后使用“为 Web 和设备保存”来另存为 HTML 或 HTML+图像——这会在 HTML 文件中创建图像映射。
回答by Ryan
In addition to LHMathies answer please note that the path in Illustratormust not be a compound path in order to use the "Polygon" shape. The HTMLoutput of a Compound Path will result in a "rectangle" shape.
除了 LHMathies 的答案,请注意Illustrator中的路径不能是复合路径才能使用“多边形”形状。HTML复合路径的输出将导致“矩形”形状。
To convert a compound path to a simple path right click the path and select Release Compound Path.
要将复合路径转换为简单路径,请右键单击该路径并选择释放复合路径。
回答by bgmCoder
Ah, I was looking for this very solution, and thanks to LHMathies' answer above, and ryandoss's tips, I worked out a complete mini-tutorial, which I put in this other SO thread.
啊,我一直在寻找这个解决方案,感谢上面 LHMathies 的回答和 ryandoss 的提示,我制定了一个完整的迷你教程,我把它放在另一个 SO 线程中。
I was able to create an imagemap from a Photoshop file in just a few minutes.
我能够在短短几分钟内从 Photoshop 文件创建图像映射。

