Commit d0550acb0d4985ee113020d933856afeaef3a927

Authored by Edmar Moretti
1 parent 3575df8e

--no commit message

classesjs/classe_arvoredecamadas.js
... ... @@ -477,6 +477,7 @@ i3GEO.arvoreDeCamadas = {
477 477 if(temp.innerHTML !== ""){
478 478 if(i3GEO.arvoreDeCamadas.comparaTemas(temas,i3GEO.arvoreDeCamadas.CAMADAS)){
479 479 if(typeof(console) !== 'undefined'){console.info("Nao é necessario atualizar arvoreDeCamadas - return");}
  480 + i3GEO.arvoreDeCamadas.CAMADAS = temas;
480 481 return;
481 482 }
482 483 }
... ... @@ -1435,19 +1436,23 @@ i3GEO.arvoreDeCamadas = {
1435 1436 Parametro:
1436 1437  
1437 1438 idtema - {String} ID do tema que será procurado
  1439 +
  1440 + camadas - {Objeto} - objeto com a lista de temas
1438 1441  
1439 1442 Return:
1440 1443  
1441 1444 {JSON}
1442 1445 */
1443   - pegaTema: function(idtema){
  1446 + pegaTema: function(idtema,camadas){
1444 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 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 1458 return v;
... ...
classesphp/classe_mapa.php
... ... @@ -196,8 +196,16 @@ string - javascript com os parametros
196 196 foreach ($this->layers as $oLayer)
197 197 {
198 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 209 $escondido = $oLayer->getmetadata("escondido");
202 210 if($escondido == "")
203 211 {$escondido = "nao";}
... ... @@ -288,6 +296,7 @@ string - javascript com os parametros
288 296 "transparency"=>($oLayer->opacity),
289 297 "type"=>($oLayer->type),
290 298 "sel"=>$sel,
  299 + "nsel"=>$nSel,
291 300 "escala"=>$escala,
292 301 "download"=>$down,
293 302 "features"=>$f,
... ...
classesphp/classe_selecao.php
... ... @@ -131,6 +131,14 @@ Salva o mapfile atual
131 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 142 function: selecaoPorPoligono
135 143  
136 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 201 $result = $this->layer->getResult($i);
194 202 $shpi[] = $result->shapeindex;
195 203 }
  204 + $this->layer->set("status",MS_DEFAULT);
196 205 if (($tipo == "adiciona") && (count($shpi) > 0))
197 206 {return($this->selecaoAdiciona($shpi,$shp_atual));}
198 207 if (($tipo == "retira") && (count ($shp_atual) > 0))
... ...
ferramentas/selecao/index.js.php
... ... @@ -125,6 +125,7 @@ i3GEOF.selecao = {
125 125 ' </ul>' +
126 126 '</div><br>' +
127 127 '<div class=guiaobj id="i3GEOselecaoguia1obj" style="left:1px;display:none;top:-5px">' +
  128 + ' <p class=paragrafo id=i3GEOselecaoNsel ></p>' +
128 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 130 if(i3GEO.Interface.ATUAL != "googlemaps" && i3GEO.Interface.ATUAL != "googleearth")
130 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 260 i3GEO.util.comboTemas(
260 261 "i3GEOselecaotemasLigados",
261 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 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 273 $i("i3GEOselecaotemasLigados").onchange = function(){i3GEOF.selecao.pegaTemasSel();};
265 274 },
266 275 "i3GEOselecaoComboTemas",
... ... @@ -291,13 +300,18 @@ i3GEOF.selecao = {
291 300 pegaTemasSel: function(){
292 301 var selObj = $i("i3GEOselecaotemasLigados"),
293 302 selectedArray = [],
294   - i;
  303 + i,
  304 + nsel;
295 305 for (i=0; i<selObj.options.length; i++) {
296 306 if (selObj.options[i].selected) {
297 307 selectedArray.push(selObj.options[i].value);
298 308 }
299 309 }
300 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 315 return selectedArray.toString();
302 316 },
303 317 /*
... ... @@ -323,10 +337,14 @@ i3GEOF.selecao = {
323 337 i3GEO.mapa.ativaTema($i("i3GEOselecaotemasLigados").value);
324 338 var tema = i3GEO.temaAtivo,
325 339 fim = function(retorno){
  340 + var nsel;
326 341 i3GEOF.selecao.aguarde.visibility = "hidden";
327 342 if(i3GEO.Interface.ATUAL === "padrao")
328 343 {i3GEO.atualiza(retorno);}
329 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 349 i3GEO.php.selecaopt(fim,tema,"",tipo,0);
332 350 }
... ... @@ -350,10 +368,13 @@ i3GEOF.selecao = {
350 368 //window.parent.i3GEO.eventos.MOUSEDOWN.remove("i3GEO.selecao.box.inicia()")
351 369 //$i("parapoli").style.display = "none";
352 370 var fim = function(retorno){
  371 + var nsel;
353 372 i3GEOF.selecao.aguarde.visibility = "hidden";
354 373 if(i3GEO.Interface.ATUAL === "padrao")
355 374 {i3GEO.atualiza(retorno);}
356 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 379 tema = i3GEOF.selecao.pegaTemasSel();
359 380 if (obj.value == "i3GEOselecaoext"){
... ... @@ -546,9 +567,12 @@ i3GEOF.selecao = {
546 567 if(typeof(console) !== 'undefined')
547 568 {console.info("i3GEO.navega.selecao.porbox()");}
548 569 var retorna = function(retorno){
  570 + var nsel;
549 571 if(i3GEO.Interface.ATUAL === "padrao")
550 572 {i3GEO.atualiza(retorno);}
551 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 577 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
554 578 i3GEO.php.selecaobox(retorna,tema,tipo,box);
... ... @@ -567,7 +591,7 @@ i3GEOF.selecao = {
567 591 var doc,tipo,tolerancia;
568 592 tipo = $i("i3GEOselecaotipoOperacao").value;
569 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 610 porxy: function(tema,tipo,tolerancia){
587 611 if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.porxy()");}
588 612 var retorna = function(retorno){
  613 + var nsel;
589 614 if(i3GEO.Interface.ATUAL === "padrao")
590 615 {i3GEO.atualiza(retorno);}
591 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 620 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
594 621 i3GEO.php.selecaopt(retorna,tema,objposicaocursor.ddx+" "+objposicaocursor.ddy,tipo,tolerancia);
... ... @@ -695,10 +722,13 @@ i3GEOF.selecao = {
695 722 xs = pontos.xpt.toString(",");
696 723 ys = pontos.ypt.toString(",");
697 724 retorna = function(retorno){
  725 + var nsel;
698 726 i3GEO.janela.fechaAguarde("i3GEO.atualiza",$trad("o1"));
699 727 if(i3GEO.Interface.ATUAL === "padrao")
700 728 {i3GEO.atualiza(retorno);}
701 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 733 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
704 734 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=selecaoPoli";
... ... @@ -886,10 +916,13 @@ i3GEOF.selecao = {
886 916 }
887 917 g_operacao = "selecao"
888 918 temp = function(retorno){
889   - if(i3GEO.Interface.ATUAL === "padrao")
  919 + var nsel;
  920 + if(i3GEO.Interface.ATUAL === "padrao")
890 921 {i3GEO.atualiza(retorno);}
891 922 i3GEOF.selecao.aguarde.visibility = "hidden";
892 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 927 i3GEO.php.selecaoatrib2(temp,i3GEO.temaAtivo,filtro,$i("i3GEOselecaotipoOperacao").value);
895 928 }
... ... @@ -914,10 +947,13 @@ i3GEOF.selecao = {
914 947 try{
915 948 i3GEOF.selecao.aguarde.visibility = "visible";
916 949 var temp = function(retorno){
917   - if(i3GEO.Interface.ATUAL === "padrao")
  950 + var nsel;
  951 + if(i3GEO.Interface.ATUAL === "padrao")
918 952 {i3GEO.atualiza(retorno);}
919 953 i3GEOF.selecao.aguarde.visibility = "hidden";
920 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 958 g_operacao = "selecao";
923 959 i3GEO.php.selecaotema(temp,$i("i3GEOselecaoTemaoverlay").value,i3GEO.temaAtivo,$i("i3GEOselecaotipoOperacao").value);
... ...
ms_criamapa.php
... ... @@ -645,17 +645,17 @@ function criaIndex()
645 645 global $dir_tmp,$diretorios;
646 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 649 fclose($f);
650   - $f = fopen($dir_tmp."/index.html",x);
  650 + $f = fopen($dir_tmp."/index.html","x");
651 651 fclose($f);
652   - $f = fopen($dir_tmp."/".$diretorios[1]."/index.html",x);
  652 + $f = fopen($dir_tmp."/".$diretorios[1]."/index.html","x");
653 653 fclose($f);
654   - $f = fopen($dir_tmp."/".$diretorios[1]."/index.htm",x);
  654 + $f = fopen($dir_tmp."/".$diretorios[1]."/index.htm","x");
655 655 fclose($f);
656   - $f = fopen($dir_tmp."/".$diretorios[2]."/index.html",x);
  656 + $f = fopen($dir_tmp."/".$diretorios[2]."/index.html","x");
657 657 fclose($f);
658   - $f = fopen($dir_tmp."/".$diretorios[2]."/index.htm",x);
  658 + $f = fopen($dir_tmp."/".$diretorios[2]."/index.htm","x");
659 659 fclose($f);
660 660 }
661 661 if (!file_exists($dir_tmp."/index.htm"))
... ...