Commit cb212a8595c8afc921eadfdb85e56ff0f59e3d52
1 parent
4ea84053
Exists in
master
and in
7 other branches
Adaptações dos códigos para a versão 6 do Mapserver
Showing
3 changed files
with
27 additions
and
12 deletions
Show diff stats
ferramentas/analisageometrias/index.js.php
... | ... | @@ -172,7 +172,7 @@ i3GEOF.analisaGeometrias = { |
172 | 172 | ins += ' <p class=paragrafo >Operações que criam novas geometrias a partir de duas ou mais geometrias:'; |
173 | 173 | ins += ' <p class=paragrafo ><select id=i3GEOanalisageometriasselecaofuncoes style="position:relative;top:-3px;" >'; |
174 | 174 | ins += ' <option value="" selected >---</option>'; |
175 | - ins += ' <option value=union_geos >União</option>'; | |
175 | + ins += ' <option value=union >União</option>'; | |
176 | 176 | ins += ' <option value=intersection >Intersecção</option>'; |
177 | 177 | ins += ' <option value=difference >Diferença</option>'; |
178 | 178 | ins += ' <option value=symdifference >Diferença inversa</option>'; | ... | ... |
ferramentas/imprimir/svg.php
... | ... | @@ -68,8 +68,12 @@ substituiCon($temp,$postgis_mapa); |
68 | 68 | $map = ms_newMapObj($temp); |
69 | 69 | if($interface == "googlemaps") |
70 | 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 | 77 | //altera o nome das classes vazias |
74 | 78 | $temas = $map->getalllayernames(); |
75 | 79 | foreach ($temas as $tema) |
... | ... | @@ -95,11 +99,25 @@ foreach ($temas as $tema) |
95 | 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 | 117 | $map->save($temp); |
101 | 118 | removeLinha("classeNula",$temp); |
102 | 119 | $map = ms_newMapObj($temp); |
120 | + | |
103 | 121 | $o = $map->outputformat; |
104 | 122 | if($mapexten != ""){ |
105 | 123 | $ext = explode(" ",$mapexten); |
... | ... | @@ -107,16 +125,12 @@ if($mapexten != ""){ |
107 | 125 | $extatual->setextent($ext[0],$ext[1],$ext[2],$ext[3]); |
108 | 126 | } |
109 | 127 | $map->selectOutputFormat("svg"); |
110 | - | |
111 | 128 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
112 | 129 | //mapa |
113 | 130 | $imgo = $map->draw(); |
114 | 131 | $nomer = ($imgo->imagepath)."mapa".$nomes.".svg"; |
115 | 132 | $imgo->saveImage($nomer); |
116 | 133 | $nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); |
117 | - | |
118 | - | |
119 | - | |
120 | 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 | 135 | echo "<p>Arquivos gerados:</p>"; |
122 | 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 | 11 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
12 | 12 | include("../../classesphp/carrega_ext.php"); |
13 | 13 | include("../../classesphp/funcoes_gerais.php"); |
14 | - | |
14 | +$versao = versao(); | |
15 | +$versao = versao["principal"]; | |
15 | 16 | substituiCon($map_file,$postgis_mapa); |
16 | 17 | $temp = explode(",",$nomesrel); |
17 | 18 | $colunas = array(); |
... | ... | @@ -56,9 +57,9 @@ $res_count = $layer->getNumresults(); |
56 | 57 | for ($i = 0; $i < $res_count; $i++) |
57 | 58 | { |
58 | 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 | 63 | $grupo = ""; |
63 | 64 | foreach ($itensrel as $item) |
64 | 65 | { | ... | ... |