diff --git a/ferramentas/animacao/index.js b/ferramentas/animacao/index.js
index f086d52..4812709 100755
--- a/ferramentas/animacao/index.js
+++ b/ferramentas/animacao/index.js
@@ -35,7 +35,7 @@ i3GEOF.animacao = {
hash["idContainer"] = p.idContainer;
hash["idlista"] = p.idlista;
i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
i3GEOF.animacao.listaDeCamadas();
},
listaDeCamadas: function(){
diff --git a/ferramentas/conectargeojson/index.js b/ferramentas/conectargeojson/index.js
index f1f7b75..89acf98 100755
--- a/ferramentas/conectargeojson/index.js
+++ b/ferramentas/conectargeojson/index.js
@@ -29,7 +29,7 @@ i3GEOF.conectargeojson = {
},
destroy: function(){
//nao use this aqui
- //i3GEOF.conectargeojson._parameters.mustache = "";
+ i3GEOF.conectargeojson.renderFunction.call();
},
html:function() {
var p = this._parameters,
@@ -38,7 +38,7 @@ i3GEOF.conectargeojson = {
locaplic: i3GEO.configura.locaplic,
namespace: p.namespace,
idContainer: p.idContainer,
- botao: $trad("p14"),
+ botao: $trad("adicmapa"),
...i3GEO.idioma.objetoIdioma(i3f.dicionario)
};
i3f.renderFunction.call(
@@ -46,15 +46,16 @@ i3GEOF.conectargeojson = {
{
texto: Mustache.render(p.mustache, hash)
});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
},
getFormData: function(){
var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
return data
},
- adiciona: function(btn){
+ adiciona: function(formEl){
+ var btn = $(formEl).find(":submit");
+ btn.prop("disabled",true).find("span").removeClass("hidden");
i3GEO.janela.abreAguarde();
- $(btn).button("disable").find("span").removeClass("hidden");
var par = this.getFormData(),
i3f = this;
par.g_sid = i3GEO.configura.sid;
@@ -68,7 +69,7 @@ i3GEOF.conectargeojson = {
i3GEO.atualiza();
i3GEO.janela.fechaAguarde();
i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
- $(btn).button("disable").find("span").addClass("hidden");
+ btn.prop("disabled",false).find("span").addClass("hidden");
i3f.destroy();
}
)
@@ -76,7 +77,7 @@ i3GEOF.conectargeojson = {
function(data){
i3GEO.janela.fechaAguarde();
i3GEO.janela.snackBar({content: data.status, style:'red'});
- $(btn).button("disable").find("span").addClass("hidden");
+ btn.prop("disabled",false).find("span").addClass("hidden");
i3f.destroy();
}
);
diff --git a/ferramentas/conectargeojson/template_mst.html b/ferramentas/conectargeojson/template_mst.html
index cdcfe33..86e68af 100755
--- a/ferramentas/conectargeojson/template_mst.html
+++ b/ferramentas/conectargeojson/template_mst.html
@@ -1,14 +1,13 @@
+ */
+ mostralegenda : function() {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p, cp;
+ p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editalegenda&opcao=edita&tema="
+ + i3GEOF.legenda.tema;
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "tabelaLegenda", i3GEOF.legenda.montaLegenda);
+ },
+ /*
+ * Function: montaLegenda
+ *
+ * Formata a tabela de edição da legenda
+ *
+ * Parametro:
+ *
+ * retorno - objeto contendo os dados para formatação da legenda
+ */
+ montaLegenda : function(retorno) {
+ i3GEOF.legenda.aviso = false;
+ try {
+ if (retorno.data != undefined) {
+ //hidden e utilizado para esconder ou mostrar determinados trechos do template
+ var mustache = [], b, ins, i, ajuda, id, re, exp, n, filtro,temp = {};
+ // se nao for do tipo raster
+ if (retorno.data[0].proc === "") {
+ n = retorno.data.length;
+ for (i = 0; i < n; i++) {
+ temp = {};
+ id = retorno.data[i].tema + "-" + retorno.data[i].idclasse;
+ re = new RegExp("'", "g");
+ exp = (retorno.data[i].expressao).replace(re, '"');
+ temp.cliqueExclui = $trad('cliqueExclui', i3GEOF.legenda.dicionario);
+ temp.cliqueAltera = $trad('cliqueAltera', i3GEOF.legenda.dicionario);
+ temp.imagem = retorno.data[i].imagem;
+ temp.id = id;
+ temp.idclasse = retorno.data[i].idclasse;
+ temp.novoNome = $trad('digitaNovoNome', i3GEOF.legenda.dicionario);
+ temp.nome = retorno.data[i].nomeclasse;
+ temp.editorExp = $trad("editorExp", i3GEOF.legenda.dicionario);
+ temp.exp = exp;
+ temp.txtMinscale = $trad('minScale', i3GEOF.legenda.dicionario);
+ temp.minScale = retorno.data[i].minScale;
+ temp.txtMaxScale = $trad('maxScale', i3GEOF.legenda.dicionario);
+ temp.maxScale = retorno.data[i].maxScale;
+ temp.sobe = $trad('sobe', i3GEOF.legenda.dicionario);
+ temp.desce = $trad('desce', i3GEOF.legenda.dicionario);
+ mustache.push(temp);
+ }
+ ins = Mustache.render(
+ i3GEOF.legenda.MUSTACHELISTA,
+ $.extend(
+ {},
+ {
+ "linhas" : mustache,
+ "hidden2":"",
+ "hidden1": "hidden"
+ },
+ i3GEOF.legenda.DICIONARIO
+ )
);
- divid = janela[2].id;
- i3GEOF.legenda.aguarde = $i("i3GEOF.legenda_imagemCabecalho").style;
- $i("i3GEOF.legenda_corpo").style.backgroundColor = "white";
- i3GEOF.legenda.inicia(divid);
- },
- /*
- * Function: ativaFoco
- *
- * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
- */
- ativaFoco : function() {
+ $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;
+ } else {
+ ajuda = i3GEOF.legenda.DICIONARIO['ajudaEscalaCores']
+ + ""
+ + i3GEOF.legenda.DICIONARIO['msgEscalaCoresAuto']
+ + "
"
+ + i3GEOF.legenda.DICIONARIO['msgEscalaCoresIndividual']
+ + "
"
+ + i3GEOF.legenda.DICIONARIO['msgBandas']
+ + "
"
+ + i3GEOF.legenda.DICIONARIO['msgReamostragem'];
- },
- /*
- * Function: aposAlterarLegenda
- *
- * Função executada após ocorrer alguma alteração efetiva da legenda do mapa
- */
- aposAlterarLegenda : function() {
- i3GEO.arvoreDeCamadas.CAMADAS = [];
- i3GEO.atualiza();
- i3GEO.Interface.atualizaTema("", i3GEOF.legenda.tema);
- },
- /*
- * Function: mostralegenda
- *
- * Pega os dados da legenda do mapa atual e mostra na tela
- *
- * Veja:
- *
- *
- */
- mostralegenda : function() {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
+ mustache = [];
+ for (i = 0; i < retorno.data[0].proc.length; i++) {
+ mustache.push({
+ "value": retorno.data[0].proc[i]
+ });
}
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p, cp;
- p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editalegenda&opcao=edita&tema="
- + i3GEOF.legenda.tema;
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "tabelaLegenda", i3GEOF.legenda.montaLegenda);
- },
- /*
- * Function: montaLegenda
- *
- * Formata a tabela de edição da legenda
- *
- * Parametro:
- *
- * retorno - objeto contendo os dados para formatação da legenda
- */
- montaLegenda : function(retorno) {
- i3GEOF.legenda.aviso = false;
- try {
- if (retorno.data != undefined) {
- //hidden e utilizado para esconder ou mostrar determinados trechos do template
- var mustache = [], b, ins, i, ajuda, id, re, exp, n, filtro,temp = {};
- // se nao for do tipo raster
- if (retorno.data[0].proc === "") {
- n = retorno.data.length;
- for (i = 0; i < n; i++) {
- temp = {};
- id = retorno.data[i].tema + "-" + retorno.data[i].idclasse;
- re = new RegExp("'", "g");
- exp = (retorno.data[i].expressao).replace(re, '"');
- temp.cliqueExclui = $trad('cliqueExclui', i3GEOF.legenda.dicionario);
- temp.cliqueAltera = $trad('cliqueAltera', i3GEOF.legenda.dicionario);
- temp.imagem = retorno.data[i].imagem;
- temp.id = id;
- temp.idclasse = retorno.data[i].idclasse;
- temp.novoNome = $trad('digitaNovoNome', i3GEOF.legenda.dicionario);
- temp.nome = retorno.data[i].nomeclasse;
- temp.editorExp = $trad("editorExp", i3GEOF.legenda.dicionario);
- temp.exp = exp;
- temp.txtMinscale = $trad('minScale', i3GEOF.legenda.dicionario);
- temp.minScale = retorno.data[i].minScale;
- temp.txtMaxScale = $trad('maxScale', i3GEOF.legenda.dicionario);
- temp.maxScale = retorno.data[i].maxScale;
- temp.sobe = $trad('sobe', i3GEOF.legenda.dicionario);
- temp.desce = $trad('desce', i3GEOF.legenda.dicionario);
- mustache.push(temp);
- }
- ins = Mustache.render(
- i3GEOF.legenda.MUSTACHELISTA,
- $.extend(
- {},
- {
- "linhas" : mustache,
- "hidden2":"",
- "hidden1": "hidden"
- },
- i3GEOF.legenda.DICIONARIO
- )
- );
- $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;
- } else {
- ajuda = i3GEOF.legenda.DICIONARIO['ajudaEscalaCores']
- + ""
- + i3GEOF.legenda.DICIONARIO['msgEscalaCoresAuto']
- + "
"
- + i3GEOF.legenda.DICIONARIO['msgEscalaCoresIndividual']
- + "
"
- + i3GEOF.legenda.DICIONARIO['msgBandas']
- + "
"
- + i3GEOF.legenda.DICIONARIO['msgReamostragem'];
- mustache = [];
- for (i = 0; i < retorno.data[0].proc.length; i++) {
- mustache.push({
- "value": retorno.data[0].proc[i]
- });
- }
+ ins = Mustache.render(
+ i3GEOF.legenda.MUSTACHELISTA,
+ $.extend(
+ {},
+ {
+ "hidden2":"hidden",
+ "hidden1": "",
+ "ajuda1": ajuda,
+ "processos": mustache
+ },
+ i3GEOF.legenda.DICIONARIO
+ )
+ );
+ $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;
+ }
+ } else {
+ $i("i3GEOlegendaresultado").innerHTML = "
Erro
";
+ }
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ } catch (e) {
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ filtro : function(idRetorno) {
+ i3GEO.tema.dialogo.filtro(i3GEOF.legenda.tema, true, idRetorno);
+ },
+ /*
+ * Function: aviso
+ *
+ * Mostra um i3GEO.janela.tempoMsga ao usuário quando um campo da tabela que contém os dados da legenda é
+ * alterado
+ *
+ * O aviso é mostrado apenas uma vez
+ */
+ aviso : function() {
+ if (i3GEOF.legenda.aviso == true) {
+ i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao', i3GEOF.legenda.dicionario));
+ i3GEOF.legenda.aviso == false;
+ }
+ },
+ /*
+ * Function: aplicaColourRamp
+ *
+ * Aplica nas classes da legenda as cores escolhidas no seletor de cores
+ */
+ aplicaColourRamp : function() {
+ if ($i("listaColourRamp").value != "") {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var cores = $i("listaColourRamp").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), temp = function() {
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ i3GEOF.legenda.aposAlterarLegenda();
+ }, p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&opcao=aplicacoresrgb&ext="
+ + ext
+ + "&tema="
+ + i3GEOF.legenda.tema, cp = new cpaint();
+ cp.set_transfer_mode('POST');
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", temp, "cores=" + cores);
+ }
+ },
+ /*
+ * Function: corj
+ *
+ * Abre a janela para o usuário selecionar uma cor interativamente
+ */
+ corj : function(obj) {
+ i3GEO.util.abreCor("", obj);
+ },
+ /*
+ * Function: modificaCor
+ *
+ * Modifica a cor de uma classe
+ */
+ modificaCor : function(id) {
+ var obj = $i("tempCorLegenda");
+ if (!obj) {
+ var obj = document.createElement("input");
+ obj.id = "tempCorLegenda";
+ obj.style.display = "none";
+ obj.type = "text";
+ obj.value = "";
+ document.body.appendChild(obj);
+ obj.onchange = function() {
+ i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name);
+ };
+ }
+ obj.name = id;
+ i3GEO.util.abreCor("", "tempCorLegenda");
+ },
+ aplicaNovaCor : function(id) {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retorna = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ i3GEO.php.aplicaCorClasseTema(retorna, i3GEOF.legenda.tema, id, $i("tempCorLegenda").value);
+ },
+ aplicarLegendaImg : function() {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente
+ var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
+ objTema.legendaimg = $i("i3GEOlegendaImg").value;
+
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retorna = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ var p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=aplicaLegendaImg"
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&imagem="
+ + objTema.legendaimg,
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", retorna);
+ },
+ aplicarOffsite : function() {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente
+ var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
+ objTema.offsite = $i("i3GEOoffsite").value;
- ins = Mustache.render(
- i3GEOF.legenda.MUSTACHELISTA,
- $.extend(
- {},
- {
- "hidden2":"hidden",
- "hidden1": "",
- "ajuda1": ajuda,
- "processos": mustache
- },
- i3GEOF.legenda.DICIONARIO
- )
- );
- $i("i3GEOlegendaguia1objLegenda").innerHTML = ins;
- }
- } else {
- $i("i3GEOlegendaresultado").innerHTML = "
Erro
";
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retorna = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ var p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=aplicaOffsite"
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&offsite="
+ + objTema.offsite,
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", retorna);
+ },
+ /*
+ * Function: mudaLegenda
+ *
+ * Altera a legenda conforme os valores existentes na tabela de propriedades (expressão e nome da classe)
+ *
+ * Veja:
+ *
+ *
+ */
+ mudaLegenda : function() {
+ i3GEOF.legenda.aviso = false;
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ try {
+ var tabela = $i("i3GEOlegendalegenda"),
+ trs = tabela.getElementsByTagName("tr"),
+ minScales = [],
+ maxScales = [],
+ nomes = [],
+ exps = [],
+ ids = [],
+ t, nn, n, p, cp, temp;
+ for (t = 1; t < trs.length; t++) {
+ if (trs[t].childNodes) {
+ nn = trs[t].childNodes;
+ for (n = 0; n < nn.length; n++) {
+ if (nn && nn[n] && nn[n].childNodes && nn[n].getElementsByTagName) {
+ var isn = nn[n].getElementsByTagName("input");
+ if (isn && isn[0] != undefined) {
+ if (isn[0].name == "nome") {
+ nomes.push(isn[0].value);
+ temp = (isn[0].id).split("i3GEOlegendaid_");
+ ids.push(temp[1]);
+ }
+ if (isn[0].name == "expressao") {
+ exps.push(isn[0].value);
+ }
+ if (isn[0].name == "minScale") {
+ minScales.push(parseInt(isn[0].value, 10));
+ }
+ if (isn[0].name == "maxScale") {
+ maxScales.push(parseInt(isn[0].value, 10));
+ }
}
- i3GEOF.legenda.aguarde.visibility = "hidden";
- } catch (e) {
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- filtro : function(idRetorno) {
- i3GEO.tema.dialogo.filtro(i3GEOF.legenda.tema, true, idRetorno);
- },
- /*
- * Function: aviso
- *
- * Mostra um i3GEO.janela.tempoMsga ao usuário quando um campo da tabela que contém os dados da legenda é
- * alterado
- *
- * O aviso é mostrado apenas uma vez
- */
- aviso : function() {
- if (i3GEOF.legenda.aviso == true) {
- i3GEO.janela.tempoMsg($trad('msgAplicaAlteracao', i3GEOF.legenda.dicionario));
- i3GEOF.legenda.aviso == false;
- }
- },
- /*
- * Function: aplicaColourRamp
- *
- * Aplica nas classes da legenda as cores escolhidas no seletor de cores
- */
- aplicaColourRamp : function() {
- if ($i("listaColourRamp").value != "") {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var cores = $i("listaColourRamp").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), temp = function() {
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- i3GEOF.legenda.aposAlterarLegenda();
- }, p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&opcao=aplicacoresrgb&ext="
- + ext
- + "&tema="
- + i3GEOF.legenda.tema, cp = new cpaint();
- cp.set_transfer_mode('POST');
- cp.set_response_type("JSON");
- cp.call(p, "foo", temp, "cores=" + cores);
- }
- },
- /*
- * Function: corj
- *
- * Abre a janela para o usuário selecionar uma cor interativamente
- */
- corj : function(obj) {
- i3GEO.util.abreCor("", obj);
- },
- /*
- * Function: modificaCor
- *
- * Modifica a cor de uma classe
- */
- modificaCor : function(id) {
- var obj = $i("tempCorLegenda");
- if (!obj) {
- var obj = document.createElement("input");
- obj.id = "tempCorLegenda";
- obj.style.display = "none";
- obj.type = "text";
- obj.value = "";
- document.body.appendChild(obj);
- obj.onchange = function() {
- i3GEOF.legenda.aplicaNovaCor($i("tempCorLegenda").name);
- };
+ }
}
- obj.name = id;
- i3GEO.util.abreCor("", "tempCorLegenda");
- },
- aplicaNovaCor : function(id) {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retorna = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- i3GEO.php.aplicaCorClasseTema(retorna, i3GEOF.legenda.tema, id, $i("tempCorLegenda").value);
- },
- aplicarLegendaImg : function() {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente
- var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
- objTema.legendaimg = $i("i3GEOlegendaImg").value;
+ }
+ }
+ ids = ids.join(";");
+ nomes = nomes.join(";");
+ exps = exps.join(";");
+ minScales = minScales.join(";");
+ maxScales = maxScales.join(";");
+ temp = function() {
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?"
+ + "base64=sim"
+ + "&g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse"
+ + "&opcao=alteraclasses"
+ + "&ext="
+ + ext;
+ cp = new cpaint();
+ cp.set_transfer_mode('POST');
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclassesPost", temp, "ids=" + ids
+ + "&nomes="
+ + i3GEO.util.base64encode(nomes)
+ //+ nomes
+ + "&exps="
+ + i3GEO.util.base64encode(exps)
+ //+ exps
+ + "&minScales="
+ + minScales
+ + "&maxScales="
+ + maxScales);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: alteraGeometria
+ *
+ * Altera o tipo de representação geométrica dos elementos de um layer
+ *
+ * Veja:
+ *
+ *
+ */
+ alteraGeometriaTema : function() {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retorna = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&opcao=alterageometria&tema="
+ + i3GEOF.legenda.tema
+ + "&tipo="
+ + $i("i3GEOlegentaTipoGeo").value, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "", retorna);
+ },
+ /*
+ * Function: adicionaConta
+ *
+ * Adiciona ao nome de cada classe o número de ocorrências em cada uma
+ *
+ * Veja:
+ *
+ *
+ */
+ adicionaConta : function() {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=contagemclasse"
+ + "&tema="
+ + i3GEOF.legenda.tema, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "contagemclasse", i3GEOF.legenda.montaLegenda);
+ i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis', i3GEOF.legenda.dicionario));
+ },
+ /*
+ * Function: adicionaClasse
+ *
+ * Adiciona uma nova classe ao tema
+ *
+ * Veja:
+ *
+ *
+ */
+ adicionaClasse : function() {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&opcao=adicionaclasse"
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&ext="
+ + ext, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", i3GEOF.legenda.mostralegenda);
+ },
+ /*
+ * Function: adicionaOpacidade
+ *
+ * Adiciona opacidade variável em cada classe
+ *
+ * Veja:
+ *
+ *
+ */
+ adicionaOpacidade : function() {
+ var retorna = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&opcao=adicionaopacidade"
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&ext="
+ + ext, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", retorna);
+ },
+ /*
+ * Function: paleta
+ *
+ * Gera as cores para as classes considerando um RGB inicial e um final
+ *
+ * Veja:
+ *
+ *
+ */
+ paleta : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retornapaleta = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ }, ci = $i("i3GEOlegendaacori").value, cf = $i("i3GEOlegendaacorf").value, cp = new cpaint(), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraCoresClasses&tema="
+ + i3GEOF.legenda.tema
+ + "&cori="
+ + ci
+ + "&corf="
+ + cf;
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraCoresClasses", retornapaleta);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: inverteCores
+ *
+ * Inverte as cores utilizadas nos símbolos das classes
+ *
+ * Veja:
+ *
+ *
+ */
+ inverteCores : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retornapaleta = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ }, cp = new cpaint(), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=inverteCoresClasses&tema="
+ + i3GEOF.legenda.tema;
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraCoresClasses", retornapaleta);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: calculaTamanho
+ *
+ * Muda o símbolo de cada classe aplicando tamanhos diferentes e lineares
+ *
+ * Veja:
+ *
+ *
+ */
+ calculaTamanho : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retornapaleta = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ }, cp = new cpaint(), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=calculaTamanhoClasses&tema="
+ + i3GEOF.legenda.tema;
+ cp.set_response_type("JSON");
+ cp.call(p, "calculaTamanhoClasses", retornapaleta);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: ordenaClasses
+ *
+ * Ordena as classes pelo nome
+ *
+ */
+ ordenaClasses : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var retornapaleta = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ }, cp = new cpaint(), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=ordenaClasses&tema="
+ + i3GEOF.legenda.tema;
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", retornapaleta);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: excluilinhaf
+ *
+ * Exclui uma linha da tabela de edição de classes da legendda
+ */
+ excluilinhaf : function(id) {
+ var p = $i(id);
+ do {
+ p.removeChild(p.childNodes[0]);
+ } while (p.childNodes.length > 0);
+ p.parentNode.removeChild(p);
+ i3GEOF.legenda.mudaLegenda();
+ },
+ /*
+ * Function: sobelinhaf
+ *
+ * Sobe uma linha na tabela de edição de classes da legendda
+ */
+ sobelinhaf : function(idclasse) {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=ALTERACLASSE&opcao=sobeclasse&tema="
+ + i3GEOF.legenda.tema
+ + "&idclasse="
+ + idclasse, cp = new cpaint(), temp = function() {
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", temp);
+ },
+ /*
+ * Function: descelinhaf
+ *
+ * Desce uma linha na tabela de edição de classes da legendda
+ */
+ descelinhaf : function(idclasse) {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=ALTERACLASSE&opcao=desceclasse&tema="
+ + i3GEOF.legenda.tema
+ + "&idclasse="
+ + idclasse, cp = new cpaint(), temp = function() {
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ };
+ ;
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", temp);
+ },
+ /*
+ * Function: editaSimbolo
+ *
+ * Abre o editor de símbolos
+ *
+ * Veja:
+ *
+ *
+ */
+ editaSimbolo : function(id) {
+ try {
+ $i("i3GEOlegendaguia1obj").style.display = "none";
+ $i("i3GEOlegendaguia3obj").style.display = "block";
+ id = id.split("-");
+ i3GEOF.legenda.classe = id[1];
+ i3GEOF.legenda.formEditorSimbolo();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ formEditorSimbolo : function() {
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&opcao=pegaparametros&tema="
+ + i3GEOF.legenda.tema
+ + "&classe="
+ + i3GEOF.legenda.classe, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "pegaParametrosMapa", i3GEOF.legenda.montaEditor);
+ },
+ /*
+ * Function: simbU
+ *
+ * Altera a leganda do tema para o tipo símbolo único
+ *
+ * Veja:
+ *
+ *
+ */
+ simbU : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&tema="
+ + i3GEOF.legenda.tema
+ + "&opcao=simbolounico&ext="
+ + ext, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: valorU
+ *
+ * Altera a leganda do tema para o tipo valor único
+ *
+ * Veja:
+ *
+ *
+ */
+ valorU : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensValorUnico").getElementsByTagName("select")[0].value, itemNome =
+ $i("i3GEOlegendaClassesValorUnico").getElementsByTagName("select")[0].value, p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&itemNome="
+ + itemNome
+ + "&opcao=valorunico"
+ + "&ignorar="
+ + $i("i3GEOlegendaignorar").value, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if ($i("i3GEOFlegendaaplicaextent").checked === true) {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ } else {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
+ }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retorna = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- var p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=aplicaLegendaImg"
- + "&tema="
- + i3GEOF.legenda.tema
- + "&imagem="
- + objTema.legendaimg,
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "foo", retorna);
- },
- aplicarOffsite : function() {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- //muda o valor do objeto tema para que a proxima vez que abrir a ferramenta o campo input seja preenchido corretamente
- var objTema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.legenda.tema);
- objTema.offsite = $i("i3GEOoffsite").value;
+ if (item == "") {
+ i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: valorC
+ *
+ * Altera a leganda do tema com um número específico de classes
+ *
+ * Veja:
+ *
+ *
+ */
+ valorC : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
+ $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&nclasses="
+ + nclasses
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&opcao=intervalosiguais&ignorar="
+ + $i("i3GEOlegendaignorar").value
+ + "&ext="
+ + ext, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if (item == "") {
+ i3GEO.janela.tempoMsg("Selecione um item!");
+ return;
+ }
+ if ($i("i3GEOFlegendaaplicaextent").checked === true) {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ } else {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: metade
+ *
+ * Duas classes concentrando a soma das metades
+ *
+ * Veja:
+ *
+ *
+ */
+ metade : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensMetade").getElementsByTagName("select")[0].value,
+ itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value,
+ p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse"
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&itemid="
+ + itemid
+ + "&opcao=metade&ignorar="
+ + $i("i3GEOlegendaignorar").value,
+ cp = new cpaint(),
+ fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if (item == "") {
+ i3GEO.janela.tempoMsg("Selecione um item!");
+ return;
+ }
+ if (itemid == "") {
+ i3GEO.janela.tempoMsg("Selecione um item!");
+ return;
+ }
+ if ($i("i3GEOFlegendaaplicaextent").checked === true) {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ } else {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: media
+ *
+ * Duas classes considerando a media
+ *
+ * Veja:
+ *
+ *
+ */
+ media : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensMedia").getElementsByTagName("select")[0].value,
+ p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse"
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&opcao=media&ignorar="
+ + $i("i3GEOlegendaignorar").value,
+ cp = new cpaint(),
+ fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if (item == "") {
+ i3GEO.janela.tempoMsg("Selecione um item!");
+ return;
+ }
+ if ($i("i3GEOFlegendaaplicaextent").checked === true) {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
+ } else {
+ p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: valorQ
+ *
+ * Altera a leganda do tema claculando as classes pelo método quartil
+ *
+ * Veja:
+ *
+ *
+ */
+ valorQ : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensValorQuartil").getElementsByTagName("select")[0].value, ext =
+ i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&opcao=quartis&ignorar="
+ + $i("i3GEOlegendaignorar").value
+ + "&ext="
+ + ext
+ + "&tipoLegenda="
+ + $i("estiloClassesQuartis").value, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if (item == "") {
+ i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: valorQu
+ *
+ * Altera a leganda do tema por meio do calculo de quantis
+ *
+ * Veja:
+ *
+ *
+ */
+ valorQu : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
+ $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&nclasses="
+ + nclasses
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&opcao=quantil&ignorar="
+ + $i("i3GEOlegendaignorar").value
+ + "&ext="
+ + ext, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if (item == "") {
+ i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: valorQN
+ *
+ * Altera a legenda do tema por meio do calculo de quebras naturais
+ *
+ * Veja:
+ *
+ *
+ */
+ valorQN : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
+ $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alteraclasse&nclasses="
+ + nclasses
+ + "&tema="
+ + i3GEOF.legenda.tema
+ + "&item="
+ + item
+ + "&opcao=quebrasnaturais&ignorar="
+ + $i("i3GEOlegendaignorar").value
+ + "&ext="
+ + ext, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ if (item == "") {
+ i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraclasse", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retorna = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- var p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=aplicaOffsite"
- + "&tema="
- + i3GEOF.legenda.tema
- + "&offsite="
- + objTema.offsite,
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "foo", retorna);
- },
- /*
- * Function: mudaLegenda
- *
- * Altera a legenda conforme os valores existentes na tabela de propriedades (expressão e nome da classe)
- *
- * Veja:
- *
- *
- */
- mudaLegenda : function() {
- i3GEOF.legenda.aviso = false;
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- try {
- var tabela = $i("i3GEOlegendalegenda"),
- trs = tabela.getElementsByTagName("tr"),
- minScales = [],
- maxScales = [],
- nomes = [],
- exps = [],
- ids = [],
- t, nn, n, p, cp, temp;
- for (t = 1; t < trs.length; t++) {
- if (trs[t].childNodes) {
- nn = trs[t].childNodes;
- for (n = 0; n < nn.length; n++) {
- if (nn && nn[n] && nn[n].childNodes && nn[n].getElementsByTagName) {
- var isn = nn[n].getElementsByTagName("input");
- if (isn && isn[0] != undefined) {
- if (isn[0].name == "nome") {
- nomes.push(isn[0].value);
- temp = (isn[0].id).split("i3GEOlegendaid_");
- ids.push(temp[1]);
- }
- if (isn[0].name == "expressao") {
- exps.push(isn[0].value);
- }
- if (isn[0].name == "minScale") {
- minScales.push(parseInt(isn[0].value, 10));
- }
- if (isn[0].name == "maxScale") {
- maxScales.push(parseInt(isn[0].value, 10));
- }
- }
- }
- }
- }
- }
- ids = ids.join(";");
- nomes = nomes.join(";");
- exps = exps.join(";");
- minScales = minScales.join(";");
- maxScales = maxScales.join(";");
- temp = function() {
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?"
- + "base64=sim"
- + "&g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse"
- + "&opcao=alteraclasses"
- + "&ext="
- + ext;
- cp = new cpaint();
- cp.set_transfer_mode('POST');
- cp.set_response_type("JSON");
- cp.call(p, "alteraclassesPost", temp, "ids=" + ids
- + "&nomes="
- + i3GEO.util.base64encode(nomes)
- //+ nomes
- + "&exps="
- + i3GEO.util.base64encode(exps)
- //+ exps
- + "&minScales="
- + minScales
- + "&maxScales="
- + maxScales);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: alteraGeometria
- *
- * Altera o tipo de representação geométrica dos elementos de um layer
- *
- * Veja:
- *
- *
- */
- alteraGeometriaTema : function() {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retorna = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&opcao=alterageometria&tema="
- + i3GEOF.legenda.tema
- + "&tipo="
- + $i("i3GEOlegentaTipoGeo").value, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "", retorna);
- },
- /*
- * Function: adicionaConta
- *
- * Adiciona ao nome de cada classe o número de ocorrências em cada uma
- *
- * Veja:
- *
- *
- */
- adicionaConta : function() {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=contagemclasse"
- + "&tema="
- + i3GEOF.legenda.tema, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "contagemclasse", i3GEOF.legenda.montaLegenda);
- i3GEO.janela.tempoMsg($trad('consideraElementosVisiveis', i3GEOF.legenda.dicionario));
- },
- /*
- * Function: adicionaClasse
- *
- * Adiciona uma nova classe ao tema
- *
- * Veja:
- *
- *
- */
- adicionaClasse : function() {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&opcao=adicionaclasse"
- + "&tema="
- + i3GEOF.legenda.tema
- + "&ext="
- + ext, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", i3GEOF.legenda.mostralegenda);
- },
- /*
- * Function: adicionaOpacidade
- *
- * Adiciona opacidade variável em cada classe
- *
- * Veja:
- *
- *
- */
- adicionaOpacidade : function() {
- var retorna = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&opcao=adicionaopacidade"
- + "&tema="
- + i3GEOF.legenda.tema
- + "&ext="
- + ext, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", retorna);
- },
- /*
- * Function: paleta
- *
- * Gera as cores para as classes considerando um RGB inicial e um final
- *
- * Veja:
- *
- *
- */
- paleta : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retornapaleta = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- }, ci = $i("i3GEOlegendaacori").value, cf = $i("i3GEOlegendaacorf").value, cp = new cpaint(), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraCoresClasses&tema="
- + i3GEOF.legenda.tema
- + "&cori="
- + ci
- + "&corf="
- + cf;
- cp.set_response_type("JSON");
- cp.call(p, "alteraCoresClasses", retornapaleta);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: inverteCores
- *
- * Inverte as cores utilizadas nos símbolos das classes
- *
- * Veja:
- *
- *
- */
- inverteCores : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retornapaleta = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- }, cp = new cpaint(), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=inverteCoresClasses&tema="
- + i3GEOF.legenda.tema;
- cp.set_response_type("JSON");
- cp.call(p, "alteraCoresClasses", retornapaleta);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: calculaTamanho
- *
- * Muda o símbolo de cada classe aplicando tamanhos diferentes e lineares
- *
- * Veja:
- *
- *
- */
- calculaTamanho : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retornapaleta = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- }, cp = new cpaint(), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=calculaTamanhoClasses&tema="
- + i3GEOF.legenda.tema;
- cp.set_response_type("JSON");
- cp.call(p, "calculaTamanhoClasses", retornapaleta);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: ordenaClasses
- *
- * Ordena as classes pelo nome
- *
- */
- ordenaClasses : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var retornapaleta = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- }, cp = new cpaint(), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=ordenaClasses&tema="
- + i3GEOF.legenda.tema;
- cp.set_response_type("JSON");
- cp.call(p, "foo", retornapaleta);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: excluilinhaf
- *
- * Exclui uma linha da tabela de edição de classes da legendda
- */
- excluilinhaf : function(id) {
- var p = $i(id);
- do {
- p.removeChild(p.childNodes[0]);
- } while (p.childNodes.length > 0);
- p.parentNode.removeChild(p);
- i3GEOF.legenda.mudaLegenda();
- },
- /*
- * Function: sobelinhaf
- *
- * Sobe uma linha na tabela de edição de classes da legendda
- */
- sobelinhaf : function(idclasse) {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=ALTERACLASSE&opcao=sobeclasse&tema="
- + i3GEOF.legenda.tema
- + "&idclasse="
- + idclasse, cp = new cpaint(), temp = function() {
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- cp.set_response_type("JSON");
- cp.call(p, "foo", temp);
- },
- /*
- * Function: descelinhaf
- *
- * Desce uma linha na tabela de edição de classes da legendda
- */
- descelinhaf : function(idclasse) {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=ALTERACLASSE&opcao=desceclasse&tema="
- + i3GEOF.legenda.tema
- + "&idclasse="
- + idclasse, cp = new cpaint(), temp = function() {
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- };
- ;
- cp.set_response_type("JSON");
- cp.call(p, "foo", temp);
- },
- /*
- * Function: editaSimbolo
- *
- * Abre o editor de símbolos
- *
- * Veja:
- *
- *
- */
- editaSimbolo : function(id) {
- try {
- $i("i3GEOlegendaguia1obj").style.display = "none";
- $i("i3GEOlegendaguia3obj").style.display = "block";
- id = id.split("-");
- i3GEOF.legenda.classe = id[1];
- i3GEOF.legenda.formEditorSimbolo();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- formEditorSimbolo : function() {
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&opcao=pegaparametros&tema="
- + i3GEOF.legenda.tema
- + "&classe="
- + i3GEOF.legenda.classe, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "pegaParametrosMapa", i3GEOF.legenda.montaEditor);
- },
- /*
- * Function: simbU
- *
- * Altera a leganda do tema para o tipo símbolo único
- *
- * Veja:
- *
- *
- */
- simbU : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&tema="
- + i3GEOF.legenda.tema
- + "&opcao=simbolounico&ext="
- + ext, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: valorU
- *
- * Altera a leganda do tema para o tipo valor único
- *
- * Veja:
- *
- *
- */
- valorU : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensValorUnico").getElementsByTagName("select")[0].value, itemNome =
- $i("i3GEOlegendaClassesValorUnico").getElementsByTagName("select")[0].value, p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&itemNome="
- + itemNome
- + "&opcao=valorunico"
- + "&ignorar="
- + $i("i3GEOlegendaignorar").value, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if ($i("i3GEOFlegendaaplicaextent").checked === true) {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- } else {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
- }
+ /*
+ * Function: representacao
+ *
+ * Altera o tipo de representação do tema (linear ou poligonoal)
+ *
+ * Veja:
+ *
+ *
+ *
+ */
+ representacao : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=alterarepresentacao&tema="
+ + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ };
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p, "alteraRepresentacao", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: montaEditor
+ *
+ * Monta o editor de símbolos quando o usuário clica em um símbolo na legenda
+ */
+ montaEditor : function(retorno) {
+ try {
+ i3GEO.util.comboItens(
+ "i3GEOlegendaSelItemLabel",
+ i3GEOF.legenda.tema,
+ function(retorno) {
+ if ($i("i3GEOlegendaitensLabel")) {
+ $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados ;
+ }
+ },
+ "i3GEOlegendaitensLabel",
+ "",
+ "",
+ "",
+ "form-control"
+ );
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ if (retorno.data != undefined) {
+ var b, l, i, sct, combo, n;
+ retorno = retorno.data;
+ i3GEOF.legenda.estilos = retorno.split("|");
+ combo =
+ "";
+ $i("i3GEOlegendacomboestilos").innerHTML = combo;
+ $i("i3GEOlegendaestilos").value = i3GEOF.legenda.estilo;
- if (item == "") {
- i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: valorC
- *
- * Altera a leganda do tema com um número específico de classes
- *
- * Veja:
- *
- *
- */
- valorC : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
- $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&nclasses="
- + nclasses
- + "&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&opcao=intervalosiguais&ignorar="
- + $i("i3GEOlegendaignorar").value
- + "&ext="
- + ext, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if (item == "") {
- i3GEO.janela.tempoMsg("Selecione um item!");
- return;
- }
- if ($i("i3GEOFlegendaaplicaextent").checked === true) {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- } else {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: metade
- *
- * Duas classes concentrando a soma das metades
- *
- * Veja:
- *
- *
- */
- metade : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensMetade").getElementsByTagName("select")[0].value,
- itemid = $i("i3GEOlegendaitensMetadeId").getElementsByTagName("select")[0].value,
- p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse"
- + "&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&itemid="
- + itemid
- + "&opcao=metade&ignorar="
- + $i("i3GEOlegendaignorar").value,
- cp = new cpaint(),
- fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if (item == "") {
- i3GEO.janela.tempoMsg("Selecione um item!");
- return;
- }
- if (itemid == "") {
- i3GEO.janela.tempoMsg("Selecione um item!");
- return;
- }
- if ($i("i3GEOFlegendaaplicaextent").checked === true) {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- } else {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: media
- *
- * Duas classes considerando a media
- *
- * Veja:
- *
- *
- */
- media : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensMedia").getElementsByTagName("select")[0].value,
- p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse"
- + "&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&opcao=media&ignorar="
- + $i("i3GEOlegendaignorar").value,
- cp = new cpaint(),
- fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if (item == "") {
- i3GEO.janela.tempoMsg("Selecione um item!");
- return;
- }
- if ($i("i3GEOFlegendaaplicaextent").checked === true) {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
- } else {
- p += "&ext=" + i3GEO.util.extOSM2Geo(i3GEO.parametros.extentTotal);
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: valorQ
- *
- * Altera a leganda do tema claculando as classes pelo método quartil
- *
- * Veja:
- *
- *
- */
- valorQ : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensValorQuartil").getElementsByTagName("select")[0].value, ext =
- i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&opcao=quartis&ignorar="
- + $i("i3GEOlegendaignorar").value
- + "&ext="
- + ext
- + "&tipoLegenda="
- + $i("estiloClassesQuartis").value, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if (item == "") {
- i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: valorQu
- *
- * Altera a leganda do tema por meio do calculo de quantis
- *
- * Veja:
- *
- *
- */
- valorQu : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
- $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&nclasses="
- + nclasses
- + "&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&opcao=quantil&ignorar="
- + $i("i3GEOlegendaignorar").value
- + "&ext="
- + ext, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if (item == "") {
- i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: valorQN
- *
- * Altera a legenda do tema por meio do calculo de quebras naturais
- *
- * Veja:
- *
- *
- */
- valorQN : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var item = $i("i3GEOlegendaitensValorClass").getElementsByTagName("select")[0].value, nclasses =
- $i("i3GEOlegendanclasses").value, ext = i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten), p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alteraclasse&nclasses="
- + nclasses
- + "&tema="
- + i3GEOF.legenda.tema
- + "&item="
- + item
- + "&opcao=quebrasnaturais&ignorar="
- + $i("i3GEOlegendaignorar").value
- + "&ext="
- + ext, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- if (item == "") {
- i3GEO.janela.tempoMsg($trad('selecionaUmItem', i3GEOF.legenda.dicionario));
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraclasse", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: representacao
- *
- * Altera o tipo de representação do tema (linear ou poligonoal)
- *
- * Veja:
- *
- *
- *
- */
- representacao : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=alterarepresentacao&tema="
- + i3GEOF.legenda.tema, cp = new cpaint(), fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- };
- i3GEOF.legenda.aguarde.visibility = "visible";
- cp.set_response_type("JSON");
- cp.call(p, "alteraRepresentacao", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- },
- /*
- * Function: montaEditor
- *
- * Monta o editor de símbolos quando o usuário clica em um símbolo na legenda
- */
- montaEditor : function(retorno) {
- try {
- i3GEO.util.comboItens(
- "i3GEOlegendaSelItemLabel",
- i3GEOF.legenda.tema,
- function(retorno) {
- if ($i("i3GEOlegendaitensLabel")) {
- $i("i3GEOlegendaitensLabel").innerHTML = retorno.dados ;
- }
- },
- "i3GEOlegendaitensLabel",
- "",
- "",
- "",
- "form-control"
- );
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- if (retorno.data != undefined) {
- var b, l, i, sct, combo, n;
- retorno = retorno.data;
- i3GEOF.legenda.estilos = retorno.split("|");
- combo =
- "";
- $i("i3GEOlegendacomboestilos").innerHTML = combo;
- $i("i3GEOlegendaestilos").value = i3GEOF.legenda.estilo;
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostraEstilo(0);
+ } else {
+ $i("i3GEOlegendacomboestilos").innerHTML = "Erro
";
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ desceEstilo: function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&opcao=desceestilo&tema="
+ + i3GEOF.legenda.tema
+ + "&classe="
+ + i3GEOF.legenda.classe
+ + "&estilo="
+ + i3GEOF.legenda.estilo, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ sobeEstilo: function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&opcao=sobeestilo&tema="
+ + i3GEOF.legenda.tema
+ + "&classe="
+ + i3GEOF.legenda.classe
+ + "&estilo="
+ + i3GEOF.legenda.estilo, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ adicionaEstilo: function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&opcao=adicionaestilo&tema="
+ + i3GEOF.legenda.tema
+ + "&classe="
+ + i3GEOF.legenda.classe
+ + "&estilo="
+ + i3GEOF.legenda.estilo, cp = new cpaint();
+ cp.set_response_type("JSON");
+ i3GEOF.legenda.estilo = i3GEOF.legenda.estilo + 1;
+ cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ excluiEstilo: function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ i3GEOF.legenda.estilo = 0;
+ var p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&opcao=excluiestilo&tema="
+ + i3GEOF.legenda.tema
+ + "&classe="
+ + i3GEOF.legenda.classe
+ + "&estilo="
+ + i3GEOF.legenda.estilo, cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: mostraEstilo
+ *
+ * Mostra as propriedades de um estilo de um símbolo
+ */
+ mostraEstilo : function() {
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ try {
+ var linha, tipoLayer, d, p, cp, mustache = {};
+ //i3GEOF.legenda.estilo = e; // esta e uma variavel global
+ linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo];
+ linha = linha.split("#");
+ tipoLayer = linha[0];
+ mustache = {
+ "voutlinecolor": linha[2],
+ "vcolor": linha[4],
+ "vbackgroundcolor": linha[3],
+ "vsize": linha[6],
+ "vwidth": linha[8],
+ "vpattern": linha[9],
+ "vopacity": linha[7],
+ "vangle": linha[10],
+ "vsymbolscale": linha[11],
+ "vminsize": linha[12],
+ "vmaxsize": linha[13],
+ "voffsetx": linha[14],
+ "voffsety": linha[15],
+ "vsymbolname": linha[5],
+ };
+ ins = Mustache.render(
+ i3GEOF.legenda.MUSTACHEESTILO,
+ $.extend(
+ {},
+ mustache,
+ i3GEOF.legenda.DICIONARIO
+ )
+ );
+ $i("i3GEOlegendaParametrosEstilos").innerHTML = ins;
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostraEstilo(0);
- } else {
- $i("i3GEOlegendacomboestilos").innerHTML = "
Erro
";
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+
+ //preenche as listas de itens
+ i3GEO.util.comboItens(
+ "",
+ i3GEOF.legenda.tema, function(retorno) {
+ if ($i("i3GEOlegendaComboSize")) {
+ $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'");
+ }
+ },
+ "",
+ "",
+ "",
+ "",
+ "form-control"
+ );
+
+ i3GEO.util.aplicaAquarela("i3GEOlegendaParametrosEstilos");
+
+ p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&tipo="
+ + tipoLayer
+ + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)";
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "editasimbolo", i3GEOF.legenda.listaSimbolos);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + i3GEOF.legenda.estilo);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: listaSimbolos
+ *
+ * Monta a lista de símbolos com imagem
+ */
+ listaSimbolos : function(retorno) {
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ try {
+ if (retorno.data != undefined) {
+ retorno = retorno.data;
+ $i("i3GEOlegendasimbolos").innerHTML =
+ "
" + $trad('listaSimbolo', i3GEOF.legenda.dicionario) + ":
" + retorno;
+ } else {
+ $i("i3GEOlegendasimbolos").innerHTML = "
Erro
";
+ }
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: aplicaSimbolo
+ *
+ * Muda o valor do campo com o código do símbolo escolhido
+ */
+ aplicaSimbolo : function(s) {
+ $i("i3GEOlegendasymbolname").value = s.title;
+ },
+ /*
+ * Function: aplicaEstilo
+ *
+ * Aplica ao estilo as propriedades definidas
+ *
+ * Veja:
+ *
+ *
+ */
+ aplicaEstilo : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var i, p, cp, fim, outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor =
+ $i("i3GEOlegendabackgroundcolor").value, color = $i("i3GEOlegendacolor").value, symbolname =
+ $i("i3GEOlegendasymbolname").value, simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n =
+ simbolos.length, size = $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern =
+ $i("i3GEOlegendapattern").value, opacidade = $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, symbolscale =
+ $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize =
+ $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value;
+ if (symbolscale != "") {
+ symbolscale = parseInt(symbolscale, 10);
+ } else {
+ symbolscale = -1;
+ }
+ for (i = 0; i < n; i++) {
+ if (simbolos[i].title == symbolname || symbolname == i) {
+ valido = "sim";
+ }
+ }
+ if (valido === "nao") {
+ // i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado");
+ // i3GEOF.legenda.aguarde.visibility = "hidden";
+ // return;
+ }
+ p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=editasimbolo&opcao=aplica&tema="
+ + i3GEOF.legenda.tema
+ + "&classe="
+ + i3GEOF.legenda.classe
+ + "&estilo="
+ + i3GEOF.legenda.estilo
+ + "&outlinecolor="
+ + outlinecolor
+ + "&backgroundcolor="
+ + backgroundcolor
+ + "&color="
+ + color
+ + "&symbolname="
+ + symbolname
+ + "&width="
+ + width
+ + "&pattern="
+ + pattern
+ + "&size="
+ + size
+ + "&opacidade="
+ + opacidade
+ + "&angle="
+ + angle
+ + "&symbolscale="
+ + symbolscale
+ + "&minsize="
+ + minsize
+ + "&maxsize="
+ + maxsize
+ + "&offsetx="
+ + offsetx
+ + "&offsety="
+ + offsety;
+ cp = new cpaint();
+ fim = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.reMontaEditor();
+ };
+ // cp.set_debug(2)
+ cp.set_response_type("JSON");
+ cp.call(p, "editasimbolo", fim);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: reMontaEditor
+ *
+ * Gera novamente o editor de símbolo após ter sido feita alguma alteração nos estilos
+ */
+ reMontaEditor : function() {
+ var id = i3GEOF.legenda.tema + "-" + i3GEOF.legenda.classe;
+ i3GEOF.legenda.editaSimbolo(id);
+ },
+ /*
+ * Function: mostraGrafico
+ *
+ * Mostra um gráfico com a contegem de elementos em caada classe
+ *
+ * Veja:
+ *
+ *
+ */
+ mostraGrafico : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var monta =
+ function(retorno) {
+ if (retorno.data && retorno.data[0].proc == "") {
+ var b, ins = [], i, re, t;
+ ins.push("" + $trad('numeroOcorrenciasClasses', i3GEOF.legenda.dicionario) + "
");
+ ins.push("");
+ i3GEOF.legenda.dadosGrafico = [
+ "n;x"
+ ];
+ if (retorno.data.length < 2) {
+ i3GEO.janela.tempoMsg($trad('msgNumeroClasses', i3GEOF.legenda.dicionario));
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ return;
+ } else {
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4", "i3GEOlegendaguia");
}
- },
- desceEstilo: function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&opcao=desceestilo&tema="
- + i3GEOF.legenda.tema
- + "&classe="
- + i3GEOF.legenda.classe
- + "&estilo="
- + i3GEOF.legenda.estilo, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ for (i = 0; i < retorno.data.length; i++) {
+ id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe
+ re = new RegExp("'", "g");
+ exp = (retorno.data[i].expressao).replace(re, '"');
+ ins.push(" |
");
+ t = (retorno.data[i].nreg * 100) / retorno.data[i].totalreg;
+ ins.push(" |
");
+ i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg);
}
- },
- sobeEstilo: function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&opcao=sobeestilo&tema="
- + i3GEOF.legenda.tema
- + "&classe="
- + i3GEOF.legenda.classe
- + "&estilo="
- + i3GEOF.legenda.estilo, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ ins.push("
");
+ $i("i3GEOlegendaguia4obj").innerHTML = ins.join("");
+ } else {
+ $i("i3GEOlegendaguia4obj").innerHTML = "Erro
";
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+
+ }, p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=contagemclasse&tema="
+ + i3GEOF.legenda.tema, cp = new cpaint();
+ // cp.set_debug(2)
+ cp.set_response_type("JSON");
+ cp.call(p, "cocontagemclasse", monta);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ iniciaGraficoPizza : function() {
+ var dados = {
+ "attributes" : {
+ "id" : ""
+ },
+ "data" : {
+ "dados" : i3GEOF.legenda.dadosGrafico
+ }
+ };
+ i3GEOF.graficointerativo1.tipo = "pizza_1";
+ i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
+ },
+ /*
+ * Function: aplicaProcessos
+ *
+ * Aplica processos de ajuste em imagens de satélite
+ *
+ * Veja:
+ *
+ *
+ */
+ aplicaProcessos : function() {
+ try {
+ if (i3GEOF.legenda.aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var lista = [], ipt, i, p, cp, temp;
+ if ($i("i3GEOlegendaprocessos").innerHTML != "") {
+ ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input");
+ for (i = 0; i < ipt.length; i++) {
+ if (ipt[i].value != "") {
+ lista.push(ipt[i].value);
}
- },
- adicionaEstilo: function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&opcao=adicionaestilo&tema="
- + i3GEOF.legenda.tema
- + "&classe="
- + i3GEOF.legenda.classe
- + "&estilo="
- + i3GEOF.legenda.estilo, cp = new cpaint();
- cp.set_response_type("JSON");
- i3GEOF.legenda.estilo = i3GEOF.legenda.estilo + 1;
- cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ }
+ lista = lista.join("|");
+ temp = function() {
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.mostralegenda();
+ i3GEOF.legenda.aposAlterarLegenda();
+ };
+ p =
+ i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=aplicaProcessos&lista="
+ + lista
+ + "&tema="
+ + i3GEOF.legenda.tema;
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "aplicaProcessos", temp);
+ } catch (e) {
+ i3GEO.janela.tempoMsg("Erro: " + e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }
+ },
+ /*
+ * Function: adicionaProcesso
+ *
+ * Adiciona um novo processo na lista de processos
+ */
+ adicionaProcesso : function(s) {
+ $i("i3GEOlegendaprocessos").innerHTML += "";
+ },
+ aplicaTodasClasses : function(parametro, id) {
+ var valor = $i(id).value;
+ i3GEO.janela.confirma("Aplica " + parametro + " = " + valor + " ?", 300, $trad("x14"), "", function() {
+ var temp = function() {
+ // i3GEOF.legenda.mostralegenda();
+ i3GEOF.legenda.aposAlterarLegenda();
+ }, p, cp;
+ p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=aplicaTodasClasses"
+ + "¶metro="
+ + parametro
+ + "&valor="
+ + valor
+ + "&tema="
+ + i3GEOF.legenda.tema;
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", temp);
+ });
+ },
+ aplicarCluster : function(){
+ var temp = function() {
+ i3GEOF.legenda.aposAlterarLegenda();
+ i3GEOF.legenda.montaCombosItens();
+ }, p, cp;
+ p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=aplicarCluster"
+ + "&maxdistance="
+ + $i("i3GEOlegendaClusterMaxdistance").value
+ + "&buffer="
+ + $i("i3GEOlegendaClusterBuffer").value
+ + "&filter="
+ //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value)
+ + $i("i3GEOlegendaClusterFilter").value
+ + "®ion="
+ + $i("i3GEOlegendaClusterRegion").value
+ + "&group="
+ + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value
+ + "&tema="
+ + i3GEOF.legenda.tema;
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", temp);
+ },
+ removerCluster : function(){
+ var temp = function() {
+ i3GEOF.legenda.montaCombosItens();
+ i3GEOF.legenda.aposAlterarLegenda();
+ }, p, cp;
+ p =
+ i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=removerCluster"
+ + "&tema="
+ + i3GEOF.legenda.tema;
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p, "foo", temp);
+ },
+ montaCombosItens : function(){
+ i3GEO.util.comboItens(
+ "",
+ i3GEOF.legenda.tema,
+ function(retorno) {
+ if ($i("i3GEOlegendaitensValorUnico")) {
+ $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados ;
}
- },
- excluiEstilo: function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- i3GEOF.legenda.estilo = 0;
- var p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&opcao=excluiestilo&tema="
- + i3GEOF.legenda.tema
- + "&classe="
- + i3GEOF.legenda.classe
- + "&estilo="
- + i3GEOF.legenda.estilo, cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "editasimbolo", i3GEOF.legenda.reMontaEditor);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ if ($i("i3GEOlegendaClassesValorUnico")) {
+ $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados;
}
- },
- /*
- * Function: mostraEstilo
- *
- * Mostra as propriedades de um estilo de um símbolo
- */
- mostraEstilo : function() {
- i3GEOF.legenda.aguarde.visibility = "visible";
- try {
- var linha, tipoLayer, d, p, cp, mustache = {};
- //i3GEOF.legenda.estilo = e; // esta e uma variavel global
- linha = i3GEOF.legenda.estilos[i3GEOF.legenda.estilo];
- linha = linha.split("#");
- tipoLayer = linha[0];
- mustache = {
- "voutlinecolor": linha[2],
- "vcolor": linha[4],
- "vbackgroundcolor": linha[3],
- "vsize": linha[6],
- "vwidth": linha[8],
- "vpattern": linha[9],
- "vopacity": linha[7],
- "vangle": linha[10],
- "vsymbolscale": linha[11],
- "vminsize": linha[12],
- "vmaxsize": linha[13],
- "voffsetx": linha[14],
- "voffsety": linha[15],
- "vsymbolname": linha[5],
- };
-
- ins = Mustache.render(
- i3GEOF.legenda.MUSTACHEESTILO,
- $.extend(
- {},
- mustache,
- i3GEOF.legenda.DICIONARIO
- )
- );
- $i("i3GEOlegendaParametrosEstilos").innerHTML = ins;
-
-
- //preenche as listas de itens
- i3GEO.util.comboItens(
- "",
- i3GEOF.legenda.tema, function(retorno) {
- if ($i("i3GEOlegendaComboSize")) {
- $i("i3GEOlegendaComboSize").innerHTML = retorno.dados.replace("id=''"," onchange='$i(\"i3GEOlegendasizes\").value = this.value'");
- }
- },
- "",
- "",
- "",
- "",
- "form-control"
- );
-
- i3GEO.util.aplicaAquarela("i3GEOlegendaParametrosEstilos");
-
- p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&tipo="
- + tipoLayer
- + "&opcao=listaSimbolos&onclick=i3GEOF.legenda.aplicaSimbolo(this)";
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "editasimbolo", i3GEOF.legenda.listaSimbolos);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + i3GEOF.legenda.estilo);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ if ($i("i3GEOlegendaitensMetade")) {
+ $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados;
}
- },
- /*
- * Function: listaSimbolos
- *
- * Monta a lista de símbolos com imagem
- */
- listaSimbolos : function(retorno) {
- i3GEOF.legenda.aguarde.visibility = "visible";
- try {
- if (retorno.data != undefined) {
- retorno = retorno.data;
- $i("i3GEOlegendasimbolos").innerHTML =
- "
" + $trad('listaSimbolo', i3GEOF.legenda.dicionario) + ":
" + retorno;
- } else {
- $i("i3GEOlegendasimbolos").innerHTML = "Erro
";
- }
- i3GEOF.legenda.aguarde.visibility = "hidden";
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ if ($i("i3GEOlegendaitensMetadeId")) {
+ $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados;
}
- },
- /*
- * Function: aplicaSimbolo
- *
- * Muda o valor do campo com o código do símbolo escolhido
- */
- aplicaSimbolo : function(s) {
- $i("i3GEOlegendasymbolname").value = s.title;
- },
- /*
- * Function: aplicaEstilo
- *
- * Aplica ao estilo as propriedades definidas
- *
- * Veja:
- *
- *
- */
- aplicaEstilo : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var i, p, cp, fim, outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor =
- $i("i3GEOlegendabackgroundcolor").value, color = $i("i3GEOlegendacolor").value, symbolname =
- $i("i3GEOlegendasymbolname").value, simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n =
- simbolos.length, size = $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern =
- $i("i3GEOlegendapattern").value, opacidade = $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, symbolscale =
- $i("i3GEOlegendasymbolscale").value, minsize = $i("i3GEOlegendaminsize").value, maxsize =
- $i("i3GEOlegendamaxsize").value, offsetx = $i("i3GEOlegendaoffsetx").value, offsety = $i("i3GEOlegendaoffsety").value;
- if (symbolscale != "") {
- symbolscale = parseInt(symbolscale, 10);
- } else {
- symbolscale = -1;
- }
- for (i = 0; i < n; i++) {
- if (simbolos[i].title == symbolname || symbolname == i) {
- valido = "sim";
- }
- }
- if (valido === "nao") {
- // i3GEO.janela.tempoMsg("Nome do simbolo nao encontrado");
- // i3GEOF.legenda.aguarde.visibility = "hidden";
- // return;
- }
- p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=editasimbolo&opcao=aplica&tema="
- + i3GEOF.legenda.tema
- + "&classe="
- + i3GEOF.legenda.classe
- + "&estilo="
- + i3GEOF.legenda.estilo
- + "&outlinecolor="
- + outlinecolor
- + "&backgroundcolor="
- + backgroundcolor
- + "&color="
- + color
- + "&symbolname="
- + symbolname
- + "&width="
- + width
- + "&pattern="
- + pattern
- + "&size="
- + size
- + "&opacidade="
- + opacidade
- + "&angle="
- + angle
- + "&symbolscale="
- + symbolscale
- + "&minsize="
- + minsize
- + "&maxsize="
- + maxsize
- + "&offsetx="
- + offsetx
- + "&offsety="
- + offsety;
- cp = new cpaint();
- fim = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.reMontaEditor();
- };
- // cp.set_debug(2)
- cp.set_response_type("JSON");
- cp.call(p, "editasimbolo", fim);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ if ($i("i3GEOlegendaitensMedia")) {
+ $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados;
}
- },
- /*
- * Function: reMontaEditor
- *
- * Gera novamente o editor de símbolo após ter sido feita alguma alteração nos estilos
- */
- reMontaEditor : function() {
- var id = i3GEOF.legenda.tema + "-" + i3GEOF.legenda.classe;
- i3GEOF.legenda.editaSimbolo(id);
- },
- /*
- * Function: mostraGrafico
- *
- * Mostra um gráfico com a contegem de elementos em caada classe
- *
- * Veja:
- *
- *
- */
- mostraGrafico : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var monta =
- function(retorno) {
- if (retorno.data && retorno.data[0].proc == "") {
- var b, ins = [], i, re, t;
- ins.push("" + $trad('numeroOcorrenciasClasses', i3GEOF.legenda.dicionario) + "
");
- ins.push("");
- i3GEOF.legenda.dadosGrafico = [
- "n;x"
- ];
- if (retorno.data.length < 2) {
- i3GEO.janela.tempoMsg($trad('msgNumeroClasses', i3GEOF.legenda.dicionario));
- i3GEOF.legenda.aguarde.visibility = "hidden";
- return;
- } else {
- i3GEO.guias.mostraGuiaFerramenta("i3GEOlegendaguia4", "i3GEOlegendaguia");
- }
- for (i = 0; i < retorno.data.length; i++) {
- id = retorno.data[i].tema + "-" + retorno.data[i].idclasse; // layer+indice da classe
- re = new RegExp("'", "g");
- exp = (retorno.data[i].expressao).replace(re, '"');
- ins.push(" |
");
- t = (retorno.data[i].nreg * 100) / retorno.data[i].totalreg;
- ins.push(" |
");
- i3GEOF.legenda.dadosGrafico.push(retorno.data[i].nomeclasse + ";" + retorno.data[i].nreg);
- }
- ins.push("
");
- $i("i3GEOlegendaguia4obj").innerHTML = ins.join("");
- } else {
- $i("i3GEOlegendaguia4obj").innerHTML = "Erro
";
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "hidden";
-
- }, p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=contagemclasse&tema="
- + i3GEOF.legenda.tema, cp = new cpaint();
- // cp.set_debug(2)
- cp.set_response_type("JSON");
- cp.call(p, "cocontagemclasse", monta);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ if ($i("i3GEOlegendaitensValorClass")) {
+ $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados;
}
- },
- iniciaGraficoPizza : function() {
- var dados = {
- "attributes" : {
- "id" : ""
- },
- "data" : {
- "dados" : i3GEOF.legenda.dadosGrafico
- }
- };
- i3GEOF.graficointerativo1.tipo = "pizza_1";
- i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
- },
- /*
- * Function: aplicaProcessos
- *
- * Aplica processos de ajuste em imagens de satélite
- *
- * Veja:
- *
- *
- */
- aplicaProcessos : function() {
- try {
- if (i3GEOF.legenda.aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.legenda.aguarde.visibility = "visible";
- var lista = [], ipt, i, p, cp, temp;
- if ($i("i3GEOlegendaprocessos").innerHTML != "") {
- ipt = $i("i3GEOlegendaprocessos").getElementsByTagName("input");
- for (i = 0; i < ipt.length; i++) {
- if (ipt[i].value != "") {
- lista.push(ipt[i].value);
- }
- }
- }
- lista = lista.join("|");
- temp = function() {
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.mostralegenda();
- i3GEOF.legenda.aposAlterarLegenda();
- };
- p =
- i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=aplicaProcessos&lista="
- + lista
- + "&tema="
- + i3GEOF.legenda.tema;
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "aplicaProcessos", temp);
- } catch (e) {
- i3GEO.janela.tempoMsg("Erro: " + e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
+ if ($i("i3GEOlegendaitensCluster")) {
+ $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados;
}
- },
- /*
- * Function: adicionaProcesso
- *
- * Adiciona um novo processo na lista de processos
- */
- adicionaProcesso : function(s) {
- $i("i3GEOlegendaprocessos").innerHTML += "";
- },
- aplicaTodasClasses : function(parametro, id) {
- var valor = $i(id).value;
- i3GEO.janela.confirma("Aplica " + parametro + " = " + valor + " ?", 300, $trad("x14"), "", function() {
- var temp = function() {
- // i3GEOF.legenda.mostralegenda();
- i3GEOF.legenda.aposAlterarLegenda();
- }, p, cp;
- p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=aplicaTodasClasses"
- + "¶metro="
- + parametro
- + "&valor="
- + valor
- + "&tema="
- + i3GEOF.legenda.tema;
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "foo", temp);
- });
- },
- aplicarCluster : function(){
- var temp = function() {
- i3GEOF.legenda.aposAlterarLegenda();
- i3GEOF.legenda.montaCombosItens();
- }, p, cp;
- p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=aplicarCluster"
- + "&maxdistance="
- + $i("i3GEOlegendaClusterMaxdistance").value
- + "&buffer="
- + $i("i3GEOlegendaClusterBuffer").value
- + "&filter="
- //+ i3GEO.util.base64encode($i("i3GEOlegendaClusterFilter").value)
- + $i("i3GEOlegendaClusterFilter").value
- + "®ion="
- + $i("i3GEOlegendaClusterRegion").value
- + "&group="
- + $i("i3GEOlegendaitensCluster").getElementsByTagName("select")[0].value
- + "&tema="
- + i3GEOF.legenda.tema;
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "foo", temp);
- },
- removerCluster : function(){
- var temp = function() {
- i3GEOF.legenda.montaCombosItens();
- i3GEOF.legenda.aposAlterarLegenda();
- }, p, cp;
- p =
- i3GEO.configura.locaplic + "/ferramentas/legenda/exec.php?g_sid="
- + i3GEO.configura.sid
- + "&funcao=removerCluster"
- + "&tema="
- + i3GEOF.legenda.tema;
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p, "foo", temp);
- },
- montaCombosItens : function(){
- i3GEO.util.comboItens(
- "",
- i3GEOF.legenda.tema,
- function(retorno) {
- if ($i("i3GEOlegendaitensValorUnico")) {
- $i("i3GEOlegendaitensValorUnico").innerHTML = retorno.dados ;
- }
- if ($i("i3GEOlegendaClassesValorUnico")) {
- $i("i3GEOlegendaClassesValorUnico").innerHTML = retorno.dados;
- }
- if ($i("i3GEOlegendaitensMetade")) {
- $i("i3GEOlegendaitensMetade").innerHTML = retorno.dados;
- }
- if ($i("i3GEOlegendaitensMetadeId")) {
- $i("i3GEOlegendaitensMetadeId").innerHTML = retorno.dados;
- }
- if ($i("i3GEOlegendaitensMedia")) {
- $i("i3GEOlegendaitensMedia").innerHTML = retorno.dados;
- }
- if ($i("i3GEOlegendaitensValorClass")) {
- $i("i3GEOlegendaitensValorClass").innerHTML = retorno.dados;
- }
- if ($i("i3GEOlegendaitensCluster")) {
- $i("i3GEOlegendaitensCluster").innerHTML = retorno.dados;
- }
- if ($i("i3GEOlegendaitensValorQuartil")) {
- $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados;
- }
- },
- "",
- "",
- "",
- "",
- "form-control"
- );
- },
- parametrosAuto : function() {
- i3GEOF.legenda.aguarde.visibility = "visible";
- var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=parametrosauto&tema=" + i3GEOF.legenda.tema,
- cp = new cpaint(),
- temp = function(retorno){
- try{
- if(retorno.data !== ""){
- $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas;
- $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem;
- $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome;
- $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor;
- $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo;
- $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho;
- $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile;
- $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep;
- }
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }catch(e){
- i3GEO.janela.tempoMsg("Erro. "+e);
- i3GEOF.legenda.aguarde.visibility = "hidden";
- }
- };
- cp.set_response_type("JSON");
- cp.call(p,"foo",temp);
- },
- salvaParametrosAuto: function(){
- if(i3GEOF.legenda.aguarde.visibility === "visible"){
- return;
+ if ($i("i3GEOlegendaitensValorQuartil")) {
+ $i("i3GEOlegendaitensValorQuartil").innerHTML = retorno.dados;
}
- i3GEOF.legenda.aguarde.visibility = "visible";
- var temp,
- p,
- cp;
- temp = function(){
- i3GEOF.legenda.aguarde.visibility = "hidden";
- i3GEOF.legenda.aposAlterarLegenda();
- };
- p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=salvaparametrosauto&tema=" + i3GEOF.legenda.tema
- + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value
- + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value
- + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value
- + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value
- + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value
- + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value
- + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value;
-
- cp = new cpaint();
- cp.set_response_type("JSON");
- cp.call(p,"foo",temp);
+ },
+ "",
+ "",
+ "",
+ "",
+ "form-control"
+ );
+ },
+ parametrosAuto : function() {
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=parametrosauto&tema=" + i3GEOF.legenda.tema,
+ cp = new cpaint(),
+ temp = function(retorno){
+ try{
+ if(retorno.data !== ""){
+ $i("i3GEOlegendaAutocolunas").innerHTML = retorno.data.colunas;
+ $i("i3GEOlegendaAutoclassesitem").value = retorno.data.classesitem;
+ $i("i3GEOlegendaAutoclassesnome").value = retorno.data.classesnome;
+ $i("i3GEOlegendaAutoclassescor").value = retorno.data.classescor;
+ $i("i3GEOlegendaAutoclassessimbolo").value = retorno.data.classessimbolo;
+ $i("i3GEOlegendaAutoclassestamanho").value = retorno.data.classestamanho;
+ $i("i3GEOlegendaAutopalletefile").value = retorno.data.palletefile;
+ $i("i3GEOlegendaAutopalletestep").value = retorno.data.palletestep;
+ }
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ }catch(e){
+ i3GEO.janela.tempoMsg("Erro. "+e);
+ i3GEOF.legenda.aguarde.visibility = "hidden";
}
+ };
+ cp.set_response_type("JSON");
+ cp.call(p,"foo",temp);
+ },
+ salvaParametrosAuto: function(){
+ if(i3GEOF.legenda.aguarde.visibility === "visible"){
+ return;
+ }
+ i3GEOF.legenda.aguarde.visibility = "visible";
+ var temp,
+ p,
+ cp;
+ temp = function(){
+ i3GEOF.legenda.aguarde.visibility = "hidden";
+ i3GEOF.legenda.aposAlterarLegenda();
+ };
+ p = i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=salvaparametrosauto&tema=" + i3GEOF.legenda.tema
+ + "&classesitem=" + $i("i3GEOlegendaAutoclassesitem").value
+ + "&classesnome=" + $i("i3GEOlegendaAutoclassesnome").value
+ + "&classescor=" + $i("i3GEOlegendaAutoclassescor").value
+ + "&classessimbolo=" + $i("i3GEOlegendaAutoclassessimbolo").value
+ + "&classestamanho=" + $i("i3GEOlegendaAutoclassestamanho").value
+ + "&palletefile=" + $i("i3GEOlegendaAutopalletefile").value
+ + "&palletestep=" + $i("i3GEOlegendaAutopalletestep").value;
+
+ cp = new cpaint();
+ cp.set_response_type("JSON");
+ cp.call(p,"foo",temp);
+ }
};
//aplica ao codigo i3GEOF definicoes feitas na interface do mapa
//isso permite a substituicao de funcoes e parametros
if(i3GEO.configura.ferramentas.hasOwnProperty("legenda")){
jQuery.each( i3GEO.configura.ferramentas.legenda, function(index, value) {
- i3GEOF.legenda[index] = i3GEO.configura.ferramentas.legenda[index];
+ i3GEOF.legenda[index] = i3GEO.configura.ferramentas.legenda[index];
});
}
\ No newline at end of file
diff --git a/ferramentas/opacidademapa/index.js b/ferramentas/opacidademapa/index.js
index 78b18ef..ff1378c 100755
--- a/ferramentas/opacidademapa/index.js
+++ b/ferramentas/opacidademapa/index.js
@@ -28,7 +28,7 @@ i3GEOF.opacidademapa = {
hash["namespace"] = "opacidademapa";
hash["idContainer"] = p.idContainer;
i3GEOF.opacidademapa.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
i3GEOF.opacidademapa.slide();
},
diff --git a/ferramentas/opcoesescala/index.js b/ferramentas/opcoesescala/index.js
index e5174eb..9d14a73 100644
--- a/ferramentas/opcoesescala/index.js
+++ b/ferramentas/opcoesescala/index.js
@@ -61,7 +61,7 @@ i3GEOF.opcoesescala = {
texto: Mustache.render(p.mustache, hash),
onclose: i3f.destroy
});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
i3GEO.util.aplicaAquarela(p.idContainer);
i3f.applyDataForm(p.dataForm);
},
diff --git a/ferramentas/opcoeslegenda/index.js b/ferramentas/opcoeslegenda/index.js
index 7d3d065..ca8815a 100644
--- a/ferramentas/opcoeslegenda/index.js
+++ b/ferramentas/opcoeslegenda/index.js
@@ -60,7 +60,7 @@ i3GEOF.opcoeslegenda = {
texto: Mustache.render(p.mustache, hash),
onclose: i3f.destroy
});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
i3GEO.util.comboFontes("i3GEOopcoeslegendafonte","i3GEOopcoeslegendafontef","form-control", p.dataForm.font );
i3GEO.util.aplicaAquarela(p.idContainer);
i3f.applyDataForm(p.dataForm);
diff --git a/ferramentas/opcoesmaparef/index.js b/ferramentas/opcoesmaparef/index.js
index 05864cd..85864d8 100644
--- a/ferramentas/opcoesmaparef/index.js
+++ b/ferramentas/opcoesmaparef/index.js
@@ -64,7 +64,7 @@ i3GEOF.opcoesmaparef = {
texto: Mustache.render(p.mustache, hash),
onclose: i3f.destroy
});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
i3GEO.util.aplicaAquarela(p.idContainer);
i3f.applyDataForm(p.dataForm);
},
diff --git a/ferramentas/opcoestamanho/index.js b/ferramentas/opcoestamanho/index.js
index c20119d..3b2ee06 100644
--- a/ferramentas/opcoestamanho/index.js
+++ b/ferramentas/opcoestamanho/index.js
@@ -54,7 +54,7 @@ i3GEOF.opcoestamanho = {
texto: Mustache.render(p.mustache, hash),
onclose: i3f.destroy
});
- i3GEO.janela.applyScrollBar(p.idContainer);
+ //i3GEO.janela.applyScrollBar(p.idContainer);
},
getFormData: function(){
var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
diff --git a/ferramentas/uploadshp/dependencias.php b/ferramentas/uploadshp/dependencias.php
index ca699dd..b6f0f9c 100644
--- a/ferramentas/uploadshp/dependencias.php
+++ b/ferramentas/uploadshp/dependencias.php
@@ -3,13 +3,6 @@ include(dirname(__FILE__)."/../blacklist.php");
verificaBlFerramentas(basename(dirname(__FILE__)));
//como o nome da pasta mudou, essa linha mantem a compatibilidade
verificaBlFerramentas("upload");
-/**
- * Carrega os programas javascript necessarios para a ferramenta
- * Esse programa e usado na tag
-
@@ -194,7 +191,7 @@ else
restauraCon($map_file,$postgis_mapa);
paraAguarde();
function paraAguarde(){
- echo "";
+ echo "";
}
function verificaNome($nome){
if(strlen(basename($nome)) > 200){
diff --git a/interface/inc/guiacamadas.php b/interface/inc/guiacamadas.php
index 3216723..1403ca7 100644
--- a/interface/inc/guiacamadas.php
+++ b/interface/inc/guiacamadas.php
@@ -52,20 +52,20 @@
-
+
-
/camadaGr.html">
+
/camadaGr.html">
-
/camada.html">
+
/camada.html">
-
+
-
+
diff --git a/interface/inc/guiacatalogo.php b/interface/inc/guiacatalogo.php
index a093892..f368a03 100644
--- a/interface/inc/guiacatalogo.php
+++ b/interface/inc/guiacatalogo.php
@@ -40,7 +40,7 @@
-
+
/catalogoMigalha.html">
diff --git a/interface/inc/guiaferramentas.php b/interface/inc/guiaferramentas.php
index 72d7e0b..6f5acf0 100644
--- a/interface/inc/guiaferramentas.php
+++ b/interface/inc/guiaferramentas.php
@@ -7,7 +7,7 @@
-
+
-
/searchInput.html" style='display: block; text-align: center; width: 100%; padding-left: 1rem; padding-right: 1rem;'>
/ferramentasMigalha.html" style='display: block; text-align: left;'>
/ferramentasLink.html" style='display: block; text-align: left'>
diff --git a/interface/inc/guialegenda.php b/interface/inc/guialegenda.php
index dde26da..7c15b45 100644
--- a/interface/inc/guialegenda.php
+++ b/interface/inc/guialegenda.php
@@ -21,7 +21,7 @@
-
+
/legenda.html" data-size="35,25" style='display: none; text-align: left'>
\ No newline at end of file
diff --git a/js/catalogoMenus.js b/js/catalogoMenus.js
index 1e267a8..894065c 100755
--- a/js/catalogoMenus.js
+++ b/js/catalogoMenus.js
@@ -319,26 +319,26 @@ i3GEO.catalogoMenus = {
},
shp: function() {
i3GEO.util.scriptTag(i3GEO.configura.locaplic
- + "/ferramentas/upload/dependencias.php",
- "i3GEOF.uploadshp.iniciaJanelaFlutuante()",
- "i3GEOF.upload_script");
+ + "/ferramentas/uploadshp/dependencias.php",
+ "i3GEOF.uploadshp.start()",
+ "i3GEOF.uploadshp_script");
},
dbfcsv: function() {
i3GEO.util.scriptTag(i3GEO.configura.locaplic
+ "/ferramentas/uploaddbf/dependencias.php",
- "i3GEOF.uploaddbf.iniciaJanelaFlutuante()",
+ "i3GEOF.uploaddbf.start()",
"i3GEOF.uploaddbf_script");
},
gpx: function() {
i3GEO.util.scriptTag(i3GEO.configura.locaplic
+ "/ferramentas/uploadgpx/dependencias.php",
- "i3GEOF.uploadgpx.iniciaJanelaFlutuante()",
+ "i3GEOF.uploadgpx.start()",
"i3GEOF.uploadgpx_script");
},
kml: function() {
i3GEO.util.scriptTag(i3GEO.configura.locaplic
+ "/ferramentas/uploadkml/dependencias.php",
- "i3GEOF.uploadkml.iniciaJanelaFlutuante()",
+ "i3GEOF.uploadkml.start()",
"i3GEOF.uploadkml_script");
}
};
\ No newline at end of file
diff --git a/js/dicionario.js b/js/dicionario.js
index 21d15fa..e76be42 100755
--- a/js/dicionario.js
+++ b/js/dicionario.js
@@ -3147,5 +3147,12 @@ g_traducao =
pt : "Camada atualizada",
en : "",
es : ""
- }]
+ }],
+ "adicmapa" : [
+ {
+ pt : "Adiconar ao mapa",
+ en : "",
+ es : ""
+ }
+ ]
};
diff --git a/js/util.js b/js/util.js
index 88b724c..ec26a2b 100755
--- a/js/util.js
+++ b/js/util.js
@@ -2153,11 +2153,17 @@ i3GEO.util =
comboEpsg : function(idCombo, onde, funcaoOnChange, valorDefault) {
onde = $i(onde);
onde.innerHTML = "
buscando...";
+ if(!funcaoOnChange){
+ funcaoOnChange = "";
+ }
+ if(!valorDefault){
+ valorDefault = "";
+ }
var monta = function(retorno) {
var ins = [], i, n;
if (retorno.data !== undefined) {
n = retorno.data.length;
- ins.push("