Commit ee1b8ed519523621b39076c7ddc18ab6a8507a92
1 parent
11d0da9a
Exists in
master
and in
7 other branches
novos parametros na ferramenta de animação
Showing
1 changed file
with
35 additions
and
8 deletions
Show diff stats
ferramentas/animagif/exec.php
@@ -14,6 +14,9 @@ if(empty($_GET)){ | @@ -14,6 +14,9 @@ if(empty($_GET)){ | ||
14 | &mapext = extensão geográfica xmin,ymin,xmax,ymax que será usada nas imagens<br> | 14 | &mapext = extensão geográfica xmin,ymin,xmax,ymax que será usada nas imagens<br> |
15 | &legenda = sim|nao<br> | 15 | &legenda = sim|nao<br> |
16 | &transparente = sim|nao<br> | 16 | &transparente = sim|nao<br> |
17 | + &operador = operador que será utilizado no filtro. Por default utilza-se 'igual a'. Pode ser ainda lt (menor que) ou gt (maior que)<br> | ||
18 | + &nulos = lista de valores, separados por ',' que não serão considerados ao aplicar o filtro, por exemplo &nulos=-, ,0<br> | ||
19 | + &tipocolunat = string|numero tipo de dados existentes na coluna que contém os valores para o filtro<br> | ||
17 | "; | 20 | "; |
18 | exit; | 21 | exit; |
19 | } | 22 | } |
@@ -30,6 +33,24 @@ if($cache == "nao"){ | @@ -30,6 +33,24 @@ if($cache == "nao"){ | ||
30 | if(empty($tempo)){ | 33 | if(empty($tempo)){ |
31 | $tempo = 40; | 34 | $tempo = 40; |
32 | } | 35 | } |
36 | +if(empty($nulos)){ | ||
37 | + $nulos = ""; | ||
38 | +} | ||
39 | +if(empty($tipocolunat)){ | ||
40 | + $tipocolunat = "string"; | ||
41 | +} | ||
42 | +if(empty($operador)){ | ||
43 | + $operador = "="; | ||
44 | +} | ||
45 | +else{ | ||
46 | + if($operador == "lt"){ | ||
47 | + $operador = "<"; | ||
48 | + } | ||
49 | + if($operador == "gt"){ | ||
50 | + $operador = ">"; | ||
51 | + } | ||
52 | +} | ||
53 | +$nulos = explode(",",$nulos); | ||
33 | $arqtemp = $dir_tmp."/".$nometemp; | 54 | $arqtemp = $dir_tmp."/".$nometemp; |
34 | if(file_exists($arqtemp.".gif")){ | 55 | if(file_exists($arqtemp.".gif")){ |
35 | $gifBinary = file_get_contents($arqtemp.".gif"); | 56 | $gifBinary = file_get_contents($arqtemp.".gif"); |
@@ -42,15 +63,13 @@ if(file_exists($arqtemp.".gif")){ | @@ -42,15 +63,13 @@ if(file_exists($arqtemp.".gif")){ | ||
42 | // | 63 | // |
43 | //carrega o phpmapscript | 64 | //carrega o phpmapscript |
44 | // | 65 | // |
45 | -if (!function_exists('ms_GetVersion')) | ||
46 | -{ | ||
47 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | ||
48 | - { | 66 | +if (!function_exists('ms_GetVersion')){ |
67 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
49 | if(!@dl('php_mapscript_48.dll')) | 68 | if(!@dl('php_mapscript_48.dll')) |
50 | dl('php_mapscript.dll'); | 69 | dl('php_mapscript.dll'); |
51 | } | 70 | } |
52 | - else | ||
53 | - {dl('php_mapscript.so'); | 71 | + else{ |
72 | + dl('php_mapscript.so'); | ||
54 | } | 73 | } |
55 | } | 74 | } |
56 | $versao = versao(); | 75 | $versao = versao(); |
@@ -176,6 +195,7 @@ $c = $mapa->imagecolor; | @@ -176,6 +195,7 @@ $c = $mapa->imagecolor; | ||
176 | $c->setrgb(-1,-1,-1); | 195 | $c->setrgb(-1,-1,-1); |
177 | $o = $mapa->outputformat; | 196 | $o = $mapa->outputformat; |
178 | $o->set("imagemode",MS_IMAGEMODE_RGBA); | 197 | $o->set("imagemode",MS_IMAGEMODE_RGBA); |
198 | + | ||
179 | if($transparente == "sim"){ | 199 | if($transparente == "sim"){ |
180 | $o->set("transparent",MS_TRUE); | 200 | $o->set("transparent",MS_TRUE); |
181 | } | 201 | } |
@@ -190,6 +210,7 @@ $m = new Atributos($arqtemp.".map",$tema); | @@ -190,6 +210,7 @@ $m = new Atributos($arqtemp.".map",$tema); | ||
190 | $lista = $m->listaUnicoRapida($colunat); | 210 | $lista = $m->listaUnicoRapida($colunat); |
191 | $listaunica = array(); | 211 | $listaunica = array(); |
192 | foreach($lista as $l){ | 212 | foreach($lista as $l){ |
213 | + $l = str_replace($nulos,"",$l); | ||
193 | if($l != ""){ | 214 | if($l != ""){ |
194 | $listaunica[] = $l; | 215 | $listaunica[] = $l; |
195 | } | 216 | } |
@@ -208,10 +229,16 @@ $objImagem = ""; | @@ -208,10 +229,16 @@ $objImagem = ""; | ||
208 | //$listaunica = array($listaunica[1]); | 229 | //$listaunica = array($listaunica[1]); |
209 | foreach($listaunica as $d){ | 230 | foreach($listaunica as $d){ |
210 | if(strtoupper($colunat) == $colunat){ | 231 | if(strtoupper($colunat) == $colunat){ |
211 | - $filtro = "(('[$colunat]' = '$d'))"; | 232 | + $filtro = "(('[$colunat]' $operador '$d'))"; |
233 | + if($tipocolunat == "numerico"){ | ||
234 | + $filtro = "(([$colunat] $operador $d))"; | ||
235 | + } | ||
212 | } | 236 | } |
213 | else{ | 237 | else{ |
214 | - $filtro = "$colunat = '$d'"; | 238 | + $filtro = "$colunat $operador '$d'"; |
239 | + if($tipocolunat == "numerico"){ | ||
240 | + $filtro = "$colunat $operador $d"; | ||
241 | + } | ||
215 | } | 242 | } |
216 | $layer->setfilter($filtro); | 243 | $layer->setfilter($filtro); |
217 | //$mapa->save($arqtemp.".map");echo $arqtemp;exit; | 244 | //$mapa->save($arqtemp.".map");echo $arqtemp;exit; |