JSFiddle - React, Tailwind, and code Playground
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Image originally created by Sameboat for Wikimedia projects and licensed under Creative Commons Attribution-ShareAlike 3.0. Unported-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1270" height="1300" viewBox="30 0 1270 1300" style="width:100%;height:100%" id="metro-svg">
<title>Moscow Metro map in Russian</title>
<defs>
<style type="text/css">
text {font-family:Liberation Sans,Arial,sans-serif}
text.st {font-size:13px}
text.ic {font-size:11px;font-weight:bold;text-anchor:middle}
text.small {font-size:10px;fill:#000;}
text.legendtext {font-size:15px}
text.legendst {font-size:12px}
text.legendic {font-size:12px;font-weight: bold;}
text.legendnum {font-weight:bold;font-size:15px}
text.title {font-weight:bold;font-family:Liberation Serif,Times New Roman,serif}
text.st tspan {z-index: 9; }
</style>
<circle id="ele-int" cx="0" cy="0" r="9" style="fill:white;stroke:black;stroke-width:1"/>
<g id="int2">
<path style="fill:none;stroke:black;stroke-width:9px;" d="M 0,0 L 27,0"/>
<use xlink:href="#ele-int" x="0" y="0"/>
<use xlink:href="#ele-int" x="28" y="0"/>
<path style="fill:none;stroke:white;stroke-width:7px;" d="M 0,0 L 28,0"/>
</g>
<g id="int2s">
<path style="fill:none;stroke:black;stroke-width:9px;stroke-linecap:round;stroke-linejoin:round" d="M 0,0 L 20,20"/>
<use xlink:href="#ele-int" x="0" y="0"/>
<use xlink:href="#ele-int" x="20" y="20"/>
<path style="fill:none;stroke:white;stroke-width:7px;stroke-linecap:round;stroke-linejoin:round" d="M 0,0 L 20,20"/>
</g>
<g id="int3-1">
<path style="fill:none;stroke:black;stroke-width:9px;stroke-linecap:round;stroke-linejoin:round" d="M 0,0 L 40,40"/>
<use xlink:href="#ele-int" x="0" y="0"/>
<use xlink:href="#ele-int" x="20.5" y="20.5"/>
<use xlink:href="#ele-int" x="41" y="41"/>
<path style="fill:none;stroke:white;stroke-width:7px;stroke-linecap:round;stroke-linejoin:round" d="M 0,0 L...
JavaScript
var Test = (function()
{
var map = document.getElementById('metro-svg'),
i = 0,
thisObj = this,
elements, text, station;
map.addEventListener('load', function()
{
elements = document.getElementsByTagName('tspan');
for(i; i < elements.length; i++) {
text = elements[i].innerHTML.length > 2
? elements[i].innerHTML
: false;
if(text) {
elements[i].addEventListener('click', function()
{
station = this.correspondingElement.childNodes[0].data;
alert(station);
});
}
}
}, false)
})()