Commit 94a815f5a7e879dc473b2763af97fef1403b04c6

Authored by Edmar Moretti
1 parent 454d03b0

Ajuste no overflow das guias principais

ferramentas/animacao/index.js
@@ -35,7 +35,7 @@ i3GEOF.animacao = { @@ -35,7 +35,7 @@ i3GEOF.animacao = {
35 hash["idContainer"] = p.idContainer; 35 hash["idContainer"] = p.idContainer;
36 hash["idlista"] = p.idlista; 36 hash["idlista"] = p.idlista;
37 i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); 37 i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
38 - i3GEO.janela.applyScrollBar(p.idContainer); 38 + //i3GEO.janela.applyScrollBar(p.idContainer);
39 i3GEOF.animacao.listaDeCamadas(); 39 i3GEOF.animacao.listaDeCamadas();
40 }, 40 },
41 listaDeCamadas: function(){ 41 listaDeCamadas: function(){
ferramentas/conectargeojson/index.js
@@ -29,7 +29,7 @@ i3GEOF.conectargeojson = { @@ -29,7 +29,7 @@ i3GEOF.conectargeojson = {
29 }, 29 },
30 destroy: function(){ 30 destroy: function(){
31 //nao use this aqui 31 //nao use this aqui
32 - //i3GEOF.conectargeojson._parameters.mustache = ""; 32 + i3GEOF.conectargeojson.renderFunction.call();
33 }, 33 },
34 html:function() { 34 html:function() {
35 var p = this._parameters, 35 var p = this._parameters,
@@ -38,7 +38,7 @@ i3GEOF.conectargeojson = { @@ -38,7 +38,7 @@ i3GEOF.conectargeojson = {
38 locaplic: i3GEO.configura.locaplic, 38 locaplic: i3GEO.configura.locaplic,
39 namespace: p.namespace, 39 namespace: p.namespace,
40 idContainer: p.idContainer, 40 idContainer: p.idContainer,
41 - botao: $trad("p14"), 41 + botao: $trad("adicmapa"),
42 ...i3GEO.idioma.objetoIdioma(i3f.dicionario) 42 ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
43 }; 43 };
44 i3f.renderFunction.call( 44 i3f.renderFunction.call(
@@ -46,15 +46,16 @@ i3GEOF.conectargeojson = { @@ -46,15 +46,16 @@ i3GEOF.conectargeojson = {
46 { 46 {
47 texto: Mustache.render(p.mustache, hash) 47 texto: Mustache.render(p.mustache, hash)
48 }); 48 });
49 - i3GEO.janela.applyScrollBar(p.idContainer); 49 + //i3GEO.janela.applyScrollBar(p.idContainer);
50 }, 50 },
51 getFormData: function(){ 51 getFormData: function(){
52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
53 return data 53 return data
54 }, 54 },
55 - adiciona: function(btn){ 55 + adiciona: function(formEl){
  56 + var btn = $(formEl).find(":submit");
  57 + btn.prop("disabled",true).find("span").removeClass("hidden");
56 i3GEO.janela.abreAguarde(); 58 i3GEO.janela.abreAguarde();
57 - $(btn).button("disable").find("span").removeClass("hidden");  
58 var par = this.getFormData(), 59 var par = this.getFormData(),
59 i3f = this; 60 i3f = this;
60 par.g_sid = i3GEO.configura.sid; 61 par.g_sid = i3GEO.configura.sid;
@@ -68,7 +69,7 @@ i3GEOF.conectargeojson = { @@ -68,7 +69,7 @@ i3GEOF.conectargeojson = {
68 i3GEO.atualiza(); 69 i3GEO.atualiza();
69 i3GEO.janela.fechaAguarde(); 70 i3GEO.janela.fechaAguarde();
70 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 71 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
71 - $(btn).button("disable").find("span").addClass("hidden"); 72 + btn.prop("disabled",false).find("span").addClass("hidden");
72 i3f.destroy(); 73 i3f.destroy();
73 } 74 }
74 ) 75 )
@@ -76,7 +77,7 @@ i3GEOF.conectargeojson = { @@ -76,7 +77,7 @@ i3GEOF.conectargeojson = {
76 function(data){ 77 function(data){
77 i3GEO.janela.fechaAguarde(); 78 i3GEO.janela.fechaAguarde();
78 i3GEO.janela.snackBar({content: data.status, style:'red'}); 79 i3GEO.janela.snackBar({content: data.status, style:'red'});
79 - $(btn).button("disable").find("span").addClass("hidden"); 80 + btn.prop("disabled",false).find("span").addClass("hidden");
80 i3f.destroy(); 81 i3f.destroy();
81 } 82 }
82 ); 83 );
ferramentas/conectargeojson/template_mst.html
1 <div id='{{idContainer}}' class='container-fluid container-tools'> 1 <div id='{{idContainer}}' class='container-fluid container-tools'>
2 - <form class="form-vertical"> 2 + <form action="#" onsubmit="i3GEOF.{{namespace}}.adiciona(this);return false;" class="form-vertical">
3 <div class='form-group label-fixed condensed'> 3 <div class='form-group label-fixed condensed'>
4 <label class="col-md-12 control-label">{{{inseregeorss}}}</label> 4 <label class="col-md-12 control-label">{{{inseregeorss}}}</label>
5 <div class="col-md-12 "> 5 <div class="col-md-12 ">
6 <input required class="form-control input-lg" type='text' id='{{namespace}}url' name="url" value='' /> 6 <input required class="form-control input-lg" type='text' id='{{namespace}}url' name="url" value='' />
7 </div> 7 </div>
8 </div> 8 </div>
  9 + <button type="submit" class='btn btn-primary btn-sm btn-raised'>
  10 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span> {{{botao}}}
  11 + </button>
9 </form> 12 </form>
10 - <button onclick="i3GEOF.{{namespace}}.adiciona(this)" class='btn btn-primary btn-sm btn-raised'>  
11 - <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span> {{{botao}}}  
12 - </button>  
13 - <br> <br>  
14 </div> 13 </div>
15 \ No newline at end of file 14 \ No newline at end of file
ferramentas/conectargeorss/index.js
@@ -47,7 +47,7 @@ i3GEOF.conectargeorss = { @@ -47,7 +47,7 @@ i3GEOF.conectargeorss = {
47 texto: Mustache.render(p.mustache, hash), 47 texto: Mustache.render(p.mustache, hash),
48 onclose: i3f.destroy 48 onclose: i3f.destroy
49 }); 49 });
50 - i3GEO.janela.applyScrollBar(p.idContainer); 50 + //i3GEO.janela.applyScrollBar(p.idContainer);
51 }, 51 },
52 getFormData: function(){ 52 getFormData: function(){
53 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 53 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
ferramentas/conectarkml/index.js
@@ -46,7 +46,7 @@ i3GEOF.conectarkml = { @@ -46,7 +46,7 @@ i3GEOF.conectarkml = {
46 { 46 {
47 texto: Mustache.render(p.mustache, hash) 47 texto: Mustache.render(p.mustache, hash)
48 }); 48 });
49 - i3GEO.janela.applyScrollBar(p.idContainer); 49 + //i3GEO.janela.applyScrollBar(p.idContainer);
50 }, 50 },
51 getFormData: function(){ 51 getFormData: function(){
52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
ferramentas/conectarwms/index.js
@@ -46,7 +46,7 @@ i3GEOF.conectarwms = { @@ -46,7 +46,7 @@ i3GEOF.conectarwms = {
46 { 46 {
47 texto: Mustache.render(p.mustache, hash) 47 texto: Mustache.render(p.mustache, hash)
48 }); 48 });
49 - i3GEO.janela.applyScrollBar(p.idContainer); 49 + //i3GEO.janela.applyScrollBar(p.idContainer);
50 }, 50 },
51 getFormData: function(){ 51 getFormData: function(){
52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
ferramentas/excluirarvore/index.js
@@ -32,7 +32,7 @@ i3GEOF.excluirarvore = { @@ -32,7 +32,7 @@ i3GEOF.excluirarvore = {
32 i3GEO.janela.formModal({texto: Mustache.render(p.mustache, hash)}); 32 i3GEO.janela.formModal({texto: Mustache.render(p.mustache, hash)});
33 i3GEOF.excluirarvore.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); 33 i3GEOF.excluirarvore.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
34 i3GEOF.excluirarvore.lista(); 34 i3GEOF.excluirarvore.lista();
35 - i3GEO.janela.applyScrollBar(p.idContainer); 35 + //i3GEO.janela.applyScrollBar(p.idContainer);
36 }, 36 },
37 lista: function(){ 37 lista: function(){
38 var camadas = i3GEO.arvoreDeCamadas.CAMADAS, 38 var camadas = i3GEO.arvoreDeCamadas.CAMADAS,
ferramentas/filtroarvore/index.js
@@ -31,7 +31,7 @@ i3GEOF.filtroarvore = { @@ -31,7 +31,7 @@ i3GEOF.filtroarvore = {
31 hash["namespace"] = p.namespace; 31 hash["namespace"] = p.namespace;
32 hash["idContainer"] = p.idContainer; 32 hash["idContainer"] = p.idContainer;
33 i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); 33 i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
34 - i3GEO.janela.applyScrollBar(p.idContainer); 34 + //i3GEO.janela.applyScrollBar(p.idContainer);
35 $('#' + p.idContainer + ' button[name="' + i3GEO.arvoreDeCamadas.FILTRO + '"]').button('toggle'); 35 $('#' + p.idContainer + ' button[name="' + i3GEO.arvoreDeCamadas.FILTRO + '"]').button('toggle');
36 }, 36 },
37 filtrar: function(filtro){ 37 filtrar: function(filtro){
ferramentas/imprimir/index.js
@@ -31,7 +31,7 @@ i3GEOF.imprimir = { @@ -31,7 +31,7 @@ i3GEOF.imprimir = {
31 hash["namespace"] = p.namespace; 31 hash["namespace"] = p.namespace;
32 hash["idContainer"] = p.idContainer; 32 hash["idContainer"] = p.idContainer;
33 i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); 33 i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
34 - i3GEO.janela.applyScrollBar(p.idContainer); 34 + //i3GEO.janela.applyScrollBar(p.idContainer);
35 }, 35 },
36 pngExport: function(){ 36 pngExport: function(){
37 i3GEO.janela.abreAguarde(); 37 i3GEO.janela.abreAguarde();
ferramentas/legenda/index.js
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 */ 35 */
36 36
37 if (typeof (i3GEOF) === 'undefined') { 37 if (typeof (i3GEOF) === 'undefined') {
38 - var i3GEOF = {}; 38 + var i3GEOF = {};
39 } 39 }
40 /* 40 /*
41 * Classe: i3GEOF.legenda 41 * Classe: i3GEOF.legenda
@@ -43,2010 +43,2010 @@ if (typeof (i3GEOF) === &#39;undefined&#39;) { @@ -43,2010 +43,2010 @@ if (typeof (i3GEOF) === &#39;undefined&#39;) {
43 //incuir opcao para inserir o nome de uma imagem da legenda 43 //incuir opcao para inserir o nome de uma imagem da legenda
44 i3GEOF.legenda = 44 i3GEOF.legenda =
45 { 45 {
46 - /*  
47 - * Variavel: parDefault  
48 - *  
49 - * Parametros padr&atilde;o utilizados para formatar os labels  
50 - */  
51 - 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=",  
52 - /*  
53 - * Variavel: aviso  
54 - *  
55 - * Indica que uma altera&ccedil;&atilde;o ainda n&atilde;o foi salva  
56 - *  
57 - * Type: {boolean}  
58 - */  
59 - aviso : false,  
60 - /*  
61 - * Variavel: tema  
62 - *  
63 - * Tema que ser&aacute; utilizado  
64 - *  
65 - * Type: {string}  
66 - */  
67 - tema : i3GEO.temaAtivo,  
68 - /*  
69 - * Variavel: dadosGrafico  
70 - *  
71 - * Dados utilizados no gr&aacute;fico no formato da ferramenta graficointerativo  
72 - */  
73 - dadosGrafico : "",  
74 - /*  
75 - * Variavel: aguarde  
76 - *  
77 - * Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.  
78 - */  
79 - aguarde : "",  
80 - /*  
81 - * Variavel: estilos  
82 - *  
83 - * Estilos existentes em um s&iacute;mbolo de uma classe  
84 - */  
85 - estilos : "",  
86 - /*  
87 - * Variavel: estilo  
88 - *  
89 - * Ultimo estilo selecionado  
90 - */  
91 - estilo : 0,  
92 - /*  
93 - * Variavel: classe  
94 - *  
95 - * Ultima classe selecionado  
96 - */  
97 - classe : "",  
98 - templateDir : "../ferramentas/legenda",  
99 - /**  
100 - * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php  
101 - */  
102 - MUSTACHE : "",  
103 - MUSTACHELISTA : "",  
104 - MUSTACHEESTILO : "",  
105 - DICIONARIO: "",  
106 - /**  
107 - * Funcao do usuario que e executada apos iniciar a ferramenta  
108 - */  
109 - aposIniciar : function(){ 46 + /*
  47 + * Variavel: parDefault
  48 + *
  49 + * Parametros padr&atilde;o utilizados para formatar os labels
  50 + */
  51 + 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=",
  52 + /*
  53 + * Variavel: aviso
  54 + *
  55 + * Indica que uma altera&ccedil;&atilde;o ainda n&atilde;o foi salva
  56 + *
  57 + * Type: {boolean}
  58 + */
  59 + aviso : false,
  60 + /*
  61 + * Variavel: tema
  62 + *
  63 + * Tema que ser&aacute; utilizado
  64 + *
  65 + * Type: {string}
  66 + */
  67 + tema : i3GEO.temaAtivo,
  68 + /*
  69 + * Variavel: dadosGrafico
  70 + *
  71 + * Dados utilizados no gr&aacute;fico no formato da ferramenta graficointerativo
  72 + */
  73 + dadosGrafico : "",
  74 + /*
  75 + * Variavel: aguarde
  76 + *
  77 + * Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.
  78 + */
  79 + aguarde : "",
  80 + /*
  81 + * Variavel: estilos
  82 + *
  83 + * Estilos existentes em um s&iacute;mbolo de uma classe
  84 + */
  85 + estilos : "",
  86 + /*
  87 + * Variavel: estilo
  88 + *
  89 + * Ultimo estilo selecionado
  90 + */
  91 + estilo : 0,
  92 + /*
  93 + * Variavel: classe
  94 + *
  95 + * Ultima classe selecionado
  96 + */
  97 + classe : "",
  98 + templateDir : "../ferramentas/legenda",
  99 + /**
  100 + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php
  101 + */
  102 + MUSTACHE : "",
  103 + MUSTACHELISTA : "",
  104 + MUSTACHEESTILO : "",
  105 + DICIONARIO: "",
  106 + /**
  107 + * Funcao do usuario que e executada apos iniciar a ferramenta
  108 + */
  109 + aposIniciar : function(){
110 110
111 - },  
112 - /**  
113 - * Susbtitutos para o template  
114 - */  
115 - mustacheHash : function() {  
116 - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.legenda.dicionario);  
117 - dicionario["locaplic"] = i3GEO.configura.locaplic;  
118 - dicionario["asp"] = '"';  
119 - dicionario["aplicar"] = $trad("p14");  
120 - //para reaproveitamento  
121 - i3GEOF.legenda.DICIONARIO = dicionario;  
122 - return dicionario;  
123 - },  
124 - /*  
125 - * Function: inicia  
126 - *  
127 - * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante  
128 - *  
129 - * Parametro:  
130 - *  
131 - * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta  
132 - */  
133 - inicia : function(iddiv) {  
134 - if(i3GEOF.legenda.MUSTACHE == ""){  
135 - var d = i3GEOF.legenda.templateDir;  
136 - var t1 = d + "/template_mst.html",  
137 - t2 = d + "/templateLista_mst.html",  
138 - t3 = d + "/templateFormEstilo_mst.html";  
139 - $.when( $.get(t1),$.get(t2),$.get(t3) ).done(function(r1,r2,r3) {  
140 - i3GEOF.legenda.MUSTACHE = r1[0];  
141 - i3GEOF.legenda.MUSTACHELISTA = r2[0];  
142 - i3GEOF.legenda.MUSTACHEESTILO = r3[0];  
143 - i3GEOF.legenda.inicia(iddiv);  
144 - }).fail(function() {  
145 - i3GEO.janela.closeMsg($trad("erroTpl"));  
146 - return;  
147 - });  
148 - return; 111 + },
  112 + /**
  113 + * Susbtitutos para o template
  114 + */
  115 + mustacheHash : function() {
  116 + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.legenda.dicionario);
  117 + dicionario["locaplic"] = i3GEO.configura.locaplic;
  118 + dicionario["asp"] = '"';
  119 + dicionario["aplicar"] = $trad("p14");
  120 + //para reaproveitamento
  121 + i3GEOF.legenda.DICIONARIO = dicionario;
  122 + return dicionario;
  123 + },
  124 + /*
  125 + * Function: inicia
  126 + *
  127 + * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
  128 + *
  129 + * Parametro:
  130 + *
  131 + * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta
  132 + */
  133 + inicia : function(iddiv) {
  134 + if(i3GEOF.legenda.MUSTACHE == ""){
  135 + var d = i3GEOF.legenda.templateDir;
  136 + var t1 = d + "/template_mst.html",
  137 + t2 = d + "/templateLista_mst.html",
  138 + t3 = d + "/templateFormEstilo_mst.html";
  139 + $.when( $.get(t1),$.get(t2),$.get(t3) ).done(function(r1,r2,r3) {
  140 + i3GEOF.legenda.MUSTACHE = r1[0];
  141 + i3GEOF.legenda.MUSTACHELISTA = r2[0];
  142 + i3GEOF.legenda.MUSTACHEESTILO = r3[0];
  143 + i3GEOF.legenda.inicia(iddiv);
  144 + }).fail(function() {
  145 + i3GEO.janela.closeMsg($trad("erroTpl"));
  146 + return;
  147 + });
  148 + return;
  149 + }
  150 +
  151 + try {
  152 + $i(iddiv).innerHTML = i3GEOF.legenda.html();
  153 + if (!$i("i3GEOFlegendaComboCabecaSel")) {
  154 + i3GEO.janela.comboCabecalhoTemasBs("i3GEOFlegendaComboCabeca", "i3GEOFlegendaComboCabecaSel", "legenda", "ligados",function(evt){
  155 + var botao = evt.target;
  156 + if (botao) {
  157 + if (botao.value != "") {
  158 + i3GEO.mapa.ativaTema(botao.value);
  159 + i3GEOF.legenda.tema = botao.value;
  160 + $i(iddiv).innerHTML = "";
  161 + i3GEOF.legenda.inicia(iddiv);
  162 + } else {
  163 + //$i(iddiv).innerHTML = "";
  164 + }
149 } 165 }
  166 + });
  167 + }
  168 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia");
  169 + // eventos das guias
  170 + $i("i3GEOlegendaguia8").onclick = function() {
  171 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia8", "i3GEOlegendaguia");
  172 + i3GEOF.legenda.parametrosAuto();
  173 + };
  174 + $i("i3GEOlegendaguia7").onclick = function() {
  175 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia7", "i3GEOlegendaguia");
  176 + };
  177 + $i("i3GEOlegendaguia6").onclick = function() {
  178 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia");
  179 + };
  180 + $i("i3GEOlegendaguia1").onclick = function() {
  181 + i3GEOF.legenda.mostralegenda();
  182 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia");
  183 + };
  184 + $i("i3GEOlegendaguia2").onclick = function() {
  185 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2", "i3GEOlegendaguia");
  186 + };
  187 + $i("i3GEOlegendaguia3").onclick = function() {
  188 + i3GEO.janela.tempoMsg($trad('ajuda', i3GEOF.legenda.dicionario));
  189 + };
  190 + $i("i3GEOlegendaguia4").onclick = function() {
  191 + i3GEOF.legenda.mostraGrafico();
  192 + };
  193 + $i("i3GEOlegendaguia5").onclick = function() {
  194 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia");
  195 + };
150 196
151 - try {  
152 - $i(iddiv).innerHTML = i3GEOF.legenda.html();  
153 - if (!$i("i3GEOFlegendaComboCabecaSel")) {  
154 - i3GEO.janela.comboCabecalhoTemasBs("i3GEOFlegendaComboCabeca", "i3GEOFlegendaComboCabecaSel", "legenda", "ligados",function(evt){  
155 - var botao = evt.target;  
156 - if (botao) {  
157 - if (botao.value != "") {  
158 - i3GEO.mapa.ativaTema(botao.value);  
159 - i3GEOF.legenda.tema = botao.value;  
160 - $i(iddiv).innerHTML = "";  
161 - i3GEOF.legenda.inicia(iddiv);  
162 - } else {  
163 - //$i(iddiv).innerHTML = "";  
164 - }  
165 - }  
166 - });  
167 - }  
168 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia");  
169 - // eventos das guias  
170 - $i("i3GEOlegendaguia8").onclick = function() {  
171 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia8", "i3GEOlegendaguia");  
172 - i3GEOF.legenda.parametrosAuto();  
173 - };  
174 - $i("i3GEOlegendaguia7").onclick = function() {  
175 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia7", "i3GEOlegendaguia");  
176 - };  
177 - $i("i3GEOlegendaguia6").onclick = function() {  
178 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia6", "i3GEOlegendaguia");  
179 - };  
180 - $i("i3GEOlegendaguia1").onclick = function() {  
181 - i3GEOF.legenda.mostralegenda();  
182 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia1", "i3GEOlegendaguia");  
183 - };  
184 - $i("i3GEOlegendaguia2").onclick = function() {  
185 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia2", "i3GEOlegendaguia");  
186 - };  
187 - $i("i3GEOlegendaguia3").onclick = function() {  
188 - i3GEO.janela.tempoMsg($trad('ajuda', i3GEOF.legenda.dicionario));  
189 - };  
190 - $i("i3GEOlegendaguia4").onclick = function() {  
191 - i3GEOF.legenda.mostraGrafico();  
192 - };  
193 - $i("i3GEOlegendaguia5").onclick = function() {  
194 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia5", "i3GEOlegendaguia");  
195 - }; 197 + i3GEOF.legenda.ativaFoco();
  198 + i3GEOF.legenda.mostralegenda();
  199 + i3GEOF.legenda.montaCombosItens();
  200 + var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
  201 + if (objTema.classe && objTema.classe.toLowerCase() == "nao") {
  202 + $i("i3GEOFlegendamostra").checked = false;
  203 + }
  204 + if(objTema.legendaimg){
  205 + $i("i3GEOlegendaImg").value = objTema.legendaimg;
  206 + }
  207 + if(objTema.offsite){
  208 + $i("i3GEOoffsite").value = objTema.offsite;
  209 + }
196 210
197 - i3GEOF.legenda.ativaFoco();  
198 - i3GEOF.legenda.mostralegenda();  
199 - i3GEOF.legenda.montaCombosItens();  
200 - var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);  
201 - if (objTema.classe && objTema.classe.toLowerCase() == "nao") {  
202 - $i("i3GEOFlegendamostra").checked = false;  
203 - }  
204 - if(objTema.legendaimg){  
205 - $i("i3GEOlegendaImg").value = objTema.legendaimg;  
206 - }  
207 - if(objTema.offsite){  
208 - $i("i3GEOoffsite").value = objTema.offsite;  
209 - } 211 + i3GEO.util.aplicaAquarela("i3GEOF.legenda_corpo");
  212 + i3GEOF.legenda.aposIniciar.call();
  213 + } catch (erro) {
  214 + i3GEOF.legenda.aposIniciar = function(){};
  215 + }
  216 + i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");
  217 + },
  218 + sldi: function() {
  219 + i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema);
  220 + },
  221 + slde: function() {
  222 + window.open(i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?funcao=tema2sld&tema="
  223 + + i3GEOF.legenda.tema
  224 + + "&g_sid="
  225 + + i3GEO.configura.sid);
  226 + },
  227 + propriedadesLabels: function() {
  228 + i3GEO.util.scriptTag(
  229 + i3GEO.configura.locaplic + "/ferramentas/opcoes_label/dependencias.php",
  230 + "i3GEOF.proplabel.iniciaJanelaFlutuante(false)",
  231 + "i3GEOFproplabel",
  232 + false);
  233 + },
  234 + incluirLabels: function() {
  235 + var par, p, temp, cp;
  236 + try {
  237 + par = i3GEOF.proplabel.pegaPar();
  238 + i3GEOF.legenda.parDefault = par;
  239 + } catch (e) {
  240 + par = i3GEOF.legenda.parDefault;
  241 + }
  242 + i3GEOF.legenda.aguarde.visibility = "visible";
  243 + temp = function() {
  244 + i3GEOF.legenda.aguarde.visibility = "hidden";
  245 + i3GEOF.legenda.aposAlterarLegenda();
  246 + i3GEOF.legenda.aguarde.visibility = "hidden";
  247 + };
  248 + p =
  249 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  250 + + i3GEO.configura.sid
  251 + + "&funcao=adicionaLabelClasse&tema="
  252 + + i3GEOF.legenda.tema
  253 + + "&classe="
  254 + + i3GEOF.legenda.classe
  255 + + par;
  256 + p += "&item=" + $i("i3GEOlegendaSelItemLabel").value;
  257 + cp = new cpaint();
  258 + cp.set_response_type("JSON");
  259 + cp.call(p, "foo", temp);
  260 + },
  261 + excluiLabels: function() {
  262 + var p, temp, cp;
  263 + i3GEOF.legenda.aguarde.visibility = "visible";
  264 + temp = function() {
  265 + i3GEOF.legenda.aguarde.visibility = "hidden";
  266 + i3GEOF.legenda.aposAlterarLegenda();
  267 + i3GEOF.legenda.aguarde.visibility = "hidden";
  268 + };
  269 + p =
  270 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  271 + + i3GEO.configura.sid
  272 + + "&funcao=removeLabelClasse&tema="
  273 + + i3GEOF.legenda.tema
  274 + + "&classe="
  275 + + i3GEOF.legenda.classe;
  276 + cp = new cpaint();
  277 + cp.set_response_type("JSON");
  278 + cp.call(p, "foo", temp);
  279 + },
  280 + janelaCorRamp: function(){
  281 + var tabela = $i("i3GEOlegendalegenda");
  282 + var trs = tabela.getElementsByTagName("tr");
  283 + var ncores = trs.length - 1;
  284 + i3GEO.util.abreColourRamp("", "listaColourRamp", ncores, i3GEOF.legenda.tema);
  285 + },
  286 + /*
  287 + * Function: html
  288 + *
  289 + * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta
  290 + *
  291 + * Retorno:
  292 + *
  293 + * String com o c&oacute;digo html
  294 + */
  295 + html : function() {
  296 + var ins = Mustache.render(i3GEOF.legenda.MUSTACHE, i3GEOF.legenda.mustacheHash());
  297 + return ins;
  298 + },
  299 + /*
  300 + * Function: iniciaJanelaFlutuante
  301 + *
  302 + * Cria a janela flutuante para controle da ferramenta.
  303 + */
  304 + iniciaJanelaFlutuante : function() {
  305 + var minimiza, cabecalho, janela, divid, temp, titulo;
  306 + if ($i("i3GEOF.legenda")) {
  307 + i3GEOF.legenda.tema = i3GEO.temaAtivo;
  308 + i3GEOF.legenda.inicia("i3GEOF.legenda_corpo");
  309 + return;
  310 + }
  311 + cabecalho = function() {
  312 + i3GEOF.legenda.ativaFoco();
  313 + };
  314 + minimiza = function() {
  315 + i3GEO.janela.minimiza("i3GEOF.legenda");
  316 + };
  317 + // cria a janela flutuante
  318 + titulo = "<span class='i3GeoTituloJanelaBsNolink' >"+$trad("t33")+"</span></div>";
210 319
211 - i3GEO.util.aplicaAquarela("i3GEOF.legenda_corpo");  
212 - i3GEOF.legenda.aposIniciar.call();  
213 - } catch (erro) {  
214 - i3GEOF.legenda.aposIniciar = function(){};  
215 - }  
216 - i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");  
217 - },  
218 - sldi: function() {  
219 - i3GEO.tema.dialogo.aplicarsld(i3GEOF.legenda.tema);  
220 - },  
221 - slde: function() {  
222 - window.open(i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?funcao=tema2sld&tema="  
223 - + i3GEOF.legenda.tema  
224 - + "&g_sid="  
225 - + i3GEO.configura.sid);  
226 - },  
227 - propriedadesLabels: function() {  
228 - i3GEO.util.scriptTag(  
229 - i3GEO.configura.locaplic + "/ferramentas/opcoes_label/dependencias.php",  
230 - "i3GEOF.proplabel.iniciaJanelaFlutuante(false)",  
231 - "i3GEOFproplabel",  
232 - false);  
233 - },  
234 - incluirLabels: function() {  
235 - var par, p, temp, cp;  
236 - try {  
237 - par = i3GEOF.proplabel.pegaPar();  
238 - i3GEOF.legenda.parDefault = par;  
239 - } catch (e) {  
240 - par = i3GEOF.legenda.parDefault;  
241 - }  
242 - i3GEOF.legenda.aguarde.visibility = "visible";  
243 - temp = function() {  
244 - i3GEOF.legenda.aguarde.visibility = "hidden";  
245 - i3GEOF.legenda.aposAlterarLegenda();  
246 - i3GEOF.legenda.aguarde.visibility = "hidden";  
247 - };  
248 - p =  
249 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
250 - + i3GEO.configura.sid  
251 - + "&funcao=adicionaLabelClasse&tema="  
252 - + i3GEOF.legenda.tema  
253 - + "&classe="  
254 - + i3GEOF.legenda.classe  
255 - + par;  
256 - p += "&item=" + $i("i3GEOlegendaSelItemLabel").value;  
257 - cp = new cpaint();  
258 - cp.set_response_type("JSON");  
259 - cp.call(p, "foo", temp);  
260 - },  
261 - excluiLabels: function() {  
262 - var p, temp, cp;  
263 - i3GEOF.legenda.aguarde.visibility = "visible";  
264 - temp = function() {  
265 - i3GEOF.legenda.aguarde.visibility = "hidden";  
266 - i3GEOF.legenda.aposAlterarLegenda();  
267 - i3GEOF.legenda.aguarde.visibility = "hidden";  
268 - };  
269 - p =  
270 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
271 - + i3GEO.configura.sid  
272 - + "&funcao=removeLabelClasse&tema="  
273 - + i3GEOF.legenda.tema  
274 - + "&classe="  
275 - + i3GEOF.legenda.classe;  
276 - cp = new cpaint();  
277 - cp.set_response_type("JSON");  
278 - cp.call(p, "foo", temp);  
279 - },  
280 - janelaCorRamp: function(){  
281 - var tabela = $i("i3GEOlegendalegenda");  
282 - var trs = tabela.getElementsByTagName("tr");  
283 - var ncores = trs.length - 1;  
284 - i3GEO.util.abreColourRamp("", "listaColourRamp", ncores, i3GEOF.legenda.tema);  
285 - },  
286 - /*  
287 - * Function: html  
288 - *  
289 - * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta  
290 - *  
291 - * Retorno:  
292 - *  
293 - * String com o c&oacute;digo html  
294 - */  
295 - html : function() {  
296 - var ins = Mustache.render(i3GEOF.legenda.MUSTACHE, i3GEOF.legenda.mustacheHash());  
297 - return ins;  
298 - },  
299 - /*  
300 - * Function: iniciaJanelaFlutuante  
301 - *  
302 - * Cria a janela flutuante para controle da ferramenta.  
303 - */  
304 - iniciaJanelaFlutuante : function() {  
305 - var minimiza, cabecalho, janela, divid, temp, titulo;  
306 - if ($i("i3GEOF.legenda")) {  
307 - i3GEOF.legenda.tema = i3GEO.temaAtivo;  
308 - i3GEOF.legenda.inicia("i3GEOF.legenda_corpo");  
309 - return;  
310 - }  
311 - cabecalho = function() {  
312 - i3GEOF.legenda.ativaFoco();  
313 - };  
314 - minimiza = function() {  
315 - i3GEO.janela.minimiza("i3GEOF.legenda");  
316 - };  
317 - // cria a janela flutuante  
318 - titulo = "<span class='i3GeoTituloJanelaBsNolink' >"+$trad("t33")+"</span></div>"; 320 + janela = i3GEO.janela.cria(
  321 + "590px",
  322 + "350px",
  323 + "",
  324 + "",
  325 + "",
  326 + titulo,
  327 + "i3GEOF.legenda",
  328 + false,
  329 + "hd",
  330 + cabecalho,
  331 + minimiza,
  332 + function() {i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");},
  333 + true,
  334 + "",
  335 + "",
  336 + "",
  337 + "",
  338 + "41"
  339 + );
  340 + divid = janela[2].id;
  341 + i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style;
  342 + $i("i3GEOF.legenda_corpo").style.backgroundColor = "white";
  343 + i3GEOF.legenda.inicia(divid);
  344 + },
  345 + /*
  346 + * Function: ativaFoco
  347 + *
  348 + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
  349 + */
  350 + ativaFoco : function() {
319 351
320 - janela = i3GEO.janela.cria(  
321 - "590px",  
322 - "350px",  
323 - "",  
324 - "",  
325 - "",  
326 - titulo,  
327 - "i3GEOF.legenda",  
328 - false,  
329 - "hd",  
330 - cabecalho,  
331 - minimiza,  
332 - function() {i3GEO.guias.ajustaGuiaFerramenta("i3GEOF.legenda", "i3GEOlegenda");},  
333 - true,  
334 - "",  
335 - "",  
336 - "",  
337 - "",  
338 - "41" 352 + },
  353 + /*
  354 + * Function: aposAlterarLegenda
  355 + *
  356 + * Fun&ccedil;&atilde;o executada ap&oacute;s ocorrer alguma altera&ccedil;&atilde;o efetiva da legenda do mapa
  357 + */
  358 + aposAlterarLegenda : function() {
  359 + i3GEO.arvoreDeCamadas.CAMADAS = [];
  360 + i3GEO.atualiza();
  361 + i3GEO.Interface.atualizaTema("", i3GEOF.legenda.tema);
  362 + },
  363 + /*
  364 + * Function: mostralegenda
  365 + *
  366 + * Pega os dados da legenda do mapa atual e mostra na tela
  367 + *
  368 + * Veja:
  369 + *
  370 + * <EDITALEGENDA>
  371 + */
  372 + mostralegenda : function() {
  373 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  374 + return;
  375 + }
  376 + i3GEOF.legenda.aguarde.visibility = "visible";
  377 + var p, cp;
  378 + p =
  379 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  380 + + i3GEO.configura.sid
  381 + + "&funcao=editalegenda&opcao=edita&tema="
  382 + + i3GEOF.legenda.tema;
  383 + cp = new cpaint();
  384 + cp.set_response_type("JSON");
  385 + cp.call(p, "tabelaLegenda", i3GEOF.legenda.montaLegenda);
  386 + },
  387 + /*
  388 + * Function: montaLegenda
  389 + *
  390 + * Formata a tabela de edi&ccedil;&atilde;o da legenda
  391 + *
  392 + * Parametro:
  393 + *
  394 + * retorno - objeto contendo os dados para formata&ccedil;&atilde;o da legenda
  395 + */
  396 + montaLegenda : function(retorno) {
  397 + i3GEOF.legenda.aviso = false;
  398 + try {
  399 + if (retorno.data != undefined) {
  400 + //hidden e utilizado para esconder ou mostrar determinados trechos do template
  401 + var mustache = [], b, ins, i, ajuda, id, re, exp, n, filtro,temp = {};
  402 + // se nao for do tipo raster
  403 + if (retorno.data[0].proc === "") {
  404 + n = retorno.data.length;
  405 + for (i = 0; i < n; i++) {
  406 + temp = {};
  407 + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse;
  408 + re = new RegExp("'", "g");
  409 + exp = (retorno.data[i].expressao).replace(re, '"');
  410 + temp.cliqueExclui = $trad('cliqueExclui', i3GEOF.legenda.dicionario);
  411 + temp.cliqueAltera = $trad('cliqueAltera', i3GEOF.legenda.dicionario);
  412 + temp.imagem = retorno.data[i].imagem;
  413 + temp.id = id;
  414 + temp.idclasse = retorno.data[i].idclasse;
  415 + temp.novoNome = $trad('digitaNovoNome', i3GEOF.legenda.dicionario);
  416 + temp.nome = retorno.data[i].nomeclasse;
  417 + temp.editorExp = $trad("editorExp", i3GEOF.legenda.dicionario);
  418 + temp.exp = exp;
  419 + temp.txtMinscale = $trad('minScale', i3GEOF.legenda.dicionario);
  420 + temp.minScale = retorno.data[i].minScale;
  421 + temp.txtMaxScale = $trad('maxScale', i3GEOF.legenda.dicionario);
  422 + temp.maxScale = retorno.data[i].maxScale;
  423 + temp.sobe = $trad('sobe', i3GEOF.legenda.dicionario);
  424 + temp.desce = $trad('desce', i3GEOF.legenda.dicionario);
  425 + mustache.push(temp);
  426 + }
  427 + ins = Mustache.render(
  428 + i3GEOF.legenda.MUSTACHELISTA,
  429 + $.extend(
  430 + {},
  431 + {
  432 + "linhas" : mustache,
  433 + "hidden2":"",
  434 + "hidden1": "hidden"
  435 + },
  436 + i3GEOF.legenda.DICIONARIO
  437 + )
339 ); 438 );
340 - divid = janela[2].id;  
341 - i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style;  
342 - $i("i3GEOF.legenda_corpo").style.backgroundColor = "white";  
343 - i3GEOF.legenda.inicia(divid);  
344 - },  
345 - /*  
346 - * Function: ativaFoco  
347 - *  
348 - * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado  
349 - */  
350 - ativaFoco : function() { 439 + $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;
  440 + } else {
  441 + ajuda = i3GEOF.legenda.DICIONARIO['ajudaEscalaCores']
  442 + + "<p>"
  443 + + i3GEOF.legenda.DICIONARIO['msgEscalaCoresAuto']
  444 + + "<p>"
  445 + + i3GEOF.legenda.DICIONARIO['msgEscalaCoresIndividual']
  446 + + "<p>"
  447 + + i3GEOF.legenda.DICIONARIO['msgBandas']
  448 + + "<p>"
  449 + + i3GEOF.legenda.DICIONARIO['msgReamostragem'];
351 450
352 - },  
353 - /*  
354 - * Function: aposAlterarLegenda  
355 - *  
356 - * Fun&ccedil;&atilde;o executada ap&oacute;s ocorrer alguma altera&ccedil;&atilde;o efetiva da legenda do mapa  
357 - */  
358 - aposAlterarLegenda : function() {  
359 - i3GEO.arvoreDeCamadas.CAMADAS = [];  
360 - i3GEO.atualiza();  
361 - i3GEO.Interface.atualizaTema("", i3GEOF.legenda.tema);  
362 - },  
363 - /*  
364 - * Function: mostralegenda  
365 - *  
366 - * Pega os dados da legenda do mapa atual e mostra na tela  
367 - *  
368 - * Veja:  
369 - *  
370 - * <EDITALEGENDA>  
371 - */  
372 - mostralegenda : function() {  
373 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
374 - return; 451 + mustache = [];
  452 + for (i = 0; i < retorno.data[0].proc.length; i++) {
  453 + mustache.push({
  454 + "value": retorno.data[0].proc[i]
  455 + });
375 } 456 }
376 - i3GEOF.legenda.aguarde.visibility = "visible";  
377 - var p, cp;  
378 - p =  
379 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
380 - + i3GEO.configura.sid  
381 - + "&funcao=editalegenda&opcao=edita&tema="  
382 - + i3GEOF.legenda.tema;  
383 - cp = new cpaint();  
384 - cp.set_response_type("JSON");  
385 - cp.call(p, "tabelaLegenda", i3GEOF.legenda.montaLegenda);  
386 - },  
387 - /*  
388 - * Function: montaLegenda  
389 - *  
390 - * Formata a tabela de edi&ccedil;&atilde;o da legenda  
391 - *  
392 - * Parametro:  
393 - *  
394 - * retorno - objeto contendo os dados para formata&ccedil;&atilde;o da legenda  
395 - */  
396 - montaLegenda : function(retorno) {  
397 - i3GEOF.legenda.aviso = false;  
398 - try {  
399 - if (retorno.data != undefined) {  
400 - //hidden e utilizado para esconder ou mostrar determinados trechos do template  
401 - var mustache = [], b, ins, i, ajuda, id, re, exp, n, filtro,temp = {};  
402 - // se nao for do tipo raster  
403 - if (retorno.data[0].proc === "") {  
404 - n = retorno.data.length;  
405 - for (i = 0; i < n; i++) {  
406 - temp = {};  
407 - id = retorno.data[i].tema + "-" + retorno.data[i].idclasse;  
408 - re = new RegExp("'", "g");  
409 - exp = (retorno.data[i].expressao).replace(re, '"');  
410 - temp.cliqueExclui = $trad('cliqueExclui', i3GEOF.legenda.dicionario);  
411 - temp.cliqueAltera = $trad('cliqueAltera', i3GEOF.legenda.dicionario);  
412 - temp.imagem = retorno.data[i].imagem;  
413 - temp.id = id;  
414 - temp.idclasse = retorno.data[i].idclasse;  
415 - temp.novoNome = $trad('digitaNovoNome', i3GEOF.legenda.dicionario);  
416 - temp.nome = retorno.data[i].nomeclasse;  
417 - temp.editorExp = $trad("editorExp", i3GEOF.legenda.dicionario);  
418 - temp.exp = exp;  
419 - temp.txtMinscale = $trad('minScale', i3GEOF.legenda.dicionario);  
420 - temp.minScale = retorno.data[i].minScale;  
421 - temp.txtMaxScale = $trad('maxScale', i3GEOF.legenda.dicionario);  
422 - temp.maxScale = retorno.data[i].maxScale;  
423 - temp.sobe = $trad('sobe', i3GEOF.legenda.dicionario);  
424 - temp.desce = $trad('desce', i3GEOF.legenda.dicionario);  
425 - mustache.push(temp);  
426 - }  
427 - ins = Mustache.render(  
428 - i3GEOF.legenda.MUSTACHELISTA,  
429 - $.extend(  
430 - {},  
431 - {  
432 - "linhas" : mustache,  
433 - "hidden2":"",  
434 - "hidden1": "hidden"  
435 - },  
436 - i3GEOF.legenda.DICIONARIO  
437 - )  
438 - );  
439 - $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;  
440 - } else {  
441 - ajuda = i3GEOF.legenda.DICIONARIO['ajudaEscalaCores']  
442 - + "<p>"  
443 - + i3GEOF.legenda.DICIONARIO['msgEscalaCoresAuto']  
444 - + "<p>"  
445 - + i3GEOF.legenda.DICIONARIO['msgEscalaCoresIndividual']  
446 - + "<p>"  
447 - + i3GEOF.legenda.DICIONARIO['msgBandas']  
448 - + "<p>"  
449 - + i3GEOF.legenda.DICIONARIO['msgReamostragem'];  
450 457
451 - mustache = [];  
452 - for (i = 0; i < retorno.data[0].proc.length; i++) {  
453 - mustache.push({  
454 - "value": retorno.data[0].proc[i]  
455 - });  
456 - } 458 + ins = Mustache.render(
  459 + i3GEOF.legenda.MUSTACHELISTA,
  460 + $.extend(
  461 + {},
  462 + {
  463 + "hidden2":"hidden",
  464 + "hidden1": "",
  465 + "ajuda1": ajuda,
  466 + "processos": mustache
  467 + },
  468 + i3GEOF.legenda.DICIONARIO
  469 + )
  470 + );
  471 + $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;
  472 + }
  473 + } else {
  474 + $i("i3GEOlegendaresultado").innerHTML = "<p style=color:red >Erro<br>";
  475 + }
  476 + i3GEOF.legenda.aguarde.visibility = "hidden";
  477 + } catch (e) {
  478 + i3GEOF.legenda.aguarde.visibility = "hidden";
  479 + }
  480 + },
  481 + filtro : function(idRetorno) {
  482 + i3GEO.tema.dialogo.filtro(i3GEOF.legenda.tema, true, idRetorno);
  483 + },
  484 + /*
  485 + * Function: aviso
  486 + *
  487 + * Mostra um i3GEO.janela.tempoMsga ao usu&aacute;rio quando um campo da tabela que cont&eacute;m os dados da legenda &eacute;
  488 + * alterado
  489 + *
  490 + * O aviso &eacute; mostrado apenas uma vez
  491 + */
  492 + aviso : function() {
  493 + if (i3GEOF.legenda.aviso == true) {
  494 + i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao', i3GEOF.legenda.dicionario));
  495 + i3GEOF.legenda.aviso == false;
  496 + }
  497 + },
  498 + /*
  499 + * Function: aplicaColourRamp
  500 + *
  501 + * Aplica nas classes da legenda as cores escolhidas no seletor de cores
  502 + */
  503 + aplicaColourRamp : function() {
  504 + if ($i("listaColourRamp").value != "") {
  505 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  506 + return;
  507 + }
  508 + i3GEOF.legenda.aguarde.visibility = "visible";
  509 + var cores = $i("listaColourRamp").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), temp = function() {
  510 + i3GEOF.legenda.aguarde.visibility = "hidden";
  511 + i3GEOF.legenda.mostralegenda();
  512 + i3GEOF.legenda.aposAlterarLegenda();
  513 + }, p =
  514 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  515 + + i3GEO.configura.sid
  516 + + "&funcao=alteraclasse&opcao=aplicacoresrgb&ext="
  517 + + ext
  518 + + "&tema="
  519 + + i3GEOF.legenda.tema, cp = new cpaint();
  520 + cp.set_transfer_mode('POST');
  521 + cp.set_response_type("JSON");
  522 + cp.call(p, "foo", temp, "cores=" + cores);
  523 + }
  524 + },
  525 + /*
  526 + * Function: corj
  527 + *
  528 + * Abre a janela para o usu&aacute;rio selecionar uma cor interativamente
  529 + */
  530 + corj : function(obj) {
  531 + i3GEO.util.abreCor("", obj);
  532 + },
  533 + /*
  534 + * Function: modificaCor
  535 + *
  536 + * Modifica a cor de uma classe
  537 + */
  538 + modificaCor : function(id) {
  539 + var obj = $i("tempCorLegenda");
  540 + if (!obj) {
  541 + var obj = document.createElement("input");
  542 + obj.id = "tempCorLegenda";
  543 + obj.style.display = "none";
  544 + obj.type = "text";
  545 + obj.value = "";
  546 + document.body.appendChild(obj);
  547 + obj.onchange = function() {
  548 + i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name);
  549 + };
  550 + }
  551 + obj.name = id;
  552 + i3GEO.util.abreCor("", "tempCorLegenda");
  553 + },
  554 + aplicaNovaCor : function(id) {
  555 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  556 + return;
  557 + }
  558 + i3GEOF.legenda.aguarde.visibility = "visible";
  559 + var retorna = function() {
  560 + i3GEOF.legenda.aposAlterarLegenda();
  561 + i3GEOF.legenda.aguarde.visibility = "hidden";
  562 + i3GEOF.legenda.mostralegenda();
  563 + };
  564 + i3GEO.php.aplicaCorClasseTema(retorna, i3GEOF.legenda.tema, id, $i("tempCorLegenda").value);
  565 + },
  566 + aplicarLegendaImg : function() {
  567 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  568 + return;
  569 + }
  570 + //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente
  571 + var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
  572 + objTema.legendaimg = $i("i3GEOlegendaImg").value;
  573 +
  574 + i3GEOF.legenda.aguarde.visibility = "visible";
  575 + var retorna = function() {
  576 + i3GEOF.legenda.aposAlterarLegenda();
  577 + i3GEOF.legenda.aguarde.visibility = "hidden";
  578 + i3GEOF.legenda.mostralegenda();
  579 + };
  580 + var p =
  581 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  582 + + i3GEO.configura.sid
  583 + + "&funcao=aplicaLegendaImg"
  584 + + "&tema="
  585 + + i3GEOF.legenda.tema
  586 + + "&imagem="
  587 + + objTema.legendaimg,
  588 + cp = new cpaint();
  589 + cp.set_response_type("JSON");
  590 + cp.call(p, "foo", retorna);
  591 + },
  592 + aplicarOffsite : function() {
  593 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  594 + return;
  595 + }
  596 + //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente
  597 + var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
  598 + objTema.offsite = $i("i3GEOoffsite").value;
457 599
458 - ins = Mustache.render(  
459 - i3GEOF.legenda.MUSTACHELISTA,  
460 - $.extend(  
461 - {},  
462 - {  
463 - "hidden2":"hidden",  
464 - "hidden1": "",  
465 - "ajuda1": ajuda,  
466 - "processos": mustache  
467 - },  
468 - i3GEOF.legenda.DICIONARIO  
469 - )  
470 - );  
471 - $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;  
472 - }  
473 - } else {  
474 - $i("i3GEOlegendaresultado").innerHTML = "<p style=color:red >Erro<br>"; 600 + i3GEOF.legenda.aguarde.visibility = "visible";
  601 + var retorna = function() {
  602 + i3GEOF.legenda.aposAlterarLegenda();
  603 + i3GEOF.legenda.aguarde.visibility = "hidden";
  604 + i3GEOF.legenda.mostralegenda();
  605 + };
  606 + var p =
  607 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  608 + + i3GEO.configura.sid
  609 + + "&funcao=aplicaOffsite"
  610 + + "&tema="
  611 + + i3GEOF.legenda.tema
  612 + + "&offsite="
  613 + + objTema.offsite,
  614 + cp = new cpaint();
  615 + cp.set_response_type("JSON");
  616 + cp.call(p, "foo", retorna);
  617 + },
  618 + /*
  619 + * Function: mudaLegenda
  620 + *
  621 + * Altera a legenda conforme os valores existentes na tabela de propriedades (express&atilde;o e nome da classe)
  622 + *
  623 + * Veja:
  624 + *
  625 + * <ALTERACLASSE>
  626 + */
  627 + mudaLegenda : function() {
  628 + i3GEOF.legenda.aviso = false;
  629 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  630 + return;
  631 + }
  632 + i3GEOF.legenda.aguarde.visibility = "visible";
  633 + try {
  634 + var tabela = $i("i3GEOlegendalegenda"),
  635 + trs = tabela.getElementsByTagName("tr"),
  636 + minScales = [],
  637 + maxScales = [],
  638 + nomes = [],
  639 + exps = [],
  640 + ids = [],
  641 + t, nn, n, p, cp, temp;
  642 + for (t = 1; t < trs.length; t++) {
  643 + if (trs[t].childNodes) {
  644 + nn = trs[t].childNodes;
  645 + for (n = 0; n < nn.length; n++) {
  646 + if (nn && nn[n] && nn[n].childNodes && nn[n].getElementsByTagName) {
  647 + var isn = nn[n].getElementsByTagName("input");
  648 + if (isn && isn[0] != undefined) {
  649 + if (isn[0].name == "nome") {
  650 + nomes.push(isn[0].value);
  651 + temp = (isn[0].id).split("i3GEOlegendaid_");
  652 + ids.push(temp[1]);
  653 + }
  654 + if (isn[0].name == "expressao") {
  655 + exps.push(isn[0].value);
  656 + }
  657 + if (isn[0].name == "minScale") {
  658 + minScales.push(parseInt(isn[0].value, 10));
  659 + }
  660 + if (isn[0].name == "maxScale") {
  661 + maxScales.push(parseInt(isn[0].value, 10));
  662 + }
475 } 663 }
476 - i3GEOF.legenda.aguarde.visibility = "hidden";  
477 - } catch (e) {  
478 - i3GEOF.legenda.aguarde.visibility = "hidden";  
479 - }  
480 - },  
481 - filtro : function(idRetorno) {  
482 - i3GEO.tema.dialogo.filtro(i3GEOF.legenda.tema, true, idRetorno);  
483 - },  
484 - /*  
485 - * Function: aviso  
486 - *  
487 - * Mostra um i3GEO.janela.tempoMsga ao usu&aacute;rio quando um campo da tabela que cont&eacute;m os dados da legenda &eacute;  
488 - * alterado  
489 - *  
490 - * O aviso &eacute; mostrado apenas uma vez  
491 - */  
492 - aviso : function() {  
493 - if (i3GEOF.legenda.aviso == true) {  
494 - i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao', i3GEOF.legenda.dicionario));  
495 - i3GEOF.legenda.aviso == false;  
496 - }  
497 - },  
498 - /*  
499 - * Function: aplicaColourRamp  
500 - *  
501 - * Aplica nas classes da legenda as cores escolhidas no seletor de cores  
502 - */  
503 - aplicaColourRamp : function() {  
504 - if ($i("listaColourRamp").value != "") {  
505 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
506 - return;  
507 - }  
508 - i3GEOF.legenda.aguarde.visibility = "visible";  
509 - var cores = $i("listaColourRamp").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), temp = function() {  
510 - i3GEOF.legenda.aguarde.visibility = "hidden";  
511 - i3GEOF.legenda.mostralegenda();  
512 - i3GEOF.legenda.aposAlterarLegenda();  
513 - }, p =  
514 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
515 - + i3GEO.configura.sid  
516 - + "&funcao=alteraclasse&opcao=aplicacoresrgb&ext="  
517 - + ext  
518 - + "&tema="  
519 - + i3GEOF.legenda.tema, cp = new cpaint();  
520 - cp.set_transfer_mode('POST');  
521 - cp.set_response_type("JSON");  
522 - cp.call(p, "foo", temp, "cores=" + cores);  
523 - }  
524 - },  
525 - /*  
526 - * Function: corj  
527 - *  
528 - * Abre a janela para o usu&aacute;rio selecionar uma cor interativamente  
529 - */  
530 - corj : function(obj) {  
531 - i3GEO.util.abreCor("", obj);  
532 - },  
533 - /*  
534 - * Function: modificaCor  
535 - *  
536 - * Modifica a cor de uma classe  
537 - */  
538 - modificaCor : function(id) {  
539 - var obj = $i("tempCorLegenda");  
540 - if (!obj) {  
541 - var obj = document.createElement("input");  
542 - obj.id = "tempCorLegenda";  
543 - obj.style.display = "none";  
544 - obj.type = "text";  
545 - obj.value = "";  
546 - document.body.appendChild(obj);  
547 - obj.onchange = function() {  
548 - i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name);  
549 - }; 664 + }
550 } 665 }
551 - obj.name = id;  
552 - i3GEO.util.abreCor("", "tempCorLegenda");  
553 - },  
554 - aplicaNovaCor : function(id) {  
555 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
556 - return;  
557 - }  
558 - i3GEOF.legenda.aguarde.visibility = "visible";  
559 - var retorna = function() {  
560 - i3GEOF.legenda.aposAlterarLegenda();  
561 - i3GEOF.legenda.aguarde.visibility = "hidden";  
562 - i3GEOF.legenda.mostralegenda();  
563 - };  
564 - i3GEO.php.aplicaCorClasseTema(retorna, i3GEOF.legenda.tema, id, $i("tempCorLegenda").value);  
565 - },  
566 - aplicarLegendaImg : function() {  
567 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
568 - return;  
569 - }  
570 - //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente  
571 - var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);  
572 - objTema.legendaimg = $i("i3GEOlegendaImg").value; 666 + }
  667 + }
  668 + ids = ids.join(";");
  669 + nomes = nomes.join(";");
  670 + exps = exps.join(";");
  671 + minScales = minScales.join(";");
  672 + maxScales = maxScales.join(";");
  673 + temp = function() {
  674 + i3GEOF.legenda.aguarde.visibility = "hidden";
  675 + i3GEOF.legenda.mostralegenda();
  676 + i3GEOF.legenda.aposAlterarLegenda();
  677 + i3GEOF.legenda.aguarde.visibility = "hidden";
  678 + };
  679 + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  680 + p =
  681 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?"
  682 + + "base64=sim"
  683 + + "&g_sid="
  684 + + i3GEO.configura.sid
  685 + + "&funcao=alteraclasse"
  686 + + "&opcao=alteraclasses"
  687 + + "&ext="
  688 + + ext;
  689 + cp = new cpaint();
  690 + cp.set_transfer_mode('POST');
  691 + cp.set_response_type("JSON");
  692 + cp.call(p, "alteraclassesPost", temp, "ids=" + ids
  693 + + "&nomes="
  694 + + i3GEO.util.base64encode(nomes)
  695 + //+ nomes
  696 + + "&exps="
  697 + + i3GEO.util.base64encode(exps)
  698 + //+ exps
  699 + + "&minScales="
  700 + + minScales
  701 + + "&maxScales="
  702 + + maxScales);
  703 + } catch (e) {
  704 + i3GEO.janela.tempoMsg("Erro: " + e);
  705 + i3GEOF.legenda.aguarde.visibility = "hidden";
  706 + }
  707 + },
  708 + /*
  709 + * Function: alteraGeometria
  710 + *
  711 + * Altera o tipo de representa&ccedil;&atilde;o geom&eacute;trica dos elementos de um layer
  712 + *
  713 + * Veja:
  714 + *
  715 + * <ALTERACLASSE>
  716 + */
  717 + alteraGeometriaTema : function() {
  718 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  719 + return;
  720 + }
  721 + i3GEOF.legenda.aguarde.visibility = "visible";
  722 + var retorna = function() {
  723 + i3GEOF.legenda.aposAlterarLegenda();
  724 + i3GEOF.legenda.aguarde.visibility = "hidden";
  725 + i3GEOF.legenda.mostralegenda();
  726 + };
  727 + var p =
  728 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  729 + + i3GEO.configura.sid
  730 + + "&funcao=alteraclasse&opcao=alterageometria&tema="
  731 + + i3GEOF.legenda.tema
  732 + + "&tipo="
  733 + + $i("i3GEOlegentaTipoGeo").value, cp = new cpaint();
  734 + cp.set_response_type("JSON");
  735 + cp.call(p, "", retorna);
  736 + },
  737 + /*
  738 + * Function: adicionaConta
  739 + *
  740 + * Adiciona ao nome de cada classe o n&uacute;mero de ocorr&ecirc;ncias em cada uma
  741 + *
  742 + * Veja:
  743 + *
  744 + * <CONTAGEMCLASSE>
  745 + */
  746 + adicionaConta : function() {
  747 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  748 + return;
  749 + }
  750 + i3GEOF.legenda.aguarde.visibility = "visible";
  751 + var p =
  752 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  753 + + i3GEO.configura.sid
  754 + + "&funcao=contagemclasse"
  755 + + "&tema="
  756 + + i3GEOF.legenda.tema, cp = new cpaint();
  757 + cp.set_response_type("JSON");
  758 + cp.call(p, "contagemclasse", i3GEOF.legenda.montaLegenda);
  759 + i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis', i3GEOF.legenda.dicionario));
  760 + },
  761 + /*
  762 + * Function: adicionaClasse
  763 + *
  764 + * Adiciona uma nova classe ao tema
  765 + *
  766 + * Veja:
  767 + *
  768 + * <ALTERACLASSE>
  769 + */
  770 + adicionaClasse : function() {
  771 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  772 + return;
  773 + }
  774 + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  775 + var p =
  776 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  777 + + i3GEO.configura.sid
  778 + + "&funcao=alteraclasse&opcao=adicionaclasse"
  779 + + "&tema="
  780 + + i3GEOF.legenda.tema
  781 + + "&ext="
  782 + + ext, cp = new cpaint();
  783 + cp.set_response_type("JSON");
  784 + cp.call(p, "alteraclasse", i3GEOF.legenda.mostralegenda);
  785 + },
  786 + /*
  787 + * Function: adicionaOpacidade
  788 + *
  789 + * Adiciona opacidade vari&aacute;vel em cada classe
  790 + *
  791 + * Veja:
  792 + *
  793 + * <ALTERACLASSE>
  794 + */
  795 + adicionaOpacidade : function() {
  796 + var retorna = function() {
  797 + i3GEOF.legenda.aposAlterarLegenda();
  798 + i3GEOF.legenda.aguarde.visibility = "hidden";
  799 + i3GEOF.legenda.mostralegenda();
  800 + };
  801 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  802 + return;
  803 + }
  804 + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  805 + var p =
  806 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  807 + + i3GEO.configura.sid
  808 + + "&funcao=alteraclasse&opcao=adicionaopacidade"
  809 + + "&tema="
  810 + + i3GEOF.legenda.tema
  811 + + "&ext="
  812 + + ext, cp = new cpaint();
  813 + cp.set_response_type("JSON");
  814 + cp.call(p, "alteraclasse", retorna);
  815 + },
  816 + /*
  817 + * Function: paleta
  818 + *
  819 + * Gera as cores para as classes considerando um RGB inicial e um final
  820 + *
  821 + * Veja:
  822 + *
  823 + * <ALTERACORESCLASSES>
  824 + */
  825 + paleta : function() {
  826 + try {
  827 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  828 + return;
  829 + }
  830 + i3GEOF.legenda.aguarde.visibility = "visible";
  831 + var retornapaleta = function() {
  832 + i3GEOF.legenda.aposAlterarLegenda();
  833 + i3GEOF.legenda.aguarde.visibility = "hidden";
  834 + i3GEOF.legenda.mostralegenda();
  835 + }, ci = $i("i3GEOlegendaacori").value, cf = $i("i3GEOlegendaacorf").value, cp = new cpaint(), p =
  836 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  837 + + i3GEO.configura.sid
  838 + + "&funcao=alteraCoresClasses&tema="
  839 + + i3GEOF.legenda.tema
  840 + + "&cori="
  841 + + ci
  842 + + "&corf="
  843 + + cf;
  844 + cp.set_response_type("JSON");
  845 + cp.call(p, "alteraCoresClasses", retornapaleta);
  846 + } catch (e) {
  847 + i3GEO.janela.tempoMsg("Erro: " + e);
  848 + i3GEOF.legenda.aguarde.visibility = "hidden";
  849 + }
  850 + },
  851 + /*
  852 + * Function: inverteCores
  853 + *
  854 + * Inverte as cores utilizadas nos s&iacute;mbolos das classes
  855 + *
  856 + * Veja:
  857 + *
  858 + * <INVERTECORESCLASSES>
  859 + */
  860 + inverteCores : function() {
  861 + try {
  862 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  863 + return;
  864 + }
  865 + i3GEOF.legenda.aguarde.visibility = "visible";
  866 + var retornapaleta = function() {
  867 + i3GEOF.legenda.aposAlterarLegenda();
  868 + i3GEOF.legenda.aguarde.visibility = "hidden";
  869 + i3GEOF.legenda.mostralegenda();
  870 + }, cp = new cpaint(), p =
  871 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  872 + + i3GEO.configura.sid
  873 + + "&funcao=inverteCoresClasses&tema="
  874 + + i3GEOF.legenda.tema;
  875 + cp.set_response_type("JSON");
  876 + cp.call(p, "alteraCoresClasses", retornapaleta);
  877 + } catch (e) {
  878 + i3GEO.janela.tempoMsg("Erro: " + e);
  879 + i3GEOF.legenda.aguarde.visibility = "hidden";
  880 + }
  881 + },
  882 + /*
  883 + * Function: calculaTamanho
  884 + *
  885 + * Muda o s&iacute;mbolo de cada classe aplicando tamanhos diferentes e lineares
  886 + *
  887 + * Veja:
  888 + *
  889 + * <CALCULATAMANHOCLASSES>
  890 + */
  891 + calculaTamanho : function() {
  892 + try {
  893 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  894 + return;
  895 + }
  896 + i3GEOF.legenda.aguarde.visibility = "visible";
  897 + var retornapaleta = function() {
  898 + i3GEOF.legenda.aposAlterarLegenda();
  899 + i3GEOF.legenda.aguarde.visibility = "hidden";
  900 + i3GEOF.legenda.mostralegenda();
  901 + }, cp = new cpaint(), p =
  902 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  903 + + i3GEO.configura.sid
  904 + + "&funcao=calculaTamanhoClasses&tema="
  905 + + i3GEOF.legenda.tema;
  906 + cp.set_response_type("JSON");
  907 + cp.call(p, "calculaTamanhoClasses", retornapaleta);
  908 + } catch (e) {
  909 + i3GEO.janela.tempoMsg("Erro: " + e);
  910 + i3GEOF.legenda.aguarde.visibility = "hidden";
  911 + }
  912 + },
  913 + /*
  914 + * Function: ordenaClasses
  915 + *
  916 + * Ordena as classes pelo nome
  917 + *
  918 + */
  919 + ordenaClasses : function() {
  920 + try {
  921 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  922 + return;
  923 + }
  924 + i3GEOF.legenda.aguarde.visibility = "visible";
  925 + var retornapaleta = function() {
  926 + i3GEOF.legenda.aposAlterarLegenda();
  927 + i3GEOF.legenda.aguarde.visibility = "hidden";
  928 + i3GEOF.legenda.mostralegenda();
  929 + }, cp = new cpaint(), p =
  930 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  931 + + i3GEO.configura.sid
  932 + + "&funcao=ordenaClasses&tema="
  933 + + i3GEOF.legenda.tema;
  934 + cp.set_response_type("JSON");
  935 + cp.call(p, "foo", retornapaleta);
  936 + } catch (e) {
  937 + i3GEO.janela.tempoMsg("Erro: " + e);
  938 + i3GEOF.legenda.aguarde.visibility = "hidden";
  939 + }
  940 + },
  941 + /*
  942 + * Function: excluilinhaf
  943 + *
  944 + * Exclui uma linha da tabela de edi&ccedil;&atilde;o de classes da legendda
  945 + */
  946 + excluilinhaf : function(id) {
  947 + var p = $i(id);
  948 + do {
  949 + p.removeChild(p.childNodes[0]);
  950 + } while (p.childNodes.length > 0);
  951 + p.parentNode.removeChild(p);
  952 + i3GEOF.legenda.mudaLegenda();
  953 + },
  954 + /*
  955 + * Function: sobelinhaf
  956 + *
  957 + * Sobe uma linha na tabela de edi&ccedil;&atilde;o de classes da legendda
  958 + */
  959 + sobelinhaf : function(idclasse) {
  960 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  961 + return;
  962 + }
  963 + i3GEOF.legenda.aguarde.visibility = "visible";
  964 + var p =
  965 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  966 + + i3GEO.configura.sid
  967 + + "&funcao=ALTERACLASSE&opcao=sobeclasse&tema="
  968 + + i3GEOF.legenda.tema
  969 + + "&idclasse="
  970 + + idclasse, cp = new cpaint(), temp = function() {
  971 + i3GEOF.legenda.aguarde.visibility = "hidden";
  972 + i3GEOF.legenda.mostralegenda();
  973 + };
  974 + cp.set_response_type("JSON");
  975 + cp.call(p, "foo", temp);
  976 + },
  977 + /*
  978 + * Function: descelinhaf
  979 + *
  980 + * Desce uma linha na tabela de edi&ccedil;&atilde;o de classes da legendda
  981 + */
  982 + descelinhaf : function(idclasse) {
  983 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  984 + return;
  985 + }
  986 + i3GEOF.legenda.aguarde.visibility = "visible";
  987 + var p =
  988 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  989 + + i3GEO.configura.sid
  990 + + "&funcao=ALTERACLASSE&opcao=desceclasse&tema="
  991 + + i3GEOF.legenda.tema
  992 + + "&idclasse="
  993 + + idclasse, cp = new cpaint(), temp = function() {
  994 + i3GEOF.legenda.aguarde.visibility = "hidden";
  995 + i3GEOF.legenda.mostralegenda();
  996 + };
  997 + ;
  998 + cp.set_response_type("JSON");
  999 + cp.call(p, "foo", temp);
  1000 + },
  1001 + /*
  1002 + * Function: editaSimbolo
  1003 + *
  1004 + * Abre o editor de s&iacute;mbolos
  1005 + *
  1006 + * Veja:
  1007 + *
  1008 + * <EDITASIMBOLO>
  1009 + */
  1010 + editaSimbolo : function(id) {
  1011 + try {
  1012 + $i("i3GEOlegendaguia1obj").style.display = "none";
  1013 + $i("i3GEOlegendaguia3obj").style.display = "block";
  1014 + id = id.split("-");
  1015 + i3GEOF.legenda.classe = id[1];
  1016 + i3GEOF.legenda.formEditorSimbolo();
  1017 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1018 + } catch (e) {
  1019 + i3GEO.janela.tempoMsg("Erro: " + e);
  1020 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1021 + }
  1022 + },
  1023 + formEditorSimbolo : function() {
  1024 + var p =
  1025 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1026 + + i3GEO.configura.sid
  1027 + + "&funcao=editasimbolo&opcao=pegaparametros&tema="
  1028 + + i3GEOF.legenda.tema
  1029 + + "&classe="
  1030 + + i3GEOF.legenda.classe, cp = new cpaint();
  1031 + cp.set_response_type("JSON");
  1032 + cp.call(p, "pegaParametrosMapa", i3GEOF.legenda.montaEditor);
  1033 + },
  1034 + /*
  1035 + * Function: simbU
  1036 + *
  1037 + * Altera a leganda do tema para o tipo s&iacute;mbolo &uacute;nico
  1038 + *
  1039 + * Veja:
  1040 + *
  1041 + * <ALTERACLASSE>
  1042 + */
  1043 + simbU : function() {
  1044 + try {
  1045 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1046 + return;
  1047 + }
  1048 + i3GEOF.legenda.aguarde.visibility = "visible";
  1049 + var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  1050 + var p =
  1051 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1052 + + i3GEO.configura.sid
  1053 + + "&funcao=alteraclasse&tema="
  1054 + + i3GEOF.legenda.tema
  1055 + + "&opcao=simbolounico&ext="
  1056 + + ext, cp = new cpaint(), fim = function() {
  1057 + i3GEOF.legenda.aposAlterarLegenda();
  1058 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1059 + };
  1060 + cp.set_response_type("JSON");
  1061 + cp.call(p, "alteraclasse", fim);
  1062 + } catch (e) {
  1063 + i3GEO.janela.tempoMsg("Erro: " + e);
  1064 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1065 + }
  1066 + },
  1067 + /*
  1068 + * Function: valorU
  1069 + *
  1070 + * Altera a leganda do tema para o tipo valor &uacute;nico
  1071 + *
  1072 + * Veja:
  1073 + *
  1074 + * <ALTERACLASSE>
  1075 + */
  1076 + valorU : function() {
  1077 + try {
  1078 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1079 + return;
  1080 + }
  1081 + var item = $i("i3GEOlegendaitensValorUnico").getElementsByTagName("select")[0].value, itemNome =
  1082 + $i("i3GEOlegendaClassesValorUnico").getElementsByTagName("select")[0].value, p =
  1083 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1084 + + i3GEO.configura.sid
  1085 + + "&funcao=alteraclasse&tema="
  1086 + + i3GEOF.legenda.tema
  1087 + + "&item="
  1088 + + item
  1089 + + "&itemNome="
  1090 + + itemNome
  1091 + + "&opcao=valorunico"
  1092 + + "&ignorar="
  1093 + + $i("i3GEOlegendaignorar").value, cp = new cpaint(), fim = function() {
  1094 + i3GEOF.legenda.aposAlterarLegenda();
  1095 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1096 + };
  1097 + if ($i("i3GEOFlegendaaplicaextent").checked === true) {
  1098 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  1099 + } else {
  1100 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
  1101 + }
573 1102
574 - i3GEOF.legenda.aguarde.visibility = "visible";  
575 - var retorna = function() {  
576 - i3GEOF.legenda.aposAlterarLegenda();  
577 - i3GEOF.legenda.aguarde.visibility = "hidden";  
578 - i3GEOF.legenda.mostralegenda();  
579 - };  
580 - var p =  
581 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
582 - + i3GEO.configura.sid  
583 - + "&funcao=aplicaLegendaImg"  
584 - + "&tema="  
585 - + i3GEOF.legenda.tema  
586 - + "&imagem="  
587 - + objTema.legendaimg,  
588 - cp = new cpaint();  
589 - cp.set_response_type("JSON");  
590 - cp.call(p, "foo", retorna);  
591 - },  
592 - aplicarOffsite : function() {  
593 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
594 - return;  
595 - }  
596 - //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente  
597 - var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);  
598 - objTema.offsite = $i("i3GEOoffsite").value; 1103 + if (item == "") {
  1104 + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
  1105 + return;
  1106 + }
  1107 + i3GEOF.legenda.aguarde.visibility = "visible";
  1108 + cp.set_response_type("JSON");
  1109 + cp.call(p, "alteraclasse", fim);
  1110 + } catch (e) {
  1111 + i3GEO.janela.tempoMsg("Erro: " + e);
  1112 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1113 + }
  1114 + },
  1115 + /*
  1116 + * Function: valorC
  1117 + *
  1118 + * Altera a leganda do tema com um n&uacute;mero espec&iacute;fico de classes
  1119 + *
  1120 + * Veja:
  1121 + *
  1122 + * <ALTERACLASSE>
  1123 + */
  1124 + valorC : function() {
  1125 + try {
  1126 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1127 + return;
  1128 + }
  1129 + var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
  1130 + $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
  1131 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1132 + + i3GEO.configura.sid
  1133 + + "&funcao=alteraclasse&nclasses="
  1134 + + nclasses
  1135 + + "&tema="
  1136 + + i3GEOF.legenda.tema
  1137 + + "&item="
  1138 + + item
  1139 + + "&opcao=intervalosiguais&ignorar="
  1140 + + $i("i3GEOlegendaignorar").value
  1141 + + "&ext="
  1142 + + ext, cp = new cpaint(), fim = function() {
  1143 + i3GEOF.legenda.aposAlterarLegenda();
  1144 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1145 + };
  1146 + if (item == "") {
  1147 + i3GEO.janela.tempoMsg("Selecione um item!");
  1148 + return;
  1149 + }
  1150 + if ($i("i3GEOFlegendaaplicaextent").checked === true) {
  1151 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  1152 + } else {
  1153 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
  1154 + }
  1155 + i3GEOF.legenda.aguarde.visibility = "visible";
  1156 + cp.set_response_type("JSON");
  1157 + cp.call(p, "alteraclasse", fim);
  1158 + } catch (e) {
  1159 + i3GEO.janela.tempoMsg("Erro: " + e);
  1160 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1161 + }
  1162 + },
  1163 + /*
  1164 + * Function: metade
  1165 + *
  1166 + * Duas classes concentrando a soma das metades
  1167 + *
  1168 + * Veja:
  1169 + *
  1170 + * <ALTERACLASSE>
  1171 + */
  1172 + metade : function() {
  1173 + try {
  1174 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1175 + return;
  1176 + }
  1177 + var item = $i("i3GEOlegendaitensMetade").getElementsByTagName("select")[0].value,
  1178 + itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value,
  1179 + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1180 + + i3GEO.configura.sid
  1181 + + "&funcao=alteraclasse"
  1182 + + "&tema="
  1183 + + i3GEOF.legenda.tema
  1184 + + "&item="
  1185 + + item
  1186 + + "&itemid="
  1187 + + itemid
  1188 + + "&opcao=metade&ignorar="
  1189 + + $i("i3GEOlegendaignorar").value,
  1190 + cp = new cpaint(),
  1191 + fim = function() {
  1192 + i3GEOF.legenda.aposAlterarLegenda();
  1193 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1194 + };
  1195 + if (item == "") {
  1196 + i3GEO.janela.tempoMsg("Selecione um item!");
  1197 + return;
  1198 + }
  1199 + if (itemid == "") {
  1200 + i3GEO.janela.tempoMsg("Selecione um item!");
  1201 + return;
  1202 + }
  1203 + if ($i("i3GEOFlegendaaplicaextent").checked === true) {
  1204 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  1205 + } else {
  1206 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
  1207 + }
  1208 + i3GEOF.legenda.aguarde.visibility = "visible";
  1209 + cp.set_response_type("JSON");
  1210 + cp.call(p, "alteraclasse", fim);
  1211 + } catch (e) {
  1212 + i3GEO.janela.tempoMsg("Erro: " + e);
  1213 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1214 + }
  1215 + },
  1216 + /*
  1217 + * Function: media
  1218 + *
  1219 + * Duas classes considerando a media
  1220 + *
  1221 + * Veja:
  1222 + *
  1223 + * <ALTERACLASSE>
  1224 + */
  1225 + media : function() {
  1226 + try {
  1227 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1228 + return;
  1229 + }
  1230 + var item = $i("i3GEOlegendaitensMedia").getElementsByTagName("select")[0].value,
  1231 + p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1232 + + i3GEO.configura.sid
  1233 + + "&funcao=alteraclasse"
  1234 + + "&tema="
  1235 + + i3GEOF.legenda.tema
  1236 + + "&item="
  1237 + + item
  1238 + + "&opcao=media&ignorar="
  1239 + + $i("i3GEOlegendaignorar").value,
  1240 + cp = new cpaint(),
  1241 + fim = function() {
  1242 + i3GEOF.legenda.aposAlterarLegenda();
  1243 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1244 + };
  1245 + if (item == "") {
  1246 + i3GEO.janela.tempoMsg("Selecione um item!");
  1247 + return;
  1248 + }
  1249 + if ($i("i3GEOFlegendaaplicaextent").checked === true) {
  1250 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
  1251 + } else {
  1252 + p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
  1253 + }
  1254 + i3GEOF.legenda.aguarde.visibility = "visible";
  1255 + cp.set_response_type("JSON");
  1256 + cp.call(p, "alteraclasse", fim);
  1257 + } catch (e) {
  1258 + i3GEO.janela.tempoMsg("Erro: " + e);
  1259 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1260 + }
  1261 + },
  1262 + /*
  1263 + * Function: valorQ
  1264 + *
  1265 + * Altera a leganda do tema claculando as classes pelo m&eacute;todo quartil
  1266 + *
  1267 + * Veja:
  1268 + *
  1269 + * <ALTERACLASSE>
  1270 + */
  1271 + valorQ : function() {
  1272 + try {
  1273 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1274 + return;
  1275 + }
  1276 + var item = $i("i3GEOlegendaitensValorQuartil").getElementsByTagName("select")[0].value, ext =
  1277 + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
  1278 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1279 + + i3GEO.configura.sid
  1280 + + "&funcao=alteraclasse&tema="
  1281 + + i3GEOF.legenda.tema
  1282 + + "&item="
  1283 + + item
  1284 + + "&opcao=quartis&ignorar="
  1285 + + $i("i3GEOlegendaignorar").value
  1286 + + "&ext="
  1287 + + ext
  1288 + + "&tipoLegenda="
  1289 + + $i("estiloClassesQuartis").value, cp = new cpaint(), fim = function() {
  1290 + i3GEOF.legenda.aposAlterarLegenda();
  1291 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1292 + };
  1293 + if (item == "") {
  1294 + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
  1295 + return;
  1296 + }
  1297 + i3GEOF.legenda.aguarde.visibility = "visible";
  1298 + cp.set_response_type("JSON");
  1299 + cp.call(p, "alteraclasse", fim);
  1300 + } catch (e) {
  1301 + i3GEO.janela.tempoMsg("Erro: " + e);
  1302 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1303 + }
  1304 + },
  1305 + /*
  1306 + * Function: valorQu
  1307 + *
  1308 + * Altera a leganda do tema por meio do calculo de quantis
  1309 + *
  1310 + * Veja:
  1311 + *
  1312 + * <ALTERACLASSE>
  1313 + */
  1314 + valorQu : function() {
  1315 + try {
  1316 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1317 + return;
  1318 + }
  1319 + var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
  1320 + $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
  1321 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1322 + + i3GEO.configura.sid
  1323 + + "&funcao=alteraclasse&nclasses="
  1324 + + nclasses
  1325 + + "&tema="
  1326 + + i3GEOF.legenda.tema
  1327 + + "&item="
  1328 + + item
  1329 + + "&opcao=quantil&ignorar="
  1330 + + $i("i3GEOlegendaignorar").value
  1331 + + "&ext="
  1332 + + ext, cp = new cpaint(), fim = function() {
  1333 + i3GEOF.legenda.aposAlterarLegenda();
  1334 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1335 + };
  1336 + if (item == "") {
  1337 + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
  1338 + return;
  1339 + }
  1340 + i3GEOF.legenda.aguarde.visibility = "visible";
  1341 + cp.set_response_type("JSON");
  1342 + cp.call(p, "alteraclasse", fim);
  1343 + } catch (e) {
  1344 + i3GEO.janela.tempoMsg("Erro: " + e);
  1345 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1346 + }
  1347 + },
  1348 + /*
  1349 + * Function: valorQN
  1350 + *
  1351 + * Altera a legenda do tema por meio do calculo de quebras naturais
  1352 + *
  1353 + * Veja:
  1354 + *
  1355 + * <ALTERACLASSE>
  1356 + */
  1357 + valorQN : function() {
  1358 + try {
  1359 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1360 + return;
  1361 + }
  1362 + var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
  1363 + $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
  1364 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1365 + + i3GEO.configura.sid
  1366 + + "&funcao=alteraclasse&nclasses="
  1367 + + nclasses
  1368 + + "&tema="
  1369 + + i3GEOF.legenda.tema
  1370 + + "&item="
  1371 + + item
  1372 + + "&opcao=quebrasnaturais&ignorar="
  1373 + + $i("i3GEOlegendaignorar").value
  1374 + + "&ext="
  1375 + + ext, cp = new cpaint(), fim = function() {
  1376 + i3GEOF.legenda.aposAlterarLegenda();
  1377 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1378 + };
  1379 + if (item == "") {
  1380 + i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
  1381 + return;
  1382 + }
  1383 + i3GEOF.legenda.aguarde.visibility = "visible";
  1384 + cp.set_response_type("JSON");
  1385 + cp.call(p, "alteraclasse", fim);
  1386 + } catch (e) {
  1387 + i3GEO.janela.tempoMsg("Erro: " + e);
  1388 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1389 + }
  1390 + },
599 1391
600 - i3GEOF.legenda.aguarde.visibility = "visible";  
601 - var retorna = function() {  
602 - i3GEOF.legenda.aposAlterarLegenda();  
603 - i3GEOF.legenda.aguarde.visibility = "hidden";  
604 - i3GEOF.legenda.mostralegenda();  
605 - };  
606 - var p =  
607 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
608 - + i3GEO.configura.sid  
609 - + "&funcao=aplicaOffsite"  
610 - + "&tema="  
611 - + i3GEOF.legenda.tema  
612 - + "&offsite="  
613 - + objTema.offsite,  
614 - cp = new cpaint();  
615 - cp.set_response_type("JSON");  
616 - cp.call(p, "foo", retorna);  
617 - },  
618 - /*  
619 - * Function: mudaLegenda  
620 - *  
621 - * Altera a legenda conforme os valores existentes na tabela de propriedades (express&atilde;o e nome da classe)  
622 - *  
623 - * Veja:  
624 - *  
625 - * <ALTERACLASSE>  
626 - */  
627 - mudaLegenda : function() {  
628 - i3GEOF.legenda.aviso = false;  
629 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
630 - return;  
631 - }  
632 - i3GEOF.legenda.aguarde.visibility = "visible";  
633 - try {  
634 - var tabela = $i("i3GEOlegendalegenda"),  
635 - trs = tabela.getElementsByTagName("tr"),  
636 - minScales = [],  
637 - maxScales = [],  
638 - nomes = [],  
639 - exps = [],  
640 - ids = [],  
641 - t, nn, n, p, cp, temp;  
642 - for (t = 1; t < trs.length; t++) {  
643 - if (trs[t].childNodes) {  
644 - nn = trs[t].childNodes;  
645 - for (n = 0; n < nn.length; n++) {  
646 - if (nn && nn[n] && nn[n].childNodes && nn[n].getElementsByTagName) {  
647 - var isn = nn[n].getElementsByTagName("input");  
648 - if (isn && isn[0] != undefined) {  
649 - if (isn[0].name == "nome") {  
650 - nomes.push(isn[0].value);  
651 - temp = (isn[0].id).split("i3GEOlegendaid_");  
652 - ids.push(temp[1]);  
653 - }  
654 - if (isn[0].name == "expressao") {  
655 - exps.push(isn[0].value);  
656 - }  
657 - if (isn[0].name == "minScale") {  
658 - minScales.push(parseInt(isn[0].value, 10));  
659 - }  
660 - if (isn[0].name == "maxScale") {  
661 - maxScales.push(parseInt(isn[0].value, 10));  
662 - }  
663 - }  
664 - }  
665 - }  
666 - }  
667 - }  
668 - ids = ids.join(";");  
669 - nomes = nomes.join(";");  
670 - exps = exps.join(";");  
671 - minScales = minScales.join(";");  
672 - maxScales = maxScales.join(";");  
673 - temp = function() {  
674 - i3GEOF.legenda.aguarde.visibility = "hidden";  
675 - i3GEOF.legenda.mostralegenda();  
676 - i3GEOF.legenda.aposAlterarLegenda();  
677 - i3GEOF.legenda.aguarde.visibility = "hidden";  
678 - };  
679 - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
680 - p =  
681 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?"  
682 - + "base64=sim"  
683 - + "&g_sid="  
684 - + i3GEO.configura.sid  
685 - + "&funcao=alteraclasse"  
686 - + "&opcao=alteraclasses"  
687 - + "&ext="  
688 - + ext;  
689 - cp = new cpaint();  
690 - cp.set_transfer_mode('POST');  
691 - cp.set_response_type("JSON");  
692 - cp.call(p, "alteraclassesPost", temp, "ids=" + ids  
693 - + "&nomes="  
694 - + i3GEO.util.base64encode(nomes)  
695 - //+ nomes  
696 - + "&exps="  
697 - + i3GEO.util.base64encode(exps)  
698 - //+ exps  
699 - + "&minScales="  
700 - + minScales  
701 - + "&maxScales="  
702 - + maxScales);  
703 - } catch (e) {  
704 - i3GEO.janela.tempoMsg("Erro: " + e);  
705 - i3GEOF.legenda.aguarde.visibility = "hidden";  
706 - }  
707 - },  
708 - /*  
709 - * Function: alteraGeometria  
710 - *  
711 - * Altera o tipo de representa&ccedil;&atilde;o geom&eacute;trica dos elementos de um layer  
712 - *  
713 - * Veja:  
714 - *  
715 - * <ALTERACLASSE>  
716 - */  
717 - alteraGeometriaTema : function() {  
718 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
719 - return;  
720 - }  
721 - i3GEOF.legenda.aguarde.visibility = "visible";  
722 - var retorna = function() {  
723 - i3GEOF.legenda.aposAlterarLegenda();  
724 - i3GEOF.legenda.aguarde.visibility = "hidden";  
725 - i3GEOF.legenda.mostralegenda();  
726 - };  
727 - var p =  
728 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
729 - + i3GEO.configura.sid  
730 - + "&funcao=alteraclasse&opcao=alterageometria&tema="  
731 - + i3GEOF.legenda.tema  
732 - + "&tipo="  
733 - + $i("i3GEOlegentaTipoGeo").value, cp = new cpaint();  
734 - cp.set_response_type("JSON");  
735 - cp.call(p, "", retorna);  
736 - },  
737 - /*  
738 - * Function: adicionaConta  
739 - *  
740 - * Adiciona ao nome de cada classe o n&uacute;mero de ocorr&ecirc;ncias em cada uma  
741 - *  
742 - * Veja:  
743 - *  
744 - * <CONTAGEMCLASSE>  
745 - */  
746 - adicionaConta : function() {  
747 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
748 - return;  
749 - }  
750 - i3GEOF.legenda.aguarde.visibility = "visible";  
751 - var p =  
752 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
753 - + i3GEO.configura.sid  
754 - + "&funcao=contagemclasse"  
755 - + "&tema="  
756 - + i3GEOF.legenda.tema, cp = new cpaint();  
757 - cp.set_response_type("JSON");  
758 - cp.call(p, "contagemclasse", i3GEOF.legenda.montaLegenda);  
759 - i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis', i3GEOF.legenda.dicionario));  
760 - },  
761 - /*  
762 - * Function: adicionaClasse  
763 - *  
764 - * Adiciona uma nova classe ao tema  
765 - *  
766 - * Veja:  
767 - *  
768 - * <ALTERACLASSE>  
769 - */  
770 - adicionaClasse : function() {  
771 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
772 - return;  
773 - }  
774 - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
775 - var p =  
776 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
777 - + i3GEO.configura.sid  
778 - + "&funcao=alteraclasse&opcao=adicionaclasse"  
779 - + "&tema="  
780 - + i3GEOF.legenda.tema  
781 - + "&ext="  
782 - + ext, cp = new cpaint();  
783 - cp.set_response_type("JSON");  
784 - cp.call(p, "alteraclasse", i3GEOF.legenda.mostralegenda);  
785 - },  
786 - /*  
787 - * Function: adicionaOpacidade  
788 - *  
789 - * Adiciona opacidade vari&aacute;vel em cada classe  
790 - *  
791 - * Veja:  
792 - *  
793 - * <ALTERACLASSE>  
794 - */  
795 - adicionaOpacidade : function() {  
796 - var retorna = function() {  
797 - i3GEOF.legenda.aposAlterarLegenda();  
798 - i3GEOF.legenda.aguarde.visibility = "hidden";  
799 - i3GEOF.legenda.mostralegenda();  
800 - };  
801 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
802 - return;  
803 - }  
804 - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
805 - var p =  
806 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
807 - + i3GEO.configura.sid  
808 - + "&funcao=alteraclasse&opcao=adicionaopacidade"  
809 - + "&tema="  
810 - + i3GEOF.legenda.tema  
811 - + "&ext="  
812 - + ext, cp = new cpaint();  
813 - cp.set_response_type("JSON");  
814 - cp.call(p, "alteraclasse", retorna);  
815 - },  
816 - /*  
817 - * Function: paleta  
818 - *  
819 - * Gera as cores para as classes considerando um RGB inicial e um final  
820 - *  
821 - * Veja:  
822 - *  
823 - * <ALTERACORESCLASSES>  
824 - */  
825 - paleta : function() {  
826 - try {  
827 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
828 - return;  
829 - }  
830 - i3GEOF.legenda.aguarde.visibility = "visible";  
831 - var retornapaleta = function() {  
832 - i3GEOF.legenda.aposAlterarLegenda();  
833 - i3GEOF.legenda.aguarde.visibility = "hidden";  
834 - i3GEOF.legenda.mostralegenda();  
835 - }, ci = $i("i3GEOlegendaacori").value, cf = $i("i3GEOlegendaacorf").value, cp = new cpaint(), p =  
836 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
837 - + i3GEO.configura.sid  
838 - + "&funcao=alteraCoresClasses&tema="  
839 - + i3GEOF.legenda.tema  
840 - + "&cori="  
841 - + ci  
842 - + "&corf="  
843 - + cf;  
844 - cp.set_response_type("JSON");  
845 - cp.call(p, "alteraCoresClasses", retornapaleta);  
846 - } catch (e) {  
847 - i3GEO.janela.tempoMsg("Erro: " + e);  
848 - i3GEOF.legenda.aguarde.visibility = "hidden";  
849 - }  
850 - },  
851 - /*  
852 - * Function: inverteCores  
853 - *  
854 - * Inverte as cores utilizadas nos s&iacute;mbolos das classes  
855 - *  
856 - * Veja:  
857 - *  
858 - * <INVERTECORESCLASSES>  
859 - */  
860 - inverteCores : function() {  
861 - try {  
862 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
863 - return;  
864 - }  
865 - i3GEOF.legenda.aguarde.visibility = "visible";  
866 - var retornapaleta = function() {  
867 - i3GEOF.legenda.aposAlterarLegenda();  
868 - i3GEOF.legenda.aguarde.visibility = "hidden";  
869 - i3GEOF.legenda.mostralegenda();  
870 - }, cp = new cpaint(), p =  
871 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
872 - + i3GEO.configura.sid  
873 - + "&funcao=inverteCoresClasses&tema="  
874 - + i3GEOF.legenda.tema;  
875 - cp.set_response_type("JSON");  
876 - cp.call(p, "alteraCoresClasses", retornapaleta);  
877 - } catch (e) {  
878 - i3GEO.janela.tempoMsg("Erro: " + e);  
879 - i3GEOF.legenda.aguarde.visibility = "hidden";  
880 - }  
881 - },  
882 - /*  
883 - * Function: calculaTamanho  
884 - *  
885 - * Muda o s&iacute;mbolo de cada classe aplicando tamanhos diferentes e lineares  
886 - *  
887 - * Veja:  
888 - *  
889 - * <CALCULATAMANHOCLASSES>  
890 - */  
891 - calculaTamanho : function() {  
892 - try {  
893 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
894 - return;  
895 - }  
896 - i3GEOF.legenda.aguarde.visibility = "visible";  
897 - var retornapaleta = function() {  
898 - i3GEOF.legenda.aposAlterarLegenda();  
899 - i3GEOF.legenda.aguarde.visibility = "hidden";  
900 - i3GEOF.legenda.mostralegenda();  
901 - }, cp = new cpaint(), p =  
902 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
903 - + i3GEO.configura.sid  
904 - + "&funcao=calculaTamanhoClasses&tema="  
905 - + i3GEOF.legenda.tema;  
906 - cp.set_response_type("JSON");  
907 - cp.call(p, "calculaTamanhoClasses", retornapaleta);  
908 - } catch (e) {  
909 - i3GEO.janela.tempoMsg("Erro: " + e);  
910 - i3GEOF.legenda.aguarde.visibility = "hidden";  
911 - }  
912 - },  
913 - /*  
914 - * Function: ordenaClasses  
915 - *  
916 - * Ordena as classes pelo nome  
917 - *  
918 - */  
919 - ordenaClasses : function() {  
920 - try {  
921 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
922 - return;  
923 - }  
924 - i3GEOF.legenda.aguarde.visibility = "visible";  
925 - var retornapaleta = function() {  
926 - i3GEOF.legenda.aposAlterarLegenda();  
927 - i3GEOF.legenda.aguarde.visibility = "hidden";  
928 - i3GEOF.legenda.mostralegenda();  
929 - }, cp = new cpaint(), p =  
930 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
931 - + i3GEO.configura.sid  
932 - + "&funcao=ordenaClasses&tema="  
933 - + i3GEOF.legenda.tema;  
934 - cp.set_response_type("JSON");  
935 - cp.call(p, "foo", retornapaleta);  
936 - } catch (e) {  
937 - i3GEO.janela.tempoMsg("Erro: " + e);  
938 - i3GEOF.legenda.aguarde.visibility = "hidden";  
939 - }  
940 - },  
941 - /*  
942 - * Function: excluilinhaf  
943 - *  
944 - * Exclui uma linha da tabela de edi&ccedil;&atilde;o de classes da legendda  
945 - */  
946 - excluilinhaf : function(id) {  
947 - var p = $i(id);  
948 - do {  
949 - p.removeChild(p.childNodes[0]);  
950 - } while (p.childNodes.length > 0);  
951 - p.parentNode.removeChild(p);  
952 - i3GEOF.legenda.mudaLegenda();  
953 - },  
954 - /*  
955 - * Function: sobelinhaf  
956 - *  
957 - * Sobe uma linha na tabela de edi&ccedil;&atilde;o de classes da legendda  
958 - */  
959 - sobelinhaf : function(idclasse) {  
960 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
961 - return;  
962 - }  
963 - i3GEOF.legenda.aguarde.visibility = "visible";  
964 - var p =  
965 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
966 - + i3GEO.configura.sid  
967 - + "&funcao=ALTERACLASSE&opcao=sobeclasse&tema="  
968 - + i3GEOF.legenda.tema  
969 - + "&idclasse="  
970 - + idclasse, cp = new cpaint(), temp = function() {  
971 - i3GEOF.legenda.aguarde.visibility = "hidden";  
972 - i3GEOF.legenda.mostralegenda();  
973 - };  
974 - cp.set_response_type("JSON");  
975 - cp.call(p, "foo", temp);  
976 - },  
977 - /*  
978 - * Function: descelinhaf  
979 - *  
980 - * Desce uma linha na tabela de edi&ccedil;&atilde;o de classes da legendda  
981 - */  
982 - descelinhaf : function(idclasse) {  
983 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
984 - return;  
985 - }  
986 - i3GEOF.legenda.aguarde.visibility = "visible";  
987 - var p =  
988 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
989 - + i3GEO.configura.sid  
990 - + "&funcao=ALTERACLASSE&opcao=desceclasse&tema="  
991 - + i3GEOF.legenda.tema  
992 - + "&idclasse="  
993 - + idclasse, cp = new cpaint(), temp = function() {  
994 - i3GEOF.legenda.aguarde.visibility = "hidden";  
995 - i3GEOF.legenda.mostralegenda();  
996 - };  
997 - ;  
998 - cp.set_response_type("JSON");  
999 - cp.call(p, "foo", temp);  
1000 - },  
1001 - /*  
1002 - * Function: editaSimbolo  
1003 - *  
1004 - * Abre o editor de s&iacute;mbolos  
1005 - *  
1006 - * Veja:  
1007 - *  
1008 - * <EDITASIMBOLO>  
1009 - */  
1010 - editaSimbolo : function(id) {  
1011 - try {  
1012 - $i("i3GEOlegendaguia1obj").style.display = "none";  
1013 - $i("i3GEOlegendaguia3obj").style.display = "block";  
1014 - id = id.split("-");  
1015 - i3GEOF.legenda.classe = id[1];  
1016 - i3GEOF.legenda.formEditorSimbolo();  
1017 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1018 - } catch (e) {  
1019 - i3GEO.janela.tempoMsg("Erro: " + e);  
1020 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1021 - }  
1022 - },  
1023 - formEditorSimbolo : function() {  
1024 - var p =  
1025 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1026 - + i3GEO.configura.sid  
1027 - + "&funcao=editasimbolo&opcao=pegaparametros&tema="  
1028 - + i3GEOF.legenda.tema  
1029 - + "&classe="  
1030 - + i3GEOF.legenda.classe, cp = new cpaint();  
1031 - cp.set_response_type("JSON");  
1032 - cp.call(p, "pegaParametrosMapa", i3GEOF.legenda.montaEditor);  
1033 - },  
1034 - /*  
1035 - * Function: simbU  
1036 - *  
1037 - * Altera a leganda do tema para o tipo s&iacute;mbolo &uacute;nico  
1038 - *  
1039 - * Veja:  
1040 - *  
1041 - * <ALTERACLASSE>  
1042 - */  
1043 - simbU : function() {  
1044 - try {  
1045 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1046 - return;  
1047 - }  
1048 - i3GEOF.legenda.aguarde.visibility = "visible";  
1049 - var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
1050 - var p =  
1051 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1052 - + i3GEO.configura.sid  
1053 - + "&funcao=alteraclasse&tema="  
1054 - + i3GEOF.legenda.tema  
1055 - + "&opcao=simbolounico&ext="  
1056 - + ext, cp = new cpaint(), fim = function() {  
1057 - i3GEOF.legenda.aposAlterarLegenda();  
1058 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1059 - };  
1060 - cp.set_response_type("JSON");  
1061 - cp.call(p, "alteraclasse", fim);  
1062 - } catch (e) {  
1063 - i3GEO.janela.tempoMsg("Erro: " + e);  
1064 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1065 - }  
1066 - },  
1067 - /*  
1068 - * Function: valorU  
1069 - *  
1070 - * Altera a leganda do tema para o tipo valor &uacute;nico  
1071 - *  
1072 - * Veja:  
1073 - *  
1074 - * <ALTERACLASSE>  
1075 - */  
1076 - valorU : function() {  
1077 - try {  
1078 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1079 - return;  
1080 - }  
1081 - var item = $i("i3GEOlegendaitensValorUnico").getElementsByTagName("select")[0].value, itemNome =  
1082 - $i("i3GEOlegendaClassesValorUnico").getElementsByTagName("select")[0].value, p =  
1083 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1084 - + i3GEO.configura.sid  
1085 - + "&funcao=alteraclasse&tema="  
1086 - + i3GEOF.legenda.tema  
1087 - + "&item="  
1088 - + item  
1089 - + "&itemNome="  
1090 - + itemNome  
1091 - + "&opcao=valorunico"  
1092 - + "&ignorar="  
1093 - + $i("i3GEOlegendaignorar").value, cp = new cpaint(), fim = function() {  
1094 - i3GEOF.legenda.aposAlterarLegenda();  
1095 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1096 - };  
1097 - if ($i("i3GEOFlegendaaplicaextent").checked === true) {  
1098 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
1099 - } else {  
1100 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);  
1101 - } 1392 + /*
  1393 + * Function: representacao
  1394 + *
  1395 + * Altera o tipo de representa&ccedil;&atilde;o do tema (linear ou poligonoal)
  1396 + *
  1397 + * Veja:
  1398 + *
  1399 + * <ALTERAREPRESENTACAO>
  1400 + *
  1401 + */
  1402 + representacao : function() {
  1403 + try {
  1404 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1405 + return;
  1406 + }
  1407 + var p =
  1408 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1409 + + i3GEO.configura.sid
  1410 + + "&funcao=alterarepresentacao&tema="
  1411 + + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() {
  1412 + i3GEOF.legenda.aposAlterarLegenda();
  1413 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1414 + };
  1415 + i3GEOF.legenda.aguarde.visibility = "visible";
  1416 + cp.set_response_type("JSON");
  1417 + cp.call(p, "alteraRepresentacao", fim);
  1418 + } catch (e) {
  1419 + i3GEO.janela.tempoMsg("Erro: " + e);
  1420 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1421 + }
  1422 + },
  1423 + /*
  1424 + * Function: montaEditor
  1425 + *
  1426 + * Monta o editor de s&iacute;mbolos quando o usu&aacute;rio clica em um s&iacute;mbolo na legenda
  1427 + */
  1428 + montaEditor : function(retorno) {
  1429 + try {
  1430 + i3GEO.util.comboItens(
  1431 + "i3GEOlegendaSelItemLabel",
  1432 + i3GEOF.legenda.tema,
  1433 + function(retorno) {
  1434 + if ($i("i3GEOlegendaitensLabel")) {
  1435 + $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados ;
  1436 + }
  1437 + },
  1438 + "i3GEOlegendaitensLabel",
  1439 + "",
  1440 + "",
  1441 + "",
  1442 + "form-control"
  1443 + );
  1444 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1445 + return;
  1446 + }
  1447 + i3GEOF.legenda.aguarde.visibility = "visible";
  1448 + if (retorno.data != undefined) {
  1449 + var b, l, i, sct, combo, n;
  1450 + retorno = retorno.data;
  1451 + i3GEOF.legenda.estilos = retorno.split("|");
  1452 + combo =
  1453 + "<select id='i3GEOlegendaestilos' class='form-control' onchange=i3GEOF.legenda.estilo=this.value;i3GEOF.legenda.mostraEstilo(this.value)>";
  1454 + n = i3GEOF.legenda.estilos.length;
  1455 + for (i = 0; i < n; i++) {
  1456 + l = i3GEOF.legenda.estilos[i].split("#");
  1457 + sct = "<option value=" + l[1] + " />" + l[1] + "</option>";
  1458 + combo += sct;
  1459 + }
  1460 + combo += "</select></div>";
  1461 + $i("i3GEOlegendacomboestilos").innerHTML = combo;
  1462 + $i("i3GEOlegendaestilos").value = i3GEOF.legenda.estilo;
1102 1463
1103 - if (item == "") {  
1104 - i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));  
1105 - return;  
1106 - }  
1107 - i3GEOF.legenda.aguarde.visibility = "visible";  
1108 - cp.set_response_type("JSON");  
1109 - cp.call(p, "alteraclasse", fim);  
1110 - } catch (e) {  
1111 - i3GEO.janela.tempoMsg("Erro: " + e);  
1112 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1113 - }  
1114 - },  
1115 - /*  
1116 - * Function: valorC  
1117 - *  
1118 - * Altera a leganda do tema com um n&uacute;mero espec&iacute;fico de classes  
1119 - *  
1120 - * Veja:  
1121 - *  
1122 - * <ALTERACLASSE>  
1123 - */  
1124 - valorC : function() {  
1125 - try {  
1126 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1127 - return;  
1128 - }  
1129 - var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =  
1130 - $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =  
1131 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1132 - + i3GEO.configura.sid  
1133 - + "&funcao=alteraclasse&nclasses="  
1134 - + nclasses  
1135 - + "&tema="  
1136 - + i3GEOF.legenda.tema  
1137 - + "&item="  
1138 - + item  
1139 - + "&opcao=intervalosiguais&ignorar="  
1140 - + $i("i3GEOlegendaignorar").value  
1141 - + "&ext="  
1142 - + ext, cp = new cpaint(), fim = function() {  
1143 - i3GEOF.legenda.aposAlterarLegenda();  
1144 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1145 - };  
1146 - if (item == "") {  
1147 - i3GEO.janela.tempoMsg("Selecione um item!");  
1148 - return;  
1149 - }  
1150 - if ($i("i3GEOFlegendaaplicaextent").checked === true) {  
1151 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
1152 - } else {  
1153 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);  
1154 - }  
1155 - i3GEOF.legenda.aguarde.visibility = "visible";  
1156 - cp.set_response_type("JSON");  
1157 - cp.call(p, "alteraclasse", fim);  
1158 - } catch (e) {  
1159 - i3GEO.janela.tempoMsg("Erro: " + e);  
1160 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1161 - }  
1162 - },  
1163 - /*  
1164 - * Function: metade  
1165 - *  
1166 - * Duas classes concentrando a soma das metades  
1167 - *  
1168 - * Veja:  
1169 - *  
1170 - * <ALTERACLASSE>  
1171 - */  
1172 - metade : function() {  
1173 - try {  
1174 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1175 - return;  
1176 - }  
1177 - var item = $i("i3GEOlegendaitensMetade").getElementsByTagName("select")[0].value,  
1178 - itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value,  
1179 - p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1180 - + i3GEO.configura.sid  
1181 - + "&funcao=alteraclasse"  
1182 - + "&tema="  
1183 - + i3GEOF.legenda.tema  
1184 - + "&item="  
1185 - + item  
1186 - + "&itemid="  
1187 - + itemid  
1188 - + "&opcao=metade&ignorar="  
1189 - + $i("i3GEOlegendaignorar").value,  
1190 - cp = new cpaint(),  
1191 - fim = function() {  
1192 - i3GEOF.legenda.aposAlterarLegenda();  
1193 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1194 - };  
1195 - if (item == "") {  
1196 - i3GEO.janela.tempoMsg("Selecione um item!");  
1197 - return;  
1198 - }  
1199 - if (itemid == "") {  
1200 - i3GEO.janela.tempoMsg("Selecione um item!");  
1201 - return;  
1202 - }  
1203 - if ($i("i3GEOFlegendaaplicaextent").checked === true) {  
1204 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
1205 - } else {  
1206 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);  
1207 - }  
1208 - i3GEOF.legenda.aguarde.visibility = "visible";  
1209 - cp.set_response_type("JSON");  
1210 - cp.call(p, "alteraclasse", fim);  
1211 - } catch (e) {  
1212 - i3GEO.janela.tempoMsg("Erro: " + e);  
1213 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1214 - }  
1215 - },  
1216 - /*  
1217 - * Function: media  
1218 - *  
1219 - * Duas classes considerando a media  
1220 - *  
1221 - * Veja:  
1222 - *  
1223 - * <ALTERACLASSE>  
1224 - */  
1225 - media : function() {  
1226 - try {  
1227 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1228 - return;  
1229 - }  
1230 - var item = $i("i3GEOlegendaitensMedia").getElementsByTagName("select")[0].value,  
1231 - p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1232 - + i3GEO.configura.sid  
1233 - + "&funcao=alteraclasse"  
1234 - + "&tema="  
1235 - + i3GEOF.legenda.tema  
1236 - + "&item="  
1237 - + item  
1238 - + "&opcao=media&ignorar="  
1239 - + $i("i3GEOlegendaignorar").value,  
1240 - cp = new cpaint(),  
1241 - fim = function() {  
1242 - i3GEOF.legenda.aposAlterarLegenda();  
1243 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1244 - };  
1245 - if (item == "") {  
1246 - i3GEO.janela.tempoMsg("Selecione um item!");  
1247 - return;  
1248 - }  
1249 - if ($i("i3GEOFlegendaaplicaextent").checked === true) {  
1250 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);  
1251 - } else {  
1252 - p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);  
1253 - }  
1254 - i3GEOF.legenda.aguarde.visibility = "visible";  
1255 - cp.set_response_type("JSON");  
1256 - cp.call(p, "alteraclasse", fim);  
1257 - } catch (e) {  
1258 - i3GEO.janela.tempoMsg("Erro: " + e);  
1259 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1260 - }  
1261 - },  
1262 - /*  
1263 - * Function: valorQ  
1264 - *  
1265 - * Altera a leganda do tema claculando as classes pelo m&eacute;todo quartil  
1266 - *  
1267 - * Veja:  
1268 - *  
1269 - * <ALTERACLASSE>  
1270 - */  
1271 - valorQ : function() {  
1272 - try {  
1273 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1274 - return;  
1275 - }  
1276 - var item = $i("i3GEOlegendaitensValorQuartil").getElementsByTagName("select")[0].value, ext =  
1277 - i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =  
1278 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1279 - + i3GEO.configura.sid  
1280 - + "&funcao=alteraclasse&tema="  
1281 - + i3GEOF.legenda.tema  
1282 - + "&item="  
1283 - + item  
1284 - + "&opcao=quartis&ignorar="  
1285 - + $i("i3GEOlegendaignorar").value  
1286 - + "&ext="  
1287 - + ext  
1288 - + "&tipoLegenda="  
1289 - + $i("estiloClassesQuartis").value, cp = new cpaint(), fim = function() {  
1290 - i3GEOF.legenda.aposAlterarLegenda();  
1291 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1292 - };  
1293 - if (item == "") {  
1294 - i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));  
1295 - return;  
1296 - }  
1297 - i3GEOF.legenda.aguarde.visibility = "visible";  
1298 - cp.set_response_type("JSON");  
1299 - cp.call(p, "alteraclasse", fim);  
1300 - } catch (e) {  
1301 - i3GEO.janela.tempoMsg("Erro: " + e);  
1302 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1303 - }  
1304 - },  
1305 - /*  
1306 - * Function: valorQu  
1307 - *  
1308 - * Altera a leganda do tema por meio do calculo de quantis  
1309 - *  
1310 - * Veja:  
1311 - *  
1312 - * <ALTERACLASSE>  
1313 - */  
1314 - valorQu : function() {  
1315 - try {  
1316 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1317 - return;  
1318 - }  
1319 - var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =  
1320 - $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =  
1321 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1322 - + i3GEO.configura.sid  
1323 - + "&funcao=alteraclasse&nclasses="  
1324 - + nclasses  
1325 - + "&tema="  
1326 - + i3GEOF.legenda.tema  
1327 - + "&item="  
1328 - + item  
1329 - + "&opcao=quantil&ignorar="  
1330 - + $i("i3GEOlegendaignorar").value  
1331 - + "&ext="  
1332 - + ext, cp = new cpaint(), fim = function() {  
1333 - i3GEOF.legenda.aposAlterarLegenda();  
1334 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1335 - };  
1336 - if (item == "") {  
1337 - i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));  
1338 - return;  
1339 - }  
1340 - i3GEOF.legenda.aguarde.visibility = "visible";  
1341 - cp.set_response_type("JSON");  
1342 - cp.call(p, "alteraclasse", fim);  
1343 - } catch (e) {  
1344 - i3GEO.janela.tempoMsg("Erro: " + e);  
1345 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1346 - }  
1347 - },  
1348 - /*  
1349 - * Function: valorQN  
1350 - *  
1351 - * Altera a legenda do tema por meio do calculo de quebras naturais  
1352 - *  
1353 - * Veja:  
1354 - *  
1355 - * <ALTERACLASSE>  
1356 - */  
1357 - valorQN : function() {  
1358 - try {  
1359 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1360 - return;  
1361 - }  
1362 - var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =  
1363 - $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =  
1364 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1365 - + i3GEO.configura.sid  
1366 - + "&funcao=alteraclasse&nclasses="  
1367 - + nclasses  
1368 - + "&tema="  
1369 - + i3GEOF.legenda.tema  
1370 - + "&item="  
1371 - + item  
1372 - + "&opcao=quebrasnaturais&ignorar="  
1373 - + $i("i3GEOlegendaignorar").value  
1374 - + "&ext="  
1375 - + ext, cp = new cpaint(), fim = function() {  
1376 - i3GEOF.legenda.aposAlterarLegenda();  
1377 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1378 - };  
1379 - if (item == "") {  
1380 - i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));  
1381 - return;  
1382 - }  
1383 - i3GEOF.legenda.aguarde.visibility = "visible";  
1384 - cp.set_response_type("JSON");  
1385 - cp.call(p, "alteraclasse", fim);  
1386 - } catch (e) {  
1387 - i3GEO.janela.tempoMsg("Erro: " + e);  
1388 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1389 - }  
1390 - },  
1391 1464
1392 - /*  
1393 - * Function: representacao  
1394 - *  
1395 - * Altera o tipo de representa&ccedil;&atilde;o do tema (linear ou poligonoal)  
1396 - *  
1397 - * Veja:  
1398 - *  
1399 - * <ALTERAREPRESENTACAO>  
1400 - *  
1401 - */  
1402 - representacao : function() {  
1403 - try {  
1404 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1405 - return;  
1406 - }  
1407 - var p =  
1408 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1409 - + i3GEO.configura.sid  
1410 - + "&funcao=alterarepresentacao&tema="  
1411 - + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() {  
1412 - i3GEOF.legenda.aposAlterarLegenda();  
1413 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1414 - };  
1415 - i3GEOF.legenda.aguarde.visibility = "visible";  
1416 - cp.set_response_type("JSON");  
1417 - cp.call(p, "alteraRepresentacao", fim);  
1418 - } catch (e) {  
1419 - i3GEO.janela.tempoMsg("Erro: " + e);  
1420 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1421 - }  
1422 - },  
1423 - /*  
1424 - * Function: montaEditor  
1425 - *  
1426 - * Monta o editor de s&iacute;mbolos quando o usu&aacute;rio clica em um s&iacute;mbolo na legenda  
1427 - */  
1428 - montaEditor : function(retorno) {  
1429 - try {  
1430 - i3GEO.util.comboItens(  
1431 - "i3GEOlegendaSelItemLabel",  
1432 - i3GEOF.legenda.tema,  
1433 - function(retorno) {  
1434 - if ($i("i3GEOlegendaitensLabel")) {  
1435 - $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados ;  
1436 - }  
1437 - },  
1438 - "i3GEOlegendaitensLabel",  
1439 - "",  
1440 - "",  
1441 - "",  
1442 - "form-control"  
1443 - );  
1444 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1445 - return;  
1446 - }  
1447 - i3GEOF.legenda.aguarde.visibility = "visible";  
1448 - if (retorno.data != undefined) {  
1449 - var b, l, i, sct, combo, n;  
1450 - retorno = retorno.data;  
1451 - i3GEOF.legenda.estilos = retorno.split("|");  
1452 - combo =  
1453 - "<select id='i3GEOlegendaestilos' class='form-control' onchange=i3GEOF.legenda.estilo=this.value;i3GEOF.legenda.mostraEstilo(this.value)>";  
1454 - n = i3GEOF.legenda.estilos.length;  
1455 - for (i = 0; i < n; i++) {  
1456 - l = i3GEOF.legenda.estilos[i].split("#");  
1457 - sct = "<option value=" + l[1] + " />" + l[1] + "</option>";  
1458 - combo += sct;  
1459 - }  
1460 - combo += "</select></div>";  
1461 - $i("i3GEOlegendacomboestilos").innerHTML = combo;  
1462 - $i("i3GEOlegendaestilos").value = i3GEOF.legenda.estilo; 1465 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1466 + i3GEOF.legenda.mostraEstilo(0);
  1467 + } else {
  1468 + $i("i3GEOlegendacomboestilos").innerHTML = "<p style=color:red >Erro<br>";
  1469 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1470 + }
  1471 + } catch (e) {
  1472 + i3GEO.janela.tempoMsg("Erro: " + e);
  1473 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1474 + }
  1475 + },
  1476 + desceEstilo: function() {
  1477 + try {
  1478 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1479 + return;
  1480 + }
  1481 + i3GEOF.legenda.aguarde.visibility = "visible";
  1482 + var p =
  1483 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1484 + + i3GEO.configura.sid
  1485 + + "&funcao=editasimbolo&opcao=desceestilo&tema="
  1486 + + i3GEOF.legenda.tema
  1487 + + "&classe="
  1488 + + i3GEOF.legenda.classe
  1489 + + "&estilo="
  1490 + + i3GEOF.legenda.estilo, cp = new cpaint();
  1491 + cp.set_response_type("JSON");
  1492 + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
  1493 + } catch (e) {
  1494 + i3GEO.janela.tempoMsg("Erro: " + e);
  1495 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1496 + }
  1497 + },
  1498 + sobeEstilo: function() {
  1499 + try {
  1500 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1501 + return;
  1502 + }
  1503 + i3GEOF.legenda.aguarde.visibility = "visible";
  1504 + var p =
  1505 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1506 + + i3GEO.configura.sid
  1507 + + "&funcao=editasimbolo&opcao=sobeestilo&tema="
  1508 + + i3GEOF.legenda.tema
  1509 + + "&classe="
  1510 + + i3GEOF.legenda.classe
  1511 + + "&estilo="
  1512 + + i3GEOF.legenda.estilo, cp = new cpaint();
  1513 + cp.set_response_type("JSON");
  1514 + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
  1515 + } catch (e) {
  1516 + i3GEO.janela.tempoMsg("Erro: " + e);
  1517 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1518 + }
  1519 + },
  1520 + adicionaEstilo: function() {
  1521 + try {
  1522 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1523 + return;
  1524 + }
  1525 + i3GEOF.legenda.aguarde.visibility = "visible";
  1526 + var p =
  1527 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1528 + + i3GEO.configura.sid
  1529 + + "&funcao=editasimbolo&opcao=adicionaestilo&tema="
  1530 + + i3GEOF.legenda.tema
  1531 + + "&classe="
  1532 + + i3GEOF.legenda.classe
  1533 + + "&estilo="
  1534 + + i3GEOF.legenda.estilo, cp = new cpaint();
  1535 + cp.set_response_type("JSON");
  1536 + i3GEOF.legenda.estilo = i3GEOF.legenda.estilo + 1;
  1537 + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
  1538 + } catch (e) {
  1539 + i3GEO.janela.tempoMsg("Erro: " + e);
  1540 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1541 + }
  1542 + },
  1543 + excluiEstilo: function() {
  1544 + try {
  1545 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1546 + return;
  1547 + }
  1548 + i3GEOF.legenda.aguarde.visibility = "visible";
  1549 + i3GEOF.legenda.estilo = 0;
  1550 + var p =
  1551 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1552 + + i3GEO.configura.sid
  1553 + + "&funcao=editasimbolo&opcao=excluiestilo&tema="
  1554 + + i3GEOF.legenda.tema
  1555 + + "&classe="
  1556 + + i3GEOF.legenda.classe
  1557 + + "&estilo="
  1558 + + i3GEOF.legenda.estilo, cp = new cpaint();
  1559 + cp.set_response_type("JSON");
  1560 + cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
  1561 + } catch (e) {
  1562 + i3GEO.janela.tempoMsg("Erro: " + e);
  1563 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1564 + }
  1565 + },
  1566 + /*
  1567 + * Function: mostraEstilo
  1568 + *
  1569 + * Mostra as propriedades de um estilo de um s&iacute;mbolo
  1570 + */
  1571 + mostraEstilo : function() {
  1572 + i3GEOF.legenda.aguarde.visibility = "visible";
  1573 + try {
  1574 + var linha, tipoLayer, d, p, cp, mustache = {};
  1575 + //i3GEOF.legenda.estilo = e; // esta e uma variavel global
  1576 + linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo];
  1577 + linha = linha.split("#");
  1578 + tipoLayer = linha[0];
  1579 + mustache = {
  1580 + "voutlinecolor": linha[2],
  1581 + "vcolor": linha[4],
  1582 + "vbackgroundcolor": linha[3],
  1583 + "vsize": linha[6],
  1584 + "vwidth": linha[8],
  1585 + "vpattern": linha[9],
  1586 + "vopacity": linha[7],
  1587 + "vangle": linha[10],
  1588 + "vsymbolscale": linha[11],
  1589 + "vminsize": linha[12],
  1590 + "vmaxsize": linha[13],
  1591 + "voffsetx": linha[14],
  1592 + "voffsety": linha[15],
  1593 + "vsymbolname": linha[5],
  1594 + };
1463 1595
  1596 + ins = Mustache.render(
  1597 + i3GEOF.legenda.MUSTACHEESTILO,
  1598 + $.extend(
  1599 + {},
  1600 + mustache,
  1601 + i3GEOF.legenda.DICIONARIO
  1602 + )
  1603 + );
  1604 + $i("i3GEOlegendaParametrosEstilos").innerHTML = ins;
1464 1605
1465 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1466 - i3GEOF.legenda.mostraEstilo(0);  
1467 - } else {  
1468 - $i("i3GEOlegendacomboestilos").innerHTML = "<p style=color:red >Erro<br>";  
1469 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1470 - }  
1471 - } catch (e) {  
1472 - i3GEO.janela.tempoMsg("Erro: " + e);  
1473 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1606 +
  1607 + //preenche as listas de itens
  1608 + i3GEO.util.comboItens(
  1609 + "",
  1610 + i3GEOF.legenda.tema, function(retorno) {
  1611 + if ($i("i3GEOlegendaComboSize")) {
  1612 + $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'");
  1613 + }
  1614 + },
  1615 + "",
  1616 + "",
  1617 + "",
  1618 + "",
  1619 + "form-control"
  1620 + );
  1621 +
  1622 + i3GEO.util.aplicaAquarela("i3GEOlegendaParametrosEstilos");
  1623 +
  1624 + p =
  1625 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1626 + + i3GEO.configura.sid
  1627 + + "&funcao=editasimbolo&tipo="
  1628 + + tipoLayer
  1629 + + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)";
  1630 + cp = new cpaint();
  1631 + cp.set_response_type("JSON");
  1632 + cp.call(p, "editasimbolo", i3GEOF.legenda.listaSimbolos);
  1633 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1634 + } catch (e) {
  1635 + i3GEO.janela.tempoMsg("Erro: " + i3GEOF.legenda.estilo);
  1636 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1637 + }
  1638 + },
  1639 + /*
  1640 + * Function: listaSimbolos
  1641 + *
  1642 + * Monta a lista de s&iacute;mbolos com imagem
  1643 + */
  1644 + listaSimbolos : function(retorno) {
  1645 + i3GEOF.legenda.aguarde.visibility = "visible";
  1646 + try {
  1647 + if (retorno.data != undefined) {
  1648 + retorno = retorno.data;
  1649 + $i("i3GEOlegendasimbolos").innerHTML =
  1650 + "<br>" + $trad('listaSimbolo', i3GEOF.legenda.dicionario) + ":<br><br>" + retorno;
  1651 + } else {
  1652 + $i("i3GEOlegendasimbolos").innerHTML = "<p style=color:red >Erro<br>";
  1653 + }
  1654 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1655 + } catch (e) {
  1656 + i3GEO.janela.tempoMsg("Erro: " + e);
  1657 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1658 + }
  1659 + },
  1660 + /*
  1661 + * Function: aplicaSimbolo
  1662 + *
  1663 + * Muda o valor do campo com o c&oacute;digo do s&iacute;mbolo escolhido
  1664 + */
  1665 + aplicaSimbolo : function(s) {
  1666 + $i("i3GEOlegendasymbolname").value = s.title;
  1667 + },
  1668 + /*
  1669 + * Function: aplicaEstilo
  1670 + *
  1671 + * Aplica ao estilo as propriedades definidas
  1672 + *
  1673 + * Veja:
  1674 + *
  1675 + * <EDITASIMBOLO>
  1676 + */
  1677 + aplicaEstilo : function() {
  1678 + try {
  1679 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1680 + return;
  1681 + }
  1682 + i3GEOF.legenda.aguarde.visibility = "visible";
  1683 + var i, p, cp, fim, outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor =
  1684 + $i("i3GEOlegendabackgroundcolor").value, color = $i("i3GEOlegendacolor").value, symbolname =
  1685 + $i("i3GEOlegendasymbolname").value, simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n =
  1686 + simbolos.length, size = $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern =
  1687 + $i("i3GEOlegendapattern").value, opacidade = $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, symbolscale =
  1688 + $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize =
  1689 + $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value;
  1690 + if (symbolscale != "") {
  1691 + symbolscale = parseInt(symbolscale, 10);
  1692 + } else {
  1693 + symbolscale = -1;
  1694 + }
  1695 + for (i = 0; i < n; i++) {
  1696 + if (simbolos[i].title == symbolname || symbolname == i) {
  1697 + valido = "sim";
  1698 + }
  1699 + }
  1700 + if (valido === "nao") {
  1701 + // i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado");
  1702 + // i3GEOF.legenda.aguarde.visibility = "hidden";
  1703 + // return;
  1704 + }
  1705 + p =
  1706 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1707 + + i3GEO.configura.sid
  1708 + + "&funcao=editasimbolo&opcao=aplica&tema="
  1709 + + i3GEOF.legenda.tema
  1710 + + "&classe="
  1711 + + i3GEOF.legenda.classe
  1712 + + "&estilo="
  1713 + + i3GEOF.legenda.estilo
  1714 + + "&outlinecolor="
  1715 + + outlinecolor
  1716 + + "&backgroundcolor="
  1717 + + backgroundcolor
  1718 + + "&color="
  1719 + + color
  1720 + + "&symbolname="
  1721 + + symbolname
  1722 + + "&width="
  1723 + + width
  1724 + + "&pattern="
  1725 + + pattern
  1726 + + "&size="
  1727 + + size
  1728 + + "&opacidade="
  1729 + + opacidade
  1730 + + "&angle="
  1731 + + angle
  1732 + + "&symbolscale="
  1733 + + symbolscale
  1734 + + "&minsize="
  1735 + + minsize
  1736 + + "&maxsize="
  1737 + + maxsize
  1738 + + "&offsetx="
  1739 + + offsetx
  1740 + + "&offsety="
  1741 + + offsety;
  1742 + cp = new cpaint();
  1743 + fim = function() {
  1744 + i3GEOF.legenda.aposAlterarLegenda();
  1745 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1746 + i3GEOF.legenda.reMontaEditor();
  1747 + };
  1748 + // cp.set_debug(2)
  1749 + cp.set_response_type("JSON");
  1750 + cp.call(p, "editasimbolo", fim);
  1751 + } catch (e) {
  1752 + i3GEO.janela.tempoMsg("Erro: " + e);
  1753 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1754 + }
  1755 + },
  1756 + /*
  1757 + * Function: reMontaEditor
  1758 + *
  1759 + * Gera novamente o editor de s&iacute;mbolo ap&oacute;s ter sido feita alguma altera&ccedil;&atilde;o nos estilos
  1760 + */
  1761 + reMontaEditor : function() {
  1762 + var id = i3GEOF.legenda.tema + "-" + i3GEOF.legenda.classe;
  1763 + i3GEOF.legenda.editaSimbolo(id);
  1764 + },
  1765 + /*
  1766 + * Function: mostraGrafico
  1767 + *
  1768 + * Mostra um gr&aacute;fico com a contegem de elementos em caada classe
  1769 + *
  1770 + * Veja:
  1771 + *
  1772 + * <CONTAGEMCLASSE>
  1773 + */
  1774 + mostraGrafico : function() {
  1775 + try {
  1776 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1777 + return;
  1778 + }
  1779 + i3GEOF.legenda.aguarde.visibility = "visible";
  1780 + var monta =
  1781 + function(retorno) {
  1782 + if (retorno.data && retorno.data[0].proc == "") {
  1783 + var b, ins = [], i, re, t;
  1784 + ins.push("<h5>" + $trad('numeroOcorrenciasClasses', i3GEOF.legenda.dicionario) + "</h5>");
  1785 + ins.push("<table width=100% >");
  1786 + i3GEOF.legenda.dadosGrafico = [
  1787 + "n;x"
  1788 + ];
  1789 + if (retorno.data.length < 2) {
  1790 + i3GEO.janela.tempoMsg($trad('msgNumeroClasses', i3GEOF.legenda.dicionario));
  1791 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1792 + return;
  1793 + } else {
  1794 + i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4", "i3GEOlegendaguia");
1474 } 1795 }
1475 - },  
1476 - desceEstilo: function() {  
1477 - try {  
1478 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1479 - return;  
1480 - }  
1481 - i3GEOF.legenda.aguarde.visibility = "visible";  
1482 - var p =  
1483 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1484 - + i3GEO.configura.sid  
1485 - + "&funcao=editasimbolo&opcao=desceestilo&tema="  
1486 - + i3GEOF.legenda.tema  
1487 - + "&classe="  
1488 - + i3GEOF.legenda.classe  
1489 - + "&estilo="  
1490 - + i3GEOF.legenda.estilo, cp = new cpaint();  
1491 - cp.set_response_type("JSON");  
1492 - cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);  
1493 - } catch (e) {  
1494 - i3GEO.janela.tempoMsg("Erro: " + e);  
1495 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1796 + for (i = 0; i < retorno.data.length; i++) {
  1797 + id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe
  1798 + re = new RegExp("'", "g");
  1799 + exp = (retorno.data[i].expressao).replace(re, '"');
  1800 + ins.push("<tr><td style='text-align:left;border-bottom:0 none white' ><label>" + retorno.data[i].nomeclasse
  1801 + + "</label></td></tr>");
  1802 + t = (retorno.data[i].nreg * 100) / retorno.data[i].totalreg;
  1803 + ins.push("<tr><td style=text-align:left ><img height=15px width=" + t
  1804 + + "% src='"
  1805 + + retorno.data[i].imagem
  1806 + + "' /></td></tr>");
  1807 + i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg);
1496 } 1808 }
1497 - },  
1498 - sobeEstilo: function() {  
1499 - try {  
1500 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1501 - return;  
1502 - }  
1503 - i3GEOF.legenda.aguarde.visibility = "visible";  
1504 - var p =  
1505 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1506 - + i3GEO.configura.sid  
1507 - + "&funcao=editasimbolo&opcao=sobeestilo&tema="  
1508 - + i3GEOF.legenda.tema  
1509 - + "&classe="  
1510 - + i3GEOF.legenda.classe  
1511 - + "&estilo="  
1512 - + i3GEOF.legenda.estilo, cp = new cpaint();  
1513 - cp.set_response_type("JSON");  
1514 - cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);  
1515 - } catch (e) {  
1516 - i3GEO.janela.tempoMsg("Erro: " + e);  
1517 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1809 + ins.push("</table><br>");
  1810 + $i("i3GEOlegendaguia4obj").innerHTML = ins.join("");
  1811 + } else {
  1812 + $i("i3GEOlegendaguia4obj").innerHTML = "<p style=color:red >Erro<br>";
  1813 + return;
  1814 + }
  1815 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1816 +
  1817 + }, p =
  1818 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  1819 + + i3GEO.configura.sid
  1820 + + "&funcao=contagemclasse&tema="
  1821 + + i3GEOF.legenda.tema, cp = new cpaint();
  1822 + // cp.set_debug(2)
  1823 + cp.set_response_type("JSON");
  1824 + cp.call(p, "cocontagemclasse", monta);
  1825 + } catch (e) {
  1826 + i3GEO.janela.tempoMsg("Erro: " + e);
  1827 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1828 + }
  1829 + },
  1830 + iniciaGraficoPizza : function() {
  1831 + var dados = {
  1832 + "attributes" : {
  1833 + "id" : ""
  1834 + },
  1835 + "data" : {
  1836 + "dados" : i3GEOF.legenda.dadosGrafico
  1837 + }
  1838 + };
  1839 + i3GEOF.graficointerativo1.tipo = "pizza_1";
  1840 + i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
  1841 + },
  1842 + /*
  1843 + * Function: aplicaProcessos
  1844 + *
  1845 + * Aplica processos de ajuste em imagens de sat&eacute;lite
  1846 + *
  1847 + * Veja:
  1848 + *
  1849 + * <APLICAPROCESSOS>
  1850 + */
  1851 + aplicaProcessos : function() {
  1852 + try {
  1853 + if (i3GEOF.legenda.aguarde.visibility === "visible") {
  1854 + return;
  1855 + }
  1856 + i3GEOF.legenda.aguarde.visibility = "visible";
  1857 + var lista = [], ipt, i, p, cp, temp;
  1858 + if ($i("i3GEOlegendaprocessos").innerHTML != "") {
  1859 + ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input");
  1860 + for (i = 0; i < ipt.length; i++) {
  1861 + if (ipt[i].value != "") {
  1862 + lista.push(ipt[i].value);
1518 } 1863 }
1519 - },  
1520 - adicionaEstilo: function() {  
1521 - try {  
1522 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1523 - return;  
1524 - }  
1525 - i3GEOF.legenda.aguarde.visibility = "visible";  
1526 - var p =  
1527 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1528 - + i3GEO.configura.sid  
1529 - + "&funcao=editasimbolo&opcao=adicionaestilo&tema="  
1530 - + i3GEOF.legenda.tema  
1531 - + "&classe="  
1532 - + i3GEOF.legenda.classe  
1533 - + "&estilo="  
1534 - + i3GEOF.legenda.estilo, cp = new cpaint();  
1535 - cp.set_response_type("JSON");  
1536 - i3GEOF.legenda.estilo = i3GEOF.legenda.estilo + 1;  
1537 - cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);  
1538 - } catch (e) {  
1539 - i3GEO.janela.tempoMsg("Erro: " + e);  
1540 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1864 + }
  1865 + }
  1866 + lista = lista.join("|");
  1867 + temp = function() {
  1868 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1869 + i3GEOF.legenda.mostralegenda();
  1870 + i3GEOF.legenda.aposAlterarLegenda();
  1871 + };
  1872 + p =
  1873 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  1874 + + i3GEO.configura.sid
  1875 + + "&funcao=aplicaProcessos&lista="
  1876 + + lista
  1877 + + "&tema="
  1878 + + i3GEOF.legenda.tema;
  1879 + cp = new cpaint();
  1880 + cp.set_response_type("JSON");
  1881 + cp.call(p, "aplicaProcessos", temp);
  1882 + } catch (e) {
  1883 + i3GEO.janela.tempoMsg("Erro: " + e);
  1884 + i3GEOF.legenda.aguarde.visibility = "hidden";
  1885 + }
  1886 + },
  1887 + /*
  1888 + * Function: adicionaProcesso
  1889 + *
  1890 + * Adiciona um novo processo na lista de processos
  1891 + */
  1892 + adicionaProcesso : function(s) {
  1893 + $i("i3GEOlegendaprocessos").innerHTML += "<div class='form-group label-fixed condensed'><input value='" + s.value + "' class='form-control input-lg' type='text' /></div>";
  1894 + },
  1895 + aplicaTodasClasses : function(parametro, id) {
  1896 + var valor = $i(id).value;
  1897 + i3GEO.janela.confirma("Aplica " + parametro + " = " + valor + " ?", 300, $trad("x14"), "", function() {
  1898 + var temp = function() {
  1899 + // i3GEOF.legenda.mostralegenda();
  1900 + i3GEOF.legenda.aposAlterarLegenda();
  1901 + }, p, cp;
  1902 + p =
  1903 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  1904 + + i3GEO.configura.sid
  1905 + + "&funcao=aplicaTodasClasses"
  1906 + + "&parametro="
  1907 + + parametro
  1908 + + "&valor="
  1909 + + valor
  1910 + + "&tema="
  1911 + + i3GEOF.legenda.tema;
  1912 + cp = new cpaint();
  1913 + cp.set_response_type("JSON");
  1914 + cp.call(p, "foo", temp);
  1915 + });
  1916 + },
  1917 + aplicarCluster : function(){
  1918 + var temp = function() {
  1919 + i3GEOF.legenda.aposAlterarLegenda();
  1920 + i3GEOF.legenda.montaCombosItens();
  1921 + }, p, cp;
  1922 + p =
  1923 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  1924 + + i3GEO.configura.sid
  1925 + + "&funcao=aplicarCluster"
  1926 + + "&maxdistance="
  1927 + + $i("i3GEOlegendaClusterMaxdistance").value
  1928 + + "&buffer="
  1929 + + $i("i3GEOlegendaClusterBuffer").value
  1930 + + "&filter="
  1931 + //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value)
  1932 + + $i("i3GEOlegendaClusterFilter").value
  1933 + + "&region="
  1934 + + $i("i3GEOlegendaClusterRegion").value
  1935 + + "&group="
  1936 + + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value
  1937 + + "&tema="
  1938 + + i3GEOF.legenda.tema;
  1939 + cp = new cpaint();
  1940 + cp.set_response_type("JSON");
  1941 + cp.call(p, "foo", temp);
  1942 + },
  1943 + removerCluster : function(){
  1944 + var temp = function() {
  1945 + i3GEOF.legenda.montaCombosItens();
  1946 + i3GEOF.legenda.aposAlterarLegenda();
  1947 + }, p, cp;
  1948 + p =
  1949 + i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
  1950 + + i3GEO.configura.sid
  1951 + + "&funcao=removerCluster"
  1952 + + "&tema="
  1953 + + i3GEOF.legenda.tema;
  1954 + cp = new cpaint();
  1955 + cp.set_response_type("JSON");
  1956 + cp.call(p, "foo", temp);
  1957 + },
  1958 + montaCombosItens : function(){
  1959 + i3GEO.util.comboItens(
  1960 + "",
  1961 + i3GEOF.legenda.tema,
  1962 + function(retorno) {
  1963 + if ($i("i3GEOlegendaitensValorUnico")) {
  1964 + $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados ;
1541 } 1965 }
1542 - },  
1543 - excluiEstilo: function() {  
1544 - try {  
1545 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1546 - return;  
1547 - }  
1548 - i3GEOF.legenda.aguarde.visibility = "visible";  
1549 - i3GEOF.legenda.estilo = 0;  
1550 - var p =  
1551 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1552 - + i3GEO.configura.sid  
1553 - + "&funcao=editasimbolo&opcao=excluiestilo&tema="  
1554 - + i3GEOF.legenda.tema  
1555 - + "&classe="  
1556 - + i3GEOF.legenda.classe  
1557 - + "&estilo="  
1558 - + i3GEOF.legenda.estilo, cp = new cpaint();  
1559 - cp.set_response_type("JSON");  
1560 - cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);  
1561 - } catch (e) {  
1562 - i3GEO.janela.tempoMsg("Erro: " + e);  
1563 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1966 + if ($i("i3GEOlegendaClassesValorUnico")) {
  1967 + $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados;
1564 } 1968 }
1565 - },  
1566 - /*  
1567 - * Function: mostraEstilo  
1568 - *  
1569 - * Mostra as propriedades de um estilo de um s&iacute;mbolo  
1570 - */  
1571 - mostraEstilo : function() {  
1572 - i3GEOF.legenda.aguarde.visibility = "visible";  
1573 - try {  
1574 - var linha, tipoLayer, d, p, cp, mustache = {};  
1575 - //i3GEOF.legenda.estilo = e; // esta e uma variavel global  
1576 - linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo];  
1577 - linha = linha.split("#");  
1578 - tipoLayer = linha[0];  
1579 - mustache = {  
1580 - "voutlinecolor": linha[2],  
1581 - "vcolor": linha[4],  
1582 - "vbackgroundcolor": linha[3],  
1583 - "vsize": linha[6],  
1584 - "vwidth": linha[8],  
1585 - "vpattern": linha[9],  
1586 - "vopacity": linha[7],  
1587 - "vangle": linha[10],  
1588 - "vsymbolscale": linha[11],  
1589 - "vminsize": linha[12],  
1590 - "vmaxsize": linha[13],  
1591 - "voffsetx": linha[14],  
1592 - "voffsety": linha[15],  
1593 - "vsymbolname": linha[5],  
1594 - };  
1595 -  
1596 - ins = Mustache.render(  
1597 - i3GEOF.legenda.MUSTACHEESTILO,  
1598 - $.extend(  
1599 - {},  
1600 - mustache,  
1601 - i3GEOF.legenda.DICIONARIO  
1602 - )  
1603 - );  
1604 - $i("i3GEOlegendaParametrosEstilos").innerHTML = ins;  
1605 -  
1606 -  
1607 - //preenche as listas de itens  
1608 - i3GEO.util.comboItens(  
1609 - "",  
1610 - i3GEOF.legenda.tema, function(retorno) {  
1611 - if ($i("i3GEOlegendaComboSize")) {  
1612 - $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'");  
1613 - }  
1614 - },  
1615 - "",  
1616 - "",  
1617 - "",  
1618 - "",  
1619 - "form-control"  
1620 - );  
1621 -  
1622 - i3GEO.util.aplicaAquarela("i3GEOlegendaParametrosEstilos");  
1623 -  
1624 - p =  
1625 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1626 - + i3GEO.configura.sid  
1627 - + "&funcao=editasimbolo&tipo="  
1628 - + tipoLayer  
1629 - + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)";  
1630 - cp = new cpaint();  
1631 - cp.set_response_type("JSON");  
1632 - cp.call(p, "editasimbolo", i3GEOF.legenda.listaSimbolos);  
1633 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1634 - } catch (e) {  
1635 - i3GEO.janela.tempoMsg("Erro: " + i3GEOF.legenda.estilo);  
1636 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1969 + if ($i("i3GEOlegendaitensMetade")) {
  1970 + $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados;
1637 } 1971 }
1638 - },  
1639 - /*  
1640 - * Function: listaSimbolos  
1641 - *  
1642 - * Monta a lista de s&iacute;mbolos com imagem  
1643 - */  
1644 - listaSimbolos : function(retorno) {  
1645 - i3GEOF.legenda.aguarde.visibility = "visible";  
1646 - try {  
1647 - if (retorno.data != undefined) {  
1648 - retorno = retorno.data;  
1649 - $i("i3GEOlegendasimbolos").innerHTML =  
1650 - "<br>" + $trad('listaSimbolo', i3GEOF.legenda.dicionario) + ":<br><br>" + retorno;  
1651 - } else {  
1652 - $i("i3GEOlegendasimbolos").innerHTML = "<p style=color:red >Erro<br>";  
1653 - }  
1654 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1655 - } catch (e) {  
1656 - i3GEO.janela.tempoMsg("Erro: " + e);  
1657 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1972 + if ($i("i3GEOlegendaitensMetadeId")) {
  1973 + $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados;
1658 } 1974 }
1659 - },  
1660 - /*  
1661 - * Function: aplicaSimbolo  
1662 - *  
1663 - * Muda o valor do campo com o c&oacute;digo do s&iacute;mbolo escolhido  
1664 - */  
1665 - aplicaSimbolo : function(s) {  
1666 - $i("i3GEOlegendasymbolname").value = s.title;  
1667 - },  
1668 - /*  
1669 - * Function: aplicaEstilo  
1670 - *  
1671 - * Aplica ao estilo as propriedades definidas  
1672 - *  
1673 - * Veja:  
1674 - *  
1675 - * <EDITASIMBOLO>  
1676 - */  
1677 - aplicaEstilo : function() {  
1678 - try {  
1679 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1680 - return;  
1681 - }  
1682 - i3GEOF.legenda.aguarde.visibility = "visible";  
1683 - var i, p, cp, fim, outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor =  
1684 - $i("i3GEOlegendabackgroundcolor").value, color = $i("i3GEOlegendacolor").value, symbolname =  
1685 - $i("i3GEOlegendasymbolname").value, simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n =  
1686 - simbolos.length, size = $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern =  
1687 - $i("i3GEOlegendapattern").value, opacidade = $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, symbolscale =  
1688 - $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize =  
1689 - $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value;  
1690 - if (symbolscale != "") {  
1691 - symbolscale = parseInt(symbolscale, 10);  
1692 - } else {  
1693 - symbolscale = -1;  
1694 - }  
1695 - for (i = 0; i < n; i++) {  
1696 - if (simbolos[i].title == symbolname || symbolname == i) {  
1697 - valido = "sim";  
1698 - }  
1699 - }  
1700 - if (valido === "nao") {  
1701 - // i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado");  
1702 - // i3GEOF.legenda.aguarde.visibility = "hidden";  
1703 - // return;  
1704 - }  
1705 - p =  
1706 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1707 - + i3GEO.configura.sid  
1708 - + "&funcao=editasimbolo&opcao=aplica&tema="  
1709 - + i3GEOF.legenda.tema  
1710 - + "&classe="  
1711 - + i3GEOF.legenda.classe  
1712 - + "&estilo="  
1713 - + i3GEOF.legenda.estilo  
1714 - + "&outlinecolor="  
1715 - + outlinecolor  
1716 - + "&backgroundcolor="  
1717 - + backgroundcolor  
1718 - + "&color="  
1719 - + color  
1720 - + "&symbolname="  
1721 - + symbolname  
1722 - + "&width="  
1723 - + width  
1724 - + "&pattern="  
1725 - + pattern  
1726 - + "&size="  
1727 - + size  
1728 - + "&opacidade="  
1729 - + opacidade  
1730 - + "&angle="  
1731 - + angle  
1732 - + "&symbolscale="  
1733 - + symbolscale  
1734 - + "&minsize="  
1735 - + minsize  
1736 - + "&maxsize="  
1737 - + maxsize  
1738 - + "&offsetx="  
1739 - + offsetx  
1740 - + "&offsety="  
1741 - + offsety;  
1742 - cp = new cpaint();  
1743 - fim = function() {  
1744 - i3GEOF.legenda.aposAlterarLegenda();  
1745 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1746 - i3GEOF.legenda.reMontaEditor();  
1747 - };  
1748 - // cp.set_debug(2)  
1749 - cp.set_response_type("JSON");  
1750 - cp.call(p, "editasimbolo", fim);  
1751 - } catch (e) {  
1752 - i3GEO.janela.tempoMsg("Erro: " + e);  
1753 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1975 + if ($i("i3GEOlegendaitensMedia")) {
  1976 + $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados;
1754 } 1977 }
1755 - },  
1756 - /*  
1757 - * Function: reMontaEditor  
1758 - *  
1759 - * Gera novamente o editor de s&iacute;mbolo ap&oacute;s ter sido feita alguma altera&ccedil;&atilde;o nos estilos  
1760 - */  
1761 - reMontaEditor : function() {  
1762 - var id = i3GEOF.legenda.tema + "-" + i3GEOF.legenda.classe;  
1763 - i3GEOF.legenda.editaSimbolo(id);  
1764 - },  
1765 - /*  
1766 - * Function: mostraGrafico  
1767 - *  
1768 - * Mostra um gr&aacute;fico com a contegem de elementos em caada classe  
1769 - *  
1770 - * Veja:  
1771 - *  
1772 - * <CONTAGEMCLASSE>  
1773 - */  
1774 - mostraGrafico : function() {  
1775 - try {  
1776 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1777 - return;  
1778 - }  
1779 - i3GEOF.legenda.aguarde.visibility = "visible";  
1780 - var monta =  
1781 - function(retorno) {  
1782 - if (retorno.data && retorno.data[0].proc == "") {  
1783 - var b, ins = [], i, re, t;  
1784 - ins.push("<h5>" + $trad('numeroOcorrenciasClasses', i3GEOF.legenda.dicionario) + "</h5>");  
1785 - ins.push("<table width=100% >");  
1786 - i3GEOF.legenda.dadosGrafico = [  
1787 - "n;x"  
1788 - ];  
1789 - if (retorno.data.length < 2) {  
1790 - i3GEO.janela.tempoMsg($trad('msgNumeroClasses', i3GEOF.legenda.dicionario));  
1791 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1792 - return;  
1793 - } else {  
1794 - i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4", "i3GEOlegendaguia");  
1795 - }  
1796 - for (i = 0; i < retorno.data.length; i++) {  
1797 - id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe  
1798 - re = new RegExp("'", "g");  
1799 - exp = (retorno.data[i].expressao).replace(re, '"');  
1800 - ins.push("<tr><td style='text-align:left;border-bottom:0 none white' ><label>" + retorno.data[i].nomeclasse  
1801 - + "</label></td></tr>");  
1802 - t = (retorno.data[i].nreg * 100) / retorno.data[i].totalreg;  
1803 - ins.push("<tr><td style=text-align:left ><img height=15px width=" + t  
1804 - + "% src='"  
1805 - + retorno.data[i].imagem  
1806 - + "' /></td></tr>");  
1807 - i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg);  
1808 - }  
1809 - ins.push("</table><br>");  
1810 - $i("i3GEOlegendaguia4obj").innerHTML = ins.join("");  
1811 - } else {  
1812 - $i("i3GEOlegendaguia4obj").innerHTML = "<p style=color:red >Erro<br>";  
1813 - return;  
1814 - }  
1815 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1816 -  
1817 - }, p =  
1818 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
1819 - + i3GEO.configura.sid  
1820 - + "&funcao=contagemclasse&tema="  
1821 - + i3GEOF.legenda.tema, cp = new cpaint();  
1822 - // cp.set_debug(2)  
1823 - cp.set_response_type("JSON");  
1824 - cp.call(p, "cocontagemclasse", monta);  
1825 - } catch (e) {  
1826 - i3GEO.janela.tempoMsg("Erro: " + e);  
1827 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1978 + if ($i("i3GEOlegendaitensValorClass")) {
  1979 + $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados;
1828 } 1980 }
1829 - },  
1830 - iniciaGraficoPizza : function() {  
1831 - var dados = {  
1832 - "attributes" : {  
1833 - "id" : ""  
1834 - },  
1835 - "data" : {  
1836 - "dados" : i3GEOF.legenda.dadosGrafico  
1837 - }  
1838 - };  
1839 - i3GEOF.graficointerativo1.tipo = "pizza_1";  
1840 - i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);  
1841 - },  
1842 - /*  
1843 - * Function: aplicaProcessos  
1844 - *  
1845 - * Aplica processos de ajuste em imagens de sat&eacute;lite  
1846 - *  
1847 - * Veja:  
1848 - *  
1849 - * <APLICAPROCESSOS>  
1850 - */  
1851 - aplicaProcessos : function() {  
1852 - try {  
1853 - if (i3GEOF.legenda.aguarde.visibility === "visible") {  
1854 - return;  
1855 - }  
1856 - i3GEOF.legenda.aguarde.visibility = "visible";  
1857 - var lista = [], ipt, i, p, cp, temp;  
1858 - if ($i("i3GEOlegendaprocessos").innerHTML != "") {  
1859 - ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input");  
1860 - for (i = 0; i < ipt.length; i++) {  
1861 - if (ipt[i].value != "") {  
1862 - lista.push(ipt[i].value);  
1863 - }  
1864 - }  
1865 - }  
1866 - lista = lista.join("|");  
1867 - temp = function() {  
1868 - i3GEOF.legenda.aguarde.visibility = "hidden";  
1869 - i3GEOF.legenda.mostralegenda();  
1870 - i3GEOF.legenda.aposAlterarLegenda();  
1871 - };  
1872 - p =  
1873 - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="  
1874 - + i3GEO.configura.sid  
1875 - + "&funcao=aplicaProcessos&lista="  
1876 - + lista  
1877 - + "&tema="  
1878 - + i3GEOF.legenda.tema;  
1879 - cp = new cpaint();  
1880 - cp.set_response_type("JSON");  
1881 - cp.call(p, "aplicaProcessos", temp);  
1882 - } catch (e) {  
1883 - i3GEO.janela.tempoMsg("Erro: " + e);  
1884 - i3GEOF.legenda.aguarde.visibility = "hidden"; 1981 + if ($i("i3GEOlegendaitensCluster")) {
  1982 + $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados;
1885 } 1983 }
1886 - },  
1887 - /*  
1888 - * Function: adicionaProcesso  
1889 - *  
1890 - * Adiciona um novo processo na lista de processos  
1891 - */  
1892 - adicionaProcesso : function(s) {  
1893 - $i("i3GEOlegendaprocessos").innerHTML += "<div class='form-group label-fixed condensed'><input value='" + s.value + "' class='form-control input-lg' type='text' /></div>";  
1894 - },  
1895 - aplicaTodasClasses : function(parametro, id) {  
1896 - var valor = $i(id).value;  
1897 - i3GEO.janela.confirma("Aplica " + parametro + " = " + valor + " ?", 300, $trad("x14"), "", function() {  
1898 - var temp = function() {  
1899 - // i3GEOF.legenda.mostralegenda();  
1900 - i3GEOF.legenda.aposAlterarLegenda();  
1901 - }, p, cp;  
1902 - p =  
1903 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
1904 - + i3GEO.configura.sid  
1905 - + "&funcao=aplicaTodasClasses"  
1906 - + "&parametro="  
1907 - + parametro  
1908 - + "&valor="  
1909 - + valor  
1910 - + "&tema="  
1911 - + i3GEOF.legenda.tema;  
1912 - cp = new cpaint();  
1913 - cp.set_response_type("JSON");  
1914 - cp.call(p, "foo", temp);  
1915 - });  
1916 - },  
1917 - aplicarCluster : function(){  
1918 - var temp = function() {  
1919 - i3GEOF.legenda.aposAlterarLegenda();  
1920 - i3GEOF.legenda.montaCombosItens();  
1921 - }, p, cp;  
1922 - p =  
1923 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
1924 - + i3GEO.configura.sid  
1925 - + "&funcao=aplicarCluster"  
1926 - + "&maxdistance="  
1927 - + $i("i3GEOlegendaClusterMaxdistance").value  
1928 - + "&buffer="  
1929 - + $i("i3GEOlegendaClusterBuffer").value  
1930 - + "&filter="  
1931 - //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value)  
1932 - + $i("i3GEOlegendaClusterFilter").value  
1933 - + "&region="  
1934 - + $i("i3GEOlegendaClusterRegion").value  
1935 - + "&group="  
1936 - + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value  
1937 - + "&tema="  
1938 - + i3GEOF.legenda.tema;  
1939 - cp = new cpaint();  
1940 - cp.set_response_type("JSON");  
1941 - cp.call(p, "foo", temp);  
1942 - },  
1943 - removerCluster : function(){  
1944 - var temp = function() {  
1945 - i3GEOF.legenda.montaCombosItens();  
1946 - i3GEOF.legenda.aposAlterarLegenda();  
1947 - }, p, cp;  
1948 - p =  
1949 - i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="  
1950 - + i3GEO.configura.sid  
1951 - + "&funcao=removerCluster"  
1952 - + "&tema="  
1953 - + i3GEOF.legenda.tema;  
1954 - cp = new cpaint();  
1955 - cp.set_response_type("JSON");  
1956 - cp.call(p, "foo", temp);  
1957 - },  
1958 - montaCombosItens : function(){  
1959 - i3GEO.util.comboItens(  
1960 - "",  
1961 - i3GEOF.legenda.tema,  
1962 - function(retorno) {  
1963 - if ($i("i3GEOlegendaitensValorUnico")) {  
1964 - $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados ;  
1965 - }  
1966 - if ($i("i3GEOlegendaClassesValorUnico")) {  
1967 - $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados;  
1968 - }  
1969 - if ($i("i3GEOlegendaitensMetade")) {  
1970 - $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados;  
1971 - }  
1972 - if ($i("i3GEOlegendaitensMetadeId")) {  
1973 - $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados;  
1974 - }  
1975 - if ($i("i3GEOlegendaitensMedia")) {  
1976 - $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados;  
1977 - }  
1978 - if ($i("i3GEOlegendaitensValorClass")) {  
1979 - $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados;  
1980 - }  
1981 - if ($i("i3GEOlegendaitensCluster")) {  
1982 - $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados;  
1983 - }  
1984 - if ($i("i3GEOlegendaitensValorQuartil")) {  
1985 - $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados;  
1986 - }  
1987 - },  
1988 - "",  
1989 - "",  
1990 - "",  
1991 - "",  
1992 - "form-control"  
1993 - );  
1994 - },  
1995 - parametrosAuto : function() {  
1996 - i3GEOF.legenda.aguarde.visibility = "visible";  
1997 - var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=parametrosauto&tema=" + i3GEOF.legenda.tema,  
1998 - cp = new cpaint(),  
1999 - temp = function(retorno){  
2000 - try{  
2001 - if(retorno.data !== ""){  
2002 - $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas;  
2003 - $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem;  
2004 - $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome;  
2005 - $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor;  
2006 - $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo;  
2007 - $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho;  
2008 - $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile;  
2009 - $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep;  
2010 - }  
2011 - i3GEOF.legenda.aguarde.visibility = "hidden";  
2012 - }catch(e){  
2013 - i3GEO.janela.tempoMsg("Erro. "+e);  
2014 - i3GEOF.legenda.aguarde.visibility = "hidden";  
2015 - }  
2016 - };  
2017 - cp.set_response_type("JSON");  
2018 - cp.call(p,"foo",temp);  
2019 - },  
2020 - salvaParametrosAuto: function(){  
2021 - if(i3GEOF.legenda.aguarde.visibility === "visible"){  
2022 - return; 1984 + if ($i("i3GEOlegendaitensValorQuartil")) {
  1985 + $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados;
2023 } 1986 }
2024 - i3GEOF.legenda.aguarde.visibility = "visible";  
2025 - var temp,  
2026 - p,  
2027 - cp;  
2028 - temp = function(){  
2029 - i3GEOF.legenda.aguarde.visibility = "hidden";  
2030 - i3GEOF.legenda.aposAlterarLegenda();  
2031 - };  
2032 - p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=salvaparametrosauto&tema=" + i3GEOF.legenda.tema  
2033 - + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value  
2034 - + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value  
2035 - + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value  
2036 - + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value  
2037 - + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value  
2038 - + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value  
2039 - + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value;  
2040 -  
2041 - cp = new cpaint();  
2042 - cp.set_response_type("JSON");  
2043 - cp.call(p,"foo",temp); 1987 + },
  1988 + "",
  1989 + "",
  1990 + "",
  1991 + "",
  1992 + "form-control"
  1993 + );
  1994 + },
  1995 + parametrosAuto : function() {
  1996 + i3GEOF.legenda.aguarde.visibility = "visible";
  1997 + var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=parametrosauto&tema=" + i3GEOF.legenda.tema,
  1998 + cp = new cpaint(),
  1999 + temp = function(retorno){
  2000 + try{
  2001 + if(retorno.data !== ""){
  2002 + $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas;
  2003 + $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem;
  2004 + $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome;
  2005 + $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor;
  2006 + $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo;
  2007 + $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho;
  2008 + $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile;
  2009 + $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep;
  2010 + }
  2011 + i3GEOF.legenda.aguarde.visibility = "hidden";
  2012 + }catch(e){
  2013 + i3GEO.janela.tempoMsg("Erro. "+e);
  2014 + i3GEOF.legenda.aguarde.visibility = "hidden";
2044 } 2015 }
  2016 + };
  2017 + cp.set_response_type("JSON");
  2018 + cp.call(p,"foo",temp);
  2019 + },
  2020 + salvaParametrosAuto: function(){
  2021 + if(i3GEOF.legenda.aguarde.visibility === "visible"){
  2022 + return;
  2023 + }
  2024 + i3GEOF.legenda.aguarde.visibility = "visible";
  2025 + var temp,
  2026 + p,
  2027 + cp;
  2028 + temp = function(){
  2029 + i3GEOF.legenda.aguarde.visibility = "hidden";
  2030 + i3GEOF.legenda.aposAlterarLegenda();
  2031 + };
  2032 + p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=salvaparametrosauto&tema=" + i3GEOF.legenda.tema
  2033 + + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value
  2034 + + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value
  2035 + + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value
  2036 + + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value
  2037 + + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value
  2038 + + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value
  2039 + + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value;
  2040 +
  2041 + cp = new cpaint();
  2042 + cp.set_response_type("JSON");
  2043 + cp.call(p,"foo",temp);
  2044 + }
2045 }; 2045 };
2046 //aplica ao codigo i3GEOF definicoes feitas na interface do mapa 2046 //aplica ao codigo i3GEOF definicoes feitas na interface do mapa
2047 //isso permite a substituicao de funcoes e parametros 2047 //isso permite a substituicao de funcoes e parametros
2048 if(i3GEO.configura.ferramentas.hasOwnProperty("legenda")){ 2048 if(i3GEO.configura.ferramentas.hasOwnProperty("legenda")){
2049 jQuery.each( i3GEO.configura.ferramentas.legenda, function(index, value) { 2049 jQuery.each( i3GEO.configura.ferramentas.legenda, function(index, value) {
2050 - i3GEOF.legenda[index] = i3GEO.configura.ferramentas.legenda[index]; 2050 + i3GEOF.legenda[index] = i3GEO.configura.ferramentas.legenda[index];
2051 }); 2051 });
2052 } 2052 }
2053 \ No newline at end of file 2053 \ No newline at end of file
ferramentas/opacidademapa/index.js
@@ -28,7 +28,7 @@ i3GEOF.opacidademapa = { @@ -28,7 +28,7 @@ i3GEOF.opacidademapa = {
28 hash["namespace"] = "opacidademapa"; 28 hash["namespace"] = "opacidademapa";
29 hash["idContainer"] = p.idContainer; 29 hash["idContainer"] = p.idContainer;
30 i3GEOF.opacidademapa.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); 30 i3GEOF.opacidademapa.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
31 - i3GEO.janela.applyScrollBar(p.idContainer); 31 + //i3GEO.janela.applyScrollBar(p.idContainer);
32 i3GEOF.opacidademapa.slide(); 32 i3GEOF.opacidademapa.slide();
33 33
34 }, 34 },
ferramentas/opcoesescala/index.js
@@ -61,7 +61,7 @@ i3GEOF.opcoesescala = { @@ -61,7 +61,7 @@ i3GEOF.opcoesescala = {
61 texto: Mustache.render(p.mustache, hash), 61 texto: Mustache.render(p.mustache, hash),
62 onclose: i3f.destroy 62 onclose: i3f.destroy
63 }); 63 });
64 - i3GEO.janela.applyScrollBar(p.idContainer); 64 + //i3GEO.janela.applyScrollBar(p.idContainer);
65 i3GEO.util.aplicaAquarela(p.idContainer); 65 i3GEO.util.aplicaAquarela(p.idContainer);
66 i3f.applyDataForm(p.dataForm); 66 i3f.applyDataForm(p.dataForm);
67 }, 67 },
ferramentas/opcoeslegenda/index.js
@@ -60,7 +60,7 @@ i3GEOF.opcoeslegenda = { @@ -60,7 +60,7 @@ i3GEOF.opcoeslegenda = {
60 texto: Mustache.render(p.mustache, hash), 60 texto: Mustache.render(p.mustache, hash),
61 onclose: i3f.destroy 61 onclose: i3f.destroy
62 }); 62 });
63 - i3GEO.janela.applyScrollBar(p.idContainer); 63 + //i3GEO.janela.applyScrollBar(p.idContainer);
64 i3GEO.util.comboFontes("i3GEOopcoeslegendafonte","i3GEOopcoeslegendafontef","form-control", p.dataForm.font ); 64 i3GEO.util.comboFontes("i3GEOopcoeslegendafonte","i3GEOopcoeslegendafontef","form-control", p.dataForm.font );
65 i3GEO.util.aplicaAquarela(p.idContainer); 65 i3GEO.util.aplicaAquarela(p.idContainer);
66 i3f.applyDataForm(p.dataForm); 66 i3f.applyDataForm(p.dataForm);
ferramentas/opcoesmaparef/index.js
@@ -64,7 +64,7 @@ i3GEOF.opcoesmaparef = { @@ -64,7 +64,7 @@ i3GEOF.opcoesmaparef = {
64 texto: Mustache.render(p.mustache, hash), 64 texto: Mustache.render(p.mustache, hash),
65 onclose: i3f.destroy 65 onclose: i3f.destroy
66 }); 66 });
67 - i3GEO.janela.applyScrollBar(p.idContainer); 67 + //i3GEO.janela.applyScrollBar(p.idContainer);
68 i3GEO.util.aplicaAquarela(p.idContainer); 68 i3GEO.util.aplicaAquarela(p.idContainer);
69 i3f.applyDataForm(p.dataForm); 69 i3f.applyDataForm(p.dataForm);
70 }, 70 },
ferramentas/opcoestamanho/index.js
@@ -54,7 +54,7 @@ i3GEOF.opcoestamanho = { @@ -54,7 +54,7 @@ i3GEOF.opcoestamanho = {
54 texto: Mustache.render(p.mustache, hash), 54 texto: Mustache.render(p.mustache, hash),
55 onclose: i3f.destroy 55 onclose: i3f.destroy
56 }); 56 });
57 - i3GEO.janela.applyScrollBar(p.idContainer); 57 + //i3GEO.janela.applyScrollBar(p.idContainer);
58 }, 58 },
59 getFormData: function(){ 59 getFormData: function(){
60 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 60 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
ferramentas/uploadshp/dependencias.php
@@ -3,13 +3,6 @@ include(dirname(__FILE__).&quot;/../blacklist.php&quot;); @@ -3,13 +3,6 @@ include(dirname(__FILE__).&quot;/../blacklist.php&quot;);
3 verificaBlFerramentas(basename(dirname(__FILE__))); 3 verificaBlFerramentas(basename(dirname(__FILE__)));
4 //como o nome da pasta mudou, essa linha mantem a compatibilidade 4 //como o nome da pasta mudou, essa linha mantem a compatibilidade
5 verificaBlFerramentas("upload"); 5 verificaBlFerramentas("upload");
6 -/**  
7 - * Carrega os programas javascript necessarios para a ferramenta  
8 - * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo  
9 - * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel  
10 - * javascript i3GEOF.uploaddbf.MUSTACHE  
11 - * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta  
12 - */  
13 if(extension_loaded('zlib')){ 6 if(extension_loaded('zlib')){
14 ob_start('ob_gzhandler'); 7 ob_start('ob_gzhandler');
15 } 8 }
ferramentas/uploadshp/dicionario.js
1 //+$trad(1,i3GEOF.upload.dicionario)+ 1 //+$trad(1,i3GEOF.upload.dicionario)+
2 -i3GEOF.upload.dicionario = {  
3 - 'pastaArmazenamento' : [ {  
4 - pt : "Pasta no servidor onde os dados ser&atilde;o armazenados. Apenas pastas localizadas no mesmo local onde o i3Geo est&aacute; instalado s&atilde;o permitidas. Exemplo, no caso da instala&ccedil;&atilde;o ser /var/www e existir a pasta /var/www/data, digite apenas data",  
5 - en : "Folder on the server where data will be stored. Only folders located in the same location where i3Geo is installed are allowed. For example, if the installation is at /var /www/ and there is a folder /var/www/data/, enter only data",  
6 - es : "Carpeta en el servidor donde se almacenan los datos. Solo est&aacute; permitido en las carpetas ubicadas en el mismo lugar donde est&aacute; instalado i3Geo. Por ejemplo, si la instalaci&oacute;n es /var/www/ y existe la carpeta /var/www/data/, ingrese solo data"  
7 - } ], 2 +i3GEOF.uploadshp.dicionario = {
8 'tipoGeom' : [ { 3 'tipoGeom' : [ {
9 pt : "Tipo de geometria", 4 pt : "Tipo de geometria",
10 en : "Geometry type", 5 en : "Geometry type",
@@ -45,9 +40,24 @@ i3GEOF.upload.dicionario = { @@ -45,9 +40,24 @@ i3GEOF.upload.dicionario = {
45 en : "Do not use _ in file names. Only letters and numbers are allowed!!!", 40 en : "Do not use _ in file names. Only letters and numbers are allowed!!!",
46 es : "No utilice _ en el nombre de archivo. &iexcl;Solo letras y n&uacute;meros son aceptados!!!" 41 es : "No utilice _ en el nombre de archivo. &iexcl;Solo letras y n&uacute;meros son aceptados!!!"
47 } ], 42 } ],
48 - 'criaMapfile' : [ {  
49 - pt : "Marque para criar o arquivo de configura&ccedil;&atilde;o (mapfile) e visualizar os dados no mapa interativo (voc&ecirc; poder&aacute; editar esse arquivo posteriormente no editor de mapfiles)",  
50 - en : "Check to create the configuration file (mapfile) and visualize the data on an interactive map (you can edit this file later using the mapfile editor)",  
51 - es : "Marque para crear el archivo de configuraci&oacute;n (mapfile) y visualizar los datos en el mapa interactivo (usted puede editar este archivo m&aacute;s adelante en el editor de mapfiles)" 43 + 'shp' : [ {
  44 + pt : "Arquivo com extens&atilde;o .shp",
  45 + en : "",
  46 + es : ""
  47 + } ],
  48 + 'shx' : [ {
  49 + pt : "Arquivo com extens&atilde;o .shx",
  50 + en : "",
  51 + es : ""
  52 + } ],
  53 + 'dbf' : [ {
  54 + pt : "Arquivo com extens&atilde;o .dbf",
  55 + en : "",
  56 + es : ""
  57 + } ],
  58 + 'prj' : [ {
  59 + pt : "Arquivo com extens&atilde;o .prj (opcional)",
  60 + en : "",
  61 + es : ""
52 } ] 62 } ]
53 }; 63 };
ferramentas/uploadshp/index.js
1 -/*  
2 -Title: Upload de arquivo shapefile  
3 -  
4 -Envia para o servidor um arquivo shapefile local e insere como uma camada no mapa.  
5 -  
6 -Veja:  
7 -  
8 -<i3GEO.arvoreDeTemas.dialogo.upload>  
9 -  
10 -Arquivo: i3geo/ferramentas/upload/index.js.php  
11 -  
12 -About: Licen&ccedil;a  
13 -  
14 -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet  
15 -  
16 -Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil  
17 -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com  
18 -  
19 -Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo  
20 -e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral  
21 -GNU conforme publicada pela Free Software Foundation;  
22 -  
23 -Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,  
24 -por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita  
25 -de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.  
26 -Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.  
27 -Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do  
28 -GNU junto com este programa; se n&atilde;o, escreva para a  
29 -Free Software Foundation, Inc., no endere&ccedil;o  
30 -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.  
31 -*/  
32 if(typeof(i3GEOF) === 'undefined'){ 1 if(typeof(i3GEOF) === 'undefined'){
33 - var i3GEOF = {}; 2 + var i3GEOF = {};
34 } 3 }
35 -/*  
36 -Classe: i3GEOF.upload  
37 -*/  
38 -i3GEOF.upload = {  
39 - /*  
40 - Variavel: aguarde  
41 -  
42 - Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.  
43 - */  
44 - aguarde: "",  
45 - MUSTACHE: "",  
46 - /**  
47 - * Susbtitutos para o template  
48 - */  
49 - mustacheHash : function() {  
50 - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.upload.dicionario);  
51 - dicionario["locaplic"] = i3GEO.configura.locaplic;  
52 - dicionario["sid"] = i3GEO.configura.sid;  
53 - return dicionario; 4 +i3GEOF.uploadshp = {
  5 + renderFunction: i3GEO.janela.formModal,
  6 + _parameters : {
  7 + "mustache": "",
  8 + "idContainer": "i3GEOuploadshp",
  9 + "namespace": "uploadshp",
  10 + "dataForm": ""
54 }, 11 },
55 - /*  
56 - Function: inicia  
57 -  
58 - Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante  
59 -  
60 - Parametro:  
61 -  
62 - iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta  
63 - */  
64 - inicia: function(iddiv){  
65 - if(i3GEOF.upload.MUSTACHE == ""){  
66 - $.get(i3GEO.configura.locaplic + "/ferramentas/upload/template_mst.html", function(template) {  
67 - i3GEOF.upload.MUSTACHE = template;  
68 - i3GEOF.upload.inicia(iddiv);  
69 - });  
70 - return;  
71 - }  
72 - $i(iddiv).innerHTML = i3GEOF.upload.html();  
73 - i3GEO.util.radioEpsg(  
74 - function(retorno){  
75 - $i("i3GEOuploadListaepsg").innerHTML = retorno.dados;  
76 - },  
77 - "i3GEOuploadListaepsg",  
78 - "upload",  
79 - "nao"  
80 - ); 12 + start : function(){
  13 + var p = this._parameters,
  14 + i3f = this,
  15 + t1 = i3GEO.configura.locaplic + "/ferramentas/"+p.namespace+"/template_mst.html";
  16 + if(p.mustache === ""){
  17 + i3GEO.janela.abreAguarde();
  18 + $.get(t1).done(function(r1) {
  19 + p.mustache = r1;
  20 + i3f.html();
  21 + i3GEO.janela.fechaAguarde();
  22 + if(p.dataForm.errorMsg && p.dataForm.errorMsg != ""){
  23 + i3GEO.janela.snackBar({content: p.dataForm.errorMsg, style:'red'});
  24 + i3GEO.janela.fechaAguarde();
  25 + i3f.destroy();
  26 + }
  27 + }).fail(function(data) {
  28 + i3GEO.janela.snackBar({content: "Erro. " + data.status, style:'red'});
  29 + i3f.destroy();
  30 + });
  31 + } else {
  32 + i3f.html();
  33 + }
81 }, 34 },
82 - /*  
83 - Function: html  
84 -  
85 - Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta  
86 -  
87 - Retorno:  
88 -  
89 - String com o c&oacute;digo html  
90 - */  
91 - html:function(){  
92 - var ins = Mustache.render(i3GEOF.upload.MUSTACHE, i3GEOF.upload.mustacheHash());  
93 - return ins; 35 + destroy: function(){
  36 + //nao use this aqui
94 }, 37 },
95 - /*  
96 - Function: iniciaJanelaFlutuante  
97 -  
98 - Cria a janela flutuante para controle da ferramenta.  
99 - */  
100 - iniciaJanelaFlutuante: function(){  
101 - var janela,divid,titulo,cabecalho,minimiza;  
102 - if ($i("i3GEOF.upload")) {  
103 - return;  
104 - }  
105 - cabecalho = function(){};  
106 - minimiza = function(){  
107 - i3GEO.janela.minimiza("i3GEOF.upload",200);  
108 - };  
109 - titulo = "<span class='i3GeoTituloJanelaBsNolink' >" + $trad("a2") + "</span></div>";  
110 - janela = i3GEO.janela.cria(  
111 - "400px",  
112 - "480px",  
113 - "",  
114 - "",  
115 - "",  
116 - titulo,  
117 - "i3GEOF.upload",  
118 - false,  
119 - "hd",  
120 - cabecalho,  
121 - minimiza,  
122 - "",  
123 - true,  
124 - "",  
125 - "",  
126 - "",  
127 - "",  
128 - "27"  
129 - );  
130 - divid = janela[2].id;  
131 - $i("i3GEOF.upload_corpo").style.backgroundColor = "white";  
132 - i3GEOF.upload.aguarde = $i("i3GEOF.upload_imagemCabecalho").style;  
133 - i3GEOF.upload.inicia(divid); 38 + html:function() {
  39 + var p = this._parameters,
  40 + i3f = this,
  41 + hash = {
  42 + locaplic: i3GEO.configura.locaplic,
  43 + namespace: p.namespace,
  44 + sid: i3GEO.configura.sid,
  45 + idContainer: p.idContainer,
  46 + ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
  47 + };
  48 + i3f.renderFunction.call(
  49 + this,
  50 + {
  51 + texto: Mustache.render(p.mustache, hash),
  52 + onclose: i3f.destroy
  53 + });
  54 + i3GEO.util.comboEpsg("uploadEPSG","i3GEOuploadListaepsg");
134 }, 55 },
135 /* 56 /*
136 Function: submete 57 Function: submete
137 58
138 Submete o arquivo ao servidor 59 Submete o arquivo ao servidor
139 - */  
140 - submete: function(){  
141 - if(i3GEOF.upload.aguarde.visibility==="visible")  
142 - {return;}  
143 - i3GEOF.upload.aguarde.visibility="visible";  
144 - $i("i3GEOuploadf").submit();  
145 - },  
146 - selNavegador: function(onde){  
147 - i3GEO.util.navegadorDir(onde,false,false,false); 60 + */
  61 + submete: function(btn){
  62 + i3GEO.janela.abreAguarde();
  63 + $(btn).prop("disabled",true).find("span").removeClass("hidden");
  64 + $("#" + this._parameters.idContainer + " form").submit();
148 } 65 }
149 -};  
150 - 66 +};
151 \ No newline at end of file 67 \ No newline at end of file
ferramentas/uploadshp/template_mst.html
1 -<div class='container-fluid'>  
2 - <h5 class="alert alert-info">{{{ajudaCaracter}}}</h5> 1 +<div id='{{idContainer}}' class='container-fluid container-tools'>
  2 + <h5 class="alert alert-info">{{{ajudaCaracter}}}</h5>
  3 + <form accept-charset="utf-8" class="form-horizontal" target="i3GEOuploadiframe" action="{{{locaplic}}}/ferramentas/uploadshp/upload.php" method="post" ENCTYPE="multipart/form-data">
  4 + <div class='form-group label-fixed condensed'>
  5 + <label class="col-md-6 control-label">{{{shp}}}</label>
  6 + <div class="col-md-6 ">
  7 + <input required onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploadshp" />
  8 + <input name="i3GEOuploadshp" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  9 + <b class="caret careti"></b>
  10 + </div>
  11 + </div>
  12 + <div class='form-group label-fixed condensed'>
  13 + <label class="col-md-6 control-label">{{{shx}}}</label>
  14 + <div class="col-md-6 ">
  15 + <input required onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploadshx" />
  16 + <input name="i3GEOuploadshx" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  17 + <b class="caret careti"></b>
  18 + </div>
  19 + </div>
  20 + <div class='form-group label-fixed condensed'>
  21 + <label class="col-md-6 control-label">{{{dbf}}}</label>
  22 + <div class="col-md-6 ">
  23 + <input required onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploaddbf" />
  24 + <input name="i3GEOuploaddbf" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  25 + <b class="caret careti"></b>
  26 + </div>
  27 + </div>
  28 + <div class='form-group label-fixed condensed'>
  29 + <label class="col-md-6 control-label">{{{prj}}}</label>
  30 + <div class="col-md-6 ">
  31 + <input onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploadprj" />
  32 + <input name="i3GEOuploadprj" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  33 + <b class="caret careti"></b>
  34 + </div>
  35 + </div>
  36 + <div style="width: 100%;" class='form-group label-fixed condensed'>
  37 + <label class="col-md-6 control-label">{{{tipoGeom}}}</label>
  38 + <div class="col-md-6">
  39 + <select class="form-control" name="tipo">
  40 + <option value="">{{{naoConhecido}}}</option>
  41 + <option value="1">{{{pontual}}}</option>
  42 + <option value="5">{{{poligonal}}}</option>
  43 + <option value="3">{{{linear}}}</option>
  44 + </select><b class="caret careti"></b>
  45 + </div>
  46 + </div>
  47 + <div style="width: 100%;" class='form-group label-fixed condensed'>
  48 + <label class="col-md-6 control-label">{{{projecao}}}</label>
  49 + <div class="col-md-6">
  50 + <div id='i3GEOuploadListaepsg'></div>
  51 + </div>
  52 + </div>
3 53
4 - <form class="form-horizontal" role="form" id=i3GEOuploadf target="i3GEOuploadiframe" action="{{{locaplic}}}/ferramentas/upload/upload.php" method="post" ENCTYPE="multipart/form-data">  
5 - <div class="input-group-btn">  
6 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">SHP</button>  
7 - <input name="i3GEOuploadshp" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
8 - <span class="form-control upload"></span>  
9 - </div>  
10 - <br>  
11 - <div class="input-group-btn">  
12 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">SHX</button>  
13 - <input name="i3GEOuploadshx" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
14 - <span class="form-control upload"></span>  
15 - </div>  
16 - <br>  
17 - <div class="input-group-btn">  
18 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">DBF</button>  
19 - <input name="i3GEOuploaddbf" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
20 - <span class="form-control upload"></span>  
21 - </div>  
22 - <br>  
23 - <div class="input-group-btn">  
24 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">PRJ (opcional)</button>  
25 - <input name="i3GEOuploadprj" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
26 - <span class="form-control upload"></span>  
27 - </div>  
28 - <br>  
29 - <div class='form-group label-fixed condensed'>  
30 - <label class="control-label" for="tipo">{{{tipoGeom}}}</label>  
31 - <div style="width: 100%;" class="input-group">  
32 - <select class="form-control" id="tipo" name="tipo">  
33 - <option value="">{{{naoConhecido}}}</option>  
34 - <option value="1">{{{pontual}}}</option>  
35 - <option value="5">{{{poligonal}}}</option>  
36 - <option value="3">{{{linear}}}</option>  
37 - </select><b class="caret careti"></b>  
38 - </div>  
39 - </div>  
40 -  
41 - <div class='form-group label-fixed condensed'>  
42 - <label class="control-label" for="tipo">{{{projecao}}}</label>  
43 - <div style="width: 100%;" class="input-group"></div>  
44 - <div id=i3GEOuploadListaepsg style="text-align: left; overflow: auto; height: 70px; margin-top:8px;"></div>  
45 - </div>  
46 -  
47 - <hr />  
48 - <button name="submit" onclick="i3GEOF.upload.submete()" class='btn btn-primary btn-sm btn-raised'>{{{envia}}}</button>  
49 -  
50 - <input type=hidden name=g_sid value="{{{sid}}}">  
51 - <input type="hidden" name="MAX_FILE_SIZE" value="1000000">  
52 - </form>  
53 -  
54 - <iframe name=i3GEOuploadiframe style="text-align: left; border: 1px solid gray;" width="98%" height="60px"></iframe> 54 + <hr />
  55 + <button id="teste" name="submit" onclick="i3GEOF.uploadshp.submete(this)" class='btn btn-primary btn-sm btn-raised'>
  56 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span>{{{envia}}}
  57 + </button>
55 58
  59 + <input type=hidden name=g_sid value="{{{sid}}}">
  60 + <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
  61 + </form>
  62 + <iframe name=i3GEOuploadiframe style="text-align: left; border: 1px solid rgb(242, 232, 232);" width="98%" height="60px"></iframe>
56 </div> 63 </div>
57 \ No newline at end of file 64 \ No newline at end of file
ferramentas/uploadshp/upload.php
@@ -24,14 +24,11 @@ if(!file_exists($map_file)){ @@ -24,14 +24,11 @@ if(!file_exists($map_file)){
24 exit; 24 exit;
25 } 25 }
26 if (ob_get_level() == 0) ob_start(); 26 if (ob_get_level() == 0) ob_start();
  27 +
27 ?> 28 ?>
28 <html> 29 <html>
29 <head> 30 <head>
30 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> 31 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
31 -<link rel="stylesheet" type="text/css" href="../../css/input.css" />  
32 -<link rel="stylesheet" type="text/css" href="../../css/geral.css" />  
33 -<script src="../../js/util.js"></script>  
34 -<title></title>  
35 </head> 32 </head>
36 <body bgcolor="white" style="background-color:white;text-align:left;"> 33 <body bgcolor="white" style="background-color:white;text-align:left;">
37 <p> 34 <p>
@@ -194,7 +191,7 @@ else @@ -194,7 +191,7 @@ else
194 restauraCon($map_file,$postgis_mapa); 191 restauraCon($map_file,$postgis_mapa);
195 paraAguarde(); 192 paraAguarde();
196 function paraAguarde(){ 193 function paraAguarde(){
197 - echo "<script>try{window.scrollTo(0,10000);window.parent.i3GEOF.upload.aguarde.visibility='hidden';}catch(e){};</script>"; 194 + echo "<script>window.parent.i3GEOF.uploadshp.destroy();</script>";
198 } 195 }
199 function verificaNome($nome){ 196 function verificaNome($nome){
200 if(strlen(basename($nome)) > 200){ 197 if(strlen(basename($nome)) > 200){
interface/inc/guiacamadas.php
@@ -52,20 +52,20 @@ @@ -52,20 +52,20 @@
52 </button> 52 </button>
53 </div> 53 </div>
54 <div class="separadorCabecalhoGuias">&nbsp;</div> 54 <div class="separadorCabecalhoGuias">&nbsp;</div>
55 - <div class="guiaOverflow" style="height: calc(100% - 45px); width: calc(100% - 12px);"> 55 + <div style="overflow-y: scroll; height: calc(100% - 45px);">
56 <!-- Esta div acrescenta a lista de layers graficos --> 56 <!-- Esta div acrescenta a lista de layers graficos -->
57 - <div id="listaLayersGr" style="overflow: none;" data-template="<?php echo $configInc["pathtemplates"];?>/camadaGr.html"></div> 57 + <div id="listaLayersGr" style="width: calc(100% - 12px);overflow: none;" data-template="<?php echo $configInc["pathtemplates"];?>/camadaGr.html"></div>
58 <!-- Esta div acrescenta a lista de camadas disponiveis no mapa atual --> 58 <!-- Esta div acrescenta a lista de camadas disponiveis no mapa atual -->
59 - <div id="listaTemas" style="overflow: none;" data-template="<?php echo $configInc["pathtemplates"];?>/camada.html"></div> 59 + <div id="listaTemas" style="width: calc(100% - 12px);overflow: none;" data-template="<?php echo $configInc["pathtemplates"];?>/camada.html"></div>
60 <!-- Esta div acrescenta a lista de de camadas de fundo 60 <!-- Esta div acrescenta a lista de de camadas de fundo
61 A lista de camadas de fundo e obtida da variavel i3GEO.Interface.openlayers.LAYERSADICIONAIS 61 A lista de camadas de fundo e obtida da variavel i3GEO.Interface.openlayers.LAYERSADICIONAIS
62 Essa variavel e definida via javascript, e no caso das interfaces padrao do i3Geo, e definida 62 Essa variavel e definida via javascript, e no caso das interfaces padrao do i3Geo, e definida
63 no programa interface/config.php 63 no programa interface/config.php
64 --> 64 -->
65 - <div data-toggle="collapse" data-target="#collapseFundo" class="list-group condensed collapsed"> 65 + <div style="width: calc(100% - 22px);overflow: none;" data-toggle="collapse" data-target="#collapseFundo" class="list-group condensed collapsed">
66 <label>{{{camadasDeFundo}}}</label> 66 <label>{{{camadasDeFundo}}}</label>
67 </div> 67 </div>
68 - <div style="margin-left: 0px;" class="collapse text-left" id="collapseFundo"> 68 + <div style="width: calc(100% - 22px);overflow: none;margin-left: 0px;" class="collapse text-left" id="collapseFundo">
69 <form> 69 <form>
70 <div id="listaFundo" class="form-group condensed" data-template="<?php echo $configInc["pathtemplates"];?>/camadaFundo.html"></div> 70 <div id="listaFundo" class="form-group condensed" data-template="<?php echo $configInc["pathtemplates"];?>/camadaFundo.html"></div>
71 </form> 71 </form>
interface/inc/guiacatalogo.php
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 </div> 40 </div>
41 <div class="separadorCabecalhoGuias">&nbsp;</div> 41 <div class="separadorCabecalhoGuias">&nbsp;</div>
42 42
43 - <div class="guiaOverflow" style="height: calc(100% - 45px); width: calc(100% - 12px);"> 43 + <div style="overflow-y: scroll; height: calc(100% - 45px);">
44 <div id="catalogoMigalha" style="display: block;" data-template="<?php echo $configInc["pathtemplates"];?>/catalogoMigalha.html"></div> 44 <div id="catalogoMigalha" style="display: block;" data-template="<?php echo $configInc["pathtemplates"];?>/catalogoMigalha.html"></div>
45 <!-- aqui entra a lista de elementos quando uma das opcoes e clicada --> 45 <!-- aqui entra a lista de elementos quando uma das opcoes e clicada -->
46 <div id="catalogoNavegacao"></div> 46 <div id="catalogoNavegacao"></div>
interface/inc/guiaferramentas.php
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 </button> 7 </button>
8 </div> 8 </div>
9 <div class="separadorCabecalhoGuias">&nbsp;</div> 9 <div class="separadorCabecalhoGuias">&nbsp;</div>
10 - <div class="guiaOverflow" style="height: calc(100% - 45px);width: calc(100% - 12px);"> 10 + <div style="overflow-y: scroll; height: calc(100% - 45px);">
11 <div class="form-inline" style="width: 100%;"> 11 <div class="form-inline" style="width: 100%;">
12 <div class="text-center form-group" style="margin: 4px; display: inline-block"> 12 <div class="text-center form-group" style="margin: 4px; display: inline-block">
13 <a onclick="i3GEO.guias.abreFecha('fecha');i3GEO.analise.dialogo.area();" role="button" class="btn btn-success btn-fab btn-fab-max" href="javascript:void(0)"> 13 <a onclick="i3GEO.guias.abreFecha('fecha');i3GEO.analise.dialogo.area();" role="button" class="btn btn-success btn-fab btn-fab-max" href="javascript:void(0)">
@@ -35,7 +35,6 @@ @@ -35,7 +35,6 @@
35 </div> 35 </div>
36 </div> 36 </div>
37 <div class="clearfix"></div> 37 <div class="clearfix"></div>
38 -  
39 <div id="searchInputFerramentas" data-template="<?php echo $configInc["pathtemplates"];?>/searchInput.html" style='display: block; text-align: center; width: 100%; padding-left: 1rem; padding-right: 1rem;'></div> 38 <div id="searchInputFerramentas" data-template="<?php echo $configInc["pathtemplates"];?>/searchInput.html" style='display: block; text-align: center; width: 100%; padding-left: 1rem; padding-right: 1rem;'></div>
40 <div id="migalhaFerramentas" data-template="<?php echo $configInc["pathtemplates"];?>/ferramentasMigalha.html" style='display: block; text-align: left;'></div> 39 <div id="migalhaFerramentas" data-template="<?php echo $configInc["pathtemplates"];?>/ferramentasMigalha.html" style='display: block; text-align: left;'></div>
41 <div id="listaFerramentasLinks" data-template="<?php echo $configInc["pathtemplates"];?>/ferramentasLink.html" style='display: block; text-align: left'></div> 40 <div id="listaFerramentasLinks" data-template="<?php echo $configInc["pathtemplates"];?>/ferramentasLink.html" style='display: block; text-align: left'></div>
interface/inc/guialegenda.php
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 </div> 21 </div>
22 22
23 <div class="separadorCabecalhoGuias">&nbsp;</div> 23 <div class="separadorCabecalhoGuias">&nbsp;</div>
24 - <div class="guiaOverflow" style="height: calc(100% - 45px);width: calc(100% - 12px);"> 24 + <div style="overflow-y: scroll; height: calc(100% - 45px);">
25 <div id="legendaHtml" data-template="<?php echo $configInc["pathtemplates"];?>/legenda.html" data-size="35,25" style='display: none; text-align: left'></div> 25 <div id="legendaHtml" data-template="<?php echo $configInc["pathtemplates"];?>/legenda.html" data-size="35,25" style='display: none; text-align: left'></div>
26 </div> 26 </div>
27 </div> 27 </div>
28 \ No newline at end of file 28 \ No newline at end of file
js/catalogoMenus.js
@@ -319,26 +319,26 @@ i3GEO.catalogoMenus = { @@ -319,26 +319,26 @@ i3GEO.catalogoMenus = {
319 }, 319 },
320 shp: function() { 320 shp: function() {
321 i3GEO.util.scriptTag(i3GEO.configura.locaplic 321 i3GEO.util.scriptTag(i3GEO.configura.locaplic
322 - + "/ferramentas/upload/dependencias.php",  
323 - "i3GEOF.uploadshp.iniciaJanelaFlutuante()",  
324 - "i3GEOF.upload_script"); 322 + + "/ferramentas/uploadshp/dependencias.php",
  323 + "i3GEOF.uploadshp.start()",
  324 + "i3GEOF.uploadshp_script");
325 }, 325 },
326 dbfcsv: function() { 326 dbfcsv: function() {
327 i3GEO.util.scriptTag(i3GEO.configura.locaplic 327 i3GEO.util.scriptTag(i3GEO.configura.locaplic
328 + "/ferramentas/uploaddbf/dependencias.php", 328 + "/ferramentas/uploaddbf/dependencias.php",
329 - "i3GEOF.uploaddbf.iniciaJanelaFlutuante()", 329 + "i3GEOF.uploaddbf.start()",
330 "i3GEOF.uploaddbf_script"); 330 "i3GEOF.uploaddbf_script");
331 }, 331 },
332 gpx: function() { 332 gpx: function() {
333 i3GEO.util.scriptTag(i3GEO.configura.locaplic 333 i3GEO.util.scriptTag(i3GEO.configura.locaplic
334 + "/ferramentas/uploadgpx/dependencias.php", 334 + "/ferramentas/uploadgpx/dependencias.php",
335 - "i3GEOF.uploadgpx.iniciaJanelaFlutuante()", 335 + "i3GEOF.uploadgpx.start()",
336 "i3GEOF.uploadgpx_script"); 336 "i3GEOF.uploadgpx_script");
337 }, 337 },
338 kml: function() { 338 kml: function() {
339 i3GEO.util.scriptTag(i3GEO.configura.locaplic 339 i3GEO.util.scriptTag(i3GEO.configura.locaplic
340 + "/ferramentas/uploadkml/dependencias.php", 340 + "/ferramentas/uploadkml/dependencias.php",
341 - "i3GEOF.uploadkml.iniciaJanelaFlutuante()", 341 + "i3GEOF.uploadkml.start()",
342 "i3GEOF.uploadkml_script"); 342 "i3GEOF.uploadkml_script");
343 } 343 }
344 }; 344 };
345 \ No newline at end of file 345 \ No newline at end of file
js/dicionario.js
@@ -3147,5 +3147,12 @@ g_traducao = @@ -3147,5 +3147,12 @@ g_traducao =
3147 pt : "Camada atualizada", 3147 pt : "Camada atualizada",
3148 en : "", 3148 en : "",
3149 es : "" 3149 es : ""
3150 - }] 3150 + }],
  3151 + "adicmapa" : [
  3152 + {
  3153 + pt : "Adiconar ao mapa",
  3154 + en : "",
  3155 + es : ""
  3156 + }
  3157 + ]
3151 }; 3158 };
@@ -2153,11 +2153,17 @@ i3GEO.util = @@ -2153,11 +2153,17 @@ i3GEO.util =
2153 comboEpsg : function(idCombo, onde, funcaoOnChange, valorDefault) { 2153 comboEpsg : function(idCombo, onde, funcaoOnChange, valorDefault) {
2154 onde = $i(onde); 2154 onde = $i(onde);
2155 onde.innerHTML = "<span style=color:red;font-size:10px; >buscando...</span>"; 2155 onde.innerHTML = "<span style=color:red;font-size:10px; >buscando...</span>";
  2156 + if(!funcaoOnChange){
  2157 + funcaoOnChange = "";
  2158 + }
  2159 + if(!valorDefault){
  2160 + valorDefault = "";
  2161 + }
2156 var monta = function(retorno) { 2162 var monta = function(retorno) {
2157 var ins = [], i, n; 2163 var ins = [], i, n;
2158 if (retorno.data !== undefined) { 2164 if (retorno.data !== undefined) {
2159 n = retorno.data.length; 2165 n = retorno.data.length;
2160 - ins.push("<select id='" + idCombo + "' onChange='" + funcaoOnChange + "(this)' >"); 2166 + ins.push("<select class='form-control' name='" + idCombo + "' id='" + idCombo + "' onChange='" + funcaoOnChange + "(this)' >");
2161 for (i = 0; i < n; i++) { 2167 for (i = 0; i < n; i++) {
2162 ins.push("<option value='" + retorno.data[i].codigo + "'>" + retorno.data[i].nome + "</option>"); 2168 ins.push("<option value='" + retorno.data[i].codigo + "'>" + retorno.data[i].nome + "</option>");
2163 } 2169 }