Commit fea58eba0a6ae47a9c72bc6d217290fc64602d8c
1 parent
a16d6526
Exists in
master
and in
7 other branches
Inclusão de customização da legenda
Showing
4 changed files
with
83 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +<!-- | ||
2 | +[leg_layer_html opt_flag=1] | ||
3 | +<table class=legendatemas cellspacing=0 width=100% > | ||
4 | + [if name=TEMA oper=neq value=NAO] | ||
5 | + <table [if name=CLASSE oper=eq value=NAO] style="display: none;"[/if] > | ||
6 | + <tr> | ||
7 | + <td style="text-align: left"><b><span class=legendaTema> [metadata name=TEMA]</span></b><br></td> | ||
8 | + </tr> | ||
9 | + [if name=legendawms oper=isset ] | ||
10 | + <tr> | ||
11 | + <td style="text-align: left"><img src='[metadata name=legendawms]' /></td> | ||
12 | + </tr> | ||
13 | + [/if][if name=legendaimg oper=isset ] | ||
14 | + <tr> | ||
15 | + <td style="text-align: left"><img src='[metadata name=legendaimg]' /></td> | ||
16 | + </tr> | ||
17 | + [/if] | ||
18 | + </table> | ||
19 | + [/if][/leg_layer_html][leg_class_html][if name=CLASSE oper=neq value=NAO] | ||
20 | + <table style="margin-top: 5px; position: relative; left: 15px;"> | ||
21 | + <tr> | ||
22 | + <td style="text-align: left"><img src=[leg_icon width=16 height=16 ] /></td> | ||
23 | + <td style="text-align: left;"><span style="font-size: 9px; position: relative; left: 2px;">[leg_class_name]</span></td> | ||
24 | + </tr> | ||
25 | + </table> | ||
26 | + [/if] | ||
27 | +</table> | ||
28 | +[/leg_class_html] | ||
29 | +--> | ||
0 | \ No newline at end of file | 30 | \ No newline at end of file |
classesjs/classe_mapa.js
@@ -454,6 +454,8 @@ i3GEO.mapa = | @@ -454,6 +454,8 @@ i3GEO.mapa = | ||
454 | * | 454 | * |
455 | * O resultado e processado pela funcao passada como parametro | 455 | * O resultado e processado pela funcao passada como parametro |
456 | * | 456 | * |
457 | + * O template utilizado para gerar a legenda é definido em i3GEO.configura.templateLegenda | ||
458 | + * | ||
457 | * Parametro: | 459 | * Parametro: |
458 | * | 460 | * |
459 | * funcao {function} - funcao que recebera o resultado da chamada AJAX. O objeto CPAINT e enviado como parametro. | 461 | * funcao {function} - funcao que recebera o resultado da chamada AJAX. O objeto CPAINT e enviado como parametro. |
@@ -0,0 +1,50 @@ | @@ -0,0 +1,50 @@ | ||
1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | +<meta http-equiv="Category" content="i3Geo Mapa interativo MMA geoprocessamento sig mobile"> | ||
5 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | ||
6 | +<title>i3GEO - OpenLayers</title> | ||
7 | +<script src="../classesjs/i3geonaocompacto.js"></script> | ||
8 | +<script src="../pacotes/openlayers/OpenLayers2131.js"></script> | ||
9 | +<link rel="stylesheet" type="text/css" href="../css/black.css"> | ||
10 | +</head> | ||
11 | +<body style='margin-left:7px;background:white;' class=yui-skin-sam > | ||
12 | +<div style="top:50px;"> | ||
13 | +<div style="width:150px;height:300px;border:1px solid;float:left;"> | ||
14 | + <div id=Legenda style="display:block;margin:auto;text-align:center;left:5px;" ></div> | ||
15 | +</div> | ||
16 | +<div id=i3geo > | ||
17 | +<div id=corpoMapa style="left:155px;width:700px;height:400px;background-image:url('../imagens/i3geo1bw.jpg');"> | ||
18 | +</div> | ||
19 | +</div> | ||
20 | +</div> | ||
21 | +<script> | ||
22 | +/************ | ||
23 | +Altera a funcao de atualizacao e geracao da legenda | ||
24 | + | ||
25 | +************/ | ||
26 | +//i3GEO.gadgets.PARAMETROS.mostraEscalaNumerica.idhtml = "escalaTeste"; | ||
27 | +i3GEO.idioma.MOSTRASELETOR = false; //para nao mostrar as bandeiras de escolha do idioma | ||
28 | +i3GEO.configura.mapaRefDisplay = "none";//nao mostra o mapa de referencia | ||
29 | +i3GEO.mapa.TEMASINICIAIS = "_lbiomashp,_llocali"; | ||
30 | +i3GEO.mapa.TEMASINICIAISLIGADOS = "_lbiomashp"; | ||
31 | + | ||
32 | +//altera a funcao que atualiza a legenda | ||
33 | +i3GEO.mapa.legendaHTML.atualiza = function() { | ||
34 | + //altera o template da legenda | ||
35 | + i3GEO.configura.templateLegenda = "legenda7.htm"; | ||
36 | + var idleg = $i("Legenda"), | ||
37 | + temp = function(retorno) { | ||
38 | + idleg.innerHTML = retorno.data.legenda; | ||
39 | + }; | ||
40 | + i3GEO.mapa.legendaHTML.obtem(temp); | ||
41 | +}; | ||
42 | + | ||
43 | +i3GEO.finaliza = function(){ | ||
44 | + i3GEO.mapa.legendaHTML.cria("Legenda"); | ||
45 | +}; | ||
46 | +i3GEO.cria(); | ||
47 | +i3GEO.inicia(); | ||
48 | +</script> | ||
49 | +</body> | ||
50 | +</html> |
exemplos/index.html
@@ -108,6 +108,8 @@ body,td { | @@ -108,6 +108,8 @@ body,td { | ||
108 | <a title="Barra de botoes fora do mapa" href="codemirror.php?&pagina=cursodsv23.htm" target="_blank">[23]</a> | 108 | <a title="Barra de botoes fora do mapa" href="codemirror.php?&pagina=cursodsv23.htm" target="_blank">[23]</a> |
109 | | 109 | |
110 | <a title="Legenda fora do mapa" href="codemirror.php?&pagina=cursodsv24.htm" target="_blank">[24]</a> | 110 | <a title="Legenda fora do mapa" href="codemirror.php?&pagina=cursodsv24.htm" target="_blank">[24]</a> |
111 | + | ||
112 | + <a title="Altera a funcao de atualizacao da legenda" href="codemirror.php?&pagina=cursodsv25.htm" target="_blank">[25]</a> | ||
111 | 113 | ||
112 | </p> | 114 | </p> |
113 | </fieldset> | 115 | </fieldset> |