diff --git a/ferramentas/tme/index.js b/ferramentas/tme/index.js index 6cbab7c..871f2b4 100755 --- a/ferramentas/tme/index.js +++ b/ferramentas/tme/index.js @@ -82,6 +82,7 @@ i3GEOF.tme = * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php */ MUSTACHE : "", + MUSTACHELISTA : "", /** * Susbtitutos para o template */ @@ -117,9 +118,16 @@ i3GEOF.tme = */ inicia : function(iddiv) { if(i3GEOF.tme.MUSTACHE == ""){ - $.get(i3GEO.configura.locaplic + "/ferramentas/tme/template_mst.html", function(template) { - i3GEOF.tme.MUSTACHE = template; + var t1 = i3GEO.configura.locaplic + "/ferramentas/tme/template_mst.html", + t2 = i3GEO.configura.locaplic + "/ferramentas/tme/templateLista_mst.html"; + + $.when( $.get(t1),$.get(t2) ).done(function(r1,r2) { + i3GEOF.tme.MUSTACHE = r1[0]; + i3GEOF.tme.MUSTACHELISTA = r2[0]; i3GEOF.tme.inicia(iddiv); + }).fail(function() { + i3GEO.janela.closeMsg($trad("erroTpl")); + return; }); return; } @@ -143,7 +151,9 @@ i3GEOF.tme = return; } $i(iddiv).innerHTML = i3GEOF.tme.html(); - i3GEOF.tme.rodape(); + if (i3GEO.login.verificaCookieLogin() === true && i3GEO.parametros.editor === "sim") { + $(".hidden").removeClass("hidden"); + } try { // // verifica se a camada possui definicao dos parametros @@ -174,73 +184,38 @@ i3GEOF.tme = $i("i3GEOTMEoutlinecolor").value = i3GEOF.tme.OUTLINECOLOR; $i("i3GEOTMEnumvertices").value = i3GEOF.tme.NUMVERTICES; // combo para escolher a coluna com os nomes das regioes - i3GEO.util.comboItens("i3GEOTMEregioes", i3GEOF.tme.tema, function(retorno) { - if ($i("i3GEOTMEregioeslista")) { - $i("i3GEOTMEregioeslista").innerHTML = retorno.dados; - } - if (i3GEOF.tme.ITEMNOMEREGIOES != "") { - $i("i3GEOTMEregioes").value = i3GEOF.tme.ITEMNOMEREGIOES; - } - // lista para escolher as colunas com os valores - var temp = function(r) { - i3GEOF.tme.montaListaItens(r); - // se os parametros da ferramenta estiverem definidos na camada - if (camada != "" && camada.ferramentas.tme && camada.ferramentas.tme.exec === "sim") { - i3GEOF.tme.ativa(); + i3GEO.util.comboItens( + "i3GEOTMEregioes", + i3GEOF.tme.tema, + function(retorno) { + if ($i("i3GEOTMEregioeslista")) { + $i("i3GEOTMEregioeslista").innerHTML = retorno.dados; } - }; - i3GEO.php.listaItensTema(temp, i3GEOF.tme.tema); - }, "i3GEOTMEregioeslista"); - i3GEO.util.mensagemAjuda("i3GEOtmemen1", $i("i3GEOtmemen1").innerHTML); + if (i3GEOF.tme.ITEMNOMEREGIOES != "") { + $i("i3GEOTMEregioes").value = i3GEOF.tme.ITEMNOMEREGIOES; + } + // lista para escolher as colunas com os valores + var temp = function(r) { + i3GEOF.tme.montaListaItens(r); + // se os parametros da ferramenta estiverem definidos na camada + if (camada != "" && camada.ferramentas.tme && camada.ferramentas.tme.exec === "sim") { + i3GEOF.tme.ativa(); + } + }; + i3GEO.php.listaItensTema(temp, i3GEOF.tme.tema); + }, + "i3GEOTMEregioeslista", + "", + "sim", + "", + "form-control" + ); + i3GEOF.tme.ativaFoco(); } catch (erro) { i3GEO.janela.tempoMsg(erro); } }, - rodape : function() { - var ins = - ''; - if (i3GEO.login.verificaCookieLogin() === true) { - ins += - ''; - ins += - ''; - } - YAHOO.i3GEO.janela.manager.find("i3GEOF.tme").setFooter(ins); - - var b = new YAHOO.widget.Button("i3GEOtmebotao1", { - onclick : { - fn : i3GEOF.tme.ativa - } - }); - b.addClass("rodar"); - $i("i3GEOtmebotao1-button").style.width = "350px"; - if (i3GEO.login.verificaCookieLogin() === true && i3GEO.parametros.editor === "sim") { - $i("parametrosComLogin").style.display = 'block'; - b = new YAHOO.widget.Button("i3GEOtmebotaoSalva", { - onclick : { - fn : i3GEOF.tme.salvaParametros - } - }); - b.addClass("rodar"); - $i("i3GEOtmebotaoSalva-button").style.width = "350px"; - - b = new YAHOO.widget.Button("i3GEOtmebotaoRemove", { - onclick : { - fn : i3GEOF.tme.removeParametros - } - }); - b.addClass("rodar"); - $i("i3GEOtmebotaoRemove-button").style.width = "350px"; - } - }, /* * Function: html * @@ -279,11 +254,29 @@ i3GEOF.tme = }; // cria a janela flutuante titulo = - "
"); - ins.push(" | " + item + " | "); + temp = {}; + temp.item = retorno.data.valores[i].item; + mustache.push(temp); } - $i("i3GEOtmelistai").innerHTML = ins.join(""); - ins.push("
" + $trad('arquivoDownload', i3GEOF.tme.dicionario)
- + "
"
+ retorno.data.url
- + "
";
+ + "";
ext = i3GEO.parametros.mapexten;
ext = i3GEO.util.extOSM2Geo(ext);
- url = i3GEO.configura.locaplic + "/ms_criamapa.php?interface=googleearth.phtml&kmlurl=" + retorno.data.url;
- ins +=
- "
" + $trad('abreNoI3geo', i3GEOF.tme.dicionario)
- + "
"
- + url
- + "
";
url =
i3GEO.configura.locaplic + "/ferramentas/cesium/kml3d.php?kmlurl="
+ retorno.data.url
@@ -462,12 +457,12 @@ i3GEOF.tme =
+ retorno.data.legenda
+ "&mapext=" + ext;
ins +=
- "
" + $trad('abreNoCesium', i3GEOF.tme.dicionario)
- + "
"
+ url
- + "
";
+ + "";
$i("i3GEOTMEresultado").innerHTML = ins;
$i("i3GEOTMEresultado").scrollIntoView(true);
diff --git a/ferramentas/tme/templateLista_mst.html b/ferramentas/tme/templateLista_mst.html
new file mode 100755
index 0000000..f9b6425
--- /dev/null
+++ b/ferramentas/tme/templateLista_mst.html
@@ -0,0 +1,19 @@
+
+
+
+
+ |
+ {{{item}}} | +
{{{tituloMapa}}} -
{{{descricaoMapa}}} -
{{{alturaMaxBarras}}} -
{{{larguraMaxBarras}}} -
{{{outLineColor}}} -
{{{numvertices}}} -
{{{colunaRegioes}}} -
-
-
{{{colunasDadosEstat}}}
-
Será criado um arquivo KML que pode ser aberto com o Google Earth. A coluna com os nomes das regiões define o nome que será mostrado para cada elemento mapeado. Quando os nomes das colunas com os valores corresponderem a um determinado ano, será mostrado um botão do tipo slide no Google Earth, mas isso só ocorre se o nome da coluna for o mesmo nome do ano, exemplo, para o ano de 1980 o nome da coluna deverá ser 1980 -