From 42b0c25cd78cbec07cad5360ed50f1263dac0d77 Mon Sep 17 00:00:00 2001 From: edmarmoretti Date: Tue, 25 Jul 2017 18:12:04 -0300 Subject: [PATCH] Adaptação da ferramenta de edição da legenda para bootstrap --- admin/admin.db | Bin 340992 -> 0 bytes css/default.css | 6 ++++++ css/i3geo7.css.php | 0 ferramentas/filtro/index.js | 1 + ferramentas/identificax/dicionario.js | 143 ----------------------------------------------------------------------------------------------------------------------------------------------- ferramentas/identificax/index.js | 1289 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ferramentas/identificax/template_mst.html | 83 ----------------------------------------------------------------------------------- ferramentas/legenda/dicionario.js | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------- ferramentas/legenda/index.js | 1738 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ferramentas/legenda/templateFormEstilo_mst.html | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ferramentas/legenda/templateLista_mst.html | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ferramentas/legenda/template_mst.html | 652 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ferramentas/legendax/dependencias.php | 24 ++++++++++++++++++++++++ ferramentas/legendax/dicionario.js | 905 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ferramentas/legendax/exec.php | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ferramentas/legendax/index.js | 2511 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ferramentas/legendax/template_mst.html | 411 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ js/i3geo_tudo_compacto7.js.php | 0 js/util.js | 2 ++ 19 files changed, 5430 insertions(+), 2985 deletions(-) mode change 100755 => 100644 css/i3geo7.css.php delete mode 100755 ferramentas/identificax/dicionario.js delete mode 100755 ferramentas/identificax/index.js delete mode 100755 ferramentas/identificax/template_mst.html create mode 100644 ferramentas/legenda/templateFormEstilo_mst.html create mode 100755 ferramentas/legenda/templateLista_mst.html create mode 100755 ferramentas/legendax/dependencias.php create mode 100755 ferramentas/legendax/dicionario.js create mode 100755 ferramentas/legendax/exec.php create mode 100755 ferramentas/legendax/index.js create mode 100755 ferramentas/legendax/template_mst.html mode change 100755 => 100644 js/i3geo_tudo_compacto7.js.php diff --git a/admin/admin.db b/admin/admin.db index 2913c9c..ebe5dbb 100755 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/css/default.css b/css/default.css index 4ac2d8d..624ed57 100755 --- a/css/default.css +++ b/css/default.css @@ -594,6 +594,12 @@ Configuracoes especificas dos elementos que ficam no rodape color: white; } +.bd hr { + border-top: 2px dashed gray; + margin-top: 15px; + margin-bottom: 15px; +} + .bd select { background: white; } diff --git a/css/i3geo7.css.php b/css/i3geo7.css.php old mode 100755 new mode 100644 index e299447..e299447 --- a/css/i3geo7.css.php +++ b/css/i3geo7.css.php diff --git a/ferramentas/filtro/index.js b/ferramentas/filtro/index.js index e8bb3cd..ffa3fdc 100755 --- a/ferramentas/filtro/index.js +++ b/ferramentas/filtro/index.js @@ -304,6 +304,7 @@ i3GEOF.filtro = { if(modoCalculadora === true){ i3GEOF.filtro.aguarde.visibility = "hidden"; $i(idRetorno).value = i3GEOF.filtro.formataMapserver(); + i3GEO.janela.destroi("i3GEOF.filtro"); } else{ p = i3GEO.configura.locaplic+"/ferramentas/filtro/exec.php?base64=sim&g_sid="+i3GEO.configura.sid+"&funcao=inserefiltro"; diff --git a/ferramentas/identificax/dicionario.js b/ferramentas/identificax/dicionario.js deleted file mode 100755 index 27b5f86..0000000 --- a/ferramentas/identificax/dicionario.js +++ /dev/null @@ -1,143 +0,0 @@ -//+$trad(1,i3GEOF.identifica.dicionario)+ -i3GEOF.identifica.dicionario = { - 'selecionaTema' : [ { - pt : "Escolha um tema da lista", - en : "", - es : "" - } ], - 'msgEtiquetas' : [ { - pt : "Esse tema não permite etiquetas", - en : "", - es : "" - } ], - 'temasVisiveis' : [ { - pt : "Resultado", - en : "", - es : "" - } ], - 'todos' : [ { - pt : "Todos", - en : "", - es : "" - } ], - 'etiquetas' : [ { - pt : "Etiquetas", - en : "", - es : "" - } ], - 'propriedades' : [ { - pt : "Propriedades", - en : "", - es : "" - } ], - 'msgAguarde' : [ { - pt : "Aguarde", - en : "", - es : "" - } ], - 'resolucaoBusca' : [ { - pt : "Resolução de busca - número de pixels, no entorno do ponto clicado no mapa, que serão utilizados na busca de dados", - en : "", - es : "" - } ], - 'mostraEtiquetas' : [ { - pt : "As etiquetas são mostradas quando o mouse é estacionado sobre um elemento.", - en : "", - es : "" - } ], - 'configuraEtiqueta' : [ { - pt : "Configurar etiquetas", - en : "", - es : "" - } ], - 'valorPonto' : [ { - pt : "Valores para o ponto indicado no mapa", - en : "", - es : "" - } ], - 'criaBuffer' : [ { - pt : "Criar entorno (buffer)", - en : "", - es : "" - } ], - 'verDados' : [ { - pt : "Clique no tema para ver os dados", - en : "", - es : "" - } ], - 'msgNadaEncontrado' : [ { - pt : "Nada encontrado", - en : "", - es : "" - } ], - 'todas' : [ { - pt : "todas", - en : "", - es : "" - } ], - 'mostraOcorrencia' : [ { - pt : "Mostra a ocorrência", - en : "", - es : "" - } ], - 'msgNadaEncontrado2' : [ { - pt : "Nada encontrado", - en : "", - es : "" - } ], - 'adicionaPonto' : [ { - pt : "Clique aqui para adicionar um ponto", - en : "", - es : "" - } ], - 'apagaRegistro' : [ { - pt : "Apagar registro", - en : "", - es : "" - } ], - 'removeRegistroBD' : [ { - pt : "Remove o registro do banco de dados?", - en : "", - es : "" - } ], - 'sim' : [ { - pt : "Sim", - en : "", - es : "" - } ], - 'cancela' : [ { - pt : "Cancela", - en : "", - es : "" - } ], - 'move' : [ { - pt : "Mover", - en : "", - es : "" - } ], - 'cliqueNovaPosicao' : [ { - pt : "Clique no mapa para indicar a nova posição", - en : "", - es : "" - } ], - 'etiquetaAtiva' : [ { - pt : "Etiqueta está ativa", - en : "", - es : "" - } ], - 'filtraValor' : [ { - pt : "Filtrar por valor", - en : "", - es : "" - } ], - 'removeFiltro' : [ { - pt : "Remove filtro", - en : "", - es : "" - } ], - 'atualizaJanela' : [ { - pt : "Atualiza essa janela", - en : "", - es : "" - } ] -}; diff --git a/ferramentas/identificax/index.js b/ferramentas/identificax/index.js deleted file mode 100755 index ab5fe14..0000000 --- a/ferramentas/identificax/index.js +++ /dev/null @@ -1,1289 +0,0 @@ -/* -Title: Identifica - -Obtem os atributos de um ou mais temas para uma coordenada. -Abre uma janela com várias opções e lista de temas disponíveis no mapa atual. - -O evento de clique no mapa e ativado em i3geo/classesjs/classe_configura.js - -Varias janelas podem coexistir. - -A lista de ids das janelas abertas e mantido na variavel i3GEOF.identifica.janelas - -As propriedades de cada janela sao mantidas em um objeto indexado pelo id de cada janela e - -mantido em i3GEOF.identifica.propJanelas - -Veja: - - - -File: i3geo/ferramentas/identifica/index.js.php - -About: Licença - -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 - -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. - */ -if (typeof (i3GEOF) === 'undefined') { - var i3GEOF = {}; -} -/* - * Classe: i3GEOF.identifica - * - */ - -// TODO na listagem de atributos, incluir opcao para abrir os valores das variaveis associadas a uma regiao, quando codigo_tipo_regiao for -// diferente de null -i3GEOF.identifica = - { - /** - * Array com os ids das janelas ja criadas - */ - janelas : [], - propJanelas : {}, - /** - * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php - */ - MUSTACHE : "", - /** - * Susbtitutos para o template - */ - mustacheHash : function(idjanela) { - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.identifica.dicionario); - dicionario["idjanela"] = idjanela; - dicionario["locaplic"] = i3GEO.configura.locaplic; - return dicionario; - }, - /* - * Propriedade: mostraLinkGeohack - * - * Mostra ou não o link para abrir o site GeoHack. - * - * Este site permite o uso de vários buscadores disponíveis na internet. - * - * Type: {boolean} - */ - mostraLinkGeohack : true, - /* - * Propriedade: mostraSistemasAdicionais - * - * Mostra ou não a lista de sistemas adicionais de busca de dados. - * - * Type: {boolean} - */ - mostraSistemasAdicionais : true, - /* - * Variavel: tema - * - * Código do tema que será pesquisado - * - * Type: {String} - */ - tema : "", - /* - * Variavel: x - * - * Coordenada x - * - * Type: {Numeric} - */ - x : 0, - /* - * Variavel: y - * - * Coordenada y - * - * Type: {Numeric} - */ - y : 0, - /* - * Variavel: sistemasAdicionais - * - * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas - * - * Type: {Array} - */ - sistemasAdicionais : [], - /* - * Variavel: dadosIdentifica - * - * Guarda os dados obtidos com a chamada em AJAX de identificação - * - * Type: {Array} - */ - dadosIdentifica : [], - - /* - * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário - */ - criaJanelaFlutuante : function(x, y) { - if (typeof (console) !== 'undefined') - console.info("i3GEOF.identifica.criaJanelaFlutuante()"); - - if(i3GEOF.identifica.MUSTACHE == ""){ - $.get(i3GEO.configura.locaplic + "/ferramentas/identifica/template_mst.html", function(template) { - i3GEOF.identifica.MUSTACHE = template; - i3GEOF.identifica.criaJanelaFlutuante(x, y); - return; - }); - return; - } - if (x) { - i3GEOF.identifica.iniciaJanelaFlutuante(x, y); - } else { - i3GEOF.identifica.iniciaJanelaFlutuante(); - } - }, - /* - * Function: inicia - * - * Inicia a janela de informações - * - * Parameters: - * - * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado - * já na inicialização - * - * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos - * - * y {Numeric} - coordenada y do ponto - * - * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido - * - * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks - * - * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados - * - * idjanela {string} - */ - inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { - if (typeof (console) !== 'undefined') - console.info("i3GEOF.identifica.inicia()"); - - $i(iddiv).innerHTML += i3GEOF.identifica.html(idjanela); - i3GEOF.identifica.propJanelas[idjanela].tema = tema; - i3GEOF.identifica.propJanelas[idjanela].temaAtivo = tema; - i3GEOF.identifica.propJanelas[idjanela].x = x; - i3GEOF.identifica.propJanelas[idjanela].y = y; - i3GEOF.identifica.propJanelas[idjanela].marca = false; - i3GEOF.identifica.mostraLinkGeohack = mostraLinkGeohack; - i3GEOF.identifica.mostraSistemasAdicionais = mostraSistemasAdicionais; - // se o usuário for editor, força mostrar a lista - // de sistemas - if (i3GEO.parametros.editor.toLowerCase() == "sim") { - i3GEOF.identifica.mostraSistemasAdicionais == true; - } - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); - // eventos das guias - $i(idjanela + "i3GEOidentificaguia1").onclick = function() { - i3GEOF.identifica.listaTemas("ligados", "", "", idjanela); - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); - if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo === "") { - $i(idjanela + "i3GEOidentificaoguia1").innerHTML = $trad('selecionaTema', i3GEOF.identifica.dicionario); - } - }; - $i(idjanela + "i3GEOidentificaguia2").onclick = function() { - i3GEOF.identifica.listaTemas("todos", "", "", idjanela); - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); - }; - $i(idjanela + "i3GEOidentificaguia3").onclick = function() { - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia3", idjanela + "i3GEOidentificaguia"); - }; - - $i(idjanela + "i3GEOidentificaguia4").onclick = - function() { - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia4", idjanela + "i3GEOidentificaguia"); - var b = - new YAHOO.widget.Button( - idjanela + "i3GEOidentificabotao1", - { - onclick : { - fn : function() { - if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo && i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { - var ltema = - i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); - if (ltema.identifica == "nao" || ltema.identifica == "NAO") { - i3GEO.janela.tempoMsg($trad('msgEtiquetas', i3GEOF.identifica.dicionario)); - } else { - i3GEO.tema.dialogo.etiquetas(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); - } - $i(idjanela + "i3GEOidentificaoguia1").innerHTML = ""; - } else { - $i(idjanela + "i3GEOidentificaoguia1").innerHTML = - $trad('selecionaTema', i3GEOF.identifica.dicionario); - } - } - } - }); - b.addClass("abrir"); - }; - $i(idjanela + "i3GEOidentificaguia5").onclick = - function() { - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia5", idjanela + "i3GEOidentificaguia"); - var temp, b = - new YAHOO.widget.Button(idjanela + "i3GEOidentificabotao2", { - onclick : { - fn : function() { - var js = i3GEO.configura.locaplic + "/ferramentas/bufferpt/dependencias.php"; - i3GEO.util.scriptTag( - js, - "i3GEOF.bufferpt.iniciaJanelaFlutuante(" + i3GEOF.identifica.propJanelas[idjanela].x - + "," - + i3GEOF.identifica.propJanelas[idjanela].y - + ")", - "i3GEOF.bufferpt_script"); - } - } - }); - b.addClass("rodar"); - //TODO corrigir em funcao das mudancas em i3geo.coordenadas - /* - temp = i3GEO.coordenadas.formato, gh = - i3GEO.coordenadas.geohash.encodeGeoHash( - i3GEOF.identifica.propJanelas[idjanela].y, - i3GEOF.identifica.propJanelas[idjanela].x); - i3GEO.coordenadas.formato = "lista"; - i3GEO.coordenadas.mostraCoordenadas( - false, - idjanela + "i3GEOidentificacoordtexto", - i3GEOF.identifica.propJanelas[idjanela].x, - i3GEOF.identifica.propJanelas[idjanela].y); - i3GEO.coordenadas.MODOTEXTO += "Geohash: " + gh + ""; - $i(idjanela + "i3GEOidentificacoordtexto").innerHTML = i3GEO.coordenadas.MODOTEXTO + ""; - i3GEO.coordenadas.formato = temp; - */ - }; - i3GEOF.identifica.listaTemas("ligados", "", "", idjanela); - // - // verifica se existem sistemas para identificar - // - i3GEOF.identifica.atualizaSistemas(); - if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { - // verifica se o tema ativo pode ser identificado - var temp = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); - if (temp.identifica.toLowerCase() !== "nao") { - i3GEOF.identifica.buscaDadosTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo, "", "", idjanela); - } - } - - // botao de redimensionar as partes da janela - var Dom = YAHOO.util.Dom, col1 = null, col2 = null; - - col1 = Dom.get(idjanela + 'i3GEOidentificatemaativo'); - col2 = Dom.get(idjanela + 'i3GEOidentificaoguia1'); - var resize = new YAHOO.util.Resize(idjanela + 'i3GEOidentificatemaativo', { - handles : [ - 'r' - ], - maxWidth : 180 - }); - resize.on('resize', function(ev) { - // Dom.setStyle(col1, 'height', ''); - // 150 é o tamanho inicial da parte esquerda, - // corresponde a 40% - var w1 = parseInt(col1.style.width); - var dif = parseInt((w1 * 40) / 150, 10); - Dom.setStyle(col2, 'width', 40 - dif + 60 + '%'); - Dom.setStyle(col2, 'left', w1 + 15 + 'px'); - }); - resize.resize(null, null, null, 0, 0, true); - }, - atualizaSistemas : function() { - if (i3GEOF.identifica.mostraSistemasAdicionais === true) { - if (i3GEOF.identifica.sistemasAdicionais.length == 0) { - var p = - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" - + i3GEO.configura.sid; - cpJSON.call(p, "foo", i3GEOF.identifica.montaListaSistemas); - } else { - i3GEOF.identifica.montaListaSistemas(""); - } - } - }, - /* - * Function: iniciaJanelaFlutuante - * - * Cria a janela flutuante para controle da ferramenta. - */ - iniciaJanelaFlutuante : function(x, y) { - if (typeof (console) !== 'undefined') - console.info("i3GEOF.identifica.iniciaJanelaFlutuante()"); - - var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" + parseInt(Math.random() * 1000000, 10); - i3GEOF.identifica.janelas.push(id); - i3GEOF.identifica.propJanelas[id] = {}; - if (x) { - objposicaocursor.ddx = x; - objposicaocursor.ddy = y; - i3GEOF.identifica.propJanelas[id].x = x; - i3GEOF.identifica.propJanelas[id].y = y; - i3GEOF.identifica.propJanelas[id].marca = false; - i3GEOF.identifica.x = x; - i3GEOF.identifica.y = y; - } - // funcao que sera executada ao ser clicado no cabeçalho da - // janela - cabecalho = function() { - i3GEOF.identifica.ativaFoco(id); - }; - minimiza = function() { - i3GEO.janela.minimiza(id); - }; - duplica = function() { - i3GEOF.identifica.iniciaJanelaFlutuante(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y); - }; - // cria a janela flutuante - titulo = - "" + $trad("d7t") - + ""; - janela = - i3GEO.janela.cria( - "470px", - "270px", - "", - "", - "", - titulo, - id, - false, - "hd", - cabecalho, - minimiza, - "", - true, - "", - duplica, - "", - "" - ); - divid = janela[2].id; - if (i3GEOF.identifica.janelas.length > 1) { - temp = janela[0].cfg.config; - janela[0].moveTo( - temp.x.value + (i3GEOF.identifica.janelas.length * 50), - temp.y.value + (i3GEOF.identifica.janelas.length * 15)); - } - i3GEOF.identifica.inicia(i3GEO.temaAtivo, objposicaocursor.ddx, objposicaocursor.ddy, divid, true, true, id); - janela[2].style.backgroundColor = "white"; - - i3GEOF.identifica.propJanelas[id].aguarde = $i(id + "_imagemCabecalho").style; - i3GEOF.identifica.propJanelas[id].atualiza = true; - temp = 'i3GEOF.identifica.propJanelas["' + id + '"].atualiza = this.checked'; - janela[0] - .setFooter("
 " - + $trad('atualizaJanela', i3GEOF.identifica.dicionario) - + "
"); - - }, - limpaMarca : function(id) { - i3GEO.desenho.removePins(id); - i3GEOF.identifica.propJanelas[id].marca = false; - }, - /* - * Function: ativaFoco - * - * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado - */ - ativaFoco : function(id) { - i3GEOF.identifica.listaTemas("ligados"); - }, - mostraImagemPonto : function(id) { - if (i3GEO.Interface.ATUAL === "googleearth") { - return; - } - if (i3GEOF.identifica.propJanelas[id].marca === false) { - i3GEOF.identifica.propJanelas[id].marca = - i3GEO.desenho.addPin(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y, "", "", "", id); - } else { - i3GEO.desenho.movePin( - i3GEOF.identifica.propJanelas[id].marca, - i3GEOF.identifica.propJanelas[id].x, - i3GEOF.identifica.propJanelas[id].y); - } - }, - /* - * Function: html - * - * Gera o código html para apresentação das opções da ferramenta - * - * Retorno: - * - * String com o código html - */ - html : function(idjanela) { - var ins = Mustache.render(i3GEOF.identifica.MUSTACHE, i3GEOF.identifica.mustacheHash(idjanela)); - return ins; - }, - /* - * Abre a janela flutuante para controlar o processo de reposicionar um ponto. Ativada apenas quando o usuario puder editar um tema - */ - janelaMoverPonto : function(tema, idreg) { - if ($i("i3GEOF.movePonto_corpo")) { - return; - } - var temp, titulo; - // cria a janela flutuante - titulo = "
" + $trad('move', i3GEOF.identifica.dicionario) + "
"; - i3GEO.janela.cria("250px", "100px", "", "", "", titulo, "i3GEOF.movePonto", false, "hd", "", ""); - $i("i3GEOF.movePonto_corpo").style.backgroundColor = "white"; - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); - i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ - "i3GEOF.identifica.atualizaJanelaMoverPonto()" - ]); - temp = function() { - i3GEO.eventos.adicionaEventos("MOUSECLIQUE", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); - }; - YAHOO.util.Event.addListener(janela[0].close, "click", temp); - $i("i3GEOF.movePonto_corpo").innerHTML = - "" + $trad('cliqueNovaPosicao', i3GEOF.identifica.dicionario) - + "

X:

" - + "
" - + "

Y:

" - + "
" - + "" - + ""; - - new YAHOO.widget.Button( - "i3GEOF.moveAplica", - { - onclick : { - fn : function() { - var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = - $i("i3GEOF.moveAplicaTema").value, p = - i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" - + i3GEO.configura.sid, temp = function(retorno) { - i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); - i3GEO.Interface.atualizaTema("", tema); - i3GEOF.identifica.buscaDadosTema(tema, x, y); - }; - i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); - i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call(p, "foo", temp, "&idunico=" + idreg + "&tema=" + tema + "&wkt=POINT(" + x + " " + y + ")"); - } - } - }); - }, - atualizaJanelaMoverPonto : function() { - if ($i("i3GEOF.movePontoX")) { - $i("i3GEOF.movePontoX").value = objposicaocursor.ddx; - $i("i3GEOF.movePontoY").value = objposicaocursor.ddy; - } else { - i3GEO.eventos.removeEventos("MOUSECLIQUE", [ - "i3GEOF.identifica.atualizaJanelaMoverPonto()" - ]); - } - }, - /* - * Function: listaTemas - * - * Incluí a lista de temas para o usuário escolher - * - * Veja: - * - * - * - * Parametros: - * - * tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas - * - * id {string} id da janela em foco - */ - listaTemas : function(tipo) { - if (i3GEO.arvoreDeCamadas.CAMADAS !== "") { - var lista = i3GEO.arvoreDeCamadas.CAMADAS; - if (tipo === "ligados") { - lista = i3GEO.arvoreDeCamadas.filtraCamadas("status", 2, "igual", lista); - } - lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica", "NAO", "diferente", lista); - lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica", "nao", "diferente", lista); - i3GEOF.identifica.montaListaTemas(lista); - } else { - i3GEO.php.listaTemas(i3GEOF.identifica.montaListaTemas, tipo, i3GEO.configura.locaplic, i3GEO.configura.sid); - } - }, - /* - * Function: montaListaTemas - * - * Monta a lista de temas na forma de botões 'radio' - * - * O resultado é inserido no div com id "listaTemas" - * - * Parametros: - * - * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas - */ - montaListaTemas : function(retorno) { - var lista, linhas, linhas1, l, nome, tema, divResultado, marcado = "", n = i3GEOF.identifica.janelas.length, id = "", i; - if (retorno.data) { - lista = retorno.data; - } else { - lista = retorno; - } - for (i = 0; i < n; i++) { - id = i3GEOF.identifica.janelas[i]; - // - // ativa o link para o site geohack - // - if (i3GEOF.identifica.mostraLinkGeohack === true) { - linhas = i3GEOF.identifica.montaLinkGeohack(); - } else { - linhas = ""; - } - // - // monta a lista de temas - // - linhas += "" + $trad('verDados', i3GEOF.identifica.dicionario) + ""; - linhas1 = ""; - for (l = 0; l < lista.length; l++) { - marcado = ""; - if (lista[l].nome) { - nome = lista[l].nome; - tema = lista[l].tema; - } else { - nome = lista[l].tema; - tema = lista[l].name; - } - if (tema == i3GEOF.identifica.propJanelas[id].temaAtivo) { - marcado = "CHECKED"; - } - if (lista[l].identifica !== "nao") { - linhas1 += - "" - + nome - + ""; - } - } - divResultado = $i(id + "i3GEOidentificalistaTemas"); - if (divResultado) { - divResultado.innerHTML = - linhas + "" - + linhas1 - + "
Todos
"; - if (i3GEOF.identifica.propJanelas[id].temaAtivo != "") { - i3GEOF.identifica.buscaDadosTema( - i3GEOF.identifica.propJanelas[id].temaAtivo, - i3GEOF.identifica.propJanelas[id].x, - i3GEOF.identifica.propJanelas[id].y, - id); - } - } - } - }, - /* - * Function: montaLinkGeohack - * - * Monta o link para o site geohack - * - * Return: - * - * {String} - */ - montaLinkGeohack : function() { - return "Buscadores web
"; - }, - abreLinkGeohack : function() { - var b, x, y, w, s, param; - b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x, i3GEOF.identifica.y); - x = b[0].split(" "); - y = b[1].split(" "); - w = "W"; - s = "S"; - if (x[0] * 1 > 0) { - w = "L"; - } - if (y[0] * 1 > 0) { - s = "N"; - } - if (x[0] * 1 < 0) { - x[0] = x[0] * -1; - } - if (y[0] * 1 < 0) { - y[0] = y[0] * -1; - } - param = y[0] + "_" + y[1] + "_" + y[2] + "_" + s + "_" + x[0] + "_" + x[1] + "_" + x[2] + "_" + w; - window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" + param); - }, - /* - * Function: montaListaSistemas - * - * Obtém a lista de sistemas especiais de consulta. - * - * O resultado é inserido no div com id "listaSistemas". - * - * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. - * - */ - montaListaSistemas : function(retorno) { - var l, divins, ig, sistema, pub, exec, temp, t, linhas, ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; - if (retorno !== undefined) { - if (i3GEOF.identifica.sistemasAdicionais.length == 0) { - sis = retorno.data; - for (ig = 0; ig < sis.length; ig++) { - sistema = sis[ig].NOME; - if (sis[ig].PUBLICADO) { - if (sis[ig].PUBLICADO) { - pub = sis[ig].PUBLICADO; - if (pub === "NAO" || pub === "nao") { - sistema = "" + sistema + ""; - } - } - } - exec = sis[ig].ABRIR; - temp = exec.split('"'); - if (temp.length === 1) { - exec = '"' + exec + '"'; - } - temp = exec.split("?"); - if (temp.length !== 2) { - exec += '+"?"'; - } - t = "blank"; - if (sis[ig].TARGET) { - t = sis[ig].TARGET; - } - i3GEOF.identifica.sistemasAdicionais.push(sistema + "," + exec + "," + t); - } - } - if (i3GEOF.identifica.sistemasAdicionais.length > 0) { - for (i = 0; i < n; i++) { - idjanela = i3GEOF.identifica.janelas[i]; - divins = $i(idjanela + "i3GEOidentificalistaSistemas"); - linhas = ""; - for (l = 0; l < i3GEOF.identifica.sistemasAdicionais.length; l++) { - ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); - if (ltema.length > 1) { - linhas += - "" - + ltema[0] - + ""; - } - - } - if (divins) { - if (i3GEO.parametros.editor.toLowerCase() == "sim") { - temp = - "

Editar a lista de sistemas adicionais

"; - } else { - temp = ""; - } - divins.innerHTML = temp + "" + linhas + "
"; - } - } - } - } - // divins.innerHTML = ""; - }, - /* - * Function: buscaDadosTema - * - * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa - * - * Veja: - * - * - */ - buscaDadosTema : function(tema, x, y, idjanela) { - var res, opcao, resolucao, janelas, n, i, id; - if (tema != "" && i3GEO.temaAtivo === "") { - i3GEO.temaAtivo = tema; - } - if (idjanela) { - janelas = [ - idjanela - ]; - } else { - janelas = i3GEOF.identifica.janelas; - } - // guarda o valor de x y nas variaveis de uso global da ferramenta - if (x && x != "") { - i3GEOF.identifica.x = x; - i3GEOF.identifica.y = y; - } - n = janelas.length; - if (n == 0 || (idjanela && !$i(idjanela + "i3GEOidentificaoguia1"))) { - if (x && x != "") { - i3GEOF.identifica.criaJanelaFlutuante(x, y); - } else { - i3GEOF.identifica.criaJanelaFlutuante(); - } - return; - } - try { - if (tema === "ligados") { - opcao = "ligados"; - tema = ""; - } else { - opcao = "tema"; - } - for (i = 0; i < n; i++) { - id = janelas[i]; - if (i3GEOF.identifica.propJanelas[id].atualiza == undefined || i3GEOF.identifica.propJanelas[id].atualiza === true) { - if (x && x != "") { - i3GEOF.identifica.propJanelas[id].x = x; - i3GEOF.identifica.propJanelas[id].y = y; - } - if (tema != "" && idjanela) { - i3GEOF.identifica.propJanelas[id].temaAtivo = tema; - } - if ($i(id + "i3GEOidentificaoguia1")) { - $i(id + "i3GEOidentificaoguia1").innerHTML = - ""; - res = $i(id + "i3GEOidentificaresolucao"); - if (res) { - resolucao = res.value; - } else { - resolucao = 5; - } - i3GEOF.identifica.buscaDadosTemaJanela(id, resolucao, opcao); - } - } - } - } catch (e) { - if (!x) { - i3GEOF.identifica.criaJanelaFlutuante(); - } else { - i3GEOF.identifica.criaJanelaFlutuante(x, y); - } - } - }, - buscaDadosTemaJanela : function(idjanela, resolucao, opcao) { - i3GEOF.identifica.mostraImagemPonto(idjanela); - var temp = function(retorno) { - // i3GEOF.identifica.dadosIdentifica = retorno.data; - if (retorno !== undefined) { - i3GEOF.identifica.mostraDadosTema(retorno.data, idjanela); - } else { - i3GEOF.identifica.mostraDadosTema(undefined, idjanela); - } - }; - // importante: os temas editaveis nao utilizam alias em seus nomes - // se o usuario estiver logado - i3GEO.php.identifica3( - temp, - i3GEOF.identifica.propJanelas[idjanela].x, - i3GEOF.identifica.propJanelas[idjanela].y, - resolucao, - opcao, - i3GEO.configura.locaplic, - i3GEO.configura.sid, - i3GEOF.identifica.propJanelas[idjanela].temaAtivo, - i3GEO.parametros.mapexten, - "nao"); - }, - /* - * Function: mostraDadosSistema - * - * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa - * - * Parametros: - * - * exec {String} - url que será aberta - * - * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso - * contrário, em uma nova página do navegador - */ - mostraDadosSistema : function(exec, target, idjanela) { - i3GEOF.identifica.mostraImagemPonto(idjanela); - exec += "&x=" + i3GEOF.identifica.propJanelas[idjanela].x + "&y=" + i3GEOF.identifica.propJanelas[idjanela].y; - if (target === "target") { - window.open(exec); - } else { - i3GEOF.identifica.abrejanelaIframe("500", "500", exec); - } - var i = $i("i3GEOmarcaIdentifica"); - if (i) { - i.style.display = "block"; - } - }, - /* - * Function abrejanelaIframe - * - * Abre uma janela flutuante contendo um iframe - * - * Parametros: - * - * w {string} - largura - * - * h {string} - altura - * - * s {string} - src do iframe - */ - abrejanelaIframe : function(w, h, s) { - var janelaeditor = - i3GEO.janela.cria(w, h, s, parseInt(Math.random() * 100, 10), 10, "", "janela" + i3GEO.util.randomRGB(), false); - var temp = function() { - i3GEOF.identifica.sistemasAdicionais = []; - i3GEOF.identifica.atualizaSistemas(); - }; - YAHOO.util.Event.addListener(janelaeditor[0].close, "click", temp, janelaeditor[0].panel, { - id : janelaeditor[0].id - }, true); - }, - /** - * Aplica um estilo a um elemento de todas as janelas - */ - aplicaEstilo : function(posFixo, estilo, valor) { - var n = i3GEOF.identifica.janelas, i = 0, temp; - for (i = 0; i < n; i++) { - temp = $i(i3GEOF.identifica.janelas[i]); - if (temp) { - temp = $i(i3GEOF.identifica.janelas[i] + posFixo); - if (temp) { - temp.style[estilo] = valor; - } - } - } - }, - /* - * Function: mostraDadosTema - * - * Mostra os dados obtidos de um ou mais temas. - * - * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para - * apresentação na tela. - * - * Parametros: - * - * retorno {JSON} - objeto JSON com os dados - */ - mostraDadosTema : function(retorno, idjanela) { - var alvo, filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = - 0, numResultados = 0, tip, link, textovalor; - - if ($i(idjanela + "i3GEOFidentificaNocorrencias")) { - atualN = $i(idjanela + "i3GEOFidentificaNocorrencias").value; - } - i3GEOF.identifica.aplicaEstilo("_corpo", "scrollTop", 0); - if (retorno == undefined || retorno == "") { - $i(idjanela + "i3GEOidentificaoguia1").innerHTML = $trad('msgNadaEncontrado', i3GEOF.identifica.dicionario); - return; - } - i = $i("i3GEOmarcaIdentifica"); - if (i) { - i.style.display = "block"; - } - if (retorno !== undefined) { - $i(idjanela + "i3GEOidentificaoguia1").innerHTML = ""; - ntemas = retorno.length; - for (i = 0; i < ntemas; i++) { - resultados = retorno[i].resultado; - // nome do tema e icone de remover filtro - res += - "
" + retorno[i].nome - + "" - + ""; - // icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso - if (retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != "") { - res += - ""; - - } - res += "
"; - // encontrou algo - if (resultados[0] !== " ") { - nres = resultados.length; - numResultados = nres; - cor = "RGB(250,250,250)"; - if (atualN != "todas") { - nres = atualN * 1; - inicio = atualN * 1 - 1; - } - for (j = inicio; j < nres; j++) { - nitens = resultados[j].length; - // pega o valor do item que e o id unico no sistema - // METAESTAT - idreg = ""; - for (k = 0; k < nitens; k++) { - if (resultados[j][k].item === retorno[i].colunaidunico) { - idreg = resultados[j][k].valor; - } - } - // opcao para apagar e mover o registro - if (idreg != "" && retorno[i].editavel == "todos") { - res += - "" - + $trad('apagaRegistro', i3GEOF.identifica.dicionario) - + "" - + " " - + $trad('move', i3GEOF.identifica.dicionario) - + "
"; - } - for (k = 0; k < nitens; k++) { - tip = "  "; - textovalor = resultados[j][k].valor; - // insere o input para edicao - // se for uma regiao cadastrada, todos os campos - // sao editaveis - if (idreg != "" && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { - if (retorno[i].tiposalva == "regiao") { - retorno[i].id_medida_variavel = 0; - } - idsalva = - "idsalva" + retorno[i].tema - + "_" - + idreg - + "_" - + resultados[j][k].item - + "_" - + retorno[i].tiposalva; - paramsalva = - "\"" + retorno[i].tema - + "\"," - + idreg - + ",\"" - + resultados[j][k].item - + "\",\"" - + retorno[i].tiposalva - + "\""; - textovalor = - "
" - + "" - + ""; - } - if (resultados[j][k].tip && resultados[j][k].tip.toLowerCase() == "sim") { - tip = - ""; - } else { - tip = - ""; - } - filtro = - "onclick=\"i3GEO.util.animaClique(this);i3GEOF.identifica.filtrar('" + retorno[i].tema - + "','" - + resultados[j][k].item - + "','" - + resultados[j][k].valor - + "','" - + idjanela - + "')\""; - filtro = - ""; - // verifica se o texto possui tags de abertura e - // fechamento html - try { - if (textovalor && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { - filtro = ""; - } - // o mesmo problema pode ocorrer em raster, - // que possuem o nome da classe como valor - if (resultados[j][k].alias.search(">") >= 0 || resultados[j][k].alias.search("<") >= 0) { - filtro = ""; - } - } catch (e) { - } - - if (resultados[j][k].link === "") { - res += - "
" - + tip - + filtro - + resultados[j][k].alias - + ": " - + textovalor - + "
"; - } else { - try { - link = eval(resultados[j][k].link); - } catch (e) { - link = resultados[j][k].link; - } - if(resultados[j][k].idIframe){ - alvo = resultados[j][k].idIframe; - } - else{ - alvo = "_blank"; - } - res += - "
" - + tip - + resultados[j][k].alias - + ": " - + textovalor - + "
"; - } - if (resultados[j][k].img !== "") { - res += - "
" - + resultados[j][k].img - + "
"; - } - if (cor === "RGB(250,250,250)") { - cor = "beige"; - } else { - cor = "RGB(250,250,250)"; - } - } - res += "

"; - } - } else { - // verifica o tipo de tema - camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo, "", "name"); - if (retorno[i].tiposalva == "regiao" && parseInt(camada.type, 10) == 0) { - // opcao para adicionar um ponto - res += - $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario) + "
" - + $trad('adicionaPonto', i3GEOF.identifica.dicionario) - + ""; - } else { - res += $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario); - } - } - } - if (ntemas == 1) { - res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia(atualN, numResultados) + res; - } - $i(idjanela + "i3GEOidentificaoguia1").innerHTML = res; - } - }, - filtrar : function(tema, item, valor, idjanela) { - if (i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility === "visible") { - return; - } - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; - var filtro = "(|[" + item + "]| = |" + valor + "|)", temp = function(retorno) { - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; - i3GEO.Interface.atualizaTema(retorno, tema); - }, p = - i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = - new cpaint(); - cp.set_response_type("JSON"); - cp.set_transfer_mode('POST'); - cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro=" + filtro); - }, - removeFiltro : function(tema, idjanela) { - if (i3GEOF.identifica.propJanelas[idjanela].visibility === "visible") { - return; - } - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; - var temp = function(retorno) { - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; - i3GEO.Interface.atualizaTema(retorno, tema); - }, p = - i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = - new cpaint(); - cp.set_response_type("JSON"); - cp.set_transfer_mode('POST'); - cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro="); - }, - adicionaPontoRegiao : function(idjanela) { - var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" + i3GEO.configura.sid, tema = - i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { - i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); - i3GEO.Interface.atualizaTema("", tema); - i3GEOF.identifica.buscaDadosTema(tema); - }; - i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); - i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call(p, "foo", temp, "&tema=" + tema - + "&wkt=POINT(" - + i3GEOF.identifica.propJanelas[idjanela].x - + " " - + i3GEOF.identifica.propJanelas[idjanela].y - + ")"); - }, - apagaRegiao : function(tema, idreg) { - var excluir = - function() { - var p = - i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" + i3GEO.configura.sid, temp = - function() { - i3GEO.janela.fechaAguarde("aguardeRemovendo"); - i3GEO.Interface.atualizaTema("", tema); - i3GEOF.identifica.buscaDadosTema(tema); - }; - i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde("aguardeRemovendo", "Excluindo..."); - i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call(p, "foo", temp, "&tema=" + tema + "&identificador=" + idreg); - }; - i3GEO.janela.confirma( - $trad('removeRegistroBD', i3GEOF.identifica.dicionario), - "", - $trad('sim', i3GEOF.identifica.dicionario), - $trad('cancela', i3GEOF.identifica.dicionario), - excluir); - }, - salvaDados : function(tema, idreg, coluna, tiposalva) { - var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" + i3GEO.configura.sid, idvalor = - $i("idsalva" + tema + "_" + idreg + "_" + coluna + "_" + tiposalva), temp = function(retorno) { - i3GEO.janela.fechaAguarde("aguardeSalvaAtributos"); - i3GEO.Interface.atualizaTema("", i3GEOF.identifica.tema); - }; - - if (idvalor) { - i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde("aguardeSalvaAtributos", "Salvando..."); - i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call(p, "foo", temp, "&tema=" + tema + "&coluna=" + coluna + "&valor=" + idvalor.value + "&identificador=" + idreg); - } else { - alert("ocorreu um erro"); - } - }, - montaOpcoesIdentificaOcorrencia : function(atual, nres) { - var ins, select, i, nocor; - if (!atual) { - atual = "todas"; - } - sel = ""; - select = - ""; - ins = ""; - ins += ""; - ins += ""; - ins += "
" + $trad('mostraOcorrencia', i3GEOF.identifica.dicionario) + ": " + select + "
"; - if (nres == 1) { - ins = ""; - } - return ins; - }, - listaVariaveis : function(codigo_tipo_regiao, idjanela) { - var p, temp; - temp = function(retorno) { - var ins = "", n, i, m, j, d, dd, nc, ic, ndd, idd; - n = retorno.length; - - if (n > 0) { - // cada variavel - for (i = 0; i < n; i++) { - d = retorno[i]; - ins += "" + d.variavel + ""; - m = d.dados.length; - // cada medida - for (j = 0; j < m; j++) { - dd = d.dados[j]; - // ins += " -> " + dd.medida; - nc = dd.dados.colunas.length; - ins += ""; - // cabecalho - for (ic = 0; ic < nc; ic++) { - ins += ""; - } - ins += ""; - ndd = dd.dados.dados.length; - // cada valor - for (idd = 0; idd < ndd; idd++) { - ins += ""; - for (ic = 0; ic < nc; ic++) { - ins += ""; - } - ins += ""; - } - ins += "
" + dd.dados.aliascolunas[ic] + "
" + dd.dados.dados[idd][dd.dados.colunas[ic]] + "
"; - } - } - } - i3GEO.janela.mensagemSimples("
" + ins + "
", ""); - }; - p = i3GEO.configura.locaplic + "/admin/php/metaestat.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", cpJSON.call( - p, - "foo", - temp, - "&codigo_tipo_regiao=" + codigo_tipo_regiao - + "&x=" - + i3GEOF.identifica.propJanelas[idjanela].x - + "&y=" - + i3GEOF.identifica.propJanelas[idjanela].y); - } - }; diff --git a/ferramentas/identificax/template_mst.html b/ferramentas/identificax/template_mst.html deleted file mode 100755 index feddc47..0000000 --- a/ferramentas/identificax/template_mst.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -
- - - - \ No newline at end of file diff --git a/ferramentas/legenda/dicionario.js b/ferramentas/legenda/dicionario.js index 023224c..d061418 100755 --- a/ferramentas/legenda/dicionario.js +++ b/ferramentas/legenda/dicionario.js @@ -164,21 +164,28 @@ i3GEOF.legenda.dicionario = ], 'consideraElementosVisisveis' : [ { - pt : "marque para considerar apenas os elementos visíveis na extensão geográfica atual, caso contrário, será considerada a extensão geográfica inicial do mapa", + pt : "marque para considerar nos cálculos apenas os elementos visíveis na extensão geográfica atual, caso contrário, será considerada a extensão geográfica inicial do mapa", en : "", es : "" } ], 'ignoraValores' : [ { - pt : "Ao gerar as classes, ignorar os valores (separe com vírgula)", + pt : "Ao obter os dados para gerar as classes, ignorar os valores listados abaixo (separe com vírgula)", en : "", es : "" } ], 'transformaGeom' : [ { - pt : "Transforma a representação geométrica dos elementos do tema. Após alterar esse parâmetro, pode ser necessário modificar as características do símbolo.", + pt : "Tipo de transformação", + en : "", + es : "" + } + ], + 'alteraGeom' : [ + { + pt : "Altera a geometria. Transforma a representação geométrica dos elementos do tema. Após alterar esse parâmetro, pode ser necessário modificar as características do símbolo.", en : "", es : "" } @@ -218,13 +225,6 @@ i3GEOF.legenda.dicionario = es : "" } ], - 'alteraGeom' : [ - { - pt : "Altera geometria", - en : "", - es : "" - } - ], 'alteraTipoGeom' : [ { pt : "Altera o tipo de representação do tema. Se for poligonal, passa para linear e vice-versa.", @@ -255,21 +255,28 @@ i3GEOF.legenda.dicionario = ], 'cadaOcorrenciaUnicoSimbolo' : [ { - pt : "Cada ocorrência de um valor para o item selecionado, será desenhado com o mesmo símbolo", + pt : "Item utilizado para obter as ocorrências únicas", en : "", es : "" } ], 'valorUnico' : [ { - pt : "Calcular valor único", + pt : "Calcular valor único. Cada ocorrência de um valor para o item selecionado, será desenhado com o mesmo símbolo.", en : "", es : "" } ], + 'classesFixas' : [ + { + pt : "Cria classes para um item numérico utilizando um número fixo de classes", + en : "", + es : "" + } + ], 'criaClassesItemNumerico' : [ { - pt : "Cria classes para um item numérico utilizando um número fixo de classes", + pt : "Item que será utilizado para obter os valores", en : "", es : "" } @@ -281,16 +288,30 @@ i3GEOF.legenda.dicionario = es : "" } ], + 'tipoCalculo' : [ + { + pt : "Tipo de cálculo", + en : "", + es : "" + } + ], 'intervalosIguais' : [ { - pt : "Calcular intervalos iguais", + pt : "Intervalos iguais", en : "", es : "" } ], + 'calcularQuartil' : [ + { + pt : "Quartis. Cria classes para um item numérico utilizando quartis", + en : "", + es : "" + } + ], 'criaQuartis' : [ { - pt : "Cria classes para um item numérico utilizando os quartis", + pt : "Item que será utilizado para obter os valores", en : "", es : "" } @@ -325,14 +346,21 @@ i3GEOF.legenda.dicionario = ], "etiquetasClasse" : [ { - pt : "Textos da classe (labels)", + pt : "Definição do texto que será mostrado em cada elemento do mapa pertencente à classe escolhida", + en : "", + es : "" + } + ], + 'removeLabels' : [ + { + pt : "Remove os textos", en : "", es : "" } ], 'itemComTexto' : [ { - pt : "Item com o texto", + pt : "Item que será utilizado como fonte para obtenção dos textos", en : "", es : "" } @@ -360,14 +388,14 @@ i3GEOF.legenda.dicionario = ], 'estilos' : [ { - pt : "Estilos", + pt : "Estilos. Cada símbolo pode ser formado por um ou mais estilos. Utilize as opções abaixo para criar ou remover os estilos do símbolo utilizado na classe atual.", en : "", es : "" } ], 'ajudaEstilo' : [ { - pt : "Cada símbolo pode ser formado por um ou mais estilos. Utilize -1,-1,-1 para anular uma cor. A cor deve ser definida no formato vermelho,verde,azul. Para criar linhas tracejadas utilize o símbolo 0 ou vazio e digite um padrão de repetição como por exemplo 2 10 2 10 ", + pt : "Utilize -1,-1,-1 para anular uma cor. A cor deve ser definida no formato vermelho,verde,azul. Para criar linhas tracejadas utilize o símbolo 0 ou vazio e digite um padrão de repetição como por exemplo 2 10 2 10 ", en : "", es : "" } @@ -507,7 +535,7 @@ i3GEOF.legenda.dicionario = ], 'selecionaProcesso' : [ { - pt : "selecione o processo", + pt : "Selecione um processo para adicionar", en : "", es : "" } @@ -570,7 +598,7 @@ i3GEOF.legenda.dicionario = ], 'estiloEdicao' : [ { - pt : "Estilo em edição", + pt : "Estilo em edição (após adicionar ou excluir um estilo, acione o botão de aplicar alterações)", en : "", es : "" } @@ -591,7 +619,7 @@ i3GEOF.legenda.dicionario = ], 'tamanhoEspacamento' : [ { - pt : "Tamanho / espaçamento", + pt : "Tamanho / espaçamento. Defina um valor para a cor ou um item da tabela de atributos que contm os valores para cada elemento.", en : "", es : "" } @@ -626,9 +654,7 @@ i3GEOF.legenda.dicionario = ], 'simbolo' : [ { - pt : "Nome do símbolo
Você pode também usar o caminho absoluto de uma imagem PNG existente no servidor ou clicar em " + "um dos símbolos mostrados abaixo. Clique aqui para upload dessa imagem", + pt : "Nome do símbolo. Você pode também usar o caminho absoluto de uma imagem PNG existente no servidor ou clicar em um dos símbolos mostrados abaixo.", en : "", es : "" } @@ -663,21 +689,14 @@ i3GEOF.legenda.dicionario = ], 'quebrasNaturais' : [ { - pt : "Calcular quebras naturais", - en : "", - es : "" - } - ], - 'calcularQuartil' : [ - { - pt : "Calcular quartis", + pt : "Quebras naturais", en : "", es : "" } ], 'calcularQuantil' : [ { - pt : "Calcular quantis", + pt : "Quantis", en : "", es : "" } @@ -761,14 +780,14 @@ i3GEOF.legenda.dicionario = ], "metade" : [ { - pt : "Metade", + pt : "Metade. Classifica os dados em duas classes, a primeira concentra os registros que somados correspondem à primeira metade do total e a segunda classe corresponde à segunda metade", en : "", es : "" } ], "duasmetades" : [ { - pt : "Classifica os dados em duas classes, a primeira concentra os registros que somados correspondem à primeira metade do total e a segunda classe corresponde à segunda metade", + pt : "Coluna utilizada para obter os valores", en : "", es : "" } @@ -801,6 +820,13 @@ i3GEOF.legenda.dicionario = es : "" } ], + "clusterAjuda" : [ + { + pt : "Faz a representação dos dados na forma de clusters. Cada cluster agrupa elementos próximos e mostra as quantidades existentes. A proximidade depende da escala do mapa.", + en : "", + es : "" + } + ], "ClusterMaxdistance" : [ { pt : "Distância (pixels) máxima entre os pontos que será considerada para permitir o agrupamento", @@ -852,13 +878,13 @@ i3GEOF.legenda.dicionario = ], "offsite" : [ { - pt : "Cor, em imagens, que será considerada como NODATA e renderizada como transparente (RGB separado por vírgulas)", + pt : "Cor que será considerada como NODATA e renderizada como transparente no caso de camadas do tipo imagem (RGB separado por vírgulas)", en : "", es : "" } ], 'autoClasses' : [ { - pt : "É possível a geração de classes automaticamente por meio da definição de colunas na tabela de atributos do tema que armazenam as informações sobre cor, tamanho, etc.", + pt : "A geração de classes pode ser feita automaticamente por meio da definição de colunas, existentes na tabela de atributos do tema, e que armazenem as informações sobre cor, tamanho, etc.", en : "", es : "" } ], @@ -898,7 +924,32 @@ i3GEOF.legenda.dicionario = es : "" } ], "colunasTxt" : [ { - pt : "Itens disponíveis", + pt : "Colunas disponíveis", + en : "", + es : "" + } ], + "inverte" : [ { + pt : "Inverte as cores", + en : "", + es : "" + } ], + "calculaTamanho" : [ { + pt : "Varia a textura ou tamanho", + en : "", + es : "" + } ], + "existentes" : [ { + pt : "Processos existentes", + en : "", + es : "" + } ], + "edicaoEstilo" : [ { + pt : "Edição do estilo escolhido", + en : "", + es : "" + } ], + "corContorno" : [ { + pt : "Cor do contorno", en : "", es : "" } ] diff --git a/ferramentas/legenda/index.js b/ferramentas/legenda/index.js index 0d8b2ec..cc432f3 100755 --- a/ferramentas/legenda/index.js +++ b/ferramentas/legenda/index.js @@ -40,9 +40,9 @@ if (typeof (i3GEOF) === 'undefined') { /* * Classe: i3GEOF.legenda */ -// incuir opcao para inserir o nome de uma imagem da legenda +//incuir opcao para inserir o nome de uma imagem da legenda i3GEOF.legenda = - { +{ /* * Variavel: parDefault * @@ -95,10 +95,14 @@ i3GEOF.legenda = * Ultima classe selecionado */ classe : "", + /** * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php */ MUSTACHE : "", + MUSTACHELISTA : "", + MUSTACHEESTILO : "", + DICIONARIO: "", /** * Funcao do usuario que e executada apos iniciar a ferramenta */ @@ -113,6 +117,8 @@ i3GEOF.legenda = dicionario["locaplic"] = i3GEO.configura.locaplic; dicionario["asp"] = '"'; dicionario["aplicar"] = $trad("p14"); + //para reaproveitamento + i3GEOF.legenda.DICIONARIO = dicionario; return dicionario; }, /* @@ -126,9 +132,18 @@ i3GEOF.legenda = */ inicia : function(iddiv) { if(i3GEOF.legenda.MUSTACHE == ""){ - $.get(i3GEO.configura.locaplic + "/ferramentas/legenda/template_mst.html", function(template) { - i3GEOF.legenda.MUSTACHE = template; + var t1 = i3GEO.configura.locaplic + "/ferramentas/legenda/template_mst.html", + t2 = i3GEO.configura.locaplic + "/ferramentas/legenda/templateLista_mst.html", + t3 = i3GEO.configura.locaplic + "/ferramentas/legenda/templateFormEstilo_mst.html"; + + $.when( $.get(t1),$.get(t2),$.get(t3) ).done(function(r1,r2,r3) { + i3GEOF.legenda.MUSTACHE = r1[0]; + i3GEOF.legenda.MUSTACHELISTA = r2[0]; + i3GEOF.legenda.MUSTACHEESTILO = r3[0]; i3GEOF.legenda.inicia(iddiv); + }).fail(function() { + i3GEO.janela.closeMsg($trad("erroTpl")); + return; }); return; } @@ -156,270 +171,33 @@ i3GEOF.legenda = i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); // eventos das guias $i("i3GEOlegendaguia8").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia8", "i3GEOlegendaguia"); i3GEOF.legenda.parametrosAuto(); }; $i("i3GEOlegendaguia7").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia7", "i3GEOlegendaguia"); }; $i("i3GEOlegendaguia6").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); }; $i("i3GEOlegendaguia1").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEOF.legenda.mostralegenda(); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); }; $i("i3GEOlegendaguia2").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2", "i3GEOlegendaguia"); }; $i("i3GEOlegendaguia3").onclick = function() { i3GEO.janela.tempoMsg($trad('ajuda', i3GEOF.legenda.dicionario)); }; $i("i3GEOlegendaguia4").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEOF.legenda.mostraGrafico(); }; $i("i3GEOlegendaguia5").onclick = function() { - i3GEOF.legenda.ativaAplicar("none"); i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); }; - var b = new YAHOO.widget.Button("i3GEOlegendabotaoImagemLegenda", { - onclick : { - fn : i3GEOF.legenda.aplicarLegendaImg - } - }); - b.addClass("rodar100"); - - var b = new YAHOO.widget.Button("i3GEOlegendabotaoOffsite", { - onclick : { - fn : i3GEOF.legenda.aplicarOffsite - } - }); - b.addClass("rodar100"); - - var b = new YAHOO.widget.Button("i3GEOlegendabotaoAplicarCluster", { - onclick : { - fn : i3GEOF.legenda.aplicarCluster - } - }); - b.addClass("rodar"); - - var b = new YAHOO.widget.Button("i3GEOlegendabotaoRemoverCluster", { - onclick : { - fn : i3GEOF.legenda.removerCluster - } - }); - b.addClass("rodar"); - - var b = new YAHOO.widget.Button("i3GEOlegendabotaoAplicarAuto", { - onclick : { - fn : i3GEOF.legenda.salvaParametrosAuto - } - }); - b.addClass("rodar"); - - var b = new YAHOO.widget.Button("i3GEOlegendabotao1", { - onclick : { - fn : i3GEOF.legenda.mudaLegenda - } - }); - b.addClass("rodar150"); - b = new YAHOO.widget.Button("i3GEOlegendabotao2", { - onclick : { - fn : i3GEOF.legenda.adicionaClasse - } - }); - b.addClass("rodar150"); - b = new YAHOO.widget.Button("i3GEOlegendabotao3", { - onclick : { - fn : i3GEOF.legenda.adicionaConta - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotao15", { - onclick : { - fn : i3GEOF.legenda.adicionaOpacidade - } - }); - b.addClass("rodar"); - - b = new YAHOO.widget.Button("i3GEOlegendabotaoRamp", { - onclick : { - fn : function() { - var tabela = $i("i3GEOlegendalegenda"); - var trs = tabela.getElementsByTagName("tr"); - var ncores = trs.length - 1; - // $i("i3geo_janelaCorRampComboCabecaSel").value = i3GEOF.legenda.tema; - i3GEO.util.abreColourRamp("", "listaColourRamp", ncores, i3GEOF.legenda.tema); - } - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotao4", { - onclick : { - fn : i3GEOF.legenda.paleta - } - }); - b.addClass("rodar100"); - b = new YAHOO.widget.Button("i3GEOlegendabotao5", { - onclick : { - fn : i3GEOF.legenda.simbU - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotao6", { - onclick : { - fn : i3GEOF.legenda.valorU - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotaoMetade", { - onclick : { - fn : i3GEOF.legenda.metade - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotaoMedia", { - onclick : { - fn : i3GEOF.legenda.media - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotao7", { - onclick : { - fn : i3GEOF.legenda.representacao - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotao8", { - onclick : { - fn : i3GEOF.legenda.valorC - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotao9", { - onclick : { - fn : i3GEOF.legenda.valorQ - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotaoQuantil", { - onclick : { - fn : i3GEOF.legenda.valorQu - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotaoQN", { - onclick : { - fn : i3GEOF.legenda.valorQN - } - }); - b.addClass("rodar"); - - b = new YAHOO.widget.Button("i3GEOlegendabotao17", { - onclick : { - fn : i3GEOF.legenda.alteraGeometriaTema - } - }); - b.addClass("rodar"); - b = - 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); - } - } - }); - b.addClass("rodar"); - b = new YAHOO.widget.Button("i3GEOlegendabotaoSLDi", { - onclick : { - fn : function() { - i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema); - } - } - }); - b.addClass("rodar"); - b = - new YAHOO.widget.Button("i3GEOlegendabotaoIncluirLabel", { - onclick : { - fn : function() { - var par, p, temp, cp; - try { - par = i3GEOF.proplabel.pegaPar(); - i3GEOF.legenda.parDefault = par; - } catch (e) { - par = i3GEOF.legenda.parDefault; - } - 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); - } - } - }); - b.addClass("rodar100"); - b = - 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); - } - } - }); - b.addClass("rodar100"); - b = - 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); - } - } - }); - b.addClass("abrir100"); i3GEOF.legenda.ativaFoco(); i3GEOF.legenda.mostralegenda(); i3GEOF.legenda.montaCombosItens(); @@ -433,9 +211,7 @@ i3GEOF.legenda = if(objTema.offsite){ $i("i3GEOoffsite").value = objTema.offsite; } - $i("i3GEOFlegendamostra").onclick = function() { - i3GEO.tema.invertestatuslegenda(i3GEOF.legenda.tema); - }; + i3GEO.util.aplicaAquarela("i3GEOF.legenda_corpo"); i3GEOF.legenda.aposIniciar.call(); } catch (erro) { @@ -444,6 +220,74 @@ i3GEOF.legenda = } i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda"); }, + sldi: function() { + i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema); + }, + slde: function() { + window.open(i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?funcao=tema2sld&tema=" + + i3GEOF.legenda.tema + + "&g_sid=" + + i3GEO.configura.sid); + }, + propriedadesLabels: function() { + i3GEO.util.scriptTag( + i3GEO.configura.locaplic + "/ferramentas/opcoes_label/index.js", + "i3GEOF.proplabel.criaJanelaFlutuante(false)", + "i3GEOFproplabel", + false); + }, + incluirLabels: function() { + var par, p, temp, cp; + try { + par = i3GEOF.proplabel.pegaPar(); + i3GEOF.legenda.parDefault = par; + } catch (e) { + par = i3GEOF.legenda.parDefault; + } + 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); + }, + excluiLabels: 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); + }, + janelaCorRamp: function(){ + var tabela = $i("i3GEOlegendalegenda"); + var trs = tabela.getElementsByTagName("tr"); + var ncores = trs.length - 1; + i3GEO.util.abreColourRamp("", "listaColourRamp", ncores, i3GEOF.legenda.tema); + }, /* * Function: html * @@ -474,31 +318,34 @@ i3GEOF.legenda = }; minimiza = function() { i3GEO.janela.minimiza("i3GEOF.legenda"); - i3GEOF.legenda.ativaAplicar("none"); }; // cria a janela flutuante titulo = "
" - + "
------
" - + " " - + $trad("t33") - +""; + + "
------
" + + " " + + $trad("t33") + +""; janela = i3GEO.janela.cria( - "590px", - "350px", - "", - "", - "", - titulo, - "i3GEOF.legenda", - false, - "hd", - cabecalho, - minimiza, - function() {i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");}, - true + "590px", + "350px", + "", + "", + "", + titulo, + "i3GEOF.legenda", + false, + "hd", + cabecalho, + minimiza, + function() {i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");}, + true, + "", + "", + "", + "" ); divid = janela[2].id; @@ -514,25 +361,6 @@ i3GEOF.legenda = ativaFoco : function() { }, - ativaAplicar : function(tipo) { - var b = $i("i3GEOlegendabotao10"); - if (b) { - b.style.display = tipo; - } else { - YAHOO.i3GEO.janela.manager.find("i3GEOF.legenda").setFooter( - ''); - b = new YAHOO.widget.Button("i3GEOlegendabotao10", { - onclick : { - fn : i3GEOF.legenda.aplicaEstilo - } - }); - b.addClass("rodar"); - $i("i3GEOlegendabotao10-button").style.width = "100%"; - $i("i3GEOlegendabotao10").style.width = "100%"; - $i("i3GEOlegendabotao10").style.display = tipo; - } - }, /* * Function: aposAlterarLegenda * @@ -542,8 +370,6 @@ i3GEOF.legenda = i3GEO.arvoreDeCamadas.CAMADAS = []; i3GEO.atualiza(); i3GEO.Interface.atualizaTema("", i3GEOF.legenda.tema); - i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEOF.legenda.tema); - i3GEO.mapa.legendaHTML.atualiza(); }, /* * Function: mostralegenda @@ -562,9 +388,9 @@ i3GEOF.legenda = var p, cp; p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=editalegenda&opcao=edita&tema=" - + i3GEOF.legenda.tema; + + 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); @@ -582,173 +408,78 @@ i3GEOF.legenda = i3GEOF.legenda.aviso = false; try { if (retorno.data != undefined) { - var b, ins, i, ajuda, id, re, exp, n, filtro; + //hidden e utilizado para esconder ou mostrar determinados trechos do template + var mustache = [], b, ins, i, ajuda, id, re, exp, n, filtro,temp = {}; // 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 + temp = {}; + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; re = new RegExp("'", "g"); exp = (retorno.data[i].expressao).replace(re, '"'); - - ins.push(""); - ins.push(""); - - ins.push(""); - - ins.push(""); - - ins.push(""); - - filtro = - ""; - - ins.push(""); - - ins.push(""); - - ins.push(""); - - ins.push(""); - - if (n > 1) { - ins.push(""); - - ins.push(""); - } - ins.push(""); + temp.cliqueExclui = $trad('cliqueExclui', i3GEOF.legenda.dicionario); + temp.cliqueAltera = $trad('cliqueAltera', i3GEOF.legenda.dicionario); + temp.imagem = retorno.data[i].imagem; + temp.id = id; + temp.idclasse = retorno.data[i].idclasse; + temp.novoNome = $trad('digitaNovoNome', i3GEOF.legenda.dicionario); + temp.nome = retorno.data[i].nomeclasse; + temp.editorExp = $trad("editorExp", i3GEOF.legenda.dicionario); + temp.exp = exp; + temp.txtMinscale = $trad('minScale', i3GEOF.legenda.dicionario); + temp.minScale = retorno.data[i].minScale; + temp.txtMaxScale = $trad('maxScale', i3GEOF.legenda.dicionario); + temp.maxScale = retorno.data[i].maxScale; + temp.sobe = $trad('sobe', i3GEOF.legenda.dicionario); + temp.desce = $trad('desce', i3GEOF.legenda.dicionario); + mustache.push(temp); } - ins.push("
" - + "" - + "nomeexpressãominScalemaxScale
 
" + $inputText( - "", - "", - "i3GEOlegendaid_" + id, - $trad('digitaNovoNome', i3GEOF.legenda.dicionario), - 20, - retorno.data[i].nomeclasse, - "nome", - "javascript:i3GEOF.legenda.aviso()") - + "" + $inputText("", "", "i3GEOlegendaid_exp" + id, $trad( - 'digitaNovaExpressao', - i3GEOF.legenda.dicionario), 25, exp, "expressao", "javascript:i3GEOF.legenda.aviso()") - + "" + filtro + "" + $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(""); + ins = Mustache.render( + i3GEOF.legenda.MUSTACHELISTA, + $.extend( + {}, + { + "linhas" : mustache, + "hidden2":"", + "hidden1": "hidden" + }, + i3GEOF.legenda.DICIONARIO + ) + ); + $i("i3GEOlegendaguia1obj").innerHTML = ins; } 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 += "
"; + ajuda = i3GEOF.legenda.DICIONARIO['ajudaEscalaCores'] + + "

" + + i3GEOF.legenda.DICIONARIO['msgEscalaCoresAuto'] + + "

" + + i3GEOF.legenda.DICIONARIO['msgEscalaCoresIndividual'] + + "

" + + i3GEOF.legenda.DICIONARIO['msgBandas'] + + "

" + + i3GEOF.legenda.DICIONARIO['msgReamostragem']; + + mustache = []; + for (i = 0; i < retorno.data[0].proc.length; i++) { + mustache.push({ + "value": retorno.data[0].proc[i] + }); } - $i("i3GEOlegendaresultado").innerHTML = ins + ajuda; - b = new YAHOO.widget.Button("i3GEOlegendabotao16", { - onclick : { - fn : i3GEOF.legenda.aplicaProcessos - } - }); - b.addClass("rodar"); + + ins = Mustache.render( + i3GEOF.legenda.MUSTACHELISTA, + $.extend( + {}, + { + "hidden2":"hidden", + "hidden1": "", + "ajuda1": ajuda, + "processos": mustache + }, + i3GEOF.legenda.DICIONARIO + ) + ); + $i("i3GEOlegendaguia1obj").innerHTML = ins; } } else { $i("i3GEOlegendaresultado").innerHTML = "

Erro
"; @@ -793,11 +524,11 @@ i3GEOF.legenda = 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(); + + 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); @@ -860,12 +591,12 @@ i3GEOF.legenda = }; var p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=aplicaLegendaImg" - + "&tema=" - + i3GEOF.legenda.tema - + "&imagem=" - + objTema.legendaimg, + + i3GEO.configura.sid + + "&funcao=aplicaLegendaImg" + + "&tema=" + + i3GEOF.legenda.tema + + "&imagem=" + + objTema.legendaimg, cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p, "foo", retorna); @@ -886,12 +617,12 @@ i3GEOF.legenda = }; var p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=aplicaOffsite" - + "&tema=" - + i3GEOF.legenda.tema - + "&offsite=" - + objTema.offsite, + + i3GEO.configura.sid + + "&funcao=aplicaOffsite" + + "&tema=" + + i3GEOF.legenda.tema + + "&offsite=" + + objTema.offsite, cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p, "foo", retorna); @@ -914,15 +645,13 @@ i3GEOF.legenda = 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++) { + for (t = 1; t < trs.length; t++) { if (trs[t].childNodes) { nn = trs[t].childNodes; for (n = 0; n < nn.length; n++) { - if (nn[n].childNodes) { + if (nn && nn[n] && nn[n].childNodes && nn[n].getElementsByTagName) { var isn = nn[n].getElementsByTagName("input"); - if (isn[0] != undefined) { + if (isn && isn[0] != undefined) { if (isn[0].name == "nome") { nomes.push(isn[0].value); temp = (isn[0].id).split("i3GEOlegendaid_"); @@ -956,27 +685,27 @@ i3GEOF.legenda = var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?" - + "base64=nao" - + "&g_sid=" - + i3GEO.configura.sid - + "&funcao=alteraclasse" - + "&opcao=alteraclasses" - + "&ext=" - + ext; + + "base64=nao" + + "&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=" + ids - + "&nomes=" - //+ i3GEO.util.base64encode(nomes) - + nomes - + "&exps=" - //+ i3GEO.util.base64encode(exps) - + exps - + "&minScales=" - + minScales - + "&maxScales=" - + maxScales); + + "&nomes=" + //+ i3GEO.util.base64encode(nomes) + + nomes + + "&exps=" + //+ i3GEO.util.base64encode(exps) + + exps + + "&minScales=" + + minScales + + "&maxScales=" + + maxScales); } catch (e) { i3GEO.janela.tempoMsg("Erro: " + e); i3GEOF.legenda.aguarde.visibility = "hidden"; @@ -1003,11 +732,11 @@ i3GEOF.legenda = }; 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(); + + 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); }, @@ -1027,10 +756,10 @@ i3GEOF.legenda = 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(); + + 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)); @@ -1051,12 +780,12 @@ i3GEOF.legenda = 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(); + + 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); }, @@ -1081,12 +810,12 @@ i3GEOF.legenda = 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(); + + 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); }, @@ -1111,13 +840,13 @@ i3GEOF.legenda = 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; + + 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) { @@ -1146,9 +875,9 @@ i3GEOF.legenda = 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; + + i3GEO.configura.sid + + "&funcao=inverteCoresClasses&tema=" + + i3GEOF.legenda.tema; cp.set_response_type("JSON"); cp.call(p, "alteraCoresClasses", retornapaleta); } catch (e) { @@ -1177,9 +906,9 @@ i3GEOF.legenda = 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; + + i3GEO.configura.sid + + "&funcao=calculaTamanhoClasses&tema=" + + i3GEOF.legenda.tema; cp.set_response_type("JSON"); cp.call(p, "calculaTamanhoClasses", retornapaleta); } catch (e) { @@ -1205,9 +934,9 @@ i3GEOF.legenda = i3GEOF.legenda.mostralegenda(); }, cp = new cpaint(), p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=ordenaClasses&tema=" - + i3GEOF.legenda.tema; + + i3GEO.configura.sid + + "&funcao=ordenaClasses&tema=" + + i3GEOF.legenda.tema; cp.set_response_type("JSON"); cp.call(p, "foo", retornapaleta); } catch (e) { @@ -1220,8 +949,8 @@ i3GEOF.legenda = * * Exclui uma linha da tabela de edição de classes da legendda */ - excluilinhaf : function(celula) { - var p = celula.parentNode.parentNode; + excluilinhaf : function(id) { + var p = $i(id); do { p.removeChild(p.childNodes[0]); } while (p.childNodes.length > 0); @@ -1240,11 +969,11 @@ i3GEOF.legenda = 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() { + + 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(); }; @@ -1263,11 +992,11 @@ i3GEOF.legenda = 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() { + + 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(); }; @@ -1288,7 +1017,6 @@ i3GEOF.legenda = try { $i("i3GEOlegendaguia1obj").style.display = "none"; $i("i3GEOlegendaguia3obj").style.display = "block"; - i3GEOF.legenda.ativaAplicar("block"); id = id.split("-"); i3GEOF.legenda.classe = id[1]; i3GEOF.legenda.estilo = 0; @@ -1302,11 +1030,11 @@ i3GEOF.legenda = 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(); + + 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); }, @@ -1328,11 +1056,11 @@ i3GEOF.legenda = 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() { + + 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"; }; @@ -1359,7 +1087,7 @@ i3GEOF.legenda = } var item = $i("i3GEOlegendaitensValorUnico").getElementsByTagName("select")[0].value, itemNome = $i("i3GEOlegendaClassesValorUnico").getElementsByTagName("select")[0].value, p = - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" + i3GEOF.legenda.tema @@ -1407,7 +1135,7 @@ i3GEOF.legenda = } var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses = $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&nclasses=" + nclasses @@ -1454,23 +1182,23 @@ i3GEOF.legenda = return; } var item = $i("i3GEOlegendaitensMetade").getElementsByTagName("select")[0].value, - itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value, - p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=alteraclasse" - + "&tema=" - + i3GEOF.legenda.tema - + "&item=" - + item - + "&itemid=" - + itemid - + "&opcao=metade&ignorar=" - + $i("i3GEOlegendaignorar").value, - cp = new cpaint(), - fim = function() { - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - }; + itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value, + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=alteraclasse" + + "&tema=" + + i3GEOF.legenda.tema + + "&item=" + + item + + "&itemid=" + + itemid + + "&opcao=metade&ignorar=" + + $i("i3GEOlegendaignorar").value, + cp = new cpaint(), + fim = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; if (item == "") { i3GEO.janela.tempoMsg("Selecione um item!"); return; @@ -1507,20 +1235,20 @@ i3GEOF.legenda = return; } var item = $i("i3GEOlegendaitensMedia").getElementsByTagName("select")[0].value, - p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=alteraclasse" - + "&tema=" - + i3GEOF.legenda.tema - + "&item=" - + item - + "&opcao=media&ignorar=" - + $i("i3GEOlegendaignorar").value, - cp = new cpaint(), - fim = function() { - i3GEOF.legenda.aposAlterarLegenda(); - i3GEOF.legenda.aguarde.visibility = "hidden"; - }; + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=alteraclasse" + + "&tema=" + + i3GEOF.legenda.tema + + "&item=" + + item + + "&opcao=media&ignorar=" + + $i("i3GEOlegendaignorar").value, + cp = new cpaint(), + fim = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; if (item == "") { i3GEO.janela.tempoMsg("Selecione um item!"); return; @@ -1554,7 +1282,7 @@ i3GEOF.legenda = } var item = $i("i3GEOlegendaitensValorQuartil").getElementsByTagName("select")[0].value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&tema=" + i3GEOF.legenda.tema @@ -1597,7 +1325,7 @@ i3GEOF.legenda = } var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses = $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&nclasses=" + nclasses @@ -1640,7 +1368,7 @@ i3GEOF.legenda = } var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses = $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p = - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=alteraclasse&nclasses=" + nclasses @@ -1685,9 +1413,9 @@ i3GEOF.legenda = } 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() { + + i3GEO.configura.sid + + "&funcao=alterarepresentacao&tema=" + + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() { i3GEOF.legenda.aposAlterarLegenda(); i3GEOF.legenda.aguarde.visibility = "hidden"; }; @@ -1706,11 +1434,20 @@ i3GEOF.legenda = */ montaEditor : function(retorno) { try { - i3GEO.util.comboItens("i3GEOlegendaSelItemLabel", i3GEOF.legenda.tema, function(retorno) { - if ($i("i3GEOlegendaitensLabel")) { - $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados; - } - }, "i3GEOlegendaitensLabel"); + i3GEO.util.comboItens( + "i3GEOlegendaSelItemLabel", + i3GEOF.legenda.tema, + function(retorno) { + if ($i("i3GEOlegendaitensLabel")) { + $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados; + } + }, + "i3GEOlegendaitensLabel", + "", + "", + "", + "form-control" + ); if (i3GEOF.legenda.aguarde.visibility === "visible") { return; } @@ -1720,7 +1457,7 @@ i3GEOF.legenda = retorno = retorno.data; i3GEOF.legenda.estilos = retorno.split("|"); combo = - "

"; n = i3GEOF.legenda.estilos.length; for (i = 0; i < n; i++) { l = i3GEOF.legenda.estilos[i].split("#"); @@ -1728,123 +1465,9 @@ i3GEOF.legenda = combo += sct; } combo += "
"; - $i("i3GEOlegendacomboestilos").innerHTML = - "
" + $trad('estiloEdicao', i3GEOF.legenda.dicionario) - + ":" - + combo - + "
 (após adicionar ou excluir, aplique a alteração)
"; - b = - 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"; - } - } - } - }); - b.addClass("rodar100"); - b = - 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"; - } - } - } - }); - b.addClass("rodar100"); - b = - 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"; - } - } - } - }); - b.addClass("rodar100"); - b = - 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"; - } - } - } - }); - b.addClass("rodar100"); + $i("i3GEOlegendacomboestilos").innerHTML = combo; + + i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.mostraEstilo(0); } else { @@ -1856,6 +1479,94 @@ i3GEOF.legenda = i3GEOF.legenda.aguarde.visibility = "hidden"; } }, + desceEstilo: 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"; + } + }, + sobeEstilo: 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"; + } + }, + adicionaEstilo: 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"; + } + }, + excluiEstilo: 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"; + } + }, /* * Function: mostraEstilo * @@ -1864,233 +1575,62 @@ i3GEOF.legenda = mostraEstilo : function(e) { i3GEOF.legenda.aguarde.visibility = "visible"; try { - var linha, tipoLayer, d, p, cp; + var linha, tipoLayer, d, p, cp, mustache = {}; 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('corFrente', i3GEOF.legenda.dicionario) - + ":

" - + "
" - + "
" - + "" - + "
" - - + "
" - + "

" - + $trad('corFundo', 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('symbolscale', i3GEOF.legenda.dicionario) - + ":

" - + "
" - + "
" - + "" - + "
" - - + "
" - + "

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

" - + "
" - + "
" - + "" - + "
" - - + "
" - + "

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

" - + "
" - + "
" - + "" - + "
" - - + "
" - + "

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

" - + "
" - + "
" - + "" - + "
" + mustache = { + "voutlinecolor": linha[2], + "vcolor": linha[4], + "vbackgroundcolor": linha[3], + "vsize": linha[6], + "vwidth": linha[8], + "vpattern": linha[9], + "vopacity": linha[7], + "vangle": linha[10], + "vsymbolscale": linha[11], + "vminsize": linha[12], + "vmaxsize": linha[13], + "voffsetx": linha[14], + "voffsety": linha[15], + "vsymbolname": linha[5], + }; - + "
" - + "

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

" - + "
" - + "
" - + "" - + "
" + ins = Mustache.render( + i3GEOF.legenda.MUSTACHEESTILO, + $.extend( + {}, + mustache, + i3GEOF.legenda.DICIONARIO + ) + ); + $i("i3GEOlegendaParametrosEstilos").innerHTML = ins; - + "
" - + "

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

" - + "
" - + "
" - + "" - + "
"; - $i("i3GEOlegendaParametrosEstilos").innerHTML = d; //preenche as listas de itens - i3GEO.util.comboItens("", i3GEOF.legenda.tema, function(retorno) { - if ($i("i3GEOlegendaComboSize")) { - $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'"); - } - }); + i3GEO.util.comboItens( + "", + i3GEOF.legenda.tema, function(retorno) { + if ($i("i3GEOlegendaComboSize")) { + $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'"); + } + }, + "", + "", + "", + "", + "form-control" + ); i3GEO.util.aplicaAquarela("i3GEOlegendaParametrosEstilos"); + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=editasimbolo&tipo=" - + tipoLayer - + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)"; + + 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); @@ -2146,11 +1686,11 @@ i3GEOF.legenda = i3GEOF.legenda.aguarde.visibility = "visible"; var i, p, cp, fim, 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, symbolscale = - $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize = - $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value; + $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, symbolscale = + $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize = + $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value; if (symbolscale != "") { symbolscale = parseInt(symbolscale, 10); } else { @@ -2168,41 +1708,41 @@ i3GEOF.legenda = } 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 - + "&symbolscale=" - + symbolscale - + "&minsize=" - + minsize - + "&maxsize=" - + maxsize - + "&offsetx=" - + offsetx - + "&offsety=" - + offsety; + + 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 + + "&symbolscale=" + + symbolscale + + "&minsize=" + + minsize + + "&maxsize=" + + maxsize + + "&offsetx=" + + offsetx + + "&offsety=" + + offsety; cp = new cpaint(); fim = function() { i3GEOF.legenda.aposAlterarLegenda(); @@ -2243,57 +1783,46 @@ i3GEOF.legenda = i3GEOF.legenda.aguarde.visibility = "visible"; var monta = function(retorno) { - if (retorno.data && retorno.data[0].proc == "") { - var b, 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("
" + retorno.data[i].nomeclasse - + "
" + $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("

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

Erro
"; - return; + i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg); } - i3GEOF.legenda.aguarde.visibility = "hidden"; + ins.push("


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

Erro
"; + return; + } + i3GEOF.legenda.aguarde.visibility = "hidden"; - b = 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"); - } - } - }); - b.addClass("abrir"); - }, p = + }, p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=contagemclasse&tema=" - + i3GEOF.legenda.tema, cp = new cpaint(); + + 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); @@ -2304,12 +1833,12 @@ i3GEOF.legenda = }, iniciaGraficoPizza : function() { var dados = { - "attributes" : { - "id" : "" - }, - "data" : { - "dados" : i3GEOF.legenda.dadosGrafico - } + "attributes" : { + "id" : "" + }, + "data" : { + "dados" : i3GEOF.legenda.dadosGrafico + } }; i3GEOF.graficointerativo1.tipo = "pizza_1"; i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados); @@ -2346,11 +1875,11 @@ i3GEOF.legenda = }; p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=aplicaProcessos&lista=" - + lista - + "&tema=" - + i3GEOF.legenda.tema; + + i3GEO.configura.sid + + "&funcao=aplicaProcessos&lista=" + + lista + + "&tema=" + + i3GEOF.legenda.tema; cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p, "aplicaProcessos", temp); @@ -2365,7 +1894,7 @@ i3GEOF.legenda = * Adiciona um novo processo na lista de processos */ adicionaProcesso : function(s) { - $i("i3GEOlegendaprocessos").innerHTML += $inputText("", "", "", "", 50, s.value); + $i("i3GEOlegendaprocessos").innerHTML += "

"; }, aplicaTodasClasses : function(parametro, id) { var valor = $i(id).value; @@ -2376,14 +1905,14 @@ i3GEOF.legenda = }, p, cp; p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=aplicaTodasClasses" - + "¶metro=" - + parametro - + "&valor=" - + valor - + "&tema=" - + i3GEOF.legenda.tema; + + i3GEO.configura.sid + + "&funcao=aplicaTodasClasses" + + "¶metro=" + + parametro + + "&valor=" + + valor + + "&tema=" + + i3GEOF.legenda.tema; cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p, "foo", temp); @@ -2396,21 +1925,21 @@ i3GEOF.legenda = }, p, cp; p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=aplicarCluster" - + "&maxdistance=" - + $i("i3GEOlegendaClusterMaxdistance").value - + "&buffer=" - + $i("i3GEOlegendaClusterBuffer").value - + "&filter=" - //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value) - + $i("i3GEOlegendaClusterFilter").value - + "®ion=" - + $i("i3GEOlegendaClusterRegion").value - + "&group=" - + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value - + "&tema=" - + i3GEOF.legenda.tema; + + i3GEO.configura.sid + + "&funcao=aplicarCluster" + + "&maxdistance=" + + $i("i3GEOlegendaClusterMaxdistance").value + + "&buffer=" + + $i("i3GEOlegendaClusterBuffer").value + + "&filter=" + //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value) + + $i("i3GEOlegendaClusterFilter").value + + "®ion=" + + $i("i3GEOlegendaClusterRegion").value + + "&group=" + + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value + + "&tema=" + + i3GEOF.legenda.tema; cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p, "foo", temp); @@ -2422,64 +1951,73 @@ i3GEOF.legenda = }, p, cp; p = i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" - + i3GEO.configura.sid - + "&funcao=removerCluster" - + "&tema=" - + i3GEOF.legenda.tema; + + i3GEO.configura.sid + + "&funcao=removerCluster" + + "&tema=" + + i3GEOF.legenda.tema; cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p, "foo", temp); }, montaCombosItens : function(){ - i3GEO.util.comboItens("", i3GEOF.legenda.tema, function(retorno) { - if ($i("i3GEOlegendaitensValorUnico")) { - $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaClassesValorUnico")) { - $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaitensMetade")) { - $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaitensMetadeId")) { - $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaitensMedia")) { - $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaitensValorClass")) { - $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaitensCluster")) { - $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados; - } - if ($i("i3GEOlegendaitensValorQuartil")) { - $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados; - } - }); + i3GEO.util.comboItens( + "", + i3GEOF.legenda.tema, + function(retorno) { + if ($i("i3GEOlegendaitensValorUnico")) { + $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaClassesValorUnico")) { + $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensMetade")) { + $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensMetadeId")) { + $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensMedia")) { + $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensValorClass")) { + $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensCluster")) { + $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensValorQuartil")) { + $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados; + } + }, + "", + "", + "", + "", + "form-control" + ); }, parametrosAuto : function() { i3GEOF.legenda.aguarde.visibility = "visible"; var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=parametrosauto&tema=" + i3GEOF.legenda.tema, - cp = new cpaint(), - temp = function(retorno){ - try{ - if(retorno.data !== ""){ - $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas; - $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem; - $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome; - $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor; - $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo; - $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho; - $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile; - $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep; - } - i3GEOF.legenda.aguarde.visibility = "hidden"; - }catch(e){ - i3GEO.janela.tempoMsg("Erro. "+e); - i3GEOF.legenda.aguarde.visibility = "hidden"; + cp = new cpaint(), + temp = function(retorno){ + try{ + if(retorno.data !== ""){ + $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas; + $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem; + $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome; + $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor; + $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo; + $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho; + $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile; + $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep; } - }; + i3GEOF.legenda.aguarde.visibility = "hidden"; + }catch(e){ + i3GEO.janela.tempoMsg("Erro. "+e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }; cp.set_response_type("JSON"); cp.call(p,"foo",temp); }, @@ -2489,23 +2027,23 @@ i3GEOF.legenda = } i3GEOF.legenda.aguarde.visibility = "visible"; var temp, - p, - cp; + p, + cp; temp = function(){ i3GEOF.legenda.aguarde.visibility = "hidden"; i3GEOF.legenda.aposAlterarLegenda(); }; p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=salvaparametrosauto&tema=" + i3GEOF.legenda.tema - + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value - + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value - + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value - + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value - + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value - + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value - + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value; + + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value + + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value + + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value + + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value + + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value + + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value + + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value; cp = new cpaint(); cp.set_response_type("JSON"); cp.call(p,"foo",temp); } - }; \ No newline at end of file +}; \ No newline at end of file diff --git a/ferramentas/legenda/templateFormEstilo_mst.html b/ferramentas/legenda/templateFormEstilo_mst.html new file mode 100644 index 0000000..4bd8272 --- /dev/null +++ b/ferramentas/legenda/templateFormEstilo_mst.html @@ -0,0 +1,238 @@ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
+ +
+
+
+ + + +
+ + + send + + +
+
diff --git a/ferramentas/legenda/templateLista_mst.html b/ferramentas/legenda/templateLista_mst.html new file mode 100755 index 0000000..030f009 --- /dev/null +++ b/ferramentas/legenda/templateLista_mst.html @@ -0,0 +1,110 @@ + +
+ + +
{{{clicaSimbolo}}}
+ + + + + + + + + + + + {{#linhas}} + + + + + + + + + + + + + {{/linhas}} +
+ + + + + + nome + expressãominScalemaxScale
+ + + + + + +
+ +
+
+
+ + +
+
+ + +
+ +
+
+
+ +
+
+ + + +
+
+ +
+ +
+ + +
+
+
{{{existentes}}}
+
+ {{#processos}} +
+ +
+ {{/processos}} +
+
{{{ajuda1}}}
+
{{{adicionaProcesso}}}
+
\ No newline at end of file diff --git a/ferramentas/legenda/template_mst.html b/ferramentas/legenda/template_mst.html index b794709..1e3eef5 100755 --- a/ferramentas/legenda/template_mst.html +++ b/ferramentas/legenda/template_mst.html @@ -1,9 +1,10 @@ -
+ +
-
  • @@ -59,353 +59,343 @@
  • -
    -
    -

    {{{colunasTxt}}}:

    -
    + +
    + + + + +
    +
    -
    -

    {{{autoClasses}}}

    -
    -

    {{{classesitem}}}:

    -
    - +
    + +
    + + + + send + + +
    -
    -

    {{{classesnome}}}:

    -
    - + +
    + +
    + + + + send + + +
    -
    -

    {{{classescor}}}:

    -
    - + +
    + +
    + {{{de}}}   + +   {{{ate}}}   + +   + + + send + +
    -
    -

    {{{classessimbolo}}}:

    -
    - +
    + +
    + + +
    +
    +
    -
    -

    {{{classestamanho}}}:

    -
    - +
    + +
    -
    -

    {{{palletefile}}}:

    -
    - + +
    + +
    {{{alteraGeom}}}
    +
    + +
    + + + + send + + +
    -
    -

    {{{palletestep}}}:

    -
    - + +
    + +
    {{{alteraTipo}}}
    +
    +
    + + + + send + + +
    +
    + +
    + +
    {{{simboloUnico}}}
    +
    +
    + + + + send + + +
    +
    + +
    + +
    {{{valorUnico}}}
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + send + + +
    +
    + +
    + +
    {{{classesFixas}}}
    +
    + +
    +
    +
    +
    +
    + + +
    +
    {{{tipoCalculo}}}
    + + + + +
    + +
    {{{metade}}}
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + send + + +
    +
    + +
    + +
    {{{media}}}
    +
    + +
    +
    + + + send + + +
    +
    + +
    + +
    {{{calcularQuartil}}}
    +
    + +
    +
    +
    +
    +
    + +
    + + + + send + + +
    -
    -

    - -


    -
    -

    {{{ClusterMaxdistance}}}:

    -
    - + +
    +
    {{{etiquetasClasse}}}
    +
    + +
    +
    +
    -
    -

    {{{ClusterBuffer}}}:

    -
    - + + + + +
    + +
    {{{estilos}}}
    + +
    + +
    +
    +
    -
    -

    {{{ClusterFilter}}}:

    -
    - + + + + + +
    + +
    {{{edicaoEstilo}}}
    +
    {{{ajudaEstilo}}}
    +
    +
    +
    +
    + + +
    + + +
    +
    {{{geraSLD}}} Mapserver SLD {{{ajudaSLD}}}
    + +
    {{{msgAplicaSLD}}}
    + +
    + + +
    +
    {{{clusterAjuda}}}
    +
    + +
    -
    -

    {{{ClusterRegion}}}

    -
    - +
    +
    + + +
    +
    + +
    -
    -

    {{{ClusterGroup}}}

    -
    -
    -

    - -

    -
    -

    - -

    -
    -
    -

    -   - - {{{mostraClassesLegenda}}} -

    -
    -

    {{{legendaImg}}}

    - - - - - -
    -
    - -
    -
    - -
    -
    -

    {{{offsite}}}

    - - - - - -
    -
    - -
    -
    - -
    -
    -

    - -

    -

    - -

    -

    - -

    -
    -

    {{{geraCores}}}

    - - - - - - - - -
    {{{de}}}: -
    - -
    -
    {{{ate}}}: -
    - -
    -
    - -
    +
    + +
    + + +
    -
    -
    - - - - - -
    -

    - -

    -
    -

    - -

    -
    -
    -

    {{{clicaSimbolo}}}

    -
    + +
    +
    {{{autoClasses}}}
    + +
    {{{colunasTxt}}}
    +
    +
    + +
    -
    -
    -
    -
    -
    -

    -   - - {{{consideraElementosVisisveis}}} -

    -

    {{{ignoraValores}}}:

    -
    - -
    -
    -
    -
    - {{{alteraGeom}}} -

    {{{transformaGeom}}}

    -
    - -
    -
    -

    - -

    -
    -
    -
    - {{{alteraTipo}}} -

    {{{alteraTipoGeom}}}

    -

    - -

    -
    -
    -
    -
    - {{{simboloUnico}}} -

    {{{todosElementosUnicoSimbolo}}}

    -

    - -

    -
    -
    -
    - {{{valorUnico}}} -

    {{{cadaOcorrenciaUnicoSimbolo}}}

    -
    -
    -

    {{{nomeClassesUnicoSimbolo}}}

    -
    -
    -

    - -

    -
    -
    -
    - {{{classes}}} -

    {{{criaClassesItemNumerico}}}

    -
    -
    -

    {{{numeroClasses}}}:

    -
    - -
    -
    -

    - -

    -

    - -

    -

    - -

    -
    -
    -
    - {{{metade}}} -

    {{{duasmetades}}}

    -
    -
    -

    {{{iunico}}}

    -
    -
    -

    - -

    -
    -
    -
    - {{{media}}} -

    {{{duasmedias}}}

    -
    -
    -

    - -

    -
    -
    -
    - {{{calcularQuartil}}} -

    {{{criaQuartis}}}

    -
    -
    -

    - -

    -

    {{{estiloNomeClasses}}}: -

    - -
    -
    -
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    -
    -
    - {{{etiquetasClasse}}} -

    {{{itemComTexto}}}:

    -
    -
    -

    - - - -

    -
    -
    -
    - {{{estilos}}} -

    {{{ajudaEstilo}}} -

    -
    - -   - -   - -   - -
    -

    - -
    -
    -
    -
    -
    -
    -

    - {{{geraSLD}}} - Mapserver SLD - {{{ajudaSLD}}} -

    - -

    -

    {{{msgAplicaSLD}}} -

    - -

    -
    + \ No newline at end of file diff --git a/ferramentas/legendax/dependencias.php b/ferramentas/legendax/dependencias.php new file mode 100755 index 0000000..e4dfd02 --- /dev/null +++ b/ferramentas/legendax/dependencias.php @@ -0,0 +1,24 @@ + ou com a funcao scripttag do i3Geo + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel + * javascript i3GEOF.legenda.MUSTACHE + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta + */ + +if(extension_loaded('zlib')){ + ob_start('ob_gzhandler'); +} +header("Content-type: text/javascript"); +include("index.js"); +include("dicionario.js"); +echo "\n"; + +if(extension_loaded('zlib')){ + ob_end_flush(); +} +?> \ No newline at end of file diff --git a/ferramentas/legendax/dicionario.js b/ferramentas/legendax/dicionario.js new file mode 100755 index 0000000..023224c --- /dev/null +++ b/ferramentas/legendax/dicionario.js @@ -0,0 +1,905 @@ +//+$trad(1,i3GEOF.legenda.dicionario)+ +i3GEOF.legenda.dicionario = + { + 'ajuda' : [ + { + pt : "Para acessar o editor, clique em um símbolo na guia Legenda", + en : "", + es : "" + } + ], + 'propriedades' : [ + { + pt : "Propriedades", + en : "", + es : "" + } + ], + "legenda" : [ + { + pt : "Legenda", + en : "", + es : "" + } + ], + "classes" : [ + { + pt : "Classes", + en : "", + es : "" + } + ], + 'editor' : [ + { + pt : "Editor", + en : "", + es : "" + } + ], + 'graficos' : [ + { + pt : "Gráficos", + en : "", + es : "" + } + ], + 'importaExportaSLD' : [ + { + pt : "SLD", + en : "", + es : "" + } + ], + 'mostraClassesLegenda' : [ + { + pt : "Mostra as classes desse tema na legenda do mapa", + en : "", + es : "" + } + ], + 'incluiNumeroOcorrencia' : [ + { + pt : "Inclui número de ocorrências", + en : "", + es : "" + } + ], + 'incluiNumeroOcorrencia2' : [ + { + pt : "incluir o número de ocorrências no nome de cada classe", + en : "", + es : "" + } + ], + 'aplicaOpacidadeVariavel' : [ + { + pt : "Aplica opacidade variável", + en : "", + es : "" + } + ], + 'aplicaOpacidade' : [ + { + pt : "aplicar opacidade nas classes existente, variando de 10 até 100", + en : "", + es : "" + } + ], + 'escolhePaletaCores' : [ + { + pt : "Escolher paleta de cores", + en : "", + es : "" + } + ], + 'variaCoresExtremos' : [ + { + pt : "escolher e aplicar as variações de cores, entre dois extremos, nas classes existentes", + en : "", + es : "" + } + ], + 'geraCores' : [ + { + pt : "Gerar cores", + en : "", + es : "" + } + ], + 'ate' : [ + { + pt : "até", + en : "", + es : "" + } + ], + 'de' : [ + { + pt : "de", + en : "", + es : "" + } + ], + 'aplica' : [ + { + pt : "Aplicar", + en : "", + es : "" + } + ], + 'aplicaVariaCores' : [ + { + pt : "aplicar variações de cores, entre dois extremos, nas classes existentes", + en : "", + es : "" + } + ], + 'aplicaAlteracao' : [ + { + pt : "Aplicar alterações", + en : "", + es : "" + } + ], + 'adicionaClasse' : [ + { + pt : "Adicionar classe", + en : "", + es : "" + } + ], + 'adicionaNovaClasse' : [ + { + pt : "adicionar uma nova classe na legenda", + en : "", + es : "" + } + ], + 'clicaSimbolo' : [ + { + pt : "Clique no símbolo da classe para alterar", + en : "", + es : "" + } + ], + 'consideraElementosVisisveis' : [ + { + pt : "marque para considerar apenas os elementos visíveis na extensão geográfica atual, caso contrário, será considerada a extensão geográfica inicial do mapa", + en : "", + es : "" + } + ], + 'ignoraValores' : [ + { + pt : "Ao gerar as classes, ignorar os valores (separe com vírgula)", + en : "", + es : "" + } + ], + 'transformaGeom' : [ + { + pt : "Transforma a representação geométrica dos elementos do tema. Após alterar esse parâmetro, pode ser necessário modificar as características do símbolo.", + en : "", + es : "" + } + ], + 'semTransformacao' : [ + { + pt : "nenhuma transformação", + en : "", + es : "" + } + ], + 'centroide' : [ + { + pt : "centróide", + en : "", + es : "" + } + ], + 'vertices' : [ + { + pt : "vértices", + en : "", + es : "" + } + ], + 'verticeInicial' : [ + { + pt : "vértice inicial", + en : "", + es : "" + } + ], + 'verticeFinal' : [ + { + pt : "vértice final", + en : "", + es : "" + } + ], + 'alteraGeom' : [ + { + pt : "Altera geometria", + en : "", + es : "" + } + ], + 'alteraTipoGeom' : [ + { + pt : "Altera o tipo de representação do tema. Se for poligonal, passa para linear e vice-versa.", + en : "", + es : "" + } + ], + 'alteraTipo' : [ + { + pt : "Altera tipo", + en : "", + es : "" + } + ], + 'todosElementosUnicoSimbolo' : [ + { + pt : "Todos os elementos serão desenhados com um único símbolo", + en : "", + es : "" + } + ], + 'simboloUnico' : [ + { + pt : "Símbolo único", + en : "", + es : "" + } + ], + 'cadaOcorrenciaUnicoSimbolo' : [ + { + pt : "Cada ocorrência de um valor para o item selecionado, será desenhado com o mesmo símbolo", + en : "", + es : "" + } + ], + 'valorUnico' : [ + { + pt : "Calcular valor único", + en : "", + es : "" + } + ], + 'criaClassesItemNumerico' : [ + { + pt : "Cria classes para um item numérico utilizando um número fixo de classes", + en : "", + es : "" + } + ], + 'numeroClasses' : [ + { + pt : "Número de classes", + en : "", + es : "" + } + ], + 'intervalosIguais' : [ + { + pt : "Calcular intervalos iguais", + en : "", + es : "" + } + ], + 'criaQuartis' : [ + { + pt : "Cria classes para um item numérico utilizando os quartis", + en : "", + es : "" + } + ], + 'estiloNomeClasses' : [ + { + pt : "Estilo dos nomes das classes", + en : "", + es : "" + } + ], + 'soValores' : [ + { + pt : "só os valores", + en : "", + es : "" + } + ], + 'quartilValores' : [ + { + pt : "quartil e os valores", + en : "", + es : "" + } + ], + 'expressaoCompleta' : [ + { + pt : "expressão completa", + en : "", + es : "" + } + ], + "etiquetasClasse" : [ + { + pt : "Textos da classe (labels)", + en : "", + es : "" + } + ], + 'itemComTexto' : [ + { + pt : "Item com o texto", + en : "", + es : "" + } + ], + 'exclui' : [ + { + pt : "excluir", + en : "", + es : "" + } + ], + 'adiciona' : [ + { + pt : "adicionar", + en : "", + es : "" + } + ], + 'propriedades2' : [ + { + pt : "propriedades", + en : "", + es : "" + } + ], + 'estilos' : [ + { + pt : "Estilos", + en : "", + es : "" + } + ], + 'ajudaEstilo' : [ + { + pt : "Cada símbolo pode ser formado por um ou mais estilos. Utilize -1,-1,-1 para anular uma cor. A cor deve ser definida no formato vermelho,verde,azul. Para criar linhas tracejadas utilize o símbolo 0 ou vazio e digite um padrão de repetição como por exemplo 2 10 2 10 ", + en : "", + es : "" + } + ], + 'aplicaAlteracoes' : [ + { + pt : "Aplicar todas as alterações", + en : "", + es : "" + } + ], + 'geraSLD' : [ + { + pt : "Gera um arquivo XML, no padrão SLD, contendo a legenda atual da camada. Para maiores informações, veja", + en : "", + es : "" + } + ], + 'ajudaSLD' : [ + { + pt : "(O SLD só é gerado ou aplicado corretamente em camadas que utilizam expressões simples e o elemento CLASSITEM)", + en : "", + es : "" + } + ], + 'exportaSLD' : [ + { + pt : "Exportar SLD", + en : "", + es : "" + } + ], + 'msgAplicaSLD' : [ + { + pt : "Aplica um arquivo SLD à camada ativa", + en : "", + es : "" + } + ], + 'aplicaSLD' : [ + { + pt : "Aplicar SLD", + en : "", + es : "" + } + ], + 'temaInexistente' : [ + { + pt : "O tema ja nao existe mais no mapa", + en : "", + es : "" + } + ], + 'cliqueAltera' : [ + { + pt : "clique para alterar", + en : "", + es : "" + } + ], + 'cliqueExclui' : [ + { + pt : "clique para excluir", + en : "", + es : "" + } + ], + 'digitaNovoNome' : [ + { + pt : "digite o novo nome", + en : "", + es : "" + } + ], + 'digitaNovaExpressao' : [ + { + pt : "digite a nova expressão", + en : "", + es : "" + } + ], + 'sobe' : [ + { + pt : "sobe", + en : "", + es : "" + } + ], + 'desce' : [ + { + pt : "desce", + en : "", + es : "" + } + ], + 'ajudaEscalaCores' : [ + { + pt : "Para aplicar um ajuste entre 0 e 255 cores, utilize a opção Escala de Cores.", + en : "", + es : "" + } + ], + 'msgEscalaCoresAuto' : [ + { + pt : "O valor de SCALE= pode ser a palavra AUTO (SCALE=AUTO) ou um valor mínimo e máximo (por exemplo SCALE=20,3000).", + en : "", + es : "" + } + ], + 'msgEscalaCoresIndividual' : [ + { + pt : "Você pode aplicar a escala em bandas individuais, para isso, utilize SCALE_n, por exemplo SCALE_1=AUTO SCALE_2=200,500.", + en : "", + es : "" + } + ], + 'msgBandas' : [ + { + pt : "Para escolher quais bandas serão utilizadas e qual sua ordem, utilize a opção BANDAS. Utilize, por exemplo, BANDS=1,2,3 BANDS=1 .", + en : "", + es : "" + } + ], + 'msgReamostragem' : [ + { + pt : "Para alterar o modo de amostragem, utilize RESAMPLE com uma das opções: AVERAGE,NEAREST ou BILINEAR.", + en : "", + es : "" + } + ], + 'adicionaProcesso' : [ + { + pt : "Você pode incluir processos na imagem para modificar as características de visualização

    Adicionar processo", + en : "", + es : "" + } + ], + 'selecionaProcesso' : [ + { + pt : "selecione o processo", + en : "", + es : "" + } + ], + 'escalaCores' : [ + { + pt : "Escala de cores", + en : "", + es : "" + } + ], + 'reamostragem' : [ + { + pt : "Reamostragem", + en : "", + es : "" + } + ], + 'bandas' : [ + { + pt : "Bandas", + en : "", + es : "" + } + ], + 'aplicaProcesso' : [ + { + pt : "aplicar processos", + en : "", + es : "" + } + ], + 'msgNaoEditaLegenda' : [ + { + pt : "Não é possível editar a legenda desse tema", + en : "", + es : "" + } + ], + 'msgAplicaAlteracao' : [ + { + pt : "Clique em Aplicar para que as alteraçõpes sejam salvas", + en : "", + es : "" + } + ], + 'consideraElementosVisiveis' : [ + { + pt : "A contagem considera apenas os elementos visíveis na abrangência do mapa", + en : "", + es : "" + } + ], + 'selecionaUmItem' : [ + { + pt : "Selecione um item!", + en : "", + es : "" + } + ], + 'estiloEdicao' : [ + { + pt : "Estilo em edição", + en : "", + es : "" + } + ], + 'corFundo' : [ + { + pt : "Cor do fundo", + en : "", + es : "" + } + ], + 'corFrente' : [ + { + pt : "Cor da frente", + en : "", + es : "" + } + ], + 'tamanhoEspacamento' : [ + { + pt : "Tamanho / espaçamento", + en : "", + es : "" + } + ], + 'espessura' : [ + { + pt : "Espessura", + en : "", + es : "" + } + ], + 'padraoRepeticao' : [ + { + pt : "Padrão de repetição", + en : "", + es : "" + } + ], + 'opacidade' : [ + { + pt : "Opacidade", + en : "", + es : "" + } + ], + 'angulo' : [ + { + pt : "Ângulo", + en : "", + es : "" + } + ], + 'simbolo' : [ + { + pt : "Nome do símbolo
    Você pode também usar o caminho absoluto de uma imagem PNG existente no servidor ou clicar em " + "um dos símbolos mostrados abaixo. Clique aqui para upload dessa imagem", + en : "", + es : "" + } + ], + 'listaSimbolo' : [ + { + pt : "Lista de símbolos. Clique para selecionar", + en : "", + es : "" + } + ], + 'graficoPizza' : [ + { + pt : "Gráfico de pizza", + en : "", + es : "" + } + ], + 'numeroOcorrenciasClasses' : [ + { + pt : "Número de ocorrências em cada classe (n)", + en : "", + es : "" + } + ], + 'msgNumeroClasses' : [ + { + pt : "O tema deve conter pelo menos 2 classes", + en : "", + es : "" + } + ], + 'quebrasNaturais' : [ + { + pt : "Calcular quebras naturais", + en : "", + es : "" + } + ], + 'calcularQuartil' : [ + { + pt : "Calcular quartis", + en : "", + es : "" + } + ], + 'calcularQuantil' : [ + { + pt : "Calcular quantis", + en : "", + es : "" + } + ], + 'minScale' : [ + { + pt : "Não desenha se escala for menor que", + en : "", + es : "" + } + ], + 'maxScale' : [ + { + pt : "Não desenha se escala for maior que", + en : "", + es : "" + } + ], + 'aplicatodos' : [ + { + pt : "Aplicar esse parâmetro em todas as classes", + en : "", + es : "" + } + ], + 'nomeClassesUnicoSimbolo' : [ + { + pt : "(Opcional) Item que será utilizado para obter os nomes das classes", + en : "", + es : "" + } + ], + 'aplicar' : [ + { + pt : "aplicar", + en : "", + es : "" + } + ], + 'symbolscale' : [ + { + pt : "Denominador da escala na qual o símbolo será apresentado com o tamanho definido. Esse parâmetro funciona em conjunto com MAXSCALE e MINSCALE e é válido para a camada como um todo e não para cada estilo (afeta pontos)", + en : "", + es : "" + } + ], + 'minsize' : [ + { + pt : "Menor tamanho (pixels), que os símbolos serão desenhados, quando a escala de desenho de símbolos estiver ativo", + en : "", + es : "" + } + ], + 'maxsize' : [ + { + pt : "Maior tamanho (pixels), que os símbolos serão desenhados, quando a escala de desenho de símbolos estiver ativo", + en : "", + es : "" + } + ], + "editorExp" : [ + { + pt : "Editor de expressão", + en : "", + es : "" + } + ], + "offsetx" : [ + { + pt : "Deslocamento em X com relação ao ponto de inserção de símbolo", + en : "", + es : "" + } + ], + "offsety" : [ + { + pt : "Deslocamento em Y com relação ao ponto de inserção de símbolo", + en : "", + es : "" + } + ], + "metade" : [ + { + pt : "Metade", + en : "", + es : "" + } + ], + "duasmetades" : [ + { + pt : "Classifica os dados em duas classes, a primeira concentra os registros que somados correspondem à primeira metade do total e a segunda classe corresponde à segunda metade", + en : "", + es : "" + } + ], + "iunico" : [ + { + pt : "Coluna que identifica cada registro de forma única", + en : "", + es : "" + } + ], + "media" : [ + { + pt : "Média", + en : "", + es : "" + } + ], + "duasmedias" : [ + { + pt : "Classifica os dados em duas classes, a primeira concentra os registros que estão abaixo da média e a segunda aqueles que são iguais ou superiores a média", + en : "", + es : "" + } + ], + "cluster" : [ + { + pt : "Cluster", + en : "", + es : "" + } + ], + "ClusterMaxdistance" : [ + { + pt : "Distância (pixels) máxima entre os pontos que será considerada para permitir o agrupamento", + en : "", + es : "" + } + ], + "ClusterBuffer" : [ + { + pt : "Distância em pixel, no entorno da extensão geográfica do mapa ou dos tiles, se for o caso, que extende a área de pesuisa dos pontos para formação do agrupamento", + en : "", + es : "" + } + ], + "ClusterFilter" : [ + { + pt : "Filtro que será aplicado para restringir os pontos que podem participar do agrupamento. A sintaxe do filtro é a mesma utilizada na definição das expressões que definem cada classe (ver o editor de classes)", + en : "", + es : "" + } + ], + "ClusterRegion" : [ + { + pt : "Tipo de forma que será utilizada na definição da região de busca dos pontos que formarão o agrupamento", + en : "", + es : "" + } + ], + "ClusterGroup" : [ + { + pt : "Item que será utilizado para separar os diferentes agrupamentos", + en : "", + es : "" + } + ], + "remover" : [ + { + pt : "Remover", + en : "", + es : "" + } + ], + "legendaImg" : [ + { + pt : "Imagem que será utilizada no lugar da montagem automática da legenda", + en : "", + es : "" + } + ], + "offsite" : [ + { + pt : "Cor, em imagens, que será considerada como NODATA e renderizada como transparente (RGB separado por vírgulas)", + en : "", + es : "" + } + ], + 'autoClasses' : [ { + pt : "É possível a geração de classes automaticamente por meio da definição de colunas na tabela de atributos do tema que armazenam as informações sobre cor, tamanho, etc.", + en : "", + es : "" + } ], + 'classesitem' : [ { + pt : "Qual a coluna da tabela que identifica unicamente cada classe. Para cada valor será criada uma classe. O tema que utiliza a geração de classes de forma automática, deve ter definido apenas uma classe. Essa classe será utilizada como padrão para geração das demais.", + en : "", + es : "" + } ], + 'classesnome' : [ { + pt : "Nome da coluna que será utilizada para compor o nome das classes geradas automaticamente.", + en : "", + es : "" + } ], + 'classescor' : [ { + pt : "Nome da coluna que definirá a cor do símbolo utilizado em cada classe. As cores devem ser definidas em RGB.", + en : "", + es : "" + } ], + 'classessimbolo' : [ { + pt : "Nome da coluna que definirá o símbolo utilizado em cada classe.", + en : "", + es : "" + } ], + 'classestamanho' : [ { + pt : "Nome da coluna que definirá o tamanho de cada símbolo.", + en : "", + es : "" + } ], + 'palletefile' : [ { + pt : "Palete de cores. Endereço do arquivo no servidor (opcional)", + en : "", + es : "" + } ], + 'palletestep' : [ { + pt : "Quantas cores em cada nível da palete (opcional)", + en : "", + es : "" + } ], + "colunasTxt" : [ { + pt : "Itens disponíveis", + en : "", + es : "" + } ] + }; diff --git a/ferramentas/legendax/exec.php b/ferramentas/legendax/exec.php new file mode 100755 index 0000000..f48a1b5 --- /dev/null +++ b/ferramentas/legendax/exec.php @@ -0,0 +1,173 @@ +getlayerbyname($tema); + $retorno = array(); + $retorno["classesitem"] = $layer->getmetadata("classesitem"); + $retorno["classesnome"] = $layer->getmetadata("classesnome"); + $retorno["classescor"] = $layer->getmetadata("classescor"); + $retorno["classessimbolo"] = $layer->getmetadata("classessimbolo"); + $retorno["classestamanho"] = $layer->getmetadata("classestamanho"); + $retorno["palletefile"] = $layer->getmetadata("palletefile"); + $retorno["palletestep"] = $layer->getmetadata("palletestep"); + $sopen = $layer->open(); + if($sopen != MS_FAILURE){ + $items = $layer->getItems(); + } + else{ + $items = array(); + } + $retorno["colunas"] = implode(",",$items); + break; + case "SALVAPARAMETROSAUTO": + $map = ms_newMapObj($map_file); + $layer = $map->getlayerbyname($tema); + $layer->setmetadata("classesitem",$_GET["classesitem"]); + $layer->setmetadata("classesnome",$_GET["classesnome"]); + $layer->setmetadata("classescor",$_GET["classescor"]); + $layer->setmetadata("classessimbolo",$_GET["classessimbolo"]); + $layer->setmetadata("classestamanho",$_GET["classestamanho"]); + $layer->setmetadata("palletefile",$_GET["palletefile"]); + $layer->setmetadata("palletestep",$_GET["palletestep"]); + $map->save($map_file); + $retorno = "ok"; + break; +/* +Valor: TEMA2SLD + +Mostra na tela o SLD de um tema + +sld> +*/ + case "TEMA2SLD": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $sld = $m->sld(); + echo header('Content-Disposition: attachment; filename="'.$tema.'.sld"'); + echo header("Content-type: application/xml"); + echo $m->sld(); + exit; + break; +/* +function: ADICIONALABELCLASSE + +Adiciona LABEL em uma classe de um layer + +adicionaLabel> +*/ + case "ADICIONALABELCLASSE": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $l = $m->mapa->getlayerbyname($tema); + if(empty($item)) + {$retorno = "erro";} + else{ + //$l->set("labelitem",$item); + $novac = $l->getclass($_GET["classe"]); + $m->adicionaLabel($novac,$_GET["wrap"],$_GET["fonte"],$_GET["tamanho"],$_GET["angulo"],$_GET["fundo"],$_GET["sombra"],$_GET["cor"],$_GET["outlinecolor"],$_GET["shadowcolor"],$_GET["shadowsizex"],$_GET["shadowsizey"],$_GET["force"],$_GET["mindistance"],$_GET["minfeaturesize"],$_GET["offsetx"],$_GET["offsety"],$_GET["partials"],$_GET["position"],"[".$_GET["item"]."]"); + $m->salva(); + $retorno = "ok"; + } + break; +/* +function: REMOVELABELCLASSE + +Remove LABEL em uma classe de um layer +*/ + case "REMOVELABELCLASSE": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $m->removeLabel($_GET["classe"]); + $m->salva(); + $retorno = "ok"; + break; +/* +Valor: EDITALEGENDA + +Cria elementos para construir uma legenda no formato de tabela em HTML. + +tabelaLegenda> +*/ + case "EDITALEGENDA": + include_once(dirname(__FILE__)."/../../classesphp/classe_legenda.php"); + $m = new Legenda($map_file,$locaplic,$tema); + $r = $m->tabelaLegenda(); + if (!$r){$r = "erro.Erro legenda nao disponivel";} + $retorno = $r; + break; +/* +Valor: CONTAGEMCLASSE + +Acrescenta a contagem de elementos em cada classe. + +tabelaLegenda> +*/ + case "CONTAGEMCLASSE": + //apresenta erro com palavras acentuadas + include_once(dirname(__FILE__)."/../../classesphp/classe_legenda.php"); + $m = new Legenda($map_file,$locaplic,$tema); + $r = $m->tabelaLegenda("sim"); + $m->salva(); + if (!$r){$r = "erro.Erro legenda nao disponivel";} + $retorno = $r; + break; + /* + Valor: APLICATODASCLASSES + + Aplica um parametro a todas as classes + */ + case "APLICATODASCLASSES": + include_once(dirname(__FILE__)."/../../classesphp/classe_legenda.php"); + $m = new Legenda($map_file,$locaplic,$tema); + $r = $m->aplicaTodasClasses($_GET["parametro"],$_GET["valor"]); + $m->salva(); + if (!$r){$r = "erro.Erro legenda nao disponivel";} + $retorno = $r; + break; + case "APLICARCLUSTER": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $l = $m->mapa->getlayerbyname($tema); + if($filter != ""){ + //$filter = base64decode($filter); + } + $m->criaCluster($_GET["group"],$_GET["filter"],$_GET["maxdistance"],$_GET["region"],$_GET["buffer"]); + $m->salva(); + $retorno = "ok"; + break; + case "REMOVERCLUSTER": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $l = $m->mapa->getlayerbyname($tema); + $m->removeCluster(); + $m->salva(); + $retorno = "ok"; + break; + case "APLICALEGENDAIMG": + include_once(dirname(__FILE__)."/../../classesphp/classe_legenda.php"); + $m = new Legenda($map_file,$locaplic,$tema); + $m->aplicaLegendaImg($_GET["imagem"]); + $m->salva(); + $retorno = "ok"; + break; + case "APLICAOFFSITE": + include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php"); + $m = new Temas($map_file,$tema); + $m->mudaOffsite($_GET["offsite"]); + $m->salva(); + $retorno = "ok"; + break; +} +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); +} +cpjson($retorno); +?> \ No newline at end of file diff --git a/ferramentas/legendax/index.js b/ferramentas/legendax/index.js new file mode 100755 index 0000000..0d8b2ec --- /dev/null +++ b/ferramentas/legendax/index.js @@ -0,0 +1,2511 @@ +/* + 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 + + Veja: + + + + Arquivo: + + i3geo/ferramentas/legenda/index.js.php + + Licenca: + + GPL2 + + 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 + + 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. + */ + +if (typeof (i3GEOF) === 'undefined') { + var i3GEOF = {}; +} +/* + * Classe: i3GEOF.legenda + */ +// incuir opcao para inserir o nome de uma imagem da 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 : "", + /** + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php + */ + MUSTACHE : "", + /** + * Funcao do usuario que e executada apos iniciar a ferramenta + */ + aposIniciar : function(){ + + }, + /** + * Susbtitutos para o template + */ + mustacheHash : function() { + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.legenda.dicionario); + dicionario["locaplic"] = i3GEO.configura.locaplic; + dicionario["asp"] = '"'; + dicionario["aplicar"] = $trad("p14"); + return dicionario; + }, + /* + * Function: inicia + * + * Inicia a ferramenta. É chamado por criaJanelaFlutuante + * + * Parametro: + * + * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta + */ + inicia : function(iddiv) { + if(i3GEOF.legenda.MUSTACHE == ""){ + $.get(i3GEO.configura.locaplic + "/ferramentas/legenda/template_mst.html", function(template) { + i3GEOF.legenda.MUSTACHE = template; + i3GEOF.legenda.inicia(iddiv); + }); + return; + } + if (!$i("i3GEOFlegendaComboCabecaSel")) { + i3GEO.janela.comboCabecalhoTemasBs("i3GEOFlegendaComboCabeca", "i3GEOFlegendaComboCabecaSel", "legenda", "ligados",function(evt){ + var botao = evt.target; + if (botao) { + if (botao.value != "") { + i3GEO.mapa.ativaTema(botao.value); + i3GEOF.legenda.tema = botao.value; + $i(iddiv).innerHTML = ""; + i3GEOF.legenda.inicia(iddiv); + } else { + $i(iddiv).innerHTML = ""; + } + } + }); + } + if (i3GEO.temaAtivo === "") { + $i(iddiv).innerHTML = ""; + return; + } + try { + $i(iddiv).innerHTML += i3GEOF.legenda.html(); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); + // eventos das guias + $i("i3GEOlegendaguia8").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia8", "i3GEOlegendaguia"); + i3GEOF.legenda.parametrosAuto(); + }; + $i("i3GEOlegendaguia7").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia7", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia6").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia1").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEOF.legenda.mostralegenda(); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia2").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2", "i3GEOlegendaguia"); + }; + $i("i3GEOlegendaguia3").onclick = function() { + i3GEO.janela.tempoMsg($trad('ajuda', i3GEOF.legenda.dicionario)); + }; + $i("i3GEOlegendaguia4").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEOF.legenda.mostraGrafico(); + }; + $i("i3GEOlegendaguia5").onclick = function() { + i3GEOF.legenda.ativaAplicar("none"); + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia"); + }; + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoImagemLegenda", { + onclick : { + fn : i3GEOF.legenda.aplicarLegendaImg + } + }); + b.addClass("rodar100"); + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoOffsite", { + onclick : { + fn : i3GEOF.legenda.aplicarOffsite + } + }); + b.addClass("rodar100"); + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoAplicarCluster", { + onclick : { + fn : i3GEOF.legenda.aplicarCluster + } + }); + b.addClass("rodar"); + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoRemoverCluster", { + onclick : { + fn : i3GEOF.legenda.removerCluster + } + }); + b.addClass("rodar"); + + var b = new YAHOO.widget.Button("i3GEOlegendabotaoAplicarAuto", { + onclick : { + fn : i3GEOF.legenda.salvaParametrosAuto + } + }); + b.addClass("rodar"); + + var b = new YAHOO.widget.Button("i3GEOlegendabotao1", { + onclick : { + fn : i3GEOF.legenda.mudaLegenda + } + }); + b.addClass("rodar150"); + b = new YAHOO.widget.Button("i3GEOlegendabotao2", { + onclick : { + fn : i3GEOF.legenda.adicionaClasse + } + }); + b.addClass("rodar150"); + b = new YAHOO.widget.Button("i3GEOlegendabotao3", { + onclick : { + fn : i3GEOF.legenda.adicionaConta + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotao15", { + onclick : { + fn : i3GEOF.legenda.adicionaOpacidade + } + }); + b.addClass("rodar"); + + b = new YAHOO.widget.Button("i3GEOlegendabotaoRamp", { + onclick : { + fn : function() { + var tabela = $i("i3GEOlegendalegenda"); + var trs = tabela.getElementsByTagName("tr"); + var ncores = trs.length - 1; + // $i("i3geo_janelaCorRampComboCabecaSel").value = i3GEOF.legenda.tema; + i3GEO.util.abreColourRamp("", "listaColourRamp", ncores, i3GEOF.legenda.tema); + } + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotao4", { + onclick : { + fn : i3GEOF.legenda.paleta + } + }); + b.addClass("rodar100"); + b = new YAHOO.widget.Button("i3GEOlegendabotao5", { + onclick : { + fn : i3GEOF.legenda.simbU + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotao6", { + onclick : { + fn : i3GEOF.legenda.valorU + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotaoMetade", { + onclick : { + fn : i3GEOF.legenda.metade + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotaoMedia", { + onclick : { + fn : i3GEOF.legenda.media + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotao7", { + onclick : { + fn : i3GEOF.legenda.representacao + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotao8", { + onclick : { + fn : i3GEOF.legenda.valorC + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotao9", { + onclick : { + fn : i3GEOF.legenda.valorQ + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotaoQuantil", { + onclick : { + fn : i3GEOF.legenda.valorQu + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotaoQN", { + onclick : { + fn : i3GEOF.legenda.valorQN + } + }); + b.addClass("rodar"); + + b = new YAHOO.widget.Button("i3GEOlegendabotao17", { + onclick : { + fn : i3GEOF.legenda.alteraGeometriaTema + } + }); + b.addClass("rodar"); + b = + 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); + } + } + }); + b.addClass("rodar"); + b = new YAHOO.widget.Button("i3GEOlegendabotaoSLDi", { + onclick : { + fn : function() { + i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema); + } + } + }); + b.addClass("rodar"); + + b = + new YAHOO.widget.Button("i3GEOlegendabotaoIncluirLabel", { + onclick : { + fn : function() { + var par, p, temp, cp; + try { + par = i3GEOF.proplabel.pegaPar(); + i3GEOF.legenda.parDefault = par; + } catch (e) { + par = i3GEOF.legenda.parDefault; + } + 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); + } + } + }); + b.addClass("rodar100"); + b = + 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); + } + } + }); + b.addClass("rodar100"); + b = + 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); + } + } + }); + b.addClass("abrir100"); + i3GEOF.legenda.ativaFoco(); + i3GEOF.legenda.mostralegenda(); + i3GEOF.legenda.montaCombosItens(); + var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema); + if (objTema.classe && objTema.classe.toLowerCase() == "nao") { + $i("i3GEOFlegendamostra").checked = false; + } + if(objTema.legendaimg){ + $i("i3GEOlegendaImg").value = objTema.legendaimg; + } + if(objTema.offsite){ + $i("i3GEOoffsite").value = objTema.offsite; + } + $i("i3GEOFlegendamostra").onclick = function() { + i3GEO.tema.invertestatuslegenda(i3GEOF.legenda.tema); + }; + i3GEO.util.aplicaAquarela("i3GEOF.legenda_corpo"); + i3GEOF.legenda.aposIniciar.call(); + } catch (erro) { + i3GEO.janela.tempoMsg(erro); + i3GEOF.legenda.aposIniciar = function(){}; + } + i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda"); + }, + /* + * 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 = Mustache.render(i3GEOF.legenda.MUSTACHE, i3GEOF.legenda.mustacheHash()); + 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"); + i3GEOF.legenda.ativaAplicar("none"); + }; + // cria a janela flutuante + titulo = + "
    " + + "
    ------
    " + + "
    " + + $trad("t33") + +""; + janela = i3GEO.janela.cria( + "590px", + "350px", + "", + "", + "", + titulo, + "i3GEOF.legenda", + false, + "hd", + cabecalho, + minimiza, + function() {i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");}, + true + ); + + divid = janela[2].id; + i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style; + $i("i3GEOF.legenda_corpo").style.backgroundColor = "white"; + i3GEOF.legenda.inicia(divid); + }, + /* + * Function: ativaFoco + * + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado + */ + ativaFoco : function() { + + }, + ativaAplicar : function(tipo) { + var b = $i("i3GEOlegendabotao10"); + if (b) { + b.style.display = tipo; + } else { + YAHOO.i3GEO.janela.manager.find("i3GEOF.legenda").setFooter( + ''); + b = new YAHOO.widget.Button("i3GEOlegendabotao10", { + onclick : { + fn : i3GEOF.legenda.aplicaEstilo + } + }); + b.addClass("rodar"); + $i("i3GEOlegendabotao10-button").style.width = "100%"; + $i("i3GEOlegendabotao10").style.width = "100%"; + $i("i3GEOlegendabotao10").style.display = tipo; + } + }, + /* + * Function: aposAlterarLegenda + * + * Função executada após ocorrer alguma alteração efetiva da legenda do mapa + */ + aposAlterarLegenda : function() { + i3GEO.arvoreDeCamadas.CAMADAS = []; + 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; + } + 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 + * + * 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 b, ins, i, ajuda, id, re, exp, n, filtro; + // 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(""); + + filtro = + ""; + + 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_exp" + id, $trad( + 'digitaNovaExpressao', + i3GEOF.legenda.dicionario), 25, exp, "expressao", "javascript:i3GEOF.legenda.aviso()") + + "" + filtro + "" + $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; + b = new YAHOO.widget.Button("i3GEOlegendabotao16", { + onclick : { + fn : i3GEOF.legenda.aplicaProcessos + } + }); + b.addClass("rodar"); + } + } 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"; + } + }, + filtro : function(idRetorno) { + i3GEO.tema.dialogo.filtro(i3GEOF.legenda.tema, true, idRetorno); + }, + /* + * 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); + }; + } + 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); + }, + aplicarLegendaImg : function() { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente + var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema); + objTema.legendaimg = $i("i3GEOlegendaImg").value; + + i3GEOF.legenda.aguarde.visibility = "visible"; + var retorna = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); + }; + var p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=aplicaLegendaImg" + + "&tema=" + + i3GEOF.legenda.tema + + "&imagem=" + + objTema.legendaimg, + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", retorna); + }, + aplicarOffsite : function() { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente + var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema); + objTema.offsite = $i("i3GEOoffsite").value; + + i3GEOF.legenda.aguarde.visibility = "visible"; + var retorna = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.mostralegenda(); + }; + var p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=aplicaOffsite" + + "&tema=" + + i3GEOF.legenda.tema + + "&offsite=" + + objTema.offsite, + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", retorna); + }, + /* + * 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"), 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=nao" + + "&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=" + ids + + "&nomes=" + //+ i3GEO.util.base64encode(nomes) + + nomes + + "&exps=" + //+ i3GEO.util.base64encode(exps) + + 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; + } + 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() { + 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() { + 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() { + 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: ordenaClasses + * + * Ordena as classes pelo nome + * + */ + ordenaClasses : 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=ordenaClasses&tema=" + + i3GEOF.legenda.tema; + cp.set_response_type("JSON"); + cp.call(p, "foo", 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() { + 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"; + i3GEOF.legenda.ativaAplicar("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; + } + 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"; + }; + 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("i3GEOlegendaitensValorUnico").getElementsByTagName("select")[0].value, itemNome = + $i("i3GEOlegendaClassesValorUnico").getElementsByTagName("select")[0].value, p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=alteraclasse&tema=" + + i3GEOF.legenda.tema + + "&item=" + + item + + "&itemNome=" + + itemNome + + "&opcao=valorunico" + + "&ignorar=" + + $i("i3GEOlegendaignorar").value, cp = new cpaint(), fim = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; + if ($i("i3GEOFlegendaaplicaextent").checked === true) { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + } else { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); + } + + 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: 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("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].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; + } + if ($i("i3GEOFlegendaaplicaextent").checked === true) { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + } else { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); + } + 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: metade + * + * Duas classes concentrando a soma das metades + * + * Veja: + * + * + */ + metade : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaitensMetade").getElementsByTagName("select")[0].value, + itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value, + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=alteraclasse" + + "&tema=" + + i3GEOF.legenda.tema + + "&item=" + + item + + "&itemid=" + + itemid + + "&opcao=metade&ignorar=" + + $i("i3GEOlegendaignorar").value, + cp = new cpaint(), + fim = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; + if (item == "") { + i3GEO.janela.tempoMsg("Selecione um item!"); + return; + } + if (itemid == "") { + i3GEO.janela.tempoMsg("Selecione um item!"); + return; + } + if ($i("i3GEOFlegendaaplicaextent").checked === true) { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + } else { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); + } + 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: media + * + * Duas classes considerando a media + * + * Veja: + * + * + */ + media : function() { + try { + if (i3GEOF.legenda.aguarde.visibility === "visible") { + return; + } + var item = $i("i3GEOlegendaitensMedia").getElementsByTagName("select")[0].value, + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=alteraclasse" + + "&tema=" + + i3GEOF.legenda.tema + + "&item=" + + item + + "&opcao=media&ignorar=" + + $i("i3GEOlegendaignorar").value, + cp = new cpaint(), + fim = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.aguarde.visibility = "hidden"; + }; + if (item == "") { + i3GEO.janela.tempoMsg("Selecione um item!"); + return; + } + if ($i("i3GEOFlegendaaplicaextent").checked === true) { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); + } else { + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal); + } + 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("i3GEOlegendaitensValorQuartil").getElementsByTagName("select")[0].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: 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("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].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: 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("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].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 b, 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)
    "; + b = + 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"; + } + } + } + }); + b.addClass("rodar100"); + b = + 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"; + } + } + } + }); + b.addClass("rodar100"); + b = + 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"; + } + } + } + }); + b.addClass("rodar100"); + b = + 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"; + } + } + } + }); + b.addClass("rodar100"); + 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"; + } + }, + /* + * 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('corFrente', i3GEOF.legenda.dicionario) + + ":

    " + + "
    " + + "
    " + + "" + + "
    " + + + "
    " + + "

    " + + $trad('corFundo', 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('symbolscale', i3GEOF.legenda.dicionario) + + ":

    " + + "
    " + + "
    " + + "" + + "
    " + + + "
    " + + "

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

    " + + "
    " + + "
    " + + "" + + "
    " + + + "
    " + + "

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

    " + + "
    " + + "
    " + + "" + + "
    " + + + "
    " + + "

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

    " + + "
    " + + "
    " + + "" + + "
    " + + + "
    " + + "

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

    " + + "
    " + + "
    " + + "" + + "
    " + + + "
    " + + "

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

    " + + "
    " + + "
    " + + "" + + "
    "; + + $i("i3GEOlegendaParametrosEstilos").innerHTML = d; + //preenche as listas de itens + i3GEO.util.comboItens("", i3GEOF.legenda.tema, function(retorno) { + if ($i("i3GEOlegendaComboSize")) { + $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'"); + } + }); + + i3GEO.util.aplicaAquarela("i3GEOlegendaParametrosEstilos"); + 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; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var i, p, cp, fim, 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, symbolscale = + $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize = + $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value; + if (symbolscale != "") { + symbolscale = parseInt(symbolscale, 10); + } else { + symbolscale = -1; + } + 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 + + "&symbolscale=" + + symbolscale + + "&minsize=" + + minsize + + "&maxsize=" + + maxsize + + "&offsetx=" + + offsetx + + "&offsety=" + + offsety; + 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"; + } + }, + /* + * 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 b, 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; + } + i3GEOF.legenda.aguarde.visibility = "hidden"; + + b = 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"); + } + } + }); + b.addClass("abrir"); + }, 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 + } + }; + 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 < ipt.length; i++) { + if (ipt[i].value != "") { + lista.push(ipt[i].value); + } + } + } + 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"; + } + }, + /* + * Function: adicionaProcesso + * + * Adiciona um novo processo na lista de processos + */ + adicionaProcesso : function(s) { + $i("i3GEOlegendaprocessos").innerHTML += $inputText("", "", "", "", 50, s.value); + }, + aplicaTodasClasses : function(parametro, id) { + var valor = $i(id).value; + i3GEO.janela.confirma("Aplica " + parametro + " = " + valor + " ?", 300, $trad("x14"), "", function() { + var temp = function() { + // i3GEOF.legenda.mostralegenda(); + i3GEOF.legenda.aposAlterarLegenda(); + }, p, cp; + p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=aplicaTodasClasses" + + "¶metro=" + + parametro + + "&valor=" + + valor + + "&tema=" + + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", temp); + }); + }, + aplicarCluster : function(){ + var temp = function() { + i3GEOF.legenda.aposAlterarLegenda(); + i3GEOF.legenda.montaCombosItens(); + }, p, cp; + p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=aplicarCluster" + + "&maxdistance=" + + $i("i3GEOlegendaClusterMaxdistance").value + + "&buffer=" + + $i("i3GEOlegendaClusterBuffer").value + + "&filter=" + //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value) + + $i("i3GEOlegendaClusterFilter").value + + "®ion=" + + $i("i3GEOlegendaClusterRegion").value + + "&group=" + + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value + + "&tema=" + + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", temp); + }, + removerCluster : function(){ + var temp = function() { + i3GEOF.legenda.montaCombosItens(); + i3GEOF.legenda.aposAlterarLegenda(); + }, p, cp; + p = + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid=" + + i3GEO.configura.sid + + "&funcao=removerCluster" + + "&tema=" + + i3GEOF.legenda.tema; + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p, "foo", temp); + }, + montaCombosItens : function(){ + i3GEO.util.comboItens("", i3GEOF.legenda.tema, function(retorno) { + if ($i("i3GEOlegendaitensValorUnico")) { + $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaClassesValorUnico")) { + $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensMetade")) { + $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensMetadeId")) { + $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensMedia")) { + $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensValorClass")) { + $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensCluster")) { + $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados; + } + if ($i("i3GEOlegendaitensValorQuartil")) { + $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados; + } + }); + }, + parametrosAuto : function() { + i3GEOF.legenda.aguarde.visibility = "visible"; + var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=parametrosauto&tema=" + i3GEOF.legenda.tema, + cp = new cpaint(), + temp = function(retorno){ + try{ + if(retorno.data !== ""){ + $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas; + $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem; + $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome; + $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor; + $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo; + $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho; + $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile; + $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep; + } + i3GEOF.legenda.aguarde.visibility = "hidden"; + }catch(e){ + i3GEO.janela.tempoMsg("Erro. "+e); + i3GEOF.legenda.aguarde.visibility = "hidden"; + } + }; + cp.set_response_type("JSON"); + cp.call(p,"foo",temp); + }, + salvaParametrosAuto: function(){ + if(i3GEOF.legenda.aguarde.visibility === "visible"){ + return; + } + i3GEOF.legenda.aguarde.visibility = "visible"; + var temp, + p, + cp; + temp = function(){ + i3GEOF.legenda.aguarde.visibility = "hidden"; + i3GEOF.legenda.aposAlterarLegenda(); + }; + p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=salvaparametrosauto&tema=" + i3GEOF.legenda.tema + + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value + + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value + + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value + + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value + + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value + + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value + + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value; + + cp = new cpaint(); + cp.set_response_type("JSON"); + cp.call(p,"foo",temp); + } + }; \ No newline at end of file diff --git a/ferramentas/legendax/template_mst.html b/ferramentas/legendax/template_mst.html new file mode 100755 index 0000000..b794709 --- /dev/null +++ b/ferramentas/legendax/template_mst.html @@ -0,0 +1,411 @@ +

    +
    +
    +

    {{{colunasTxt}}}:

    +
    +
    +
    +

    {{{autoClasses}}}

    +
    +

    {{{classesitem}}}:

    +
    + +
    +
    +

    {{{classesnome}}}:

    +
    + +
    +
    +

    {{{classescor}}}:

    +
    + +
    +
    +

    {{{classessimbolo}}}:

    +
    + +
    +
    +

    {{{classestamanho}}}:

    +
    + +
    +
    +

    {{{palletefile}}}:

    +
    + +
    +
    +

    {{{palletestep}}}:

    +
    + +
    +
    +

    + +

    +
    +
    +
    +

    {{{ClusterMaxdistance}}}:

    +
    + +
    +
    +

    {{{ClusterBuffer}}}:

    +
    + +
    +
    +

    {{{ClusterFilter}}}:

    +
    + +
    +
    +

    {{{ClusterRegion}}}

    +
    + +
    +
    +

    {{{ClusterGroup}}}

    +
    +
    +

    + +

    +
    +

    + +

    +
    +
    +

    +   + + {{{mostraClassesLegenda}}} +

    +
    +

    {{{legendaImg}}}

    + + + + + +
    +
    + +
    +
    + +
    +
    +

    {{{offsite}}}

    + + + + + +
    +
    + +
    +
    + +
    +
    +

    + +

    +

    + +

    +

    + +

    +
    +

    {{{geraCores}}}

    + + + + + + + + +
    {{{de}}}: +
    + +
    +
    {{{ate}}}: +
    + +
    +
    + +
    +
    +
    +
    +
    + + + + + +
    +

    + +

    +
    +

    + +

    +
    +
    +

    {{{clicaSimbolo}}}

    +
    +
    +
    +
    +
    +
    +
    +

    +   + + {{{consideraElementosVisisveis}}} +

    +

    {{{ignoraValores}}}:

    +
    + +
    +
    +
    +
    + {{{alteraGeom}}} +

    {{{transformaGeom}}}

    +
    + +
    +
    +

    + +

    +
    +
    +
    + {{{alteraTipo}}} +

    {{{alteraTipoGeom}}}

    +

    + +

    +
    +
    +
    +
    + {{{simboloUnico}}} +

    {{{todosElementosUnicoSimbolo}}}

    +

    + +

    +
    +
    +
    + {{{valorUnico}}} +

    {{{cadaOcorrenciaUnicoSimbolo}}}

    +
    +
    +

    {{{nomeClassesUnicoSimbolo}}}

    +
    +
    +

    + +

    +
    +
    +
    + {{{classes}}} +

    {{{criaClassesItemNumerico}}}

    +
    +
    +

    {{{numeroClasses}}}:

    +
    + +
    +
    +

    + +

    +

    + +

    +

    + +

    +
    +
    +
    + {{{metade}}} +

    {{{duasmetades}}}

    +
    +
    +

    {{{iunico}}}

    +
    +
    +

    + +

    +
    +
    +
    + {{{media}}} +

    {{{duasmedias}}}

    +
    +
    +

    + +

    +
    +
    +
    + {{{calcularQuartil}}} +

    {{{criaQuartis}}}

    +
    +
    +

    + +

    +

    {{{estiloNomeClasses}}}: +

    + +
    +
    +
    +
    +
    +
    +
    + {{{etiquetasClasse}}} +

    {{{itemComTexto}}}:

    +
    +
    +

    + + + +

    +
    +
    +
    + {{{estilos}}} +

    {{{ajudaEstilo}}} +

    +
    + +   + +   + +   + +
    +

    + +
    +
    +
    +
    +
    +
    +

    + {{{geraSLD}}} + Mapserver SLD + {{{ajudaSLD}}} +

    + +

    +

    {{{msgAplicaSLD}}} +

    + +

    +
    + \ No newline at end of file diff --git a/js/i3geo_tudo_compacto7.js.php b/js/i3geo_tudo_compacto7.js.php old mode 100755 new mode 100644 index f0d5593..f0d5593 --- a/js/i3geo_tudo_compacto7.js.php +++ b/js/i3geo_tudo_compacto7.js.php diff --git a/js/util.js b/js/util.js index f578c62..3ea2838 100755 --- a/js/util.js +++ b/js/util.js @@ -1782,6 +1782,8 @@ i3GEO.util = * {string} sim|nao indica se para os nomes dos itens sera usado o alias (default= sim) * * {string} - estilo CSS em linha + * + * {string} - classe css */ comboItens : function(id, tema, funcao, onde, nome, alias, estilo, classe) { if (typeof (console) !== 'undefined') -- libgit2 0.21.2