Open twifast opened 4 years ago
Hi, try this, it worked for me
<ReactSVGPanZoom
ref={Viewer}
onClick={(e) => {
const point = e.point;
const target = e.originalEvent.target;
const id = target.id;
const tagName = target.tagName;
console.log("Click:", tagName, id );
console.log("Point", point);
Viewer.current.setPointOnViewerCenter(point.x, point.y, 10);
}}
>
<svg width={width || 0} height={height || 0} >
{content}
</svg>
</ReactSVGPanZoom>
HI. How can I use ReactSVGPanZoom onclick get the ID and NAME of SVG polygon rect.