Commit d0550acb0d4985ee113020d933856afeaef3a927

Authored by Edmar Moretti
1 parent 3575df8e

--no commit message

classesjs/classe_arvoredecamadas.js
@@ -477,6 +477,7 @@ i3GEO.arvoreDeCamadas = { @@ -477,6 +477,7 @@ i3GEO.arvoreDeCamadas = {
477 if(temp.innerHTML !== ""){ 477 if(temp.innerHTML !== ""){
478 if(i3GEO.arvoreDeCamadas.comparaTemas(temas,i3GEO.arvoreDeCamadas.CAMADAS)){ 478 if(i3GEO.arvoreDeCamadas.comparaTemas(temas,i3GEO.arvoreDeCamadas.CAMADAS)){
479 if(typeof(console) !== 'undefined'){console.info("Nao é necessario atualizar arvoreDeCamadas - return");} 479 if(typeof(console) !== 'undefined'){console.info("Nao é necessario atualizar arvoreDeCamadas - return");}
  480 + i3GEO.arvoreDeCamadas.CAMADAS = temas;
480 return; 481 return;
481 } 482 }
482 } 483 }
@@ -1435,19 +1436,23 @@ i3GEO.arvoreDeCamadas = { @@ -1435,19 +1436,23 @@ i3GEO.arvoreDeCamadas = {
1435 Parametro: 1436 Parametro:
1436 1437
1437 idtema - {String} ID do tema que será procurado 1438 idtema - {String} ID do tema que será procurado
  1439 +
  1440 + camadas - {Objeto} - objeto com a lista de temas
1438 1441
1439 Return: 1442 Return:
1440 1443
1441 {JSON} 1444 {JSON}
1442 */ 1445 */
1443 - pegaTema: function(idtema){ 1446 + pegaTema: function(idtema,camadas){
1444 if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.pegaTema()");} 1447 if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.pegaTema()");}
1445 - var i,  
1446 - v = "",  
1447 - c = i3GEO.arvoreDeCamadas.CAMADAS.length; 1448 + var i,c
  1449 + v = "";
  1450 + if(!camadas)
  1451 + {camadas = i3GEO.arvoreDeCamadas.CAMADAS;}
  1452 + c = camadas.length;
1448 for (i=0; i<c; i += 1){ 1453 for (i=0; i<c; i += 1){
1449 - if(i3GEO.arvoreDeCamadas.CAMADAS[i].name === idtema){  
1450 - v = i3GEO.arvoreDeCamadas.CAMADAS[i]; 1454 + if(camadas[i].name === idtema){
  1455 + v = camadas[i];
1451 } 1456 }
1452 } 1457 }
1453 return v; 1458 return v;
classesphp/classe_mapa.php
@@ -196,8 +196,16 @@ string - javascript com os parametros @@ -196,8 +196,16 @@ string - javascript com os parametros
196 foreach ($this->layers as $oLayer) 196 foreach ($this->layers as $oLayer)
197 { 197 {
198 $sel = "nao"; 198 $sel = "nao";
199 - if(file_exists($dir."/".$oLayer->name.".php"))  
200 - {$sel = "sim";$existesel = true;} 199 + $nSel = 0;
  200 + $arqS = $dir."/".$oLayer->name.".php";
  201 + if(file_exists($arqS)){
  202 + $sel = "sim";
  203 + $existesel = true;
  204 + $handle = fopen ($arqS, "r");
  205 + $conteudo = fread ($handle, filesize ($arqS));
  206 + fclose ($handle);
  207 + $nSel = count(unserialize($conteudo));
  208 + }
201 $escondido = $oLayer->getmetadata("escondido"); 209 $escondido = $oLayer->getmetadata("escondido");
202 if($escondido == "") 210 if($escondido == "")
203 {$escondido = "nao";} 211 {$escondido = "nao";}
@@ -288,6 +296,7 @@ string - javascript com os parametros @@ -288,6 +296,7 @@ string - javascript com os parametros
288 "transparency"=>($oLayer->opacity), 296 "transparency"=>($oLayer->opacity),
289 "type"=>($oLayer->type), 297 "type"=>($oLayer->type),
290 "sel"=>$sel, 298 "sel"=>$sel,
  299 + "nsel"=>$nSel,
291 "escala"=>$escala, 300 "escala"=>$escala,
292 "download"=>$down, 301 "download"=>$down,
293 "features"=>$f, 302 "features"=>$f,
classesphp/classe_selecao.php
@@ -131,6 +131,14 @@ Salva o mapfile atual @@ -131,6 +131,14 @@ Salva o mapfile atual
131 $this->mapa->save($this->arquivo); 131 $this->mapa->save($this->arquivo);
132 } 132 }
133 /* 133 /*
  134 +function: nSel
  135 +
  136 +Retorna o número de elementos selecionados
  137 +*/
  138 + function nSel(){
  139 + return $this->layer->getNumresults();
  140 + }
  141 +/*
134 function: selecaoPorPoligono 142 function: selecaoPorPoligono
135 143
136 Seleciona os elementos de um tema baseado em um conjunto de pontos que formarão um polígono. 144 Seleciona os elementos de um tema baseado em um conjunto de pontos que formarão um polígono.
@@ -193,6 +201,7 @@ $ys - lista de coordenadas y separadas por virgula @@ -193,6 +201,7 @@ $ys - lista de coordenadas y separadas por virgula
193 $result = $this->layer->getResult($i); 201 $result = $this->layer->getResult($i);
194 $shpi[] = $result->shapeindex; 202 $shpi[] = $result->shapeindex;
195 } 203 }
  204 + $this->layer->set("status",MS_DEFAULT);
196 if (($tipo == "adiciona") && (count($shpi) > 0)) 205 if (($tipo == "adiciona") && (count($shpi) > 0))
197 {return($this->selecaoAdiciona($shpi,$shp_atual));} 206 {return($this->selecaoAdiciona($shpi,$shp_atual));}
198 if (($tipo == "retira") && (count ($shp_atual) > 0)) 207 if (($tipo == "retira") && (count ($shp_atual) > 0))
ferramentas/selecao/index.js.php
@@ -125,6 +125,7 @@ i3GEOF.selecao = { @@ -125,6 +125,7 @@ i3GEOF.selecao = {
125 ' </ul>' + 125 ' </ul>' +
126 '</div><br>' + 126 '</div><br>' +
127 '<div class=guiaobj id="i3GEOselecaoguia1obj" style="left:1px;display:none;top:-5px">' + 127 '<div class=guiaobj id="i3GEOselecaoguia1obj" style="left:1px;display:none;top:-5px">' +
  128 + ' <p class=paragrafo id=i3GEOselecaoNsel ></p>' +
128 ' <p class=paragrafo ><button title="Clique no mapa para selecionar" style="background:none;background-color:#F5F5F5" value="i3GEOselecaopt" onclick="i3GEOF.selecao.tiposel(this)"><img id=i3GEOselecaopt src="'+i3GEO.configura.locaplic+'/imagens/gisicons/select-one.png" /></button>'; 129 ' <p class=paragrafo ><button title="Clique no mapa para selecionar" style="background:none;background-color:#F5F5F5" value="i3GEOselecaopt" onclick="i3GEOF.selecao.tiposel(this)"><img id=i3GEOselecaopt src="'+i3GEO.configura.locaplic+'/imagens/gisicons/select-one.png" /></button>';
129 if(i3GEO.Interface.ATUAL != "googlemaps" && i3GEO.Interface.ATUAL != "googleearth") 130 if(i3GEO.Interface.ATUAL != "googlemaps" && i3GEO.Interface.ATUAL != "googleearth")
130 {ins += ' <button title="Desenhe um poligono no mapa para selecionar" style="background:none;background-color:#F5F5F5" onclick="i3GEOF.selecao.tiposel(this)" value="i3GEOselecaopoli"><img id=i3GEOselecaopoli src="'+i3GEO.configura.locaplic+'/imagens/gisicons/select-polygon.png" /></button>'} 131 {ins += ' <button title="Desenhe um poligono no mapa para selecionar" style="background:none;background-color:#F5F5F5" onclick="i3GEOF.selecao.tiposel(this)" value="i3GEOselecaopoli"><img id=i3GEOselecaopoli src="'+i3GEO.configura.locaplic+'/imagens/gisicons/select-polygon.png" /></button>'}
@@ -259,8 +260,16 @@ i3GEOF.selecao = { @@ -259,8 +260,16 @@ i3GEOF.selecao = {
259 i3GEO.util.comboTemas( 260 i3GEO.util.comboTemas(
260 "i3GEOselecaotemasLigados", 261 "i3GEOselecaotemasLigados",
261 function(retorno){ 262 function(retorno){
262 - $i("i3GEOselecaoComboTemas").innerHTML = retorno.dados; 263 + var nsel,temp;
  264 + temp = $i("i3GEOselecaoComboTemas");
  265 + if(!temp){return;}
  266 + temp.innerHTML = retorno.dados;
263 $i("i3GEOselecaotemasLigados").value = i3GEO.temaAtivo; 267 $i("i3GEOselecaotemasLigados").value = i3GEO.temaAtivo;
  268 + //verifica qts elementos selecionados
  269 + if(i3GEO.temaAtivo != ""){
  270 + nsel = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo);
  271 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
  272 + }
264 $i("i3GEOselecaotemasLigados").onchange = function(){i3GEOF.selecao.pegaTemasSel();}; 273 $i("i3GEOselecaotemasLigados").onchange = function(){i3GEOF.selecao.pegaTemasSel();};
265 }, 274 },
266 "i3GEOselecaoComboTemas", 275 "i3GEOselecaoComboTemas",
@@ -291,13 +300,18 @@ i3GEOF.selecao = { @@ -291,13 +300,18 @@ i3GEOF.selecao = {
291 pegaTemasSel: function(){ 300 pegaTemasSel: function(){
292 var selObj = $i("i3GEOselecaotemasLigados"), 301 var selObj = $i("i3GEOselecaotemasLigados"),
293 selectedArray = [], 302 selectedArray = [],
294 - i; 303 + i,
  304 + nsel;
295 for (i=0; i<selObj.options.length; i++) { 305 for (i=0; i<selObj.options.length; i++) {
296 if (selObj.options[i].selected) { 306 if (selObj.options[i].selected) {
297 selectedArray.push(selObj.options[i].value); 307 selectedArray.push(selObj.options[i].value);
298 } 308 }
299 } 309 }
300 i3GEO.mapa.ativaTema(selectedArray[0]); 310 i3GEO.mapa.ativaTema(selectedArray[0]);
  311 + if(i3GEO.temaAtivo != ""){
  312 + nsel = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo);
  313 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
  314 + }
301 return selectedArray.toString(); 315 return selectedArray.toString();
302 }, 316 },
303 /* 317 /*
@@ -323,10 +337,14 @@ i3GEOF.selecao = { @@ -323,10 +337,14 @@ i3GEOF.selecao = {
323 i3GEO.mapa.ativaTema($i("i3GEOselecaotemasLigados").value); 337 i3GEO.mapa.ativaTema($i("i3GEOselecaotemasLigados").value);
324 var tema = i3GEO.temaAtivo, 338 var tema = i3GEO.temaAtivo,
325 fim = function(retorno){ 339 fim = function(retorno){
  340 + var nsel;
326 i3GEOF.selecao.aguarde.visibility = "hidden"; 341 i3GEOF.selecao.aguarde.visibility = "hidden";
327 if(i3GEO.Interface.ATUAL === "padrao") 342 if(i3GEO.Interface.ATUAL === "padrao")
328 {i3GEO.atualiza(retorno);} 343 {i3GEO.atualiza(retorno);}
329 i3GEO.Interface.atualizaTema(retorno,tema); 344 i3GEO.Interface.atualizaTema(retorno,tema);
  345 + //verifica qts elementos selecionados
  346 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  347 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
330 }; 348 };
331 i3GEO.php.selecaopt(fim,tema,"",tipo,0); 349 i3GEO.php.selecaopt(fim,tema,"",tipo,0);
332 } 350 }
@@ -350,10 +368,13 @@ i3GEOF.selecao = { @@ -350,10 +368,13 @@ i3GEOF.selecao = {
350 //window.parent.i3GEO.eventos.MOUSEDOWN.remove("i3GEO.selecao.box.inicia()") 368 //window.parent.i3GEO.eventos.MOUSEDOWN.remove("i3GEO.selecao.box.inicia()")
351 //$i("parapoli").style.display = "none"; 369 //$i("parapoli").style.display = "none";
352 var fim = function(retorno){ 370 var fim = function(retorno){
  371 + var nsel;
353 i3GEOF.selecao.aguarde.visibility = "hidden"; 372 i3GEOF.selecao.aguarde.visibility = "hidden";
354 if(i3GEO.Interface.ATUAL === "padrao") 373 if(i3GEO.Interface.ATUAL === "padrao")
355 {i3GEO.atualiza(retorno);} 374 {i3GEO.atualiza(retorno);}
356 i3GEO.Interface.atualizaTema(retorno,tema); 375 i3GEO.Interface.atualizaTema(retorno,tema);
  376 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  377 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
357 }, 378 },
358 tema = i3GEOF.selecao.pegaTemasSel(); 379 tema = i3GEOF.selecao.pegaTemasSel();
359 if (obj.value == "i3GEOselecaoext"){ 380 if (obj.value == "i3GEOselecaoext"){
@@ -546,9 +567,12 @@ i3GEOF.selecao = { @@ -546,9 +567,12 @@ i3GEOF.selecao = {
546 if(typeof(console) !== 'undefined') 567 if(typeof(console) !== 'undefined')
547 {console.info("i3GEO.navega.selecao.porbox()");} 568 {console.info("i3GEO.navega.selecao.porbox()");}
548 var retorna = function(retorno){ 569 var retorna = function(retorno){
  570 + var nsel;
549 if(i3GEO.Interface.ATUAL === "padrao") 571 if(i3GEO.Interface.ATUAL === "padrao")
550 {i3GEO.atualiza(retorno);} 572 {i3GEO.atualiza(retorno);}
551 i3GEO.Interface.atualizaTema(retorno,tema); 573 i3GEO.Interface.atualizaTema(retorno,tema);
  574 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  575 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
552 }; 576 };
553 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); 577 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
554 i3GEO.php.selecaobox(retorna,tema,tipo,box); 578 i3GEO.php.selecaobox(retorna,tema,tipo,box);
@@ -567,7 +591,7 @@ i3GEOF.selecao = { @@ -567,7 +591,7 @@ i3GEOF.selecao = {
567 var doc,tipo,tolerancia; 591 var doc,tipo,tolerancia;
568 tipo = $i("i3GEOselecaotipoOperacao").value; 592 tipo = $i("i3GEOselecaotipoOperacao").value;
569 tolerancia = $i("i3GEOselecaotoleranciapt").value; 593 tolerancia = $i("i3GEOselecaotoleranciapt").value;
570 - i3GEOF.selecao.porxy(i3GEO.temaAtivo,tipo,tolerancia); 594 + i3GEOF.selecao.porxy(i3GEO.temaAtivo,tipo,tolerancia);
571 } 595 }
572 }, 596 },
573 /* 597 /*
@@ -586,9 +610,12 @@ i3GEOF.selecao = { @@ -586,9 +610,12 @@ i3GEOF.selecao = {
586 porxy: function(tema,tipo,tolerancia){ 610 porxy: function(tema,tipo,tolerancia){
587 if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.porxy()");} 611 if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.porxy()");}
588 var retorna = function(retorno){ 612 var retorna = function(retorno){
  613 + var nsel;
589 if(i3GEO.Interface.ATUAL === "padrao") 614 if(i3GEO.Interface.ATUAL === "padrao")
590 {i3GEO.atualiza(retorno);} 615 {i3GEO.atualiza(retorno);}
591 i3GEO.Interface.atualizaTema(retorno,tema); 616 i3GEO.Interface.atualizaTema(retorno,tema);
  617 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  618 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
592 }; 619 };
593 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); 620 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
594 i3GEO.php.selecaopt(retorna,tema,objposicaocursor.ddx+" "+objposicaocursor.ddy,tipo,tolerancia); 621 i3GEO.php.selecaopt(retorna,tema,objposicaocursor.ddx+" "+objposicaocursor.ddy,tipo,tolerancia);
@@ -695,10 +722,13 @@ i3GEOF.selecao = { @@ -695,10 +722,13 @@ i3GEOF.selecao = {
695 xs = pontos.xpt.toString(","); 722 xs = pontos.xpt.toString(",");
696 ys = pontos.ypt.toString(","); 723 ys = pontos.ypt.toString(",");
697 retorna = function(retorno){ 724 retorna = function(retorno){
  725 + var nsel;
698 i3GEO.janela.fechaAguarde("i3GEO.atualiza",$trad("o1")); 726 i3GEO.janela.fechaAguarde("i3GEO.atualiza",$trad("o1"));
699 if(i3GEO.Interface.ATUAL === "padrao") 727 if(i3GEO.Interface.ATUAL === "padrao")
700 {i3GEO.atualiza(retorno);} 728 {i3GEO.atualiza(retorno);}
701 i3GEO.Interface.atualizaTema(retorno,tema); 729 i3GEO.Interface.atualizaTema(retorno,tema);
  730 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  731 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
702 }; 732 };
703 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); 733 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
704 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=selecaoPoli"; 734 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=selecaoPoli";
@@ -886,10 +916,13 @@ i3GEOF.selecao = { @@ -886,10 +916,13 @@ i3GEOF.selecao = {
886 } 916 }
887 g_operacao = "selecao" 917 g_operacao = "selecao"
888 temp = function(retorno){ 918 temp = function(retorno){
889 - if(i3GEO.Interface.ATUAL === "padrao") 919 + var nsel;
  920 + if(i3GEO.Interface.ATUAL === "padrao")
890 {i3GEO.atualiza(retorno);} 921 {i3GEO.atualiza(retorno);}
891 i3GEOF.selecao.aguarde.visibility = "hidden"; 922 i3GEOF.selecao.aguarde.visibility = "hidden";
892 i3GEO.Interface.atualizaTema(retorno,i3GEO.temaAtivo); 923 i3GEO.Interface.atualizaTema(retorno,i3GEO.temaAtivo);
  924 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  925 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
893 }; 926 };
894 i3GEO.php.selecaoatrib2(temp,i3GEO.temaAtivo,filtro,$i("i3GEOselecaotipoOperacao").value); 927 i3GEO.php.selecaoatrib2(temp,i3GEO.temaAtivo,filtro,$i("i3GEOselecaotipoOperacao").value);
895 } 928 }
@@ -914,10 +947,13 @@ i3GEOF.selecao = { @@ -914,10 +947,13 @@ i3GEOF.selecao = {
914 try{ 947 try{
915 i3GEOF.selecao.aguarde.visibility = "visible"; 948 i3GEOF.selecao.aguarde.visibility = "visible";
916 var temp = function(retorno){ 949 var temp = function(retorno){
917 - if(i3GEO.Interface.ATUAL === "padrao") 950 + var nsel;
  951 + if(i3GEO.Interface.ATUAL === "padrao")
918 {i3GEO.atualiza(retorno);} 952 {i3GEO.atualiza(retorno);}
919 i3GEOF.selecao.aguarde.visibility = "hidden"; 953 i3GEOF.selecao.aguarde.visibility = "hidden";
920 i3GEO.Interface.atualizaTema(retorno,i3GEO.temaAtivo); 954 i3GEO.Interface.atualizaTema(retorno,i3GEO.temaAtivo);
  955 + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas);
  956 + $i("i3GEOselecaoNsel").innerHTML = "Selecionados: "+(nsel.nsel);
921 }; 957 };
922 g_operacao = "selecao"; 958 g_operacao = "selecao";
923 i3GEO.php.selecaotema(temp,$i("i3GEOselecaoTemaoverlay").value,i3GEO.temaAtivo,$i("i3GEOselecaotipoOperacao").value); 959 i3GEO.php.selecaotema(temp,$i("i3GEOselecaoTemaoverlay").value,i3GEO.temaAtivo,$i("i3GEOselecaotipoOperacao").value);
ms_criamapa.php
@@ -645,17 +645,17 @@ function criaIndex() @@ -645,17 +645,17 @@ function criaIndex()
645 global $dir_tmp,$diretorios; 645 global $dir_tmp,$diretorios;
646 if (!file_exists($dir_tmp."/index.htm")) 646 if (!file_exists($dir_tmp."/index.htm"))
647 { 647 {
648 - $f = fopen($dir_tmp."/index.htm",x); 648 + $f = fopen($dir_tmp."/index.htm","x");
649 fclose($f); 649 fclose($f);
650 - $f = fopen($dir_tmp."/index.html",x); 650 + $f = fopen($dir_tmp."/index.html","x");
651 fclose($f); 651 fclose($f);
652 - $f = fopen($dir_tmp."/".$diretorios[1]."/index.html",x); 652 + $f = fopen($dir_tmp."/".$diretorios[1]."/index.html","x");
653 fclose($f); 653 fclose($f);
654 - $f = fopen($dir_tmp."/".$diretorios[1]."/index.htm",x); 654 + $f = fopen($dir_tmp."/".$diretorios[1]."/index.htm","x");
655 fclose($f); 655 fclose($f);
656 - $f = fopen($dir_tmp."/".$diretorios[2]."/index.html",x); 656 + $f = fopen($dir_tmp."/".$diretorios[2]."/index.html","x");
657 fclose($f); 657 fclose($f);
658 - $f = fopen($dir_tmp."/".$diretorios[2]."/index.htm",x); 658 + $f = fopen($dir_tmp."/".$diretorios[2]."/index.htm","x");
659 fclose($f); 659 fclose($f);
660 } 660 }
661 if (!file_exists($dir_tmp."/index.htm")) 661 if (!file_exists($dir_tmp."/index.htm"))