Descripción: Receptor del mapa de España
A continuación mostramos los apuntes asociados a este extra:
session_start();
/*
[rss]Receptor del mapa de España[/rss]
*/
$extra = $_GET["extra"];
$mapa = get_magic_quotes_gpc() ? stripslashes($_POST["mapa"]) : $_POST["mapa"];
$zoom = $_POST["zoom"];
$cabeza = "<h1>Mapa de España</h1>";
$hoy = getdate();
$año = $hoy["year"];
$otros_anuarios = array();
for ($i = 2010; $i <= $año; $i++)
array_push($otros_anuarios, "<a href='?extra=anuario&a=$i' >$i</a>");
$anuarios = implode(", ", $otros_anuarios);
ob_start();
echo <<< pie
<div id="copyright">
<h6>
<span style="font-weight: bolder">Copyright © 2002 - $year <a href="index.php">www.pepemolina.com</a></span>
<br/>
<a href="diario.rss.xml" >RSS</a>
<a href="diario.rss.xml" ><img src="diario.imagen.php?id=22&max=10" alt="rss" title="rss" longdesc="diario.ficha.php?id=22" /></a>
| Ver <a href="diario.sitemap.html" >Mapa del sitio</a>
</h6>
</div><!-- id="copyright" -->
pie;
$pie = ob_get_clean();
ob_start();
echo <<< cuerpo
$cabeza
<div id="contenido">
<p>
Resultado obtenido:
</p>
</div>
<div id='mapa'></div>
<p style="text-align: right; margin-right: 1em;">
<a href="index.php?titulo=Etiquetando+mapa+SVG">Volver al arículo "Etiquetando mapa SVG"</a>.
</p>
<p>
<b>Listados</b>:
<a href='?extra=imagenes'>imágenes</a>,
<a href='?extra=categorias'>categorías</a>,
<a href='?extra=etiquetas'>etiquetas</a>,
<a href='?extra=extras'>extras</a> |
<b>Anuarios</b>:
$anuarios |
<b>Otros enlaces</b>: <a href='?extra=buscador'>buscador</a>
</p>
$pie
cuerpo;
$body = ob_get_clean();
ob_start();
echo <<< estilos
body {
text-align: left;
padding: 0;
margin: 0;
}
h1 {
text-align: center;
margin: 0;
padding: .5em;
background-color: #eeeeee;
}
#mapa {
margin: 1em auto;
text-align: center;
}
h6 {
text-align: center;
background-color: #eeeeee;
margin: 0;
padding: .5em;
}
p {
margin: 0 auto;
text-indent: 3em;
}
/*
dl {
margin: 1em auto;
width: 70%;
border: 1px solid black;
padding: 1em;
}
li {
margin-left: 2em;
}
#comentarios {
border: 1px solid red;
margin: 1em 0;
}
.comentario {
border: 3px ridge blue;
background-color: #eeeeff;
padding: 1em 0 0 1em;
margin: 1em;
}
.comentario p {
background-color: white;
padding: 0;
}
#mensajes div div.comm {
border: 1px solid aqua;
background-color: white;
padding: 5px 2em 2px 0;
margin: 2px;
}
*/
.figura_polygon {
stroke: black;
stroke-width: .1;
fill: green;
opacity: .5;
}
.figura_polyline {
fill: transparent;
opacity: .5;
}
.figura_path {
stroke: black;
stroke-width: .1;
fill: red;
opacity: .5;
}
.nada {
fill: none;
}
.recuadro {
fill: none;
stroke-width: .2;
stroke: black;
}
.mar {
fill: #d3ebfa;
}
.provincia {
fill: #fff8b3;/*red;*/
opacity: .8;
stroke-width: .2;
stroke: black;
}
.francia, .portugal, .africa {
fill: #f4e2ba;
opacity: 1;
stroke-width: .4;
stroke: black;
}
estilos;
$css = ob_get_clean();
$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
$links = "<title>Extra: $extra</title>\n<link rel='shortcut icon' href='caricatos.ico' />\n";
$links .= "<script type='text/javascript' >\n";
$links .= "mapa = $mapa\n";
$links .= "zoom = $zoom\n";
$links .= <<< onload
svgns = "http://www.w3.org/2000/svg";
function tag(id) {return document.getElementById(id);};
window.onload = function() {
_imagen_ = document.createElementNS(svgns, "svg");
_imagen_.id = "mapa";
_imagen_.setAttribute("xmlns", mapa.xmlns);
_imagen_.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
_imagen_.setAttribute("width", mapa.ancho * zoom);
_imagen_.setAttribute("height", mapa.alto * zoom);
_imagen_.setAttribute("viewBox", mapa.box);
for (i = 0, total = mapa.tag.length; i < total; i++) {
_a_ = document.createElementNS("http://www.w3.org/2000/svg", "a");
_figura_ = document.createElementNS(svgns, mapa.tag[i].shape);
_puntos_ = (mapa.tag[i].shape == "path") ? "d" : "points";
_figura_.setAttributeNS(null, _puntos_, mapa.tag[i].puntos);
_estilo_ = (mapa.tag[i].estilo != "figura") ? mapa.tag[i].estilo: "figura_" + mapa.tag[i].shape;
//_figura_.setAttributeNS(null, "class", mapa.tag[i].estilo);
_figura_.setAttributeNS(null, "class", _estilo_);
_figura_.id = mapa.tag[i].id;
_a_.appendChild(_figura_);
_a_.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:title", mapa.tag[i].nombre);
_imagen_.appendChild(_a_);
}
tag("mapa").appendChild(_imagen_);
}
onload;
$links .= "</script>\n";
Este código ha sido leído en 74 ocasiones.
Esta extra aún no tiene comentarios.
Valoración de esta página: (extra.recibir_etiquetando_svg)
Listados: imágenes, categorías, etiquetas, extras | Anuarios: 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 | Otros enlaces: buscador