Commit 1ae105484af9c23e2974147159695ca897ca2621

Authored by Edmar Moretti
1 parent 2ff6fb2a

Adaptações para versão 7 do Mapserver

aplicmap/geral1debianv7.map
... ... @@ -18,7 +18,7 @@ MAP
18 18 #edite os caminhos caso a aplicacao esteja instalada em um local diferente do default
19 19 #
20 20 FONTSET "/var/www/i3geo/symbols/fontes.txt"
21   - SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym"
  21 + SYMBOLSET "/var/www/i3geo/symbols/simbolosv7.sym"
22 22 SHAPEPATH "/var/www/geodados"
23 23 IMAGECOLOR 104 171 195
24 24 MAXSIZE 4096
... ...
aplicmap/simpolv7.map
1 1 MAP
2   -SYMBOLSET ../symbols/simbolospolv6.sym
  2 +SYMBOLSET ../symbols/simbolospolv7.sym
3 3 FONTSET "../symbols/fontes.txt"
4 4 DEBUG OFF
5 5 #DEBUG 5
... ...
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&atilde;o geogr&aacute;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(&quot;layerprj&quot;=&gt;$xylayer,&quot;mapprj&quot;=&gt;$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);
... ...