I use vue-svg-map and usa map.
I need to show state code (path.id) on my svg map. How can i make this?
<radio-svg-map
v-model="selectedLocation"
:map="usa"
:location-class="getLocationClass"
@change="selectdLocation"
@mouseover="pointLocation"
@mouseout="unpointLocation"
@mousemove="moveOnLocation"
/>
import usa from "../static/usa";
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="192 9 1028 746"
aria-label="Map of USA"
>
<path
id="AK"
name="Alaska"
d="M456.18,..."
/>
...
</svg>
I assume you can use <text> SVG tag.
If you using Vue.JS it will be something like:
<text>{{ path.id }}</text>
More detailed about <text> tag you can read here:
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text
P.S. Your code snippet seems a little bit broken.