Commit 0ac84d78c420cbd58a0babc1253e13bfb4dca49e
1 parent
65744aed
Exists in
master
Adaptações para versão 7 do Mapserver
Showing
7 changed files
with
61 additions
and
38 deletions
Show diff stats
classesphp/classe_analise.php
| ... | ... | @@ -1132,7 +1132,7 @@ class Analise |
| 1132 | 1132 | } |
| 1133 | 1133 | if ($layer->getResult(0) !== FALSE) |
| 1134 | 1134 | { |
| 1135 | - if($this->v == 6) | |
| 1135 | + if($this->v >= 6) | |
| 1136 | 1136 | { |
| 1137 | 1137 | $shape = $layer->getShape($layer->getResult(0)); |
| 1138 | 1138 | } |
| ... | ... | @@ -1261,7 +1261,7 @@ class Analise |
| 1261 | 1261 | |
| 1262 | 1262 | for ($i = 0; $i < $res_count; ++$i) |
| 1263 | 1263 | { |
| 1264 | - if($this->v == 6) | |
| 1264 | + if($this->v >= 6) | |
| 1265 | 1265 | { |
| 1266 | 1266 | $shapesdestino[] = $layerdestino->getShape($layerdestino->getResult($i)); |
| 1267 | 1267 | } |
| ... | ... | @@ -2200,7 +2200,7 @@ class Analise |
| 2200 | 2200 | $layerPt->open(); |
| 2201 | 2201 | $res_count = $layerPt->getNumresults(); |
| 2202 | 2202 | for ($i = 0; $i < $res_count; ++$i){ |
| 2203 | - if($this->v == 6){ | |
| 2203 | + if($this->v >= 6){ | |
| 2204 | 2204 | $s = $layerPt->getShape($layerPt->getResult($i)); |
| 2205 | 2205 | } |
| 2206 | 2206 | else{ | ... | ... |
classesphp/classe_atributos.php
| ... | ... | @@ -214,7 +214,7 @@ class Atributos |
| 214 | 214 | //$this->layer->setfilter(""); |
| 215 | 215 | $ext = ""; |
| 216 | 216 | //procura o registro e pega a extensão geográfica |
| 217 | - if($this->v == 6){ | |
| 217 | + if($this->v >= 6){ | |
| 218 | 218 | $this->layer->open(); |
| 219 | 219 | $shape = $this->layer->getShape(new resultObj($registro)); |
| 220 | 220 | //$shape = $this->layer->getShape($this->layer->getResult($registro)); |
| ... | ... | @@ -505,7 +505,7 @@ class Atributos |
| 505 | 505 | $valoresunicos = array(); |
| 506 | 506 | for ($i = $inicio; $i < $res_count; ++$i){ |
| 507 | 507 | $valitem = array(); |
| 508 | - if($this->v == 6){ | |
| 508 | + if($this->v >= 6){ | |
| 509 | 509 | $shape = $this->layer->getShape($this->layer->getResult($i)); |
| 510 | 510 | $indx = $shape->index; |
| 511 | 511 | } |
| ... | ... | @@ -621,7 +621,7 @@ class Atributos |
| 621 | 621 | $sopen = $this->layer->open(); |
| 622 | 622 | for ($i = 0; $i < $res_count; ++$i){ |
| 623 | 623 | $valitem = array(); |
| 624 | - if($this->v == 6){ | |
| 624 | + if($this->v >= 6){ | |
| 625 | 625 | $shape = $this->layer->getShape($this->layer->getResult($i)); |
| 626 | 626 | $indx = $shape->index; |
| 627 | 627 | } |
| ... | ... | @@ -732,7 +732,7 @@ class Atributos |
| 732 | 732 | $palavra = $this->remove_accents(strtolower($palavra)); |
| 733 | 733 | for ($i = 0; $i < $res_count; ++$i) { |
| 734 | 734 | $valitem = array(); |
| 735 | - if($this->v == 6){ | |
| 735 | + if($this->v >= 6){ | |
| 736 | 736 | $shape = $l->getShape($l->getResult($i)); |
| 737 | 737 | $indx = $shape->index; |
| 738 | 738 | } |
| ... | ... | @@ -1930,7 +1930,7 @@ class Atributos |
| 1930 | 1930 | for ($i = 0; $i < $res_count; ++$i) |
| 1931 | 1931 | { |
| 1932 | 1932 | $valori = array(); |
| 1933 | - if($this->v == 6) | |
| 1933 | + if($this->v >= 6) | |
| 1934 | 1934 | { |
| 1935 | 1935 | $shape = $layer->getShape($layer->getResult($i)); |
| 1936 | 1936 | } |
| ... | ... | @@ -2308,7 +2308,7 @@ class Atributos |
| 2308 | 2308 | } |
| 2309 | 2309 | for ($i = 0; $i < $res_count; ++$i) { |
| 2310 | 2310 | $valori = array(); |
| 2311 | - if($this->v == 6){ | |
| 2311 | + if($this->v >= 6){ | |
| 2312 | 2312 | $shape = $layer->getShape($layer->getResult($i)); |
| 2313 | 2313 | } |
| 2314 | 2314 | else{ | ... | ... |
classesphp/classe_legenda.php
| ... | ... | @@ -656,8 +656,8 @@ class Legenda |
| 656 | 656 | { |
| 657 | 657 | $mapatemp = ms_newMapObj($this->localaplicacao."\\aplicmap\\".$t); |
| 658 | 658 | } |
| 659 | - else | |
| 660 | - {$mapatemp = ms_newMapObj($this->localaplicacao."/aplicmap/".$t); | |
| 659 | + else{ | |
| 660 | + $mapatemp = ms_newMapObj($this->localaplicacao."/aplicmap/".$t); | |
| 661 | 661 | } |
| 662 | 662 | $l = $mapatemp->getlayer(0); |
| 663 | 663 | |
| ... | ... | @@ -665,21 +665,38 @@ class Legenda |
| 665 | 665 | { |
| 666 | 666 | $novoss = dirname($this->mapa->symbolsetfilename)."\\".basename($mapatemp->symbolsetfilename); |
| 667 | 667 | } |
| 668 | - else | |
| 669 | - {$novoss = dirname($this->mapa->symbolsetfilename)."/".basename($mapatemp->symbolsetfilename); | |
| 668 | + else{ | |
| 669 | + $novoss = dirname($this->mapa->symbolsetfilename)."/".basename($mapatemp->symbolsetfilename); | |
| 670 | 670 | } |
| 671 | + | |
| 671 | 672 | $this->mapa->setsymbolset($novoss); |
| 673 | + | |
| 672 | 674 | $ns = $this->mapa->getnumsymbols(); |
| 673 | - for ($i=0;$i < $ns;++$i) | |
| 674 | - { | |
| 675 | + $inis = 0; | |
| 676 | + | |
| 677 | + //na versao 7 nao tem o simbolo 0 | |
| 678 | + if($this->v >= 7){ | |
| 679 | + $inis = 1; | |
| 680 | + //se for versao 7 inclui um primeiro simbolo com valor 0 e imagem | |
| 681 | + $oSymbol = $this->mapa->getSymbolObjectById(1); | |
| 682 | + $adiciona = ms_newLayerObj($this->mapa, $l); | |
| 683 | + $nomel = $l->name; | |
| 684 | + $tematemp= $this->mapa->getlayerbyname($nomel); | |
| 685 | + $c = $tematemp->getClass(0); | |
| 686 | + $e = $c->getstyle(0); | |
| 687 | + $e->set("size",1); | |
| 688 | + $e->set("width",1); | |
| 689 | + $ico = $c->createLegendIcon(40,40); | |
| 690 | + $nimg = $ico->saveWebImage(); | |
| 691 | + $pat = $this->mapa->web->imageurl; | |
| 692 | + $ins .= "<img src='".$nimg."' style='cursor:pointer;border: 5px solid #FFFFFF' title='0' onclick='".$onclick."'>"; | |
| 693 | + } | |
| 694 | + for ($i=$inis;$i < $ns;++$i){ | |
| 675 | 695 | $oSymbol = $this->mapa->getSymbolObjectById($i); |
| 676 | - | |
| 677 | 696 | $nomes = $oSymbol->name; |
| 678 | - if($nomes == "") | |
| 679 | - { | |
| 697 | + if($nomes == ""){ | |
| 680 | 698 | $nomes = $i; |
| 681 | 699 | } |
| 682 | - | |
| 683 | 700 | $adiciona = ms_newLayerObj($this->mapa, $l); |
| 684 | 701 | $nomel = $l->name; |
| 685 | 702 | $tematemp= $this->mapa->getlayerbyname($nomel); |
| ... | ... | @@ -688,11 +705,8 @@ class Legenda |
| 688 | 705 | $e->set("symbolname",$nomes); |
| 689 | 706 | $e->set("size",$tamanho); |
| 690 | 707 | $e->set("width",$width); |
| 691 | - | |
| 692 | 708 | $ico = $c->createLegendIcon(40,40); |
| 693 | - | |
| 694 | 709 | $nimg = $ico->saveWebImage(); |
| 695 | - | |
| 696 | 710 | $pat = $this->mapa->web->imageurl; |
| 697 | 711 | $ins .= "<img src='".$nimg."' style='cursor:pointer;border: 5px solid #FFFFFF' title=".$nomes." onclick='".$onclick."'>"; |
| 698 | 712 | } |
| ... | ... | @@ -701,8 +715,7 @@ class Legenda |
| 701 | 715 | //copy ($dir."/simbolos".$tipo.".inc",$dir_tmp."/comum/simbolos".$tipo.".inc"); |
| 702 | 716 | return $ins; |
| 703 | 717 | } |
| 704 | - else | |
| 705 | - { | |
| 718 | + else { | |
| 706 | 719 | $res = ""; |
| 707 | 720 | include_once $dir."/simbolos".$tipo.".inc"; |
| 708 | 721 | return $res; |
| ... | ... | @@ -728,8 +741,7 @@ class Legenda |
| 728 | 741 | $tipoLayer = $this->layer->type; |
| 729 | 742 | $classe = $this->layer->getclass($classe); |
| 730 | 743 | $numestilos = $classe->numstyles; |
| 731 | - for ($i=0;$i<$numestilos;++$i) | |
| 732 | - { | |
| 744 | + for ($i=0;$i<$numestilos;++$i){ | |
| 733 | 745 | $linha = array(); |
| 734 | 746 | $estilo = $classe->getstyle($i); |
| 735 | 747 | $linha[] = $i; |
| ... | ... | @@ -739,7 +751,7 @@ class Legenda |
| 739 | 751 | $linha[] = $estilo->symbolname; |
| 740 | 752 | $linha[] = $estilo->size; |
| 741 | 753 | $linha[] = $estilo->opacity; |
| 742 | - if($this->v == 6){ | |
| 754 | + if($this->v >= 6){ | |
| 743 | 755 | $linha[] = $estilo->width; |
| 744 | 756 | $s = $estilo->symbol; |
| 745 | 757 | $linha[] = implode(" ",$s->getPatternArray); |
| ... | ... | @@ -832,11 +844,11 @@ class Legenda |
| 832 | 844 | { |
| 833 | 845 | $estilo->set("size",$size); |
| 834 | 846 | } |
| 835 | - if ((isset ($width)) && ($width != "-1") && ($this->v == 6)) | |
| 847 | + if ((isset ($width)) && ($width != "-1") && ($this->v >= 6)) | |
| 836 | 848 | { |
| 837 | 849 | $estilo->set("width",$width); |
| 838 | 850 | } |
| 839 | - if ((isset ($pattern)) && ($pattern != "-1") && ($this->v == 6) && ($pattern != "")) | |
| 851 | + if ((isset ($pattern)) && ($pattern != "-1") && ($this->v >= 6) && ($pattern != "")) | |
| 840 | 852 | { |
| 841 | 853 | $estilo->updatefromstring("STYLE PATTERN ".$pattern." END"); |
| 842 | 854 | } |
| ... | ... | @@ -1054,7 +1066,7 @@ class Legenda |
| 1054 | 1066 | case "pattern": |
| 1055 | 1067 | if(!empty($pattern)){ |
| 1056 | 1068 | $pattern = str_replace(","," ",$valor); |
| 1057 | - if ($this->v == 6){ | |
| 1069 | + if ($this->v >= 6){ | |
| 1058 | 1070 | $estilo->updatefromstring("STYLE PATTERN ".$valor." END"); |
| 1059 | 1071 | } |
| 1060 | 1072 | } | ... | ... |
classesphp/classe_selecao.php
| ... | ... | @@ -276,7 +276,7 @@ $buffer - Opcional |
| 276 | 276 | $res_count = $layero->getNumresults(); |
| 277 | 277 | for ($i = 0; $i < $res_count; ++$i) |
| 278 | 278 | { |
| 279 | - if($this->v == 6) | |
| 279 | + if($this->v >= 6) | |
| 280 | 280 | {$sh = $layero->getShape($layero->getResult($i));} |
| 281 | 281 | else{ |
| 282 | 282 | $result = $layero->getResult($i); |
| ... | ... | @@ -339,7 +339,7 @@ $buffer - Opcional |
| 339 | 339 | $conta = $layero->getNumresults(); |
| 340 | 340 | for ($k = 0; $k < $conta; $k++) |
| 341 | 341 | { |
| 342 | - if($this->v == 6) | |
| 342 | + if($this->v >= 6) | |
| 343 | 343 | {$s = @$layero->getShape($layero->getResult($k));} |
| 344 | 344 | else |
| 345 | 345 | {$s = @$layero->getfeature($k,-1);} | ... | ... |
classesphp/classe_shp.php
| ... | ... | @@ -438,7 +438,7 @@ array("layerprj"=>$xylayer,"mapprj"=>$xymapa) |
| 438 | 438 | $sopen = $this->layer->open(); |
| 439 | 439 | if($sopen == MS_FAILURE){return "erro";} |
| 440 | 440 | $xy = array(); |
| 441 | - if($this->v == 6) | |
| 441 | + if($this->v >= 6) | |
| 442 | 442 | {$shape = $this->layer->getShape($this->layer->getshape(new resultObj($res_count - 1)));} |
| 443 | 443 | else{ |
| 444 | 444 | $result = $this->layer->getResult($res_count - 1); | ... | ... |
classesphp/mapa_openlayers.php
| ... | ... | @@ -59,9 +59,9 @@ Arquivo: |
| 59 | 59 | i3geo/classesphp/mapa_openlayers.php |
| 60 | 60 | |
| 61 | 61 | */ |
| 62 | + | |
| 62 | 63 | error_reporting(0); |
| 63 | 64 | inicializa(); |
| 64 | - | |
| 65 | 65 | // |
| 66 | 66 | //calcula a extensao geografica com base no x,y,z |
| 67 | 67 | //nos casos do modo notile, a requisicao e feita como se fosse um wms |
| ... | ... | @@ -145,7 +145,6 @@ if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getf |
| 145 | 145 | if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ |
| 146 | 146 | carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"],$_SESSION["i3georendermode"]); |
| 147 | 147 | } |
| 148 | - | |
| 149 | 148 | // |
| 150 | 149 | //map_fileX e para o caso register_globals = On no PHP.INI |
| 151 | 150 | // |
| ... | ... | @@ -244,7 +243,6 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alter |
| 244 | 243 | } |
| 245 | 244 | } |
| 246 | 245 | } |
| 247 | - | |
| 248 | 246 | if (!function_exists('imagepng')){ |
| 249 | 247 | $_GET["TIPOIMAGEM"] = ""; |
| 250 | 248 | } |
| ... | ... | @@ -562,6 +560,9 @@ function inicializa(){ |
| 562 | 560 | ilegal(); |
| 563 | 561 | } |
| 564 | 562 | session_start(); |
| 563 | + if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ | |
| 564 | + return; | |
| 565 | + } | |
| 565 | 566 | if(@$_SESSION["fingerprint"]){ |
| 566 | 567 | $f = explode(",",$_SESSION["fingerprint"]); |
| 567 | 568 | if (md5('I3GEOSEC' . $_SERVER['HTTP_USER_AGENT'] . session_id()) != $f[0] && !in_array($_GET["telaR"],$f) ) | ... | ... |
classesphp/proxy.php
| ... | ... | @@ -7,12 +7,22 @@ if(!$ch){ |
| 7 | 7 | echo "erro curl_init"; |
| 8 | 8 | exit; |
| 9 | 9 | } |
| 10 | -curl_setopt($ch, CURLOPT_URL, $_GET["url"]); | |
| 10 | +if($_GET["url"]){ | |
| 11 | + curl_setopt($ch, CURLOPT_URL, $_GET["url"]); | |
| 12 | +} | |
| 13 | +else{ | |
| 14 | + curl_setopt($ch, CURLOPT_URL, $_SERVER["QUERY_STRING"]); | |
| 15 | +} | |
| 11 | 16 | curl_setopt($ch, CURLOPT_HEADER, 0); |
| 12 | 17 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 13 | 18 | if(isset($i3geo_proxy_server) && $i3geo_proxy_server != ""){ |
| 14 | 19 | curl_setopt($ch, CURLOPT_PROXY, $i3geo_proxy_server); |
| 15 | 20 | } |
| 16 | 21 | $resultado = curl_exec($ch); |
| 17 | -echo $resultado; | |
| 22 | +if($_GET["tipoRetornoProxy"] == "string"){ | |
| 23 | + echo '"'.$resultado.'"'; | |
| 24 | +} | |
| 25 | +else{ | |
| 26 | + echo $resultado; | |
| 27 | +} | |
| 18 | 28 | ?> |
| 19 | 29 | \ No newline at end of file | ... | ... |