Commit 5179238e38cb7f2c79628cd2b6fc3e3d2b0ae756
1 parent
4a92d8f9
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
35 additions
and
4 deletions
Show diff stats
classesphp/classe_legenda.php
... | ... | @@ -92,7 +92,13 @@ class Legenda |
92 | 92 | |
93 | 93 | Localização da aplicação |
94 | 94 | */ |
95 | - protected $localaplicacao; | |
95 | + protected $localaplicacao; | |
96 | + /* | |
97 | + Variavel: $v | |
98 | + | |
99 | + Versão atual do Mapserver (primeiro dígito) | |
100 | + */ | |
101 | + public $v; | |
96 | 102 | /* |
97 | 103 | Function: __construct |
98 | 104 | |
... | ... | @@ -116,6 +122,8 @@ $template - nome do template para processar a legenda |
116 | 122 | include_once($locaplic."/funcoes_gerais.php"); |
117 | 123 | else |
118 | 124 | include_once("funcoes_gerais.php"); |
125 | + $this->v = versao(); | |
126 | + $this->v = $this->v["principal"]; | |
119 | 127 | $this->localaplicacao = $locaplic; |
120 | 128 | if($map_file == "") |
121 | 129 | {return;} |
... | ... | @@ -438,6 +446,7 @@ Exclui um estilo de uma classe. |
438 | 446 | $classe = $this->layer->getclass($classe); |
439 | 447 | $classe->deletestyle($estilo); |
440 | 448 | $this->layer->removeMetaData("cache"); |
449 | + return "ok"; | |
441 | 450 | } |
442 | 451 | /* |
443 | 452 | function: adicionaEstilo |
... | ... | @@ -610,6 +619,15 @@ string com o tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbo |
610 | 619 | $linha[] = $estilo->symbolname; |
611 | 620 | $linha[] = $estilo->size; |
612 | 621 | $linha[] = $estilo->opacity; |
622 | + if($this->v == 6){ | |
623 | + $linha[] = $estilo->width; | |
624 | + $s = $estilo->symbol; | |
625 | + $linha[] = implode(" ",$s->getPatternArray); | |
626 | + } | |
627 | + else{ | |
628 | + $linha[] = ""; | |
629 | + $linha[] = ""; | |
630 | + } | |
613 | 631 | $linhas[] = $tipoLayer."#".implode("#",$linha); |
614 | 632 | } |
615 | 633 | //retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size |
... | ... | @@ -638,11 +656,20 @@ $size - Tamanho que será aplicado ao símbolo. |
638 | 656 | |
639 | 657 | $opacidade - Opacidade |
640 | 658 | */ |
641 | - function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade) | |
659 | + function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern) | |
642 | 660 | { |
643 | 661 | if(!$this->layer){return "erro";} |
662 | + if(!empty($pattern)) | |
663 | + {$pattern = str_replace(","," ",$pattern);} | |
644 | 664 | $classe = $this->layer->getclass($classe); |
645 | - $estilo = $classe->getstyle($estilo); | |
665 | + //isso é necessário pq o mapserver não consegue apagar o nome de um estilo | |
666 | + if(isset($symbolname) && ($symbolname == "" || $symbolname == "0")){ | |
667 | + $classe->deletestyle($estilo); | |
668 | + $estilo = ms_newStyleObj($classe); | |
669 | + } | |
670 | + else{ | |
671 | + $estilo = $classe->getstyle($estilo); | |
672 | + } | |
646 | 673 | if (isset($outlinecolor)) |
647 | 674 | { |
648 | 675 | $cor = $estilo->outlinecolor; |
... | ... | @@ -661,7 +688,7 @@ $opacidade - Opacidade |
661 | 688 | $nc = explode(",",$color); |
662 | 689 | $cor->setRGB($nc[0],$nc[1],$nc[2]); |
663 | 690 | } |
664 | - if ((isset($symbolname)) && ($symbolname != "")) | |
691 | + if((isset($symbolname)) && ($symbolname != "")) | |
665 | 692 | { |
666 | 693 | if(is_numeric($symbolname)) |
667 | 694 | {$estilo->set("symbol",$symbolname);} |
... | ... | @@ -670,6 +697,10 @@ $opacidade - Opacidade |
670 | 697 | } |
671 | 698 | if ((isset ($size)) && ($size != "-1")) |
672 | 699 | {$estilo->set("size",$size);} |
700 | + if ((isset ($width)) && ($width != "-1") && ($this->v == 6)) | |
701 | + {$estilo->set("width",$width);} | |
702 | + if ((isset ($pattern)) && ($pattern != "-1") && ($this->v == 6)) | |
703 | + {$estilo->updatefromstring("STYLE PATTERN ".$pattern." END");} | |
673 | 704 | if(isset($opacidade)) |
674 | 705 | {$estilo->set("opacity",$opacidade);} |
675 | 706 | if ($this->layer->getmetadata("sld") != "") | ... | ... |