From 8e305beec0d1409564ddcb551a61891b07046ef9 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 9 Oct 2014 21:31:14 +0000 Subject: [PATCH] Inclusão de minscale e maxscale no editor de legenda --- classesphp/classe_alteraclasse.php | 29 ++++++++++++++++++++++------- classesphp/classe_legenda.php | 6 +++--- classesphp/mapa_controle.php | 6 +++--- ferramentas/legenda/dicionario.js | 12 ++++++++++++ ferramentas/legenda/index.js | 3402 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5 files changed, 1931 insertions(+), 1524 deletions(-) diff --git a/classesphp/classe_alteraclasse.php b/classesphp/classe_alteraclasse.php index 1fe7a10..445b255 100644 --- a/classesphp/classe_alteraclasse.php +++ b/classesphp/classe_alteraclasse.php @@ -173,8 +173,12 @@ $nomes - lista com os novos nomes $exps - lista com as novas expressões $base64 sim|nao indica se as strings estao codificadas em base64 + +$minScales - lista com valores para minscaledenom + +$maxScales - lista com valores para maxscaledenom */ - function alteraclasses($ids,$nomes,$exps,$base64="nao") + function alteraclasses($ids,$nomes,$exps,$base64="nao",$minScales="",$maxScales="") { if($base64 == "sim"){ $ids = base64_decode($ids); @@ -183,6 +187,8 @@ $base64 sim|nao indica se as strings estao codificadas em base64 } //prepara os arrays com os valores $ids = explode(";",$ids); + $minScales = explode(";",$minScales); + $maxScales = explode(";",$maxScales); //$nomes = mb_convert_encoding($nomes,"ISO-8859-1","UTF-8"); $nomes = explode(";",$nomes); //$exps = mb_convert_encoding($exps,"ISO-8859-1","UTF-8"); @@ -196,8 +202,7 @@ $base64 sim|nao indica se as strings estao codificadas em base64 //elimina nomes de layers duplicados $t = array_unique($t); //elimina as classes existentes atualmente em cada layer - foreach ($t as $tema) - { + foreach ($t as $tema){ $layer = $this->mapa->getlayerbyname($tema); $layer->setMetaData("cache",""); $nc = $layer->numclasses; @@ -209,14 +214,12 @@ $base64 sim|nao indica se as strings estao codificadas em base64 } //acrescenta as classes definidas $c = count($ids); - for ($i=0; $i < $c; ++$i) - { + for ($i=0; $i < $c; ++$i){ $layerc = explode("-",$ids[$i]); //nome do layer é o indice 0 do array $layer = $this->mapa->getlayerbyname($layerc[0]); $layer->setMetaData("cache",""); $ncl = $layer->numclasses; - if ($layerc[1] < $ncl) - { + if ($layerc[1] < $ncl){ $classe = $layer->getclass($layerc[1]); $classe->set("status",MS_DEFAULT); $classe->set("name",$nomes[$i]); @@ -226,6 +229,18 @@ $base64 sim|nao indica se as strings estao codificadas em base64 $e = str_replace("''","'",$e); $e = str_replace("##","'",$e); $classe->setexpression($e); + if($minScales[$i]){ + if($minScales[$i] == 0 || $minScales[$i] == ""){ + $minScales[$i] = -1; + } + $classe->set("minscaledenom",$minScales[$i]); + } + if($maxScales[$i]){ + if($maxScales[$i] == 0 || $maxScales[$i] == ""){ + $maxScales[$i] = -1; + } + $classe->set("maxscaledenom",$maxScales[$i]); + } } } } diff --git a/classesphp/classe_legenda.php b/classesphp/classe_legenda.php index 94b834a..cdf3744 100644 --- a/classesphp/classe_legenda.php +++ b/classesphp/classe_legenda.php @@ -342,7 +342,7 @@ array } else {$imgLeg = $im;} - $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg); + $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg,"minScale"=>0,"maxScale"=>0); } else { @@ -360,7 +360,7 @@ array $nomeexp = $classe->getExpressionString(); if (function_exists("mb_convert_encoding")) {$nomeexp = mb_convert_encoding($nomeexp,"UTF-8","ISO-8859-1");} - $linhas[] = array("tema"=>$l,"idclasse"=>$c,"nomeclasse"=>$nomeclasse,"expressao"=>$nomeexp,"imagem"=>$i,"proc"=>""); + $linhas[] = array("tema"=>$l,"idclasse"=>$c,"nomeclasse"=>$nomeclasse,"expressao"=>$nomeexp,"imagem"=>$i,"proc"=>"","minScale"=>$classe->minscaledenom,"maxScale"=>$classe->maxscaledenom); } if (($totaliza=="sim") && ($nc > 1)){ $layer->set("template","none.htm"); @@ -422,7 +422,7 @@ array if($layer->type == MS_LAYER_RASTER && $proc == ""){ $proc = array("RESAMPLE=NEAREST"); } - $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","imagem"=>"","proc"=>$proc); + $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","imagem"=>"","proc"=>$proc,"minScale"=>0,"maxScale"=>0); } } } diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index 1fb6e7f..d3ce676 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -1159,7 +1159,7 @@ Altera uma classe de um tema, aplicando uma nova classificação ou if ($opcao == "alteraclasses"){ //esta operação é chamada com POST via cpaint //error_reporting(0); - alteraclassesPost($ids,$nomes,$exps,$base64); + alteraclassesPost($ids,$nomes,$exps,$base64,$minScales,$maxScales); restauraCon($map_file,$postgis_mapa); cpjson(""); } @@ -2242,10 +2242,10 @@ Altera as classes de um tema aplicando novos parâmetros como nome e expres Include: */ -function alteraclassesPost($ids,$nomes,$exps,$base64="nao"){ +function alteraclassesPost($ids,$nomes,$exps,$base64="nao",$minScales="",$maxScales=""){ global $map_file,$tema; $m = new Alteraclasse($map_file,$tema); - $m->alteraclasses($ids,$nomes,$exps,$base64); + $m->alteraclasses($ids,$nomes,$exps,$base64,$minScales,$maxScales); $m->salva(); $_SESSION["contadorsalva"]++; } diff --git a/ferramentas/legenda/dicionario.js b/ferramentas/legenda/dicionario.js index 2588303..3b3b329 100644 --- a/ferramentas/legenda/dicionario.js +++ b/ferramentas/legenda/dicionario.js @@ -569,5 +569,17 @@ i3GEOF.legenda.dicionario = { en:"", es:"", it:"" + }], + 'minScale': [{ + pt:"Não desenha se escala for menor que", + en:"", + es:"", + it:"" + }], + 'maxScale': [{ + pt:"Não desenha se escala for maior que", + en:"", + es:"", + it:"" }] }; \ No newline at end of file diff --git a/ferramentas/legenda/index.js b/ferramentas/legenda/index.js index 3987662..779bdce 100644 --- a/ferramentas/legenda/index.js +++ b/ferramentas/legenda/index.js @@ -1,1614 +1,1994 @@ - -/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ /* -Title: Editor de legenda + Title: Editor de legenda -Define a forma de representação de um tema, modificando o tipo de classificação e os símbolos utilizados em cada classe + Define a forma de representação de um tema, modificando o tipo de classificação e os símbolos utilizados em cada classe -Veja: + Veja: - + -Arquivo: + Arquivo: -i3geo/ferramentas/legenda/index.js.php + i3geo/ferramentas/legenda/index.js.php -Licenca: + Licenca: -GPL2 + GPL2 -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com + Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil + Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com -Este programa é software livre; você pode redistribuí-lo -e/ou modificá-lo sob os termos da Licença Pública Geral -GNU conforme publicada pela Free Software Foundation; + Este programa é software livre; você pode redistribuí-lo + e/ou modificá-lo sob os termos da Licença Pública Geral + GNU conforme publicada pela Free Software Foundation; -Este programa é distribuído na expectativa de que seja útil, -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. -Consulte a Licença Pública Geral do GNU para mais detalhes. -Você deve ter recebido uma cópia da Licença Pública Geral do -GNU junto com este programa; se não, escreva para a -Free Software Foundation, Inc., no endereço -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. -*/ + Este programa é distribuído na expectativa de que seja útil, + porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita + de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. + Consulte a Licença Pública Geral do GNU para mais detalhes. + Você deve ter recebido uma cópia da Licença Pública Geral do + GNU junto com este programa; se não, escreva para a + Free Software Foundation, Inc., no endereço + 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. + */ -if(typeof(i3GEOF) === 'undefined'){ +if (typeof (i3GEOF) === 'undefined') { var i3GEOF = {}; } /* -Classe: i3GEOF.legenda -*/ -i3GEOF.legenda = { - /* - Variavel: parDefault - - Parametros padrão utilizados para formatar os labels - */ - parDefault: "&position=MS_UR&partials=1&offsetx=0&offsety=0&minfeaturesize=auto&mindistance=auto&force=0&shadowsizex=1&shadowsizey=1&cor=0 0 0&sombray=1&sombrax=1&angulo=0&tamanho=8&fonte=bitmap&fundo=off&sombra=off&outlinecolor=off&shadowcolor=off&wrap=", - /* - Variavel: aviso - - Indica que uma alteração ainda não foi salva - - Type: - {boolean} - */ - aviso: false, - /* - Variavel: tema - - Tema que será utilizado - - Type: - {string} - */ - tema: i3GEO.temaAtivo, - /* - Variavel: dadosGrafico - - Dados utilizados no gráfico no formato da ferramenta graficointerativo - */ - dadosGrafico: "", - /* - Variavel: aguarde - - Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. - */ - aguarde: "", - /* - Variavel: estilos - - Estilos existentes em um símbolo de uma classe - */ - estilos: "", - /* - Variavel: estilo - - Ultimo estilo selecionado - */ - estilo: "", - /* - Variavel: classe - - Ultima classe selecionado - */ - classe: "", - /* - Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário - */ - criaJanelaFlutuante: function(){ - i3GEOF.legenda.iniciaDicionario(); - }, - /* - Function: iniciaDicionario - - Carrega o dicionário e chama a função que inicia a ferramenta - - O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script - */ - iniciaDicionario: function(){ - if(typeof(i3GEOF.legenda.dicionario) === 'undefined'){ - i3GEO.util.scriptTag( - i3GEO.configura.locaplic+"/ferramentas/legenda/dicionario.js", - "i3GEOF.legenda.iniciaJanelaFlutuante()", - "i3GEOF.legenda.dicionario_script" - ); - } - else{ - i3GEOF.legenda.iniciaJanelaFlutuante(); - } - }, - /* - Function: inicia - - Inicia a ferramenta. É chamado por criaJanelaFlutuante - - Parametro: - - iddiv {String} - id do div que receberá o conteudo HTML da ferramenta - */ - inicia: function(iddiv){ - i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados"); - if(i3GEO.temaAtivo === ""){ - $i(iddiv).innerHTML = "";//'

'+$trad("x33")+'

'; - return; - } - try{ - $i(iddiv).innerHTML += i3GEOF.legenda.html(); - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1","i3GEOlegendaguia"); - //eventos das guias - $i("i3GEOlegendaguia6").onclick = function() - {i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6","i3GEOlegendaguia");}; - $i("i3GEOlegendaguia1").onclick = function(){ - i3GEOF.legenda.mostralegenda(); - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1","i3GEOlegendaguia"); - }; - $i("i3GEOlegendaguia2").onclick = function() - {i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2","i3GEOlegendaguia");}; - $i("i3GEOlegendaguia3").onclick = function(){ - i3GEO.janela.tempoMsg($trad('ajuda',i3GEOF.legenda.dicionario)); - }; - $i("i3GEOlegendaguia4").onclick = function(){ - i3GEOF.legenda.mostraGrafico(); - }; - $i("i3GEOlegendaguia5").onclick = function(){ - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5","i3GEOlegendaguia"); - }; - new YAHOO.widget.Button( - "i3GEOlegendabotao1", - {onclick:{fn: i3GEOF.legenda.mudaLegenda}} - ); - if(navm) - {$i("i3GEOlegendabotao1-button").style.width = "0px";} - new YAHOO.widget.Button( - "i3GEOlegendabotao2", - {onclick:{fn: i3GEOF.legenda.adicionaClasse}} - ); - //if(navm) - //{$i("i3GEOlegendabotao2-button").style.width = "0px";} - - new YAHOO.widget.Button( - "i3GEOlegendabotao3", - {onclick:{fn: i3GEOF.legenda.adicionaConta},width:"100px"} - ); - $i("i3GEOlegendabotao3-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotao15", - {onclick:{fn: i3GEOF.legenda.adicionaOpacidade}} - ); - $i("i3GEOlegendabotao15-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotaoRamp", - {onclick:{fn: function(){ - var tabela = $i("i3GEOlegendalegenda"); - var trs = tabela.getElementsByTagName("tr"); - var ncores = trs.length - 1; - i3GEO.util.abreColourRamp("","listaColourRamp",ncores); - }}} - ); - $i("i3GEOlegendabotaoRamp-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotao4", - {onclick:{fn: i3GEOF.legenda.paleta}} - ); - new YAHOO.widget.Button( - "i3GEOlegendabotao5", - {onclick:{fn: i3GEOF.legenda.simbU}} - ); - $i("i3GEOlegendabotao5-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotao6", - {onclick:{fn: i3GEOF.legenda.valorU}} - ); - $i("i3GEOlegendabotao6-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotao7", - {onclick:{fn: i3GEOF.legenda.representacao}} - ); - $i("i3GEOlegendabotao7-button").style.width = "200px"; - - new YAHOO.widget.Button( - "i3GEOlegendabotao8", - {onclick:{fn: i3GEOF.legenda.valorC}} - ); - $i("i3GEOlegendabotao8-button").style.width = "120px"; - - new YAHOO.widget.Button( - "i3GEOlegendabotao9", - {onclick:{fn: i3GEOF.legenda.valorQ}} - ); - $i("i3GEOlegendabotao9-button").style.width = "120px"; - - new YAHOO.widget.Button( - "i3GEOlegendabotaoQuantil", - {onclick:{fn: i3GEOF.legenda.valorQu}} - ); - $i("i3GEOlegendabotaoQuantil-button").style.width = "120px"; - - new YAHOO.widget.Button( - "i3GEOlegendabotaoQN", - {onclick:{fn: i3GEOF.legenda.valorQN}} - ); - $i("i3GEOlegendabotaoQN-button").style.width = "120px"; - - new YAHOO.widget.Button( - "i3GEOlegendabotao10", - {onclick:{fn: i3GEOF.legenda.aplicaEstilo}} - ); - $i("i3GEOlegendabotao10-button").style.width = "220px"; - - new YAHOO.widget.Button( - "i3GEOlegendabotao17", - {onclick:{fn: i3GEOF.legenda.alteraGeometriaTema}} - ); - $i("i3GEOlegendabotao17-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotaoSLDe", - {onclick:{fn: function(){window.open(i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?funcao=tema2sld&tema="+i3GEOF.legenda.tema+"&g_sid="+i3GEO.configura.sid);}}} - ); - $i("i3GEOlegendabotaoSLDe-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotaoSLDi", - {onclick:{fn: function(){i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema);}}} - ); - $i("i3GEOlegendabotaoSLDi-button").style.width = "200px"; - new YAHOO.widget.Button( - "i3GEOlegendabotaoIncluirLabel", - {onclick:{fn: function(){ - var par,p,temp,cp; - try{ - par = i3GEOF.proplabel.pegaPar(); - i3GEOF.legenda.parDefault = par; + * Classe: i3GEOF.legenda + */ +i3GEOF.legenda = + { + /* + * Variavel: parDefault + * + * Parametros padrão utilizados para formatar os labels + */ + parDefault : "&position=MS_UR&partials=1&offsetx=0&offsety=0&minfeaturesize=auto&mindistance=auto&force=0&shadowsizex=1&shadowsizey=1&cor=0 0 0&sombray=1&sombrax=1&angulo=0&tamanho=8&fonte=bitmap&fundo=off&sombra=off&outlinecolor=off&shadowcolor=off&wrap=", + /* + * Variavel: aviso + * + * Indica que uma alteração ainda não foi salva + * + * Type: {boolean} + */ + aviso : false, + /* + * Variavel: tema + * + * Tema que será utilizado + * + * Type: {string} + */ + tema : i3GEO.temaAtivo, + /* + * Variavel: dadosGrafico + * + * Dados utilizados no gráfico no formato da ferramenta graficointerativo + */ + dadosGrafico : "", + /* + * Variavel: aguarde + * + * Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. + */ + aguarde : "", + /* + * Variavel: estilos + * + * Estilos existentes em um símbolo de uma classe + */ + estilos : "", + /* + * Variavel: estilo + * + * Ultimo estilo selecionado + */ + estilo : "", + /* + * Variavel: classe + * + * Ultima classe selecionado + */ + classe : "", + /* + * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário + */ + criaJanelaFlutuante : function() { + i3GEOF.legenda.iniciaDicionario(); + }, + /* + * Function: iniciaDicionario + * + * Carrega o dicionário e chama a função que inicia a ferramenta + * + * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script + */ + iniciaDicionario : function() { + if (typeof (i3GEOF.legenda.dicionario) === 'undefined') { + i3GEO.util.scriptTag( + i3GEO.configura.locaplic + "/ferramentas/legenda/dicionario.js", + "i3GEOF.legenda.iniciaJanelaFlutuante()", + "i3GEOF.legenda.dicionario_script"); + } else { + i3GEOF.legenda.iniciaJanelaFlutuante(); + } + }, + /* + * Function: inicia + * + * Inicia a ferramenta. É chamado por criaJanelaFlutuante + * + * Parametro: + * + * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta + */ + inicia : function(iddiv) { + i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca", "i3GEOFlegendaComboCabecaSel", "legenda", "ligados"); + if (i3GEO.temaAtivo === "") { + $i(iddiv).innerHTML = "";// '

'+$trad("x33")+'

'; + return; + } + try { + $i(iddiv).innerHTML += i3GEOF.legenda.html(); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); + // eventos das guias + $i("i3GEOlegendaguia6").onclick = function() { + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia1").onclick = function() { + i3GEOF.legenda.mostralegenda(); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia2").onclick = function() { + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia3").onclick = function() { + i3GEO.janela.tempoMsg($trad('ajuda', i3GEOF.legenda.dicionario)); + }; + $i("i3GEOlegendaguia4").onclick = function() { + i3GEOF.legenda.mostraGrafico(); + }; + $i("i3GEOlegendaguia5").onclick = function() { + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); + }; + new YAHOO.widget.Button("i3GEOlegendabotao1", { + onclick : { + fn : i3GEOF.legenda.mudaLegenda } - catch(e){ - par = i3GEOF.legenda.parDefault; + }); + if (navm) { + $i("i3GEOlegendabotao1-button").style.width = "0px"; + } + new YAHOO.widget.Button("i3GEOlegendabotao2", { + onclick : { + fn : i3GEOF.legenda.adicionaClasse } - i3GEOF.legenda.aguarde.visibility = "visible"; - temp = function(){ - i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - }; - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionaLabelClasse&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+par; - p += "&item="+$i("i3GEOlegendaSelItemLabel").value; - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"foo",temp); - }}} - ); - new YAHOO.widget.Button( - "i3GEOlegendabotaoExcluirLabel", - {onclick:{fn: function(){ - var p,temp,cp; - i3GEOF.legenda.aguarde.visibility = "visible"; - temp = function(){ - i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - }; - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=removeLabelClasse&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe; - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"foo",temp); - }}} - ); - new YAHOO.widget.Button( - "i3GEOlegendabotaoPropriedadeLabel", - {onclick:{fn: function(){ - i3GEO.util.scriptTag( - i3GEO.configura.locaplic+"/ferramentas/opcoes_label/index.js", - "i3GEOF.proplabel.criaJanelaFlutuante(false)", - "i3GEOFproplabel", - false - ); - }}} - ); - i3GEOF.legenda.ativaFoco(); - i3GEOF.legenda.mostralegenda(); - i3GEO.util.comboItens( - "i3GEOlegendaSelItem", - i3GEOF.legenda.tema, - function(retorno){ - if($i("i3GEOlegendaitens")) - {$i("i3GEOlegendaitens").innerHTML = retorno.dados;} - }, - "i3GEOlegendaitens" - ); - if(i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema).classe && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema).classe.toLowerCase() == "nao") - {$i("i3GEOFlegendamostra").checked = false;} - $i("i3GEOFlegendamostra").onclick = function(){i3GEO.tema.invertestatuslegenda(i3GEOF.legenda.tema);}; - } - catch(erro){i3GEO.janela.tempoMsg(erro);} - }, - /* - Function: html - - Gera o código html para apresentação das opções da ferramenta - - Retorno: - - String com o código html - */ - html:function(){ - var ins = '' + - '
'+ - '
'+ - '

  '+$trad('mostraClassesLegenda',i3GEOF.legenda.dicionario)+'

' + - '

' + - '

' + - '

' + - '
' + - '

'+$trad('geraCores',i3GEOF.legenda.dicionario)+'

' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
'+$trad('ate',i3GEOF.legenda.dicionario)+':' + - '
' + - ' ' + - '
' + - '
aquarela.gif ' + - ' '+$trad('de',i3GEOF.legenda.dicionario)+':'+ - '
' + - ' ' + - '
' + - '
aquarela.gif ' + - '
' + - '
' + - '
' + - '
'+ - '
' + - ' ' + - ' '+ - ' ' + - '

' + - '

'+$trad('clicaSimbolo',i3GEOF.legenda.dicionario)+'

' + - '
' + - '
'+ - '
'+ - '
' + - '
'+ - '
' + - '
' + - '

  '+$trad('consideraElementosVisisveis',i3GEOF.legenda.dicionario)+'

' + - '

'+$trad('ignoraValores',i3GEOF.legenda.dicionario)+':'+ - '

' + - ' ' + - '
' + - '

'+$trad('transformaGeom',i3GEOF.legenda.dicionario)+'

'+ - '
' + - ' '+ - '
' + - '

' + - '

'+ - '

'+$trad('alteraTipoGeom',i3GEOF.legenda.dicionario)+'

'+ - '

'+ - '
' + - '

'+$trad('todosElementosUnicoSimbolo',i3GEOF.legenda.dicionario)+'

'+ - '

'+ - '

'+$trad('cadaOcorrenciaUnicoSimbolo',i3GEOF.legenda.dicionario)+'

'+ - '

'+ - '

'+ - '

'+$trad('criaClassesItemNumerico',i3GEOF.legenda.dicionario)+'

'+ - '

'+$trad('numeroClasses',i3GEOF.legenda.dicionario)+':'+ - '

' + - ' ' + - '
' + - '

'+ - '  '+ - '  '+ - '


'+$trad('criaQuartis',i3GEOF.legenda.dicionario)+'

'+ - '

'+ - '

'+$trad('estiloNomeClasses',i3GEOF.legenda.dicionario)+': ' + - '

' + - '

' + - '
'+ - '
'+ - '
'+ - '
'+ - ' '+$trad('etiquetasClasse',i3GEOF.legenda.dicionario)+''+ - '

'+$trad('itemComTexto',i3GEOF.legenda.dicionario)+':

' + - '

'+ - ' ' + - ' ' + - ' ' + - '

' + - '

'+ - '
'+ - ' '+$trad('estilos',i3GEOF.legenda.dicionario)+''+ - '

'+$trad('ajudaEstilo',i3GEOF.legenda.dicionario)+''+ - '

'+ - '
'+ - "
" + - "  " + - "  " + - "  " + - '
'+ - '
'+ - '

'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '

'+$trad('geraSLD',i3GEOF.legenda.dicionario)+' Mapserver SLD '+$trad('ajudaSLD',i3GEOF.legenda.dicionario)+ - '

'+ - '

'+$trad('msgAplicaSLD',i3GEOF.legenda.dicionario)+ - '

'+ - '
' + - ''; //utilizado pelo seletor de colourramp - return ins; - }, - /* - Function: iniciaJanelaFlutuante - - Cria a janela flutuante para controle da ferramenta. - */ - iniciaJanelaFlutuante: function(){ - var minimiza,cabecalho,janela,divid,temp,titulo; - if($i("i3GEOF.legenda")){ - i3GEOF.legenda.tema = i3GEO.temaAtivo; - i3GEOF.legenda.inicia("i3GEOF.legenda_corpo"); - return; - } - cabecalho = function(){ - i3GEOF.legenda.ativaFoco(); - }; - minimiza = function(){ - i3GEO.janela.minimiza("i3GEOF.legenda"); - }; - //cria a janela flutuante - titulo = "
------
   "+$trad("t33")+"    "; - janela = i3GEO.janela.cria( - "490px", - "340px", - "", - "", - "", - titulo, - "i3GEOF.legenda", - false, - "hd", - cabecalho, - minimiza, - "", - true, - i3GEO.configura.locaplic+"/imagens/oxygen/16x16/format-list-unordered.png" - ); - divid = janela[2].id; - i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style; - $i("i3GEOF.legenda_corpo").style.backgroundColor = "white"; - i3GEOF.legenda.inicia(divid); - temp = function(){ - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search('i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")') > 0) - {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")');} - }; - YAHOO.util.Event.addListener(janela[0].close, "click", temp); - }, - /* - Function: ativaFoco - - Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado - */ - ativaFoco: function(){ - if(i3GEOF.legenda.tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema) === "") - {i3GEO.janela.tempoMsg($trad('temaInexistente',i3GEOF.legenda.dicionario));} - var i = $i("i3GEOF.legenda_c").style; - i.zIndex = i3GEO.janela.ULTIMOZINDEX; - i3GEO.janela.ULTIMOZINDEX++; - }, - /* - Function: aposAlterarLegenda - - Função executada após ocorrer alguma alteração efetiva da legenda do mapa - */ - aposAlterarLegenda: function(){ - i3GEO.atualiza(); - i3GEO.Interface.atualizaTema("",i3GEOF.legenda.tema); - i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEOF.legenda.tema); - i3GEO.mapa.legendaHTML.atualiza(); - }, - /* - Function: mostralegenda + }); + // if(navm) + // {$i("i3GEOlegendabotao2-button").style.width = "0px";} + + new YAHOO.widget.Button("i3GEOlegendabotao3", { + onclick : { + fn : i3GEOF.legenda.adicionaConta + }, + width : "100px" + }); + $i("i3GEOlegendabotao3-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOlegendabotao15", { + onclick : { + fn : i3GEOF.legenda.adicionaOpacidade + } + }); + $i("i3GEOlegendabotao15-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOlegendabotaoRamp", { + onclick : { + fn : function() { + var tabela = $i("i3GEOlegendalegenda"); + var trs = tabela.getElementsByTagName("tr"); + var ncores = trs.length - 1; + i3GEO.util.abreColourRamp("", "listaColourRamp", ncores); + } + } + }); + $i("i3GEOlegendabotaoRamp-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOlegendabotao4", { + onclick : { + fn : i3GEOF.legenda.paleta + } + }); + new YAHOO.widget.Button("i3GEOlegendabotao5", { + onclick : { + fn : i3GEOF.legenda.simbU + } + }); + $i("i3GEOlegendabotao5-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOlegendabotao6", { + onclick : { + fn : i3GEOF.legenda.valorU + } + }); + $i("i3GEOlegendabotao6-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOlegendabotao7", { + onclick : { + fn : i3GEOF.legenda.representacao + } + }); + $i("i3GEOlegendabotao7-button").style.width = "200px"; - Pega os dados da legenda do mapa atual e mostra na tela + new YAHOO.widget.Button("i3GEOlegendabotao8", { + onclick : { + fn : i3GEOF.legenda.valorC + } + }); + $i("i3GEOlegendabotao8-button").style.width = "120px"; - Veja: + new YAHOO.widget.Button("i3GEOlegendabotao9", { + onclick : { + fn : i3GEOF.legenda.valorQ + } + }); + $i("i3GEOlegendabotao9-button").style.width = "120px"; - - */ - mostralegenda: function(){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p,cp; - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=editalegenda&opcao=edita&tema="+i3GEOF.legenda.tema; - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"tabelaLegenda",i3GEOF.legenda.montaLegenda); - }, - /* - Function: montaLegenda + new YAHOO.widget.Button("i3GEOlegendabotaoQuantil", { + onclick : { + fn : i3GEOF.legenda.valorQu + } + }); + $i("i3GEOlegendabotaoQuantil-button").style.width = "120px"; - Formata a tabela de edição da legenda + new YAHOO.widget.Button("i3GEOlegendabotaoQN", { + onclick : { + fn : i3GEOF.legenda.valorQN + } + }); + $i("i3GEOlegendabotaoQN-button").style.width = "120px"; - Parametro: + new YAHOO.widget.Button("i3GEOlegendabotao10", { + onclick : { + fn : i3GEOF.legenda.aplicaEstilo + } + }); + $i("i3GEOlegendabotao10-button").style.width = "220px"; - retorno - objeto contendo os dados para formatação da legenda - */ - montaLegenda: function(retorno){ - i3GEOF.legenda.aviso = false; - try{ - if (retorno.data != undefined){ - var ins, - i, - ajuda, - id, - re, - exp, - n; - if (retorno.data[0].proc === ""){ - ins = [""]; - n = retorno.data.length; - for (i=0;i"); - ins.push(""); - ins.push(""); - if(n>1){ - ins.push(""); - ins.push(""); + new YAHOO.widget.Button("i3GEOlegendabotao17", { + onclick : { + fn : i3GEOF.legenda.alteraGeometriaTema + } + }); + $i("i3GEOlegendabotao17-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOlegendabotaoSLDe", { + onclick : { + fn : function() { + window.open(i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?funcao=tema2sld&tema=" + + i3GEOF.legenda.tema + "&g_sid=" + i3GEO.configura.sid); } - ins.push(""); } - ins.push("
nomeexpressão
"); - ins.push($inputText("","","i3GEOlegendaid_"+id,$trad('digitaNovoNome',i3GEOF.legenda.dicionario),20,retorno.data[i].nomeclasse,"nome","javascript:i3GEOF.legenda.aviso()")); - ins.push(""); - ins.push($inputText("","","i3GEOlegendaid_"+id,$trad('digitaNovaExpressao',i3GEOF.legenda.dicionario),25,exp,"expressao","javascript:i3GEOF.legenda.aviso()")); - ins.push("

"); - $i("i3GEOlegendaresultado").innerHTML = ins.join(""); - } - else{ - ajuda = "

"+$trad('ajudaEscalaCores',i3GEOF.legenda.dicionario) + - "

"+$trad('msgEscalaCoresAuto',i3GEOF.legenda.dicionario) + - "

"+$trad('msgEscalaCoresIndividual',i3GEOF.legenda.dicionario) + - "

"+$trad('msgBandas',i3GEOF.legenda.dicionario) + - "

"+$trad('msgReamostragem',i3GEOF.legenda.dicionario) ; - ins = "

"+$trad('adicionaProcesso',i3GEOF.legenda.dicionario)+":" + - "
" + - '

'; - if(retorno.data[0].proc == "") - {ins += "

";} - else{ - ins += "
' + + '
' + + '

  ' + + $trad('mostraClassesLegenda', i3GEOF.legenda.dicionario) + + '

' + + '

' + + '

' + + '

' + + '
' + + '

' + + $trad('geraCores', i3GEOF.legenda.dicionario) + + '

' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
' + + $trad('ate', i3GEOF.legenda.dicionario) + + ':' + + '
' + + ' ' + + '
' + + '
aquarela.gif ' + + ' ' + + $trad('de', i3GEOF.legenda.dicionario) + + ':' + + '
' + + ' ' + + '
' + + '
aquarela.gif ' + + '
' + + '
' + + '
' + + '
' + + '
' + + ' ' + + ' ' + + ' ' + + '

' + + '

' + + $trad('clicaSimbolo', i3GEOF.legenda.dicionario) + + '

' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '

  ' + + $trad('consideraElementosVisisveis', i3GEOF.legenda.dicionario) + + '

' + + '

' + + $trad('ignoraValores', i3GEOF.legenda.dicionario) + + ':' + + '

' + + ' ' + + '
' + + '

' + + $trad('transformaGeom', i3GEOF.legenda.dicionario) + + '

' + + '
' + + ' ' + + '
' + + '

' + + '

' + + '

' + + $trad('alteraTipoGeom', i3GEOF.legenda.dicionario) + + '

' + + '

' + + '
' + + '

' + + $trad('todosElementosUnicoSimbolo', i3GEOF.legenda.dicionario) + + '

' + + '

' + + '

' + + $trad('cadaOcorrenciaUnicoSimbolo', i3GEOF.legenda.dicionario) + + '

' + + '

' + + '

' + + '

' + + $trad('criaClassesItemNumerico', i3GEOF.legenda.dicionario) + + '

' + + '

' + + $trad('numeroClasses', i3GEOF.legenda.dicionario) + + ':' + + '

' + + ' ' + + '
' + + '

' + + '  ' + + '  ' + + '


' + + $trad('criaQuartis', i3GEOF.legenda.dicionario) + + '

' + + '

' + + '

' + + $trad('estiloNomeClasses', i3GEOF.legenda.dicionario) + + ': ' + + '

' + + '

' + + '
' + + '
' + + '
' + + '
' + + ' ' + + $trad('etiquetasClasse', i3GEOF.legenda.dicionario) + + '' + + '

' + + $trad('itemComTexto', i3GEOF.legenda.dicionario) + + ':

' + + '

' + + ' ' + + ' ' + + ' ' + + '

' + + '

' + + '
' + + ' ' + + $trad('estilos', i3GEOF.legenda.dicionario) + + '' + + '

' + + $trad('ajudaEstilo', i3GEOF.legenda.dicionario) + + '' + + '

' + + '
' + + "
" + + "  " + + "  " + + "  " + + '
' + + '
' + + '

' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '

' + + $trad('geraSLD', i3GEOF.legenda.dicionario) + + ' Mapserver SLD ' + + $trad('ajudaSLD', i3GEOF.legenda.dicionario) + + '

' + + '

' + + $trad('msgAplicaSLD', i3GEOF.legenda.dicionario) + + '

' + + '
' + + ''; // utilizado + // pelo + // seletor + // de + // colourramp + return ins; + }, + /* + * Function: iniciaJanelaFlutuante + * + * Cria a janela flutuante para controle da ferramenta. + */ + iniciaJanelaFlutuante : function() { + var minimiza, cabecalho, janela, divid, temp, titulo; + if ($i("i3GEOF.legenda")) { + i3GEOF.legenda.tema = i3GEO.temaAtivo; + i3GEOF.legenda.inicia("i3GEOF.legenda_corpo"); + return; + } + cabecalho = function() { + i3GEOF.legenda.ativaFoco(); + }; + minimiza = function() { + i3GEO.janela.minimiza("i3GEOF.legenda"); + }; + // cria a janela flutuante + titulo = + "
------
   " + $trad("t33") + + "    "; + janela = + i3GEO.janela.cria( + "490px", + "340px", + "", + "", + "", + titulo, + "i3GEOF.legenda", + false, + "hd", + cabecalho, + minimiza, + "", + true, + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/format-list-unordered.png"); + divid = janela[2].id; + i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style; + $i("i3GEOF.legenda_corpo").style.backgroundColor = "white"; + i3GEOF.legenda.inicia(divid); + temp = + function() { + if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search( + 'i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")') > 0) { + i3GEO.eventos.ATUALIZAARVORECAMADAS + .remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados")'); + } + }; + YAHOO.util.Event.addListener(janela[0].close, "click", temp); + }, + /* + * Function: ativaFoco + * + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado + */ + ativaFoco : function() { + if (i3GEOF.legenda.tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema) === "") { + i3GEO.janela.tempoMsg($trad('temaInexistente', i3GEOF.legenda.dicionario)); + } + var i = $i("i3GEOF.legenda_c").style; + i.zIndex = i3GEO.janela.ULTIMOZINDEX; + i3GEO.janela.ULTIMOZINDEX++; + }, + /* + * Function: aposAlterarLegenda + * + * Função executada após ocorrer alguma alteração efetiva da legenda do mapa + */ + aposAlterarLegenda : function() { + i3GEO.atualiza(); + i3GEO.Interface.atualizaTema("", i3GEOF.legenda.tema); + i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEOF.legenda.tema); + i3GEO.mapa.legendaHTML.atualiza(); + }, + /* + * Function: mostralegenda + * + * Pega os dados da legenda do mapa atual e mostra na tela + * + * Veja: + * + * + */ + mostralegenda : function() { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; } - else - {$i("i3GEOlegendaresultado").innerHTML = "

Erro
";} - i3GEOF.legenda.aguarde.visibility = "hidden"; - } - catch(e){i3GEO.janela.tempoMsg($trad('msgNaoEditaLegenda',i3GEOF.legenda.dicionario));i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: aviso - - Mostra um i3GEO.janela.tempoMsga ao usuário quando um campo da tabela que contém os dados da legenda é alterado - - O aviso é mostrado apenas uma vez - */ - aviso: function(){ - if(i3GEOF.legenda.aviso == true){ - i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao',i3GEOF.legenda.dicionario)); - i3GEOF.legenda.aviso == false; - } - }, - /* - Function: aplicaColourRamp - - Aplica nas classes da legenda as cores escolhidas no seletor de cores - */ - aplicaColourRamp: function(){ - if($i("listaColourRamp").value != ""){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} i3GEOF.legenda.aguarde.visibility = "visible"; - var cores = $i("listaColourRamp").value, - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), - temp = function(){ + var p, cp; + p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editalegenda&opcao=edita&tema=" + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "tabelaLegenda", i3GEOF.legenda.montaLegenda); + }, + /* + * Function: montaLegenda + * + * Formata a tabela de edição da legenda + * + * Parametro: + * + * retorno - objeto contendo os dados para formatação da legenda + */ + montaLegenda : function(retorno) { + i3GEOF.legenda.aviso = false; + try { + if (retorno.data != undefined) { + var ins, i, ajuda, id, re, exp, n; + // se nao for do tipo raster + if (retorno.data[0].proc === "") { + ins = + [ + "" + + "" + + "" + + "" + "" + + "" + + "" + + "" + "" + ]; + n = retorno.data.length; + for (i = 0; i < n; i++) { + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe + re = new RegExp("'", "g"); + exp = (retorno.data[i].expressao).replace(re, '"'); + + ins.push(""); + ins.push(""); + + ins.push(""); + + ins.push(""); + + ins.push(""); + + ins.push(""); + + ins.push(""); + + ins.push(""); + + if (n > 1) { + ins.push(""); + + ins.push(""); + } + ins.push(""); + } + ins.push("
nomeexpressãominScalemaxScale
" + + $inputText( + "", + "", + "i3GEOlegendaid_" + id, + $trad('digitaNovoNome', i3GEOF.legenda.dicionario), + 20, + retorno.data[i].nomeclasse, + "nome", + "javascript:i3GEOF.legenda.aviso()") + "" + + $inputText( + "", + "", + "i3GEOlegendaid_" + id, + $trad('digitaNovaExpressao', i3GEOF.legenda.dicionario), + 25, + exp, + "expressao", + "javascript:i3GEOF.legenda.aviso()") + "" + + $inputText( + "", + "", + "i3GEOlegendaid_" + id, + $trad('minScale', i3GEOF.legenda.dicionario), + 10, + retorno.data[i].minScale, + "minScale", + "javascript:i3GEOF.legenda.aviso()") + "" + + $inputText( + "", + "", + "i3GEOlegendaid_" + id, + $trad('maxScale', i3GEOF.legenda.dicionario), + 10, + retorno.data[i].maxScale, + "maxScale", + "javascript:i3GEOF.legenda.aviso()") + "

"); + $i("i3GEOlegendaresultado").innerHTML = ins.join(""); + } else { + ajuda = + "

" + $trad('ajudaEscalaCores', i3GEOF.legenda.dicionario) + "

" + + $trad('msgEscalaCoresAuto', i3GEOF.legenda.dicionario) + "

" + + $trad('msgEscalaCoresIndividual', i3GEOF.legenda.dicionario) + "

" + + $trad('msgBandas', i3GEOF.legenda.dicionario) + "

" + + $trad('msgReamostragem', i3GEOF.legenda.dicionario); + ins = + "

" + $trad('adicionaProcesso', i3GEOF.legenda.dicionario) + ":" + + "
" + + '

'; + if (retorno.data[0].proc == "") { + ins += "

"; + } else { + ins += "
"; + for (i = 0; i < retorno.data[0].proc.length; i++) { + ins += "
" + $inputText("", "", "", "", 50, retorno.data[0].proc[i]); + } + ins += "
"; + } + $i("i3GEOlegendaresultado").innerHTML = ins + ajuda; + new YAHOO.widget.Button("i3GEOlegendabotao16", { + onclick : { + fn : i3GEOF.legenda.aplicaProcessos + } + }); + } + } else { + $i("i3GEOlegendaresultado").innerHTML = "

Erro
"; + } + i3GEOF.legenda.aguarde.visibility = "hidden"; + } catch (e) { + i3GEO.janela.tempoMsg($trad('msgNaoEditaLegenda', i3GEOF.legenda.dicionario)); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: aviso + * + * Mostra um i3GEO.janela.tempoMsga ao usuário quando um campo da tabela que contém os dados da legenda é + * alterado + * + * O aviso é mostrado apenas uma vez + */ + aviso : function() { + if (i3GEOF.legenda.aviso == true) { + i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao', i3GEOF.legenda.dicionario)); + i3GEOF.legenda.aviso == false; + } + }, + /* + * Function: aplicaColourRamp + * + * Aplica nas classes da legenda as cores escolhidas no seletor de cores + */ + aplicaColourRamp : function() { + if ($i("listaColourRamp").value != "") { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var cores = $i("listaColourRamp").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), temp = function() { i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.mostralegenda(); i3GEOF.legenda.aposAlterarLegenda(); - }, - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=aplicacoresrgb&ext="+ext+"&tema="+i3GEOF.legenda.tema, - cp = new cpaint(); - cp.set_transfer_mode('POST'); - cp.set_response_type("JSON"); - cp.call(p,"foo",temp,"cores="+cores); - } - }, - /* - Function: corj - - Abre a janela para o usuário selecionar uma cor interativamente - */ - corj: function(obj) - {i3GEO.util.abreCor("",obj);}, - /* - Function: modificaCor - - Modifica a cor de uma classe - */ - modificaCor: function(id){ - var obj = $i("tempCorLegenda"); - if(!obj){ - var obj = document.createElement("input"); - obj.id = "tempCorLegenda"; - obj.style.display = "none"; - obj.type = "text"; - obj.value = ""; - document.body.appendChild(obj); - obj.onchange = function(){ - i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name); + }, p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&opcao=aplicacoresrgb&ext=" + ext + "&tema=" + i3GEOF.legenda.tema, cp = new cpaint(); + cp.set_transfer_mode('POST'); + cp.set_response_type("JSON"); + cp.call(p, "foo", temp, "cores=" + cores); + } + }, + /* + * Function: corj + * + * Abre a janela para o usuário selecionar uma cor interativamente + */ + corj : function(obj) { + i3GEO.util.abreCor("", obj); + }, + /* + * Function: modificaCor + * + * Modifica a cor de uma classe + */ + modificaCor : function(id) { + var obj = $i("tempCorLegenda"); + if (!obj) { + var obj = document.createElement("input"); + obj.id = "tempCorLegenda"; + obj.style.display = "none"; + obj.type = "text"; + obj.value = ""; + document.body.appendChild(obj); + obj.onchange = function() { + i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name); + }; + } + obj.name = id; + i3GEO.util.abreCor("", "tempCorLegenda"); + }, + aplicaNovaCor : function(id) { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var retorna = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); }; - } - obj.name = id; - i3GEO.util.abreCor("","tempCorLegenda"); - }, - aplicaNovaCor: function(id){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var retorna = function(){ - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostralegenda(); - }; - i3GEO.php.aplicaCorClasseTema(retorna,i3GEOF.legenda.tema,id,$i("tempCorLegenda").value); - }, - /* - Function: mudaLegenda - - Altera a legenda conforme os valores existentes na tabela de propriedades (expressão e nome da classe) - - Veja: - - - */ - mudaLegenda: function(){ - i3GEOF.legenda.aviso = false; - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - try{ - var tabela = $i("i3GEOlegendalegenda"), - trs = tabela.getElementsByTagName("tr"), - nomes = [], - exps = [], - ids = [], - t, - nn, - n, - p, - cp, - temp; - //expn, - //re = new RegExp('"', "g"); - for (t=0;t + */ + mudaLegenda : function() { + i3GEOF.legenda.aviso = false; + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + try { + var tabela = $i("i3GEOlegendalegenda"), trs = tabela.getElementsByTagName("tr"), minScales = [], maxScales = [], nomes = [], exps = [], ids = [], t, nn, n, p, cp, temp; + // expn, + // re = new RegExp('"', "g"); + for (t = 0; t < trs.length; t++) { + if (trs[t].childNodes) { + nn = trs[t].childNodes; + for (n = 0; n < nn.length; n++) { + if (nn[n].childNodes) { + var isn = nn[n].getElementsByTagName("input"); + if (isn[0] != undefined) { + if (isn[0].name == "nome") { + nomes.push(isn[0].value); + temp = (isn[0].id).split("i3GEOlegendaid_"); + ids.push(temp[1]); + } + if (isn[0].name == "expressao") { + exps.push(isn[0].value); + } + if (isn[0].name == "minScale") { + minScales.push(parseInt(isn[0].value,10)); + } + if (isn[0].name == "maxScale") { + maxScales.push(parseInt(isn[0].value,10)); + } } } } } } + ids = ids.join(";"); + nomes = nomes.join(";"); + exps = exps.join(";"); + minScales = minScales.join(";"); + maxScales = maxScales.join(";"); + temp = function() { + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?" + "base64=sim" + "&g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse" + "&opcao=alteraclasses" + "&ext=" + ext; + cp = new cpaint(); + cp.set_transfer_mode('POST'); + cp.set_response_type("JSON"); + cp.call(p, "alteraclassesPost", temp, "ids=" + i3GEO.util.base64encode(ids) + "&nomes=" + i3GEO.util.base64encode(nomes) + + "&exps=" + i3GEO.util.base64encode(exps) + "&minScales=" + minScales + "&maxScales=" + maxScales); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: alteraGeometria + * + * Altera o tipo de representação geométrica dos elementos de um layer + * + * Veja: + * + * + */ + alteraGeometriaTema : function() { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; } - ids = ids.join(";"); - nomes = nomes.join(";"); - exps = exps.join(";"); - temp = function(){ + i3GEOF.legenda.aguarde.visibility = "visible"; + var retorna = function() { + i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.mostralegenda(); + }; + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&opcao=alterageometria&tema=" + i3GEOF.legenda.tema + "&tipo=" + $i("i3GEOlegentaTipoGeo").value, cp = + new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "", retorna); + }, + /* + * Function: adicionaConta + * + * Adiciona ao nome de cada classe o número de ocorrências em cada uma + * + * Veja: + * + * + */ + adicionaConta : function() { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=contagemclasse" + + "&tema=" + i3GEOF.legenda.tema, cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "contagemclasse", i3GEOF.legenda.montaLegenda); + i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis', i3GEOF.legenda.dicionario)); + }, + /* + * Function: adicionaClasse + * + * Adiciona uma nova classe ao tema + * + * Veja: + * + * + */ + adicionaClasse : function() { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&opcao=adicionaclasse" + "&tema=" + i3GEOF.legenda.tema + "&ext=" + ext, cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "alteraclasse", i3GEOF.legenda.mostralegenda); + }, + /* + * Function: adicionaOpacidade + * + * Adiciona opacidade variável em cada classe + * + * Veja: + * + * + */ + adicionaOpacidade : function() { + var retorna = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); }; + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?" + - "base64=sim" + - "&g_sid="+i3GEO.configura.sid+ - "&funcao=alteraclasse" + - "&opcao=alteraclasses" + - "&ext="+ext; - cp = new cpaint(); - cp.set_transfer_mode('POST'); + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&opcao=adicionaopacidade" + "&tema=" + i3GEOF.legenda.tema + "&ext=" + ext, cp = new cpaint(); cp.set_response_type("JSON"); - cp.call( - p, - "alteraclassesPost", - temp, - "ids="+i3GEO.util.base64encode(ids)+ - "&nomes="+i3GEO.util.base64encode(nomes)+ - "&exps="+i3GEO.util.base64encode(exps) - ); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: alteraGeometria - - Altera o tipo de representação geométrica dos elementos de um layer - - Veja: - - - */ - alteraGeometriaTema: function(){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var retorna = function(){ - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostralegenda(); - }; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=alterageometria&tema="+i3GEOF.legenda.tema+"&tipo="+$i("i3GEOlegentaTipoGeo").value, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"",retorna); - }, - /* - Function: adicionaConta - - Adiciona ao nome de cada classe o número de ocorrências em cada uma - - Veja: - - - */ - adicionaConta: function(){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=contagemclasse"+"&tema="+i3GEOF.legenda.tema, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"contagemclasse",i3GEOF.legenda.montaLegenda); - i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis',i3GEOF.legenda.dicionario)); - }, - /* - Function: adicionaClasse - - Adiciona uma nova classe ao tema - - Veja: - - - */ - adicionaClasse: function(){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=adicionaclasse"+"&tema="+i3GEOF.legenda.tema+"&ext="+ext, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",i3GEOF.legenda.mostralegenda); - }, - /* - Function: adicionaOpacidade - - Adiciona opacidade variável em cada classe - - Veja: - - - */ - adicionaOpacidade: function(){ - var retorna = function(){ - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostralegenda(); - }; - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=adicionaopacidade"+"&tema="+i3GEOF.legenda.tema+"&ext="+ext, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",retorna); - }, - /* - Function: paleta - - Gera as cores para as classes considerando um RGB inicial e um final - - Veja: - - - */ - paleta: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var retornapaleta = function(){ + cp.call(p, "alteraclasse", retorna); + }, + /* + * Function: paleta + * + * Gera as cores para as classes considerando um RGB inicial e um final + * + * Veja: + * + * + */ + paleta : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var retornapaleta = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.mostralegenda(); - }, - ci = $i("i3GEOlegendaacori").value, - cf = $i("i3GEOlegendaacorf").value, - cp = new cpaint(), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraCoresClasses&tema="+i3GEOF.legenda.tema+"&cori="+ci+"&corf="+cf; - cp.set_response_type("JSON"); - cp.call(p,"alteraCoresClasses",retornapaleta); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: inverteCores - - Inverte as cores utilizadas nos símbolos das classes - - Veja: - - - */ - inverteCores: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var retornapaleta = function(){ + }, ci = $i("i3GEOlegendaacori").value, cf = $i("i3GEOlegendaacorf").value, cp = new cpaint(), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraCoresClasses&tema=" + i3GEOF.legenda.tema + "&cori=" + ci + "&corf=" + cf; + cp.set_response_type("JSON"); + cp.call(p, "alteraCoresClasses", retornapaleta); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: inverteCores + * + * Inverte as cores utilizadas nos símbolos das classes + * + * Veja: + * + * + */ + inverteCores : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var retornapaleta = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.mostralegenda(); - }, - cp = new cpaint(), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=inverteCoresClasses&tema="+i3GEOF.legenda.tema; - cp.set_response_type("JSON"); - cp.call(p,"alteraCoresClasses",retornapaleta); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: calculaTamanho - - Muda o símbolo de cada classe aplicando tamanhos diferentes e lineares - - Veja: - - - */ - calculaTamanho: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var retornapaleta = function(){ + }, cp = new cpaint(), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=inverteCoresClasses&tema=" + i3GEOF.legenda.tema; + cp.set_response_type("JSON"); + cp.call(p, "alteraCoresClasses", retornapaleta); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: calculaTamanho + * + * Muda o símbolo de cada classe aplicando tamanhos diferentes e lineares + * + * Veja: + * + * + */ + calculaTamanho : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var retornapaleta = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.mostralegenda(); - }, - cp = new cpaint(), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=calculaTamanhoClasses&tema="+i3GEOF.legenda.tema; - cp.set_response_type("JSON"); - cp.call(p,"calculaTamanhoClasses",retornapaleta); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: excluilinhaf - - Exclui uma linha da tabela de edição de classes da legendda - */ - excluilinhaf: function(celula){ - var p = celula.parentNode.parentNode; - do{ - p.removeChild(p.childNodes[0]); - } while (p.childNodes.length > 0); - p.parentNode.removeChild(p); - i3GEOF.legenda.mudaLegenda(); - }, - /* - Function: sobelinhaf - - Sobe uma linha na tabela de edição de classes da legendda - */ - sobelinhaf: function(idclasse){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=ALTERACLASSE&opcao=sobeclasse&tema="+i3GEOF.legenda.tema+"&idclasse="+idclasse, - cp = new cpaint(), - temp = function(){ + }, cp = new cpaint(), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=calculaTamanhoClasses&tema=" + i3GEOF.legenda.tema; + cp.set_response_type("JSON"); + cp.call(p, "calculaTamanhoClasses", retornapaleta); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostralegenda(); - }; - cp.set_response_type("JSON"); - cp.call(p,"foo",temp); - }, - /* - Function: descelinhaf - - Desce uma linha na tabela de edição de classes da legendda - */ - descelinhaf: function(idclasse){ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=ALTERACLASSE&opcao=desceclasse&tema="+i3GEOF.legenda.tema+"&idclasse="+idclasse, - cp = new cpaint(), - temp = function(){ - i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostralegenda(); - };; - cp.set_response_type("JSON"); - cp.call(p,"foo",temp); - }, - /* - Function: editaSimbolo - - Abre o editor de símbolos - - Veja: - - - */ - editaSimbolo: function(id){ - try{ - $i("i3GEOlegendaguia1obj").style.display="none"; - $i("i3GEOlegendaguia3obj").style.display="block"; - id = id.split("-"); - i3GEOF.legenda.classe = id[1]; - i3GEOF.legenda.estilo = 0; - i3GEOF.legenda.formEditorSimbolo(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - formEditorSimbolo: function(){ - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=pegaparametros&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"pegaParametrosMapa",i3GEOF.legenda.montaEditor); - }, - /* - Function: simbU - - Altera a leganda do tema para o tipo símbolo único - - Veja: - - - */ - simbU: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} + } + }, + /* + * Function: excluilinhaf + * + * Exclui uma linha da tabela de edição de classes da legendda + */ + excluilinhaf : function(celula) { + var p = celula.parentNode.parentNode; + do { + p.removeChild(p.childNodes[0]); + } while (p.childNodes.length > 0); + p.parentNode.removeChild(p); + i3GEOF.legenda.mudaLegenda(); + }, + /* + * Function: sobelinhaf + * + * Sobe uma linha na tabela de edição de classes da legendda + */ + sobelinhaf : function(idclasse) { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } i3GEOF.legenda.aguarde.visibility = "visible"; - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&opcao=simbolounico&ext="+ext, - cp = new cpaint(), - fim = function(){ - i3GEOF.legenda.aposAlterarLegenda(); + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=ALTERACLASSE&opcao=sobeclasse&tema=" + i3GEOF.legenda.tema + "&idclasse=" + idclasse, cp = new cpaint(), temp = + function() { i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); }; cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: valorU - - Altera a leganda do tema para o tipo valor único - - Veja: - - - */ - valorU: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var item = $i("i3GEOlegendaSelItem").value, - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=valorunico&ignorar="+$i("i3GEOlegendaignorar").value, - cp = new cpaint(), - fim = function(){ - i3GEOF.legenda.aposAlterarLegenda(); + cp.call(p, "foo", temp); + }, + /* + * Function: descelinhaf + * + * Desce uma linha na tabela de edição de classes da legendda + */ + descelinhaf : function(idclasse) { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=ALTERACLASSE&opcao=desceclasse&tema=" + i3GEOF.legenda.tema + "&idclasse=" + idclasse, cp = new cpaint(), temp = + function() { i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); }; - if($i("i3GEOFlegendaaplicaextent").checked === true){ - p += "&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); - } - else{ - p += "&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); + ; + cp.set_response_type("JSON"); + cp.call(p, "foo", temp); + }, + /* + * Function: editaSimbolo + * + * Abre o editor de símbolos + * + * Veja: + * + * + */ + editaSimbolo : function(id) { + try { + $i("i3GEOlegendaguia1obj").style.display = "none"; + $i("i3GEOlegendaguia3obj").style.display = "block"; + id = id.split("-"); + i3GEOF.legenda.classe = id[1]; + i3GEOF.legenda.estilo = 0; + i3GEOF.legenda.formEditorSimbolo(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; } - - if (item == "") - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} - i3GEOF.legenda.aguarde.visibility = "visible"; + }, + formEditorSimbolo : function() { + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editasimbolo&opcao=pegaparametros&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe, cp = + new cpaint(); cp.set_response_type("JSON"); - //window.parent.g_operacao = "outras" - cp.call(p,"alteraclasse",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: valorC - - Altera a leganda do tema com um número específico de classes - - Veja: - - - */ - valorC: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var item = $i("i3GEOlegendaSelItem").value, - nclasses = $i("i3GEOlegendanclasses").value, - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=intervalosiguais&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext, - cp = new cpaint(), - fim = function(){ + cp.call(p, "pegaParametrosMapa", i3GEOF.legenda.montaEditor); + }, + /* + * Function: simbU + * + * Altera a leganda do tema para o tipo símbolo único + * + * Veja: + * + * + */ + simbU : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" + + i3GEOF.legenda.tema + "&opcao=simbolounico&ext=" + ext, cp = new cpaint(), fim = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; }; - if (item == "") - {i3GEO.janela.tempoMsg("Selecione um item!");return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: valorQ - - Altera a leganda do tema claculando as classes pelo método quartil - - Veja: - - - */ - valorQ: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var item = $i("i3GEOlegendaSelItem").value, - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quartis&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext+"&tipoLegenda="+$i("estiloClassesQuartis").value, - cp = new cpaint(), - fim = function(){ + cp.set_response_type("JSON"); + cp.call(p, "alteraclasse", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: valorU + * + * Altera a leganda do tema para o tipo valor único + * + * Veja: + * + * + */ + valorU : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaSelItem").value, p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" + + i3GEOF.legenda.tema + "&item=" + item + "&opcao=valorunico&ignorar=" + $i("i3GEOlegendaignorar").value, cp = + new cpaint(), fim = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; }; - if (item == "") - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: valorQu - - Altera a leganda do tema por meio do calculo de quantis - - Veja: + if ($i("i3GEOFlegendaaplicaextent").checked === true) { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + } else { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); + } - - */ - valorQu: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var item = $i("i3GEOlegendaSelItem").value, - nclasses = $i("i3GEOlegendanclasses").value, - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quantil&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext, - cp = new cpaint(), - fim = function(){ + if (item == "") { + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + cp.set_response_type("JSON"); + // window.parent.g_operacao = "outras" + cp.call(p, "alteraclasse", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: valorC + * + * Altera a leganda do tema com um número específico de classes + * + * Veja: + * + * + */ + valorC : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaSelItem").value, nclasses = $i("i3GEOlegendanclasses").value, ext = + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&nclasses=" + nclasses + "&tema=" + i3GEOF.legenda.tema + "&item=" + item + + "&opcao=intervalosiguais&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + ext, cp = new cpaint(), fim = + function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; + if (item == "") { + i3GEO.janela.tempoMsg("Selecione um item!"); + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + cp.set_response_type("JSON"); + cp.call(p, "alteraclasse", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: valorQ + * + * Altera a leganda do tema claculando as classes pelo método quartil + * + * Veja: + * + * + */ + valorQ : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaSelItem").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" + + i3GEOF.legenda.tema + "&item=" + item + "&opcao=quartis&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + + ext + "&tipoLegenda=" + $i("estiloClassesQuartis").value, cp = new cpaint(), fim = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; }; - if (item == "") - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: valorQN - - Altera a legenda do tema por meio do calculo de quebras naturais - - Veja: - - - */ - valorQN: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var item = $i("i3GEOlegendaSelItem").value, - nclasses = $i("i3GEOlegendanclasses").value, - ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quebrasnaturais&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+ext, - cp = new cpaint(), - fim = function(){ + if (item == "") { + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + cp.set_response_type("JSON"); + cp.call(p, "alteraclasse", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: valorQu + * + * Altera a leganda do tema por meio do calculo de quantis + * + * Veja: + * + * + */ + valorQu : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaSelItem").value, nclasses = $i("i3GEOlegendanclasses").value, ext = + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&nclasses=" + nclasses + "&tema=" + i3GEOF.legenda.tema + "&item=" + item + + "&opcao=quantil&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + ext, cp = new cpaint(), fim = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; }; - if (item == "") - {i3GEO.janela.tempoMsg($trad('selecionaUmItem',i3GEOF.legenda.dicionario));return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - cp.set_response_type("JSON"); - cp.call(p,"alteraclasse",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - - /* - Function: representacao - - Altera o tipo de representação do tema (linear ou poligonoal) - - Veja: - - - - */ - representacao: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alterarepresentacao&tema="+i3GEOF.legenda.tema, - cp = new cpaint(), - fim = function(){ + if (item == "") { + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + cp.set_response_type("JSON"); + cp.call(p, "alteraclasse", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: valorQN + * + * Altera a legenda do tema por meio do calculo de quebras naturais + * + * Veja: + * + * + */ + valorQN : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaSelItem").value, nclasses = $i("i3GEOlegendanclasses").value, ext = + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alteraclasse&nclasses=" + nclasses + "&tema=" + i3GEOF.legenda.tema + "&item=" + item + + "&opcao=quebrasnaturais&ignorar=" + $i("i3GEOlegendaignorar").value + "&ext=" + ext, cp = new cpaint(), fim = + function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; + if (item == "") { + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario)); + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + cp.set_response_type("JSON"); + cp.call(p, "alteraclasse", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + + /* + * Function: representacao + * + * Altera o tipo de representação do tema (linear ou poligonoal) + * + * Veja: + * + * + * + */ + representacao : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=alterarepresentacao&tema=" + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; }; - i3GEOF.legenda.aguarde.visibility = "visible"; - cp.set_response_type("JSON"); - cp.call(p,"alteraRepresentacao",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: montaEditor - - Monta o editor de símbolos quando o usuário clica em um símbolo na legenda - */ - montaEditor: function(retorno){ - try{ - i3GEO.util.comboItens( - "i3GEOlegendaSelItemLabel", - i3GEOF.legenda.tema, - function(retorno){ - if($i("i3GEOlegendaitensLabel")) - {$i("i3GEOlegendaitensLabel").innerHTML = retorno.dados;} - }, - "i3GEOlegendaitensLabel" - ); - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - if (retorno.data != undefined){ - var l,i,sct,combo,n; - retorno = retorno.data; - i3GEOF.legenda.estilos = retorno.split("|"); - combo = "

"; - $i("i3GEOlegendacomboestilos").innerHTML = "
"+$trad('estiloEdicao',i3GEOF.legenda.dicionario)+":"+combo+"
 (após adicionar ou excluir, aplique a alteração)
"; - new YAHOO.widget.Button( - "i3GEOlegendabotao11",{onclick:{fn: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=excluiestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); + i3GEOF.legenda.aguarde.visibility = "visible"; + if (retorno.data != undefined) { + var l, i, sct, combo, n; + retorno = retorno.data; + i3GEOF.legenda.estilos = retorno.split("|"); + combo = + "
"; + $i("i3GEOlegendacomboestilos").innerHTML = + "
" + $trad('estiloEdicao', i3GEOF.legenda.dicionario) + + ":" + combo + + "
 (após adicionar ou excluir, aplique a alteração)
"; + new YAHOO.widget.Button("i3GEOlegendabotao11", { + onclick : { + fn : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editasimbolo&opcao=excluiestilo&tema=" + i3GEOF.legenda.tema + "&classe=" + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + } } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }}} - ); - new YAHOO.widget.Button( - "i3GEOlegendabotao12", - {onclick:{fn: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=adicionaestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); + }); + new YAHOO.widget.Button("i3GEOlegendabotao12", { + onclick : { + fn : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editasimbolo&opcao=adicionaestilo&tema=" + i3GEOF.legenda.tema + "&classe=" + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + } } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }}} - ); - new YAHOO.widget.Button( - "i3GEOlegendabotao13", - {onclick:{fn: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=sobeestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); + }); + new YAHOO.widget.Button("i3GEOlegendabotao13", { + onclick : { + fn : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editasimbolo&opcao=sobeestilo&tema=" + i3GEOF.legenda.tema + "&classe=" + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + } } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }}} - ); - new YAHOO.widget.Button( - "i3GEOlegendabotao14", - {onclick:{fn: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=desceestilo&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"editasimbolo",i3GEOF.legenda.reMontaEditor); + }); + new YAHOO.widget.Button("i3GEOlegendabotao14", { + onclick : { + fn : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editasimbolo&opcao=desceestilo&tema=" + i3GEOF.legenda.tema + "&classe=" + + i3GEOF.legenda.classe + "&estilo=" + i3GEOF.legenda.estilo, cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + } } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }}} - ); + }); + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostraEstilo(0); + } else { + $i("i3GEOlegendacomboestilos").innerHTML = "

Erro
"; + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostraEstilo(0); } - else{ - $i("i3GEOlegendacomboestilos").innerHTML = "

Erro
"; + }, + /* + * Function: mostraEstilo + * + * Mostra as propriedades de um estilo de um símbolo + */ + mostraEstilo : function(e) { + i3GEOF.legenda.aguarde.visibility = "visible"; + try { + var linha, tipoLayer, d, p, cp; + i3GEOF.legenda.estilo = e; // esta e uma variavel global + linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo]; + linha = linha.split("#"); + tipoLayer = linha[0]; + d = + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "
Cor do contorno:" + "
" + + "" + + "
" + + "
" + + $trad('corFundo', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('corFrente', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('tamanhoEspacamento', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('espessura', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('padraoRepeticao', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('opacidade', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('angulo', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + + "
" + + $trad('simbolo', i3GEOF.legenda.dicionario) + + ":" + + "
" + + "" + + "
" + "
"; + $i("i3GEOlegendaParametrosEstilos").innerHTML = d; + p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=editasimbolo&tipo=" + + tipoLayer + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)"; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "editasimbolo", i3GEOF.legenda.listaSimbolos); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); i3GEOF.legenda.aguarde.visibility = "hidden"; } - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: mostraEstilo - - Mostra as propriedades de um estilo de um símbolo - */ - mostraEstilo: function(e){ - i3GEOF.legenda.aguarde.visibility = "visible"; - try{ - var linha,tipoLayer,d,p,cp; - i3GEOF.legenda.estilo = e; //esta e uma variavel global - linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo]; - linha = linha.split("#"); - tipoLayer = linha[0]; - d = ""+ - ""+ - ""+ - "" + - "" + - "" + - "" + - "" + - "
Cor do contorno:" + - "
" + - "" + - "
" + - "
"+$trad('corFundo',i3GEOF.legenda.dicionario)+":" + - "
" + - "" + - "
" + - "
"+$trad('corFrente',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"+$trad('tamanhoEspacamento',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"+$trad('espessura',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"+$trad('padraoRepeticao',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"+$trad('opacidade',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"+$trad('angulo',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"+$trad('simbolo',i3GEOF.legenda.dicionario)+":"+ - "
" + - "" + - "
" + - "
"; - $i("i3GEOlegendaParametrosEstilos").innerHTML = d; - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&tipo="+tipoLayer+"&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)"; - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"editasimbolo",i3GEOF.legenda.listaSimbolos); - i3GEOF.legenda.aguarde.visibility = "hidden"; - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: listaSimbolos - - Monta a lista de símbolos com imagem - */ - listaSimbolos: function(retorno){ - i3GEOF.legenda.aguarde.visibility = "visible"; - try{ - if (retorno.data != undefined){ - retorno = retorno.data; - $i("i3GEOlegendasimbolos").innerHTML = "
"+$trad('listaSimbolo',i3GEOF.legenda.dicionario)+":

"+retorno; - } - else - {$i("i3GEOlegendasimbolos").innerHTML = "

Erro
";} - i3GEOF.legenda.aguarde.visibility = "hidden"; - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: aplicaSimbolo - - Muda o valor do campo com o código do símbolo escolhido - */ - aplicaSimbolo: function(s) - {$i("i3GEOlegendasymbolname").value = s.title;}, - /* - Function: aplicaEstilo - - Aplica ao estilo as propriedades definidas - - Veja: - - - */ - aplicaEstilo: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} + }, + /* + * Function: listaSimbolos + * + * Monta a lista de símbolos com imagem + */ + listaSimbolos : function(retorno) { i3GEOF.legenda.aguarde.visibility = "visible"; - var outlinecolor = $i("i3GEOlegendaoutlinecolor").value, - backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, - color = $i("i3GEOlegendacolor").value, - symbolname = $i("i3GEOlegendasymbolname").value, - simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), - valido = "nao", - n = simbolos.length, - size = $i("i3GEOlegendasizes").value, - width = $i("i3GEOlegendawidth").value, - pattern = $i("i3GEOlegendapattern").value, - opacidade = $i("i3GEOlegendaopacidade").value, - angle = $i("i3GEOlegendaangulo").value, - i,p,cp,fim; - for (i=0;i" + $trad('listaSimbolo', i3GEOF.legenda.dicionario) + ":

" + retorno; + } else { + $i("i3GEOlegendasimbolos").innerHTML = "

Erro
"; + } + i3GEOF.legenda.aguarde.visibility = "hidden"; + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; } - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=editasimbolo&opcao=aplica&tema="+i3GEOF.legenda.tema+"&classe="+i3GEOF.legenda.classe+"&estilo="+i3GEOF.legenda.estilo+"&outlinecolor="+outlinecolor+"&backgroundcolor="+backgroundcolor+"&color="+color+"&symbolname="+symbolname+"&width="+width+"&pattern="+pattern+"&size="+size+"&opacidade="+opacidade+"&angle="+angle; - cp = new cpaint(); - fim = function(){ - i3GEOF.legenda.aposAlterarLegenda(); + }, + /* + * Function: aplicaSimbolo + * + * Muda o valor do campo com o código do símbolo escolhido + */ + aplicaSimbolo : function(s) { + $i("i3GEOlegendasymbolname").value = s.title; + }, + /* + * Function: aplicaEstilo + * + * Aplica ao estilo as propriedades definidas + * + * Veja: + * + * + */ + aplicaEstilo : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, color = + $i("i3GEOlegendacolor").value, symbolname = $i("i3GEOlegendasymbolname").value, simbolos = + $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n = simbolos.length, size = + $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern = $i("i3GEOlegendapattern").value, opacidade = + $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, i, p, cp, fim; + for (i = 0; i < n; i++) { + if (simbolos[i].title == symbolname || symbolname == i) { + valido = "sim"; + } + } + if (valido === "nao") { + // i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado"); + // i3GEOF.legenda.aguarde.visibility = "hidden"; + // return; + } + p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=editasimbolo&opcao=aplica&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe + "&estilo=" + + i3GEOF.legenda.estilo + "&outlinecolor=" + outlinecolor + "&backgroundcolor=" + backgroundcolor + "&color=" + + color + "&symbolname=" + symbolname + "&width=" + width + "&pattern=" + pattern + "&size=" + size + "&opacidade=" + + opacidade + "&angle=" + angle; + cp = new cpaint(); + fim = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.reMontaEditor(); + }; + // cp.set_debug(2) + cp.set_response_type("JSON"); + cp.call(p, "editasimbolo", fim); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.reMontaEditor(); - }; - //cp.set_debug(2) - cp.set_response_type("JSON"); - cp.call(p,"editasimbolo",fim); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: reMontaEditor - - Gera novamente o editor de símbolo após ter sido feita alguma alteração nos estilos - */ - reMontaEditor: function(){ - var id = i3GEOF.legenda.tema+"-"+i3GEOF.legenda.classe; - i3GEOF.legenda.editaSimbolo(id); - }, - /* - Function: mostraGrafico - - Mostra um gráfico com a contegem de elementos em caada classe - - Veja: - - - */ - mostraGrafico: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var monta = function(retorno){ - if (retorno.data && retorno.data[0].proc == ""){ - var ins = [],i,re,t; - ins.push("

"); - ins.push("

"+$trad('numeroOcorrenciasClasses',i3GEOF.legenda.dicionario)+"

"); - ins.push(""); - i3GEOF.legenda.dadosGrafico = ["n;x"]; - if(retorno.data.length < 2){ - i3GEO.janela.tempoMsg($trad('msgNumeroClasses',i3GEOF.legenda.dicionario)); - i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }, + /* + * Function: reMontaEditor + * + * Gera novamente o editor de símbolo após ter sido feita alguma alteração nos estilos + */ + reMontaEditor : function() { + var id = i3GEOF.legenda.tema + "-" + i3GEOF.legenda.classe; + i3GEOF.legenda.editaSimbolo(id); + }, + /* + * Function: mostraGrafico + * + * Mostra um gráfico com a contegem de elementos em caada classe + * + * Veja: + * + * + */ + mostraGrafico : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var monta = + function(retorno) { + if (retorno.data && retorno.data[0].proc == "") { + var ins = [], i, re, t; + ins.push("

"); + ins.push("

" + $trad('numeroOcorrenciasClasses', i3GEOF.legenda.dicionario) + "

"); + ins.push("
"); + i3GEOF.legenda.dadosGrafico = [ + "n;x" + ]; + if (retorno.data.length < 2) { + i3GEO.janela.tempoMsg($trad('msgNumeroClasses', i3GEOF.legenda.dicionario)); + i3GEOF.legenda.aguarde.visibility = "hidden"; + return; + } else { + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4", "i3GEOlegendaguia"); + } + for (i = 0; i < retorno.data.length; i++) { + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe + re = new RegExp("'", "g"); + exp = (retorno.data[i].expressao).replace(re, '"'); + ins.push(""); + t = (retorno.data[i].nreg * 100) / retorno.data[i].totalreg; + ins.push(""); + i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg); + } + ins.push("
" + retorno.data[i].nomeclasse + + "

"); + $i("i3GEOlegendaguia4obj").innerHTML = ins.join(""); + } else { + $i("i3GEOlegendaguia4obj").innerHTML = "

Erro
"; return; } - else - {i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4","i3GEOlegendaguia");} - for (i=0;i"+retorno.data[i].nomeclasse+""); - t = (retorno.data[i].nreg * 100)/retorno.data[i].totalreg; - ins.push(""); - i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse+";"+retorno.data[i].nreg); - } - ins.push("
"); - $i("i3GEOlegendaguia4obj").innerHTML = ins.join(""); - } - else - {$i("i3GEOlegendaguia4obj").innerHTML = "

Erro
";return;} - i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.aguarde.visibility = "hidden"; - new YAHOO.widget.Button( - "i3GEOlegendaGraficoPizza", - {onclick:{fn: function(){ - var js = i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php"; - i3GEO.util.scriptTag(js,"i3GEOF.legenda.iniciaGraficoPizza()","i3GEOF.graficointerativo1_script"); + new YAHOO.widget.Button("i3GEOlegendaGraficoPizza", { + onclick : { + fn : function() { + var js = i3GEO.configura.locaplic + "/ferramentas/graficointerativo1/dependencias.php"; + i3GEO.util.scriptTag(js, "i3GEOF.legenda.iniciaGraficoPizza()", "i3GEOF.graficointerativo1_script"); + } } - }} - ); - $i("i3GEOlegendaGraficoPizza-button").style.width = "200px"; - }, - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=contagemclasse&tema="+i3GEOF.legenda.tema, - cp = new cpaint(); - //cp.set_debug(2) - cp.set_response_type("JSON"); - cp.call(p,"cocontagemclasse",monta); - } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - iniciaGraficoPizza: function(){ - var dados = { - "attributes":{"id":""}, - "data":{ - "dados":i3GEOF.legenda.dadosGrafico + }); + $i("i3GEOlegendaGraficoPizza-button").style.width = "200px"; + }, p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + i3GEO.configura.sid + + "&funcao=contagemclasse&tema=" + i3GEOF.legenda.tema, cp = new cpaint(); + // cp.set_debug(2) + cp.set_response_type("JSON"); + cp.call(p, "cocontagemclasse", monta); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); + i3GEOF.legenda.aguarde.visibility = "hidden"; } - }; - i3GEOF.graficointerativo1.tipo = "pizza_1"; - i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados); - }, - /* - Function: aplicaProcessos - - Aplica processos de ajuste em imagens de satélite - - Veja: - - - */ - aplicaProcessos: function(){ - try{ - if(i3GEOF.legenda.aguarde.visibility === "visible") - {return;} - i3GEOF.legenda.aguarde.visibility = "visible"; - var lista = [],ipt,i,p,cp,temp; - if ($i("i3GEOlegendaprocessos").innerHTML != ""){ - ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input"); - for (i=0;i + */ + aplicaProcessos : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var lista = [], ipt, i, p, cp, temp; + if ($i("i3GEOlegendaprocessos").innerHTML != "") { + ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input"); + for (i = 0; i < ipt.length; i++) { + if (ipt[i].value != "") { + lista.push(ipt[i].value); + } } } - } - lista = lista.join("|"); - temp = function(){ + lista = lista.join("|"); + temp = function() { + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); + i3GEOF.legenda.aposAlterarLegenda(); + }; + p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + + "&funcao=aplicaProcessos&lista=" + lista + "&tema=" + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "aplicaProcessos", temp); + } catch (e) { + i3GEO.janela.tempoMsg("Erro: " + e); i3GEOF.legenda.aguarde.visibility = "hidden"; - i3GEOF.legenda.mostralegenda(); - i3GEOF.legenda.aposAlterarLegenda(); - }; - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=aplicaProcessos&lista="+lista+"&tema="+i3GEOF.legenda.tema; - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"aplicaProcessos",temp); + } + }, + /* + * Function: adicionaProcesso + * + * Adiciona um novo processo na lista de processos + */ + adicionaProcesso : function(s) { + $i("i3GEOlegendaprocessos").innerHTML += $inputText("", "", "", "", 50, s.value); } - catch(e){i3GEO.janela.tempoMsg("Erro: "+ e);i3GEOF.legenda.aguarde.visibility = "hidden";} - }, - /* - Function: adicionaProcesso - - Adiciona um novo processo na lista de processos - */ - adicionaProcesso: function(s){ - $i("i3GEOlegendaprocessos").innerHTML += $inputText("","","","",50,s.value); - } -}; \ No newline at end of file + }; \ No newline at end of file -- libgit2 0.21.2