I have closed SVG path that is the province of the country.
How to recognize point(x,y) is inside SVG path or outside by javascript?
Advertisement
Answer
Call document.elementFromPoint. If the position is in the path then it will return that element. If the path is not filled then you may need to adjust the pointer-events property so that it works properly.