Commit 86d7705fe53a198467cd4e71f8e428a644ba74b2

Authored by Edmar Moretti
1 parent 22975886

Resolvido o problema do destaque dos elementos selecionados nas versões novas do Mapserver

classesphp/classe_mapa.php
@@ -166,15 +166,19 @@ string - javascript com os parametros @@ -166,15 +166,19 @@ string - javascript com os parametros
166 function parametrosTemas() 166 function parametrosTemas()
167 { 167 {
168 $existesel = false; 168 $existesel = false;
169 - $qy = file_exists($this->qyfile); 169 + $dir = dirname($this->arquivo);
  170 + //$qy = file_exists($this->qyfile);
170 foreach($this->layers as $l) 171 foreach($this->layers as $l)
171 {$l->set("template","none.htm");} 172 {$l->set("template","none.htm");}
172 173
173 - if ($qy)  
174 - {$this->mapa->loadquery($this->qyfile);} 174 + //if ($qy)
  175 + //{$this->mapa->loadquery($this->qyfile);}
175 foreach ($this->layers as $oLayer) 176 foreach ($this->layers as $oLayer)
176 { 177 {
177 $sel = "nao"; 178 $sel = "nao";
  179 + if(file_exists($dir."/".$oLayer->name.".php"))
  180 + {$sel = "sim";$existesel = true;}
  181 + /*
178 if ($qy) //verifica se existe alguma selecao no tema 182 if ($qy) //verifica se existe alguma selecao no tema
179 { 183 {
180 $sopen = $oLayer->open(); 184 $sopen = $oLayer->open();
@@ -185,6 +189,7 @@ string - javascript com os parametros @@ -185,6 +189,7 @@ string - javascript com os parametros
185 if ($res_count > 0){$sel = "sim";$existesel = true;} 189 if ($res_count > 0){$sel = "sim";$existesel = true;}
186 } 190 }
187 } 191 }
  192 + */
188 $escondido = $oLayer->getmetadata("escondido"); 193 $escondido = $oLayer->getmetadata("escondido");
189 if($escondido == "") 194 if($escondido == "")
190 {$escondido = "nao";} 195 {$escondido = "nao";}
classesphp/classe_selecao.php
@@ -586,16 +586,19 @@ Limpa a seleção do tema. @@ -586,16 +586,19 @@ Limpa a seleção do tema.
586 */ 586 */
587 function selecaoLimpa() 587 function selecaoLimpa()
588 { 588 {
  589 + //apaga o arquivo do i3geo com os ids selecionados
589 if(file_exists($this->qyfileTema)) 590 if(file_exists($this->qyfileTema))
590 {unlink($this->qyfileTema);} 591 {unlink($this->qyfileTema);}
591 if ($this->nome != "") //limpa de um tema 592 if ($this->nome != "") //limpa de um tema
592 { 593 {
593 if(!$this->layer){return "erro";} 594 if(!$this->layer){return "erro";}
594 if (file_exists($this->qyfile)) 595 if (file_exists($this->qyfile))
595 - {$this->mapa->loadquery($this->qyfile);}  
596 - $indxlayer = $this->layer->index;  
597 - $this->mapa->freequery($indxlayer);  
598 - $this->mapa->savequery($this->qyfile); 596 + {
  597 + $this->mapa->loadquery($this->qyfile);
  598 + $indxlayer = $this->layer->index;
  599 + $this->mapa->freequery($indxlayer);
  600 + $this->mapa->savequery($this->qyfile);
  601 + }
599 } 602 }
600 else //limpa de todos os temas 603 else //limpa de todos os temas
601 { 604 {
@@ -668,6 +671,7 @@ $shp_atual - Indices dos elementos já selecionados. @@ -668,6 +671,7 @@ $shp_atual - Indices dos elementos já selecionados.
668 $this->mapa->freequery($indxlayer); 671 $this->mapa->freequery($indxlayer);
669 foreach ($shp as $indx) 672 foreach ($shp as $indx)
670 {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} 673 {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);}
  674 + //echo $this->layer->getNumresults();
671 $this->mapa->savequery($this->qyfile); 675 $this->mapa->savequery($this->qyfile);
672 $this->serializeQ($this->qyfileTema,$shp); 676 $this->serializeQ($this->qyfileTema,$shp);
673 return("ok"); 677 return("ok");
@@ -865,7 +869,7 @@ $ext - coordenadas separadas por espaços no estilo xmin ymin xmax ymax @@ -865,7 +869,7 @@ $ext - coordenadas separadas por espaços no estilo xmin ymin xmax ymax
865 /* 869 /*
866 function unserializeQ 870 function unserializeQ
867 871
868 -Deserializa um arquivo de geometrias. 872 +Deserializa um arquivo.
869 873
870 Parametros: 874 Parametros:
871 $arquivo - arquivo que será processado 875 $arquivo - arquivo que será processado
@@ -880,7 +884,7 @@ $arquivo - arquivo que será processado @@ -880,7 +884,7 @@ $arquivo - arquivo que será processado
880 /* 884 /*
881 function serializeQ 885 function serializeQ
882 886
883 -Deserializa um arquivo de geometrias. 887 +Serializa um arquivo.
884 888
885 Parametros: 889 Parametros:
886 $arquivo - arquivo que será processado 890 $arquivo - arquivo que será processado
classesphp/mapa_googleearth.php
@@ -93,11 +93,28 @@ function retornaWms(){ @@ -93,11 +93,28 @@ function retornaWms(){
93 } 93 }
94 $mapa = ms_newMapObj($_GET["map"]); 94 $mapa = ms_newMapObj($_GET["map"]);
95 $mapa->setProjection("init=epsg:4326"); 95 $mapa->setProjection("init=epsg:4326");
  96 + /*
96 $qyfile = str_replace(".map",".qy",$_GET["map"]); 97 $qyfile = str_replace(".map",".qy",$_GET["map"]);
97 $qy = file_exists($qyfile); 98 $qy = file_exists($qyfile);
98 if($qy) 99 if($qy)
99 {$mapa->loadquery($qyfile);} 100 {$mapa->loadquery($qyfile);}
100 - 101 + */
  102 + //
  103 + //resolve o problema da seleção na versão nova do mapserver
  104 + //
  105 + $qyfile = dirname($_GET["map"])."/".$_GET["layer"].".php";
  106 + $qy = file_exists($qyfile);
  107 + if($qy)
  108 + {
  109 + $l = $mapa->getLayerByname($_GET["layer"]);
  110 + $indxlayer = $l->index;
  111 + $handle = fopen ($qyfile, "r");
  112 + $conteudo = fread ($handle, filesize ($qyfile));
  113 + fclose ($handle);
  114 + $shp = unserialize($conteudo);
  115 + foreach ($shp as $indx)
  116 + {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);}
  117 + }
101 $layersNames = $mapa->getalllayernames(); 118 $layersNames = $mapa->getalllayernames();
102 foreach ($layersNames as $layerName) 119 foreach ($layersNames as $layerName)
103 { 120 {
classesphp/mapa_googlemaps.php
@@ -11,7 +11,7 @@ Licenca: @@ -11,7 +11,7 @@ Licenca:
11 11
12 GPL2 12 GPL2
13 13
14 -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet 14 +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
15 15
16 Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil 16 Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
17 Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br 17 Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br
@@ -76,11 +76,28 @@ $_GET["WIDTH"] = "256"; @@ -76,11 +76,28 @@ $_GET["WIDTH"] = "256";
76 $_GET["HEIGHT"] = "256"; 76 $_GET["HEIGHT"] = "256";
77 77
78 $mapa = ms_newMapObj($_GET["map"]); 78 $mapa = ms_newMapObj($_GET["map"]);
  79 +/*
79 $qyfile = str_replace(".map",".qy",$_GET["map"]); 80 $qyfile = str_replace(".map",".qy",$_GET["map"]);
80 $qy = file_exists($qyfile); 81 $qy = file_exists($qyfile);
81 if($qy) 82 if($qy)
82 {$mapa->loadquery($qyfile);} 83 {$mapa->loadquery($qyfile);}
83 - 84 +*/
  85 +//
  86 +//resolve o problema da seleção na versão nova do mapserver
  87 +//
  88 +$qyfile = dirname($_GET["map"])."/".$_GET["layer"].".php";
  89 +$qy = file_exists($qyfile);
  90 +if($qy)
  91 +{
  92 + $l = $mapa->getLayerByname($_GET["layer"]);
  93 + $indxlayer = $l->index;
  94 + $handle = fopen ($qyfile, "r");
  95 + $conteudo = fread ($handle, filesize ($qyfile));
  96 + fclose ($handle);
  97 + $shp = unserialize($conteudo);
  98 + foreach ($shp as $indx)
  99 + {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);}
  100 +}
84 $layersNames = $mapa->getalllayernames(); 101 $layersNames = $mapa->getalllayernames();
85 $cache = false; 102 $cache = false;
86 foreach ($layersNames as $layerName) 103 foreach ($layersNames as $layerName)
classesphp/mapa_openlayers.php
@@ -12,7 +12,7 @@ Licenca: @@ -12,7 +12,7 @@ Licenca:
12 12
13 GPL2 13 GPL2
14 14
15 -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet 15 +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
16 16
17 Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil 17 Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
18 Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br 18 Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br
@@ -50,10 +50,28 @@ if(isset($_GET["BBOX"])) @@ -50,10 +50,28 @@ if(isset($_GET["BBOX"]))
50 $_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; 50 $_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"];
51 } 51 }
52 $mapa = ms_newMapObj($_GET["map"]); 52 $mapa = ms_newMapObj($_GET["map"]);
  53 +/*
53 $qyfile = str_replace(".map",".qy",$_GET["map"]); 54 $qyfile = str_replace(".map",".qy",$_GET["map"]);
54 $qy = file_exists($qyfile); 55 $qy = file_exists($qyfile);
55 if($qy) 56 if($qy)
56 {$mapa->loadquery($qyfile);} 57 {$mapa->loadquery($qyfile);}
  58 +*/
  59 +//
  60 +//resolve o problema da seleção na versão nova do mapserver
  61 +//
  62 +$qyfile = dirname($_GET["map"])."/".$_GET["layer"].".php";
  63 +$qy = file_exists($qyfile);
  64 +if($qy)
  65 +{
  66 + $l = $mapa->getLayerByname($_GET["layer"]);
  67 + $indxlayer = $l->index;
  68 + $handle = fopen ($qyfile, "r");
  69 + $conteudo = fread ($handle, filesize ($qyfile));
  70 + fclose ($handle);
  71 + $shp = unserialize($conteudo);
  72 + foreach ($shp as $indx)
  73 + {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);}
  74 +}
57 75
58 $layersNames = $mapa->getalllayernames(); 76 $layersNames = $mapa->getalllayernames();
59 $cache = false; 77 $cache = false;
ferramentas/convertekml/index.js.php
@@ -18,7 +18,7 @@ Licenca: @@ -18,7 +18,7 @@ Licenca:
18 18
19 GPL2 19 GPL2
20 20
21 -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet 21 +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
22 22
23 Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil 23 Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
24 Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br 24 Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <br><br> 13 <br><br>
14 <table> 14 <table>
15 <tr> 15 <tr>
16 - <td style="padding:10px;"><center><img alt="logomarca" src='imagens/logo_inicio.png'></td> 16 + <td style="padding:10px;"><center><img alt="i3Geo" src='imagens/logo_inicio.png'></td>
17 </tr> 17 </tr>
18 </table> 18 </table>
19 </body> 19 </body>