我希望通过坐标从SVG文件中获取对象ID。
例如,在以下代码中:
例如,在以下代码中:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1"
height="50" width="50">
<rect id="rectRED"
x="15" y="5" height="30" width="30"
style="fill:#ff0000;fill-opacity:0.5;stroke:#000000;stroke-width:1.5" />
<rect id="rectBLUE"
x="5" y="15" height="30" width="30"
style="fill:#0000ff;fill-opacity:0.5;stroke:#000000;stroke-width:1.5" />
</svg>
getObjectsAt(10,25)
应该返回一个包含rectBLUE
的列表getObjectsAt(25,25)
应该返回一个包含rectRED
和rectBLUE
的列表getObjectsAt(10,10)
应该返回类似于NIL
的东西
有没有一种方法可以实现这个目标?