Commit c0b112415d3ae15780a18a8645a693ea00df7ca0
1 parent
6536aa71
Exists in
master
Correção em bug do Mapserver que não permitia o uso de layers do tipo GRID
Showing
4 changed files
with
80 additions
and
3 deletions
Show diff stats
classesphp/funcoes_gerais.php
| ... | ... | @@ -3107,4 +3107,22 @@ function checaLoginIp($lista){ |
| 3107 | 3107 | exit (); |
| 3108 | 3108 | } |
| 3109 | 3109 | } |
| 3110 | +// | |
| 3111 | +//corrige layers do tipo GRID | |
| 3112 | +//bug do mapserver nao permite renderizar grids | |
| 3113 | +//essa funcao corrige esse problema | |
| 3114 | +// | |
| 3115 | +function corrigeLayerGrid($layerOrigem,$layerDestino){ | |
| 3116 | + if($layerOrigem->connectiontype == MS_GRATICULE){ | |
| 3117 | + ms_newgridobj($layerDestino); | |
| 3118 | + $layerDestino->grid->set("labelformat", $layerOrigem->grid->labelformat); | |
| 3119 | + $layerDestino->grid->set("mininterval", $layerOrigem->grid->mininterval); | |
| 3120 | + $layerDestino->grid->set("maxinterval", $layerOrigem->grid->maxinterval); | |
| 3121 | + $layerDestino->grid->set("minsubdivide", $layerOrigem->grid->minsubdivide); | |
| 3122 | + $layerDestino->grid->set("maxsubdivide", $layerOrigem->grid->maxsubdivide); | |
| 3123 | + $layerDestino->grid->set("minarcs", $layerOrigem->grid->minarcs); | |
| 3124 | + $layerDestino->grid->set("maxarcs", $layerOrigem->grid->maxarcs); | |
| 3125 | + //$layerDestino->updatefromstring("LAYER GRID LABELFORMAT '" . $layerOrigem->grid->labelformat . "' END END"); | |
| 3126 | + } | |
| 3127 | +} | |
| 3110 | 3128 | ?> | ... | ... |
ms_criamapa.php
| ... | ... | @@ -908,7 +908,8 @@ function incluiTemasIniciais(){ |
| 908 | 908 | $layern->set("status",$statustemp); |
| 909 | 909 | } |
| 910 | 910 | cloneInlineSymbol($layern,$maptemp,$mapn); |
| 911 | - ms_newLayerObj($mapn, $layern); | |
| 911 | + $layerAdicionado = ms_newLayerObj($mapn, $layern); | |
| 912 | + corrigeLayerGrid($layern,$layerAdicionado); | |
| 912 | 913 | } |
| 913 | 914 | } |
| 914 | 915 | ... | ... |
| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | +MAP | |
| 2 | + FONTSET "../symbols/fontes.txt" | |
| 3 | + SYMBOLSET "../symbols/simbolos.sym" | |
| 4 | + LAYER | |
| 5 | + METADATA | |
| 6 | + "METAESTAT_ID_MEDIDA_VARIAVEL" "" | |
| 7 | + "CACHE" "nao" | |
| 8 | + "DESCRIPTION" "Grid" | |
| 9 | + "permitekmz" "nao" | |
| 10 | + "TILES" "nao" | |
| 11 | + "METAESTAT_CODIGO_TIPO_REGIAO" "" | |
| 12 | + "permitedownload" "sim" | |
| 13 | + "metaestat" "" | |
| 14 | + "download" "sim" | |
| 15 | + "permitekml" "sim" | |
| 16 | + "permiteogc" "sim" | |
| 17 | + "TEMA" "Grade DMS" | |
| 18 | + END # METADATA | |
| 19 | + NAME "gridg" | |
| 20 | + PROJECTION | |
| 21 | + "proj=longlat" | |
| 22 | + "ellps=WGS84" | |
| 23 | + "datum=WGS84" | |
| 24 | + "no_defs" | |
| 25 | + END # PROJECTION | |
| 26 | + STATUS DEFAULT | |
| 27 | + TILEITEM "location" | |
| 28 | + TYPE LINE | |
| 29 | + UNITS METERS | |
| 30 | + CLASS | |
| 31 | + NAME "Graticule" | |
| 32 | + LABEL | |
| 33 | + FONT "arial" | |
| 34 | + SIZE 8 | |
| 35 | + BUFFER 2 | |
| 36 | + OFFSET 0 0 | |
| 37 | + OUTLINECOLOR 255 255 255 | |
| 38 | + PARTIALS FALSE | |
| 39 | + POSITION CC | |
| 40 | + SHADOWSIZE 1 1 | |
| 41 | + TYPE TRUETYPE | |
| 42 | + END # LABEL | |
| 43 | + STYLE | |
| 44 | + COLOR 200 200 200 | |
| 45 | + END # STYLE | |
| 46 | + END # CLASS | |
| 47 | + GRID | |
| 48 | + LABELFORMAT "DDMMSS" | |
| 49 | + MAXINTERVAL 10 | |
| 50 | + MININTERVAL 10 | |
| 51 | + END # GRID | |
| 52 | + END # LAYER | |
| 53 | + | |
| 54 | +END # MAP | |
| 55 | + | ... | ... |
testamapfile.php
| ... | ... | @@ -349,7 +349,10 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){ |
| 349 | 349 | } |
| 350 | 350 | //pega simbolos locais e aplica no novo mapa |
| 351 | 351 | cloneInlineSymbol($layern,$nmapa,$mapa); |
| 352 | - ms_newLayerObj($mapa, $layern); | |
| 352 | + | |
| 353 | + $layerAdicionado = ms_newLayerObj($mapa, $layern); | |
| 354 | + | |
| 355 | + corrigeLayerGrid($layern,$layerAdicionado); | |
| 353 | 356 | /* |
| 354 | 357 | if ($layern->data == ""){ |
| 355 | 358 | $dados = $layern->connection; |
| ... | ... | @@ -447,7 +450,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){ |
| 447 | 450 | } |
| 448 | 451 | else{ |
| 449 | 452 | $mapa = ms_newMapObj($destino); |
| 450 | - restauraCon($destino,$postgis_mapa); | |
| 453 | + restauraConObj($mapa,$postgis_mapa); | |
| 451 | 454 | $objImagem = @$mapa->draw(); |
| 452 | 455 | //corrige o titulo da legenda |
| 453 | 456 | $numlayers = $mapa->numlayers; | ... | ... |