Commit cb212a8595c8afc921eadfdb85e56ff0f59e3d52

Authored by Edmar Moretti
1 parent 4ea84053

Adaptações dos códigos para a versão 6 do Mapserver

ferramentas/analisageometrias/index.js.php
@@ -172,7 +172,7 @@ i3GEOF.analisaGeometrias = { @@ -172,7 +172,7 @@ i3GEOF.analisaGeometrias = {
172 ins += ' <p class=paragrafo >Operações que criam novas geometrias a partir de duas ou mais geometrias:'; 172 ins += ' <p class=paragrafo >Operações que criam novas geometrias a partir de duas ou mais geometrias:';
173 ins += ' <p class=paragrafo ><select id=i3GEOanalisageometriasselecaofuncoes style="position:relative;top:-3px;" >'; 173 ins += ' <p class=paragrafo ><select id=i3GEOanalisageometriasselecaofuncoes style="position:relative;top:-3px;" >';
174 ins += ' <option value="" selected >---</option>'; 174 ins += ' <option value="" selected >---</option>';
175 - ins += ' <option value=union_geos >Uni&atilde;o</option>'; 175 + ins += ' <option value=union >Uni&atilde;o</option>';
176 ins += ' <option value=intersection >Intersec&ccedil;&atilde;o</option>'; 176 ins += ' <option value=intersection >Intersec&ccedil;&atilde;o</option>';
177 ins += ' <option value=difference >Diferen&ccedil;a</option>'; 177 ins += ' <option value=difference >Diferen&ccedil;a</option>';
178 ins += ' <option value=symdifference >Diferen&ccedil;a inversa</option>'; 178 ins += ' <option value=symdifference >Diferen&ccedil;a inversa</option>';
ferramentas/imprimir/svg.php
@@ -68,8 +68,12 @@ substituiCon($temp,$postgis_mapa); @@ -68,8 +68,12 @@ substituiCon($temp,$postgis_mapa);
68 $map = ms_newMapObj($temp); 68 $map = ms_newMapObj($temp);
69 if($interface == "googlemaps") 69 if($interface == "googlemaps")
70 {$map->setProjection("init=epsg:4291");} 70 {$map->setProjection("init=epsg:4291");}
71 -//$legenda =$map->legend;  
72 -//$legenda->set("status",MS_EMBED); 71 +$eb = $map->scalebar;
  72 +$leb = $eb->label;
  73 +if($leb->type == "MS_BITMAP"){
  74 + $leb->set("type",MS_TRUETYPE);
  75 + $leb->set("font","Arial");
  76 +}
73 //altera o nome das classes vazias 77 //altera o nome das classes vazias
74 $temas = $map->getalllayernames(); 78 $temas = $map->getalllayernames();
75 foreach ($temas as $tema) 79 foreach ($temas as $tema)
@@ -95,11 +99,25 @@ foreach ($temas as $tema) @@ -95,11 +99,25 @@ foreach ($temas as $tema)
95 $classe->set("name","classeNula"); 99 $classe->set("name","classeNula");
96 } 100 }
97 } 101 }
98 - } 102 + }
  103 + $nclasses = $layer->numclasses;
  104 + if ($nclasses > 0)
  105 + {
  106 + for($i=0;$i<$nclasses;$i++)
  107 + {
  108 + $classe = $layer->getclass($i);
  109 + $leb = $classe->label;
  110 + if($leb->type == MS_BITMAP){
  111 + $leb->set("type",MS_TRUETYPE);
  112 + $leb->set("font","Arial");
  113 + }
  114 + }
  115 + }
99 } 116 }
100 $map->save($temp); 117 $map->save($temp);
101 removeLinha("classeNula",$temp); 118 removeLinha("classeNula",$temp);
102 $map = ms_newMapObj($temp); 119 $map = ms_newMapObj($temp);
  120 +
103 $o = $map->outputformat; 121 $o = $map->outputformat;
104 if($mapexten != ""){ 122 if($mapexten != ""){
105 $ext = explode(" ",$mapexten); 123 $ext = explode(" ",$mapexten);
@@ -107,16 +125,12 @@ if($mapexten != &quot;&quot;){ @@ -107,16 +125,12 @@ if($mapexten != &quot;&quot;){
107 $extatual->setextent($ext[0],$ext[1],$ext[2],$ext[3]); 125 $extatual->setextent($ext[0],$ext[1],$ext[2],$ext[3]);
108 } 126 }
109 $map->selectOutputFormat("svg"); 127 $map->selectOutputFormat("svg");
110 -  
111 $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); 128 $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']);
112 //mapa 129 //mapa
113 $imgo = $map->draw(); 130 $imgo = $map->draw();
114 $nomer = ($imgo->imagepath)."mapa".$nomes.".svg"; 131 $nomer = ($imgo->imagepath)."mapa".$nomes.".svg";
115 $imgo->saveImage($nomer); 132 $imgo->saveImage($nomer);
116 $nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); 133 $nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer);
117 -  
118 -  
119 -  
120 echo "<p>Utilize a opção de alteração das propriedades do mapa para ajustar a legenda, tamanho e outras características antes de gerar os arquivos.</p>"; 134 echo "<p>Utilize a opção de alteração das propriedades do mapa para ajustar a legenda, tamanho e outras características antes de gerar os arquivos.</p>";
121 echo "<p>Arquivos gerados:</p>"; 135 echo "<p>Arquivos gerados:</p>";
122 echo "<a style=font-family:Verdana,Arial,Helvetica,sans-serif; href='$nomemapa' target=_blank >Mapa</a><br><br>"; 136 echo "<a style=font-family:Verdana,Arial,Helvetica,sans-serif; href='$nomemapa' target=_blank >Mapa</a><br><br>";
ferramentas/tabela/relatorio.php
@@ -11,7 +11,8 @@ foreach(array_keys($_SESSION) as $k) @@ -11,7 +11,8 @@ foreach(array_keys($_SESSION) as $k)
11 $postgis_mapa = $_SESSION["postgis_mapa"]; 11 $postgis_mapa = $_SESSION["postgis_mapa"];
12 include("../../classesphp/carrega_ext.php"); 12 include("../../classesphp/carrega_ext.php");
13 include("../../classesphp/funcoes_gerais.php"); 13 include("../../classesphp/funcoes_gerais.php");
14 - 14 +$versao = versao();
  15 +$versao = versao["principal"];
15 substituiCon($map_file,$postgis_mapa); 16 substituiCon($map_file,$postgis_mapa);
16 $temp = explode(",",$nomesrel); 17 $temp = explode(",",$nomesrel);
17 $colunas = array(); 18 $colunas = array();
@@ -56,9 +57,9 @@ $res_count = $layer-&gt;getNumresults(); @@ -56,9 +57,9 @@ $res_count = $layer-&gt;getNumresults();
56 for ($i = 0; $i < $res_count; $i++) 57 for ($i = 0; $i < $res_count; $i++)
57 { 58 {
58 $valitem = array(); 59 $valitem = array();
59 - $result = $layer->getResult($i);  
60 - $shp_index = $result->shapeindex;  
61 - $shape = $layer->getshape(-1, $shp_index); 60 + if($versao == 6)
  61 + {$shape = $layer->getShape($layer->getResult($i));}
  62 + else{$shape = $layer->getFeature($layer->getResult($i)->shapeindex);}
62 $grupo = ""; 63 $grupo = "";
63 foreach ($itensrel as $item) 64 foreach ($itensrel as $item)
64 { 65 {