Estoy haciendo un mapa de España vectorial en .svg que me he traido desde Inkscape hasta htm.l Estoy intentando hacerlo interactivo en html y css ell problema es que por ejemplo cuando creo un enlace algunos textos no salen al 100% de ancho ya que hay otra provincia que se superpone y tapa el texto sobrante de cada provincia.
El código que tengo ahora es este quitando alguno sobrate que traia inkscape, no se si me falta algo por añadir o quitar.
Código CSS:
Ver original
<style type="text/css"> /*CSS especial para adaptar el map añadiendo la clase por ejemplo la clase map*/ .map-svg{ width: 100%; border: 1px solid blue; } svg{ height: 50vw; } /*Path provincias*/ path{ stroke:#4B4B4B; fill:#000; } path:hover{ fill:#4B4B4B; fill-opacity:1; } a path{ fill:#000; fill:red; } a:hover path{ fill:#000; fill:#ffbc03; fill:#4B4B4B; fill-opacity:1; fill:green; } a.current path{ fill:#ffbc03; } a.current:hover path { fill:#4B4B4B; stroke: #000 !important; } /*Textos*/ text{ font-weight: bold; } tspan{ fill: #FFCF4C; fill: #FFC34C; font: 8px Verdana, Helvetica, Arial, sans-serif; } tspan:hover{ fill: #E8C44C; fill: #F8BC02; fill:red; } a tspan{ fill:blue; fill: #FFC34C; font: 8px Verdana, Helvetica, Arial, sans-serif; } a.current tspan{ fill:blue; fill:green; fill:#000; } a.current:hover tspan{ fill:blue; fill:white; fill: #FFC34C; } </style>
Código HTML:
Ver original
<svg id="svg3609" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="map-svg"> <!-- Guipúzcoa --> <a class="%current49%" id="guipuzcoa_map" xlink:href="%judet49%"> <path id="path16" d="m474.23 42.243v0.24002h-0.24-0.23999-0.24v0.24001-0.24001l-0.23999 0.24001h-0.24-0.47998v0.24002l-0.24 0.24002v0.24001 0.24002 0.24002 0.24001 0.24002h-0.23999v0.24002h-0.24-0.23999v0.24001l-0.24 0.24002h-0.23999v0.24002-0.24002l-0.24 0.24002h-0.23999v-0.24002 0.24002 0.24001h-0.24 0.24-0.24v0.24002-0.24002h-0.23999v-0.24001-0.24002h-0.23999-0.24 0.24v0.24002h-0.24 0.24v0.24001h-0.24 0.24v0.24002h-0.24v0.24002-0.48004l-0.23999 0.24002h0.23999l-0.23999 0.24002v-0.24002h-0.24l-0.23999-0.24002h0.23999l-0.23999-0.24001v-0.24002l-0.24 0.24002v0.48003l0.24 0.24002-0.24 0.48003-0.23999 0.24001v0.24002l0.23999 0.48003v0.24002 0.24002 0.24001l0.24 0.24002h0.23999v0.24002 0.24001l-0.47999 0.24002v0.24002 0.24001h-0.23999-0.24v0.24002h-0.23999l0.23999 0.24002h-0.23999l-0.23999 0.24001-0.47999 0.24002h-0.24l0.24 0.24002h-0.24v0.24001h-0.23999l-0.24 0.24002v-0.24002l-0.47999 0.24002-0.23999 0.24001v0.24002h-0.23999l0.23999 0.48003v0.24002l-0.47999 0.24002v0.24001l-0.23999 0.24002v0.48003l0.23999 0.48004v0.24001h0.24l-0.24 0.48004-0.23999 0.24001h-0.24v0.24002h-0.95998-0.47998v0.72005l-0.24 0.24001v0.24002l-0.23999 0.24002h-0.24-0.23999-0.24-0.23999-0.24l-0.23999 0.24001h-0.23999-0.24v-0.24001l-0.23999-0.24002-0.24-0.24002-0.23999 0.24002-0.24-0.24002v0.24002 0.24002 0.24001h-0.23999l-0.24 0.24002h-0.23999v0.24002 1.2001l-0.24-0.24002-0.23999 0.24002v-0.24002h-0.47999-0.47999l-0.23999-0.24001v-0.48004l-0.24-0.24001v-0.24002l-0.23999 0.24002-0.24-0.24002h-0.23999l-0.47999-0.24002-0.23999-0.24001v-0.24002h-0.24-0.23999-0.24l-0.23999-0.24002h-0.24-0.23999l-0.23999-0.24001-0.47999 0.24001-0.24-0.24001h-0.23999-0.24l-0.23999 0.24001-0.24-0.24001-0.47998-0.24002h-0.24l-0.47999 0.24002-0.95998-0.48004-0.23999 0.24002 0.23999 0.48003-0.23999 0.24002v-0.24002l-0.23999-0.24001h-0.47999l-0.24-0.24002h-0.23999v-0.24002h-0.24l-0.23999-0.24001v-0.24002h0.23999l-0.23999-0.48003v-0.24002-0.24001h0.23999 0.24l0.71998-0.48004h0.24l0.23999-0.24001v-0.24002l0.23999-0.24002 0.24-0.24001v-0.24002l-0.24-0.48003h-0.23999v-0.48004h-0.23999l0.23999-0.24001v-0.24002-0.24001h0.23999l0.24-0.24002 0.47999 0.24002 0.23999-0.24002v-0.96007h0.24l-0.24-0.72005v-0.48003-0.24002l-0.23999-0.24001v-0.24002h0.23999 0.47999v-0.24002l-0.23999-0.24001 0.23999-0.24002v-0.72005h-0.23999v-0.24001h-0.24v-0.48004l0.24-0.24001v0.24001l0.23999-0.24001 0.24 0.24001h0.47998v-0.24001l0.47999-0.48004 0.24-0.24001v-0.24002l0.47999-0.48003v-0.24002-0.24002h-0.24v-0.24001l-0.47999-0.24002 0.24-0.48003v-0.24002l0.23999-0.24001h0.24v-0.48004h0.23999 0.24l0.71998 0.48004h-0.24 0.24 0.23999l0.24 0.24001h0.23999v0.24002h0.24v-0.24002l0.71998 0.24002h0.23999 0.71999 0.23999 0.24 0.23999v-0.24002 0.24002l0.24-0.24002h0.23999 0.23999v-0.24001h0.47999 0.24l0.23999 0.24001 0.24-0.24001v0.24001l0.23999 0.24002v0.24001l0.24-0.24001 0.23999 0.24001v0.24002l0.71998-0.24002v-0.24001l0.24 0.24001h0.23999 0.24v-0.24001h0.23999l0.24-0.24002 0.71998-0.24001h0.47999v-0.24002h0.71998v-0.24002h0.24 0.47999 0.23999v-0.24001h0.23999v0.24001l0.24 0.24002 0.23999-0.24002-0.23999-0.24001h0.23999 0.24 0.23999v-0.48004h0.24 0.47999v0.24002l0.23999-0.24002h0.23999v0.24002h0.24v-0.24002h-0.24 0.47999l0.24-0.24001 0.47999-0.24002h0.23999l0.24-0.72005 0.23999-0.24002h0.23999v-0.24001h0.24 0.23999v-0.24002h0.47999l0.24-0.24002h0.23999l0.47999-0.24001 0.24 0.24001h-0.24l-0.23999 0.24002v0.24002l0.23999 0.24001v-0.24001 0.24001 0.24002l0.24 0.24002-0.24 0.24001h0.24l0.23999 0.24002 0.23999 0.24002 0.24-0.24002 0.23999 0.24002v0.24001l0.47999 0.24002v0.24002 0.24001 0.24002l0.24 0.48003m-12.48 0.48003" clip-path="url(#SVG_CP_1)" transform="translate(-112.39 -18.688)" fill=""/> <text id="text769" transform="scale(.99995 1)" y="33.925827" x="327.77164"> <tspan id="tspan771">Guipúzcoa</tspan> </text> </a> <!-- Vizcaya --> <a class="%current30%" id="vizcaya_map" xlink:href="%judet30%"> <path id="path44" d="m339.59 25.344-0.25 0.5h-0.25-0.25-0.21875v0.21875h-0.25l-0.25 0.5h-0.21875-0.25l-0.25-0.25v0.25h-0.46875-0.25-0.46875v-0.25h-0.25-0.21875-0.25v0.25l-0.25-0.25h-0.21875-0.25-0.25-0.21875-0.5v0.25h-0.21875v0.21875 0.25h0.21875v0.25h-0.21875v-0.25l-0.25 0.25h-0.25v0.21875l-0.46875 0.25v0.25 0.21875h-0.25-0.25v0.25h-0.21875l-0.25 0.25h-0.25l-0.21875 0.21875 0.21875 0.25 0.25 0.25v0.21875h-0.25l0.5 0.25v0.25 0.21875 0.25h-0.25-0.25l-0.21875-0.25h0.21875l-0.15625-0.0625 0.15625-0.15625h-0.21875l0.21875-0.25-0.46875 0.25-0.71875-0.25-0.25-0.25-0.46875-0.46875h-0.25l0.5-0.46875-0.71875 0.46875v0.25 0.21875l-0.25 0.25-0.25-0.25h-0.46875-0.25v0.25 0.25 0.9375 0.5l-0.21875 0.25h-0.75-0.21875l-0.25 0.21875h-0.25v0.5l-0.21875-0.25v-0.25l-0.25-0.21875v-0.5l-0.71875 0.25-0.25 0.25v0.21875h-0.21875l-0.5 0.25h-0.21875l-0.25-0.25 0.25-0.21875h-0.25-0.46875v0.21875h-0.25l-0.25-0.21875-0.46875 0.21875 0.25 0.5v0.21875l-0.5 0.25-0.46875-0.25-0.25 0.25-0.25 0.25-0.21875 0.46875v0.25l-0.25-0.25h-0.25v0.25l-0.21875 0.21875h-0.25l-0.25 0.25-0.21875-0.25-0.25 0.25 0.25 0.25v0.21875l0.21875 0.71875v0.25 1.1875l0.25 0.25v0.25l0.25 0.25v0.71875h0.21875v-0.25h0.71875l0.5-0.46875h0.25l0.21875-0.25 0.25-0.5h0.25l0.21875 0.25 0.25-0.25 0.46875-0.21875 0.25-0.25 0.46875-0.46875h0.5v-0.25l0.21875 0.25v-0.25l0.5 0.46875 0.21875 0.25v0.25h0.25v0.21875l0.25-0.21875h0.21875l0.25 0.21875h0.46875l0.25-0.21875 0.25-0.25 0.25 0.25h0.21875l0.25 0.21875v0.25h0.25v0.25h0.21875l0.25 0.46875h0.25l0.46875-0.21875h0.25l0.21875 0.21875 0.5-0.46875 0.9375-0.25v-0.25l0.25-0.46875v-0.46875-0.25l0.25-0.25v0.25h0.21875 0.71875v-0.25l0.25 0.71875 0.25 0.5 0.46875 0.21875-0.21875 0.5h0.21875l0.25 0.46875v0.25l0.25 0.25h-0.25v0.21875h-0.25l-0.21875 0.5-0.25 0.46875-0.25 0.25 0.25 0.21875 0.71875 0.5v0.21875h0.25l0.46875 0.5 0.25 0.21875 0.46875 0.5v-0.25h0.25 0.46875l0.46875 0.25h0.5l0.46875 0.46875h0.96875 0.21875l0.25 0.25h0.5 0.21875v-0.25h0.25v0.25h0.25l0.46875-0.25h0.25v0.25h0.21875l0.25 0.25 0.46875-0.25 0.25-0.25 0.25 0.25 0.46875 0.25h0.25v-0.25-0.25-0.46875h-0.25l-0.25-0.5v-0.21875h-0.21875l-0.25-0.25v-0.25l0.96875-0.46875h0.21875 0.5l0.46875 0.25 0.96875-0.25h0.25l0.21875-0.25h0.25l0.25-0.21875 0.46875 0.21875 0.25-0.21875v-0.96875h0.21875l-0.21875-0.71875v-0.46875-0.25l-0.25-0.25v-0.25h0.25 0.46875v-0.21875l-0.25-0.25 0.25-0.25v-0.71875h-0.25v-0.21875h-0.21875v-0.5l0.21875-0.21875v0.21875l0.25-0.21875 0.25 0.21875h0.46875v-0.21875l0.46875-0.5 0.25-0.21875v-0.25l0.46875-0.46875v-0.25-0.25h-0.21875v-0.21875l-0.5-0.25 0.25-0.46875v-0.25l0.25-0.25h0.21875v-0.46875-0.25l-0.46875-0.25h-0.25l-0.21875-0.21875-0.25 0.21875v-0.21875l-0.25-0.5h-0.21875v-0.21875h-0.25v-0.25h-0.25-0.21875v-0.25l-0.25-0.21875h-0.25-0.21875-0.25-0.25-0.21875v-0.25h-0.25v-0.25h-0.25-0.25-0.21875-0.25-0.25v-0.21875h-0.46875-0.25-0.21875v-0.25l-0.25-0.25v-0.21875l-0.25-0.25-0.21875 0.25h-0.25-0.25-0.21875l-0.25 0.21875h-0.25v-0.21875l-0.21875-0.25h-0.25-0.25v-0.25h-0.21875l-0.25-0.21875-0.25-0.5v-0.46875h-0.21875v-0.25zm-15.125 7.6875 0.21875 0.25 0.25 0.21875v0.5l-0.25 0.21875-0.21875 0.25-0.25 0.25 0.25 0.21875-0.25 0.25 0.25 0.46875h-0.25l-0.25 0.25-0.21875-0.25h-0.25v-0.21875l0.25-0.25-0.25-0.25v-0.21875l0.25-0.5-0.24-0.22-0.25-0.25v-0.25l0.5-0.21875h0.21875 0.25l0.25-0.25zm6.9375 2.1562 0.25 0.25v0.21875h-0.25l-0.21875-0.21875 0.21875-0.25zm-0.71875 6.9688-0.21875 0.21875v0.75l-0.96875 0.46875 0.25 0.25h0.21875v-0.25l0.25 0.25h0.25v0.21875h0.21875l0.5 0.5h0.21875l0.71875 0.21875v-0.21875l0.25-0.25h0.25v-0.46875l0.21875-0.25-0.21875-0.25h-0.25-0.25l-0.46875-0.21875h-0.25l0.25-0.5v-0.25h-0.25v-0.21875h-0.46875-0.25zm1.9375 2.1562h0.21875l0.75-0.25-0.25-0.21875v0.21875h-0.25l-0.46875 0.25z" clip-path="url(#SVG_CP_1)" transform="translate(-7.9818 -8.0336)" fill=""/> <text id="text757" transform="scale(.99995 1)" y="26.83588" x="312.99408"> <tspan id="tspan759">Vizcaya</tspan> </text> </a> </svg>
He intentado ya varias maneras, incluso buscando con z-index pero veo que aquí no se utiliza, ¿Hay algún modo en svg para que no se superpongan las provincias y textos?.