我在SVG上有一些路径元素。 SVG使用可从传单库中获得的SVG层,我正在使用d3在其上绘制路径。
我尝试将.attr('pointer-events, 'visible')
添加到path元素,但无济于事。将相同的属性添加到地图上的圆形元素可使其单击,但对于路径元素则无效。我已经从stackoverflow的答案中尝试了d3 moveToFront,但这也不起作用
<g class="pathGroup" pointer-events="visible"><path pathId="1" class="path" dataVal="115" stroke-width="5" fill="none" stroke="#b8e986" cursor="pointer" pointer-events="visible" d="M145.87172093226562 116.5293275524338 L155.12827906773438 117.47067244756622"></path><path pathId="1" class="path" dataVal="115" stroke-width="5" fill="none" stroke="#b8e986" cursor="pointer" pointer-events="visible" d="M 204.92163481440843 121.97790752495305 Q207.54418495009392 172.34326962881687 218.07836518559157 123.02209247504695"></path></g>