【发布时间】:2012-11-16 04:36:29
【问题描述】:
我有以下 SVG 元素,其中包含要显示在网页地图上的标记。标记由引用各种小型 PNG 图像的 <image> 元素组成:
<svg id="OL_105_svgRoot" width="1246" height="373" viewBox="0 0 1246 373">
<g id="OL_105_root" style="visibility: visible;" transform="">
<g id="OL_vroot">
<image id="P115" cx="843" cy="203" r="1" x="827" y="188" width="32" height="32" href="spider.png" ...>
<image id="P119" cx="453" cy="269" r="1" x="437" y="254" width="32" height="32" href="zoo.png" ...>
<image id="P123" cx="628" cy="82" r="1" x="612" y="67" width="32" height="32" href="wild.png" ...>
<image id="P131" cx="10495" cy="69" r="1" x="1034" y="53" width="32" height="32" href="export.png" ...>
...
</g>
</g>
</svg>
有什么方法可以用一个大的图像文件替换这些图像,并使用类似于 CSS background-position 属性的东西来指定每个图像的查看窗口?
【问题讨论】:
标签: javascript css svg