Commit 7702d538abebef368ddc8faccc065933ef8fcc0a
1 parent
e2ffa59e
Exists in
master
and in
7 other branches
--no commit message
Showing
4 changed files
with
34 additions
and
18 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_alteraclasse.php
@@ -665,7 +665,7 @@ Calcula o tamanho dos estilos das classes, alterando o tamanho do símbolo. | @@ -665,7 +665,7 @@ Calcula o tamanho dos estilos das classes, alterando o tamanho do símbolo. | ||
665 | return("ok"); | 665 | return("ok"); |
666 | } | 666 | } |
667 | /* | 667 | /* |
668 | -function: inverteStatusClasse | 668 | +function: statusClasse |
669 | 669 | ||
670 | Inverte o status a uma classe desligando ou desligando, conforme o status atual. | 670 | Inverte o status a uma classe desligando ou desligando, conforme o status atual. |
671 | 671 | ||
@@ -676,13 +676,27 @@ $classe - id da classe | @@ -676,13 +676,27 @@ $classe - id da classe | ||
676 | */ | 676 | */ |
677 | function statusClasse($classe) | 677 | function statusClasse($classe) |
678 | { | 678 | { |
679 | + // | ||
680 | + //na versão 6 do Mapserver as classes não obedecem o OFF ou ON em arquivos RASTER. Foi necessário contornar o problema usando um metadata | ||
681 | + // | ||
679 | if(!$this->layer){return "erro";} | 682 | if(!$this->layer){return "erro";} |
680 | - $classe = $this->layer->getclass($classe); | ||
681 | - $status = $classe->status; | ||
682 | - if ($status == MS_OFF) | ||
683 | - {$classe->set("status",MS_ON);} | ||
684 | - else | ||
685 | - {$classe->set("status",MS_OFF);} | 683 | + $cl = $this->layer->getclass($classe); |
684 | + $status = $cl->status; | ||
685 | + echo $status; | ||
686 | + if ($status == MS_OFF){ | ||
687 | + $cl->set("status",MS_ON); | ||
688 | + if($this->layer->type == 3){ | ||
689 | + $e = $cl->getstyle(0); | ||
690 | + $e->set("opacity",100); | ||
691 | + } | ||
692 | + } | ||
693 | + else{ | ||
694 | + $cl->set("status",MS_OFF); | ||
695 | + if($this->layer->type == 3){ | ||
696 | + $e = $cl->getstyle(0); | ||
697 | + $e->set("opacity",0); | ||
698 | + } | ||
699 | + } | ||
686 | $this->layer->setMetaData("cache",""); | 700 | $this->layer->setMetaData("cache",""); |
687 | return("ok"); | 701 | return("ok"); |
688 | } | 702 | } |
classesphp/classe_atributos.php
@@ -242,16 +242,17 @@ Lista os itens de um tema. | @@ -242,16 +242,17 @@ Lista os itens de um tema. | ||
242 | foreach ($l as $tema) | 242 | foreach ($l as $tema) |
243 | { | 243 | { |
244 | $layer = $this->mapa->getlayerbyname($tema); | 244 | $layer = $this->mapa->getlayerbyname($tema); |
245 | + $layer->set("template","none.htm"); | ||
245 | //pega o nome correto do tema | 246 | //pega o nome correto do tema |
246 | $nometmp = pegaNome($layer,"UTF-8"); | 247 | $nometmp = pegaNome($layer,"UTF-8"); |
247 | $nomestemas[] = $nometmp; | 248 | $nomestemas[] = $nometmp; |
248 | if($layer->data != "" || $layer->connectiontype == 7) | 249 | if($layer->data != "" || $layer->connectiontype == 7) |
249 | { | 250 | { |
250 | - $items = pegaItens($layer,$this->mapa); | ||
251 | - foreach ($items as $item) | ||
252 | - { | ||
253 | - $lista[] = array("item"=>$item,"nome"=>$nometmp,"tema"=>$tema); | ||
254 | - } | 251 | + $items = pegaItens($layer,$this->mapa); |
252 | + foreach ($items as $item) | ||
253 | + { | ||
254 | + $lista[] = array("item"=>$item,"nome"=>$nometmp,"tema"=>$tema); | ||
255 | + } | ||
255 | } | 256 | } |
256 | } | 257 | } |
257 | return (array("valores"=>$lista,"temas"=>$l,"nomes"=>$nomestemas)); | 258 | return (array("valores"=>$lista,"temas"=>$l,"nomes"=>$nomestemas)); |
@@ -272,7 +273,7 @@ $tipo - Tipo de busca brasil|null | @@ -272,7 +273,7 @@ $tipo - Tipo de busca brasil|null | ||
272 | $this->layer->set("template","none.htm"); | 273 | $this->layer->set("template","none.htm"); |
273 | $this->layer->setfilter(""); | 274 | $this->layer->setfilter(""); |
274 | //le o arquivo de query se existir e checa se existe seleção para o tema | 275 | //le o arquivo de query se existir e checa se existe seleção para o tema |
275 | - $items = pegaItens($this->layer); | 276 | + $items = pegaItens($this->layer,$this->mapa); |
276 | 277 | ||
277 | $shapes = retornaShapesSelecionados($this->layer,$this->arquivo,$this->mapa); | 278 | $shapes = retornaShapesSelecionados($this->layer,$this->arquivo,$this->mapa); |
278 | if(count($shapes) == 0){ | 279 | if(count($shapes) == 0){ |
@@ -336,7 +337,7 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona | @@ -336,7 +337,7 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona | ||
336 | {return "erro. O tema não tem tabela";} | 337 | {return "erro. O tema não tem tabela";} |
337 | //pega os valores | 338 | //pega os valores |
338 | if ((!isset($itemtema)) || ($itemtema == "")) | 339 | if ((!isset($itemtema)) || ($itemtema == "")) |
339 | - {$items = pegaItens($this->layer);} | 340 | + {$items = pegaItens($this->layer,$this->mapa);} |
340 | else | 341 | else |
341 | {$items[] = $itemtema;} | 342 | {$items[] = $itemtema;} |
342 | $resultadoFinal[] = array("itens"=>$items); | 343 | $resultadoFinal[] = array("itens"=>$items); |
@@ -548,7 +549,7 @@ Include: | @@ -548,7 +549,7 @@ Include: | ||
548 | { | 549 | { |
549 | if(!$this->layer){return "erro";} | 550 | if(!$this->layer){return "erro";} |
550 | $this->layer->set("template","none.htm"); | 551 | $this->layer->set("template","none.htm"); |
551 | - $items = pegaItens($this->layer); | 552 | + $items = pegaItens($this->layer,$this->mapa); |
552 | $valores = array(); | 553 | $valores = array(); |
553 | $filtro = $this->layer->getfilterstring(); | 554 | $filtro = $this->layer->getfilterstring(); |
554 | if ($filtro != ""){$this->layer->setfilter("");} | 555 | if ($filtro != ""){$this->layer->setfilter("");} |
@@ -1271,14 +1272,13 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1271,14 +1272,13 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
1271 | $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo padrão do serviço","link"=>$res2,"img"=>""); | 1272 | $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo padrão do serviço","link"=>$res2,"img"=>""); |
1272 | return array($n); | 1273 | return array($n); |
1273 | } | 1274 | } |
1274 | - | ||
1275 | $itens = $layer->getmetadata("ITENS"); // itens | 1275 | $itens = $layer->getmetadata("ITENS"); // itens |
1276 | $itensdesc = $layer->getmetadata("ITENSDESC"); // descrição dos itens | 1276 | $itensdesc = $layer->getmetadata("ITENSDESC"); // descrição dos itens |
1277 | $lks = $layer->getmetadata("ITENSLINK"); // link dos itens | 1277 | $lks = $layer->getmetadata("ITENSLINK"); // link dos itens |
1278 | $itemimg = $layer->getmetadata("ITEMIMG"); //indica um item que será utilizado para colocar um ícone | 1278 | $itemimg = $layer->getmetadata("ITEMIMG"); //indica um item que será utilizado para colocar um ícone |
1279 | $locimg = $layer->getmetadata("IMGLOC"); //indica o local onde estão os ícones | 1279 | $locimg = $layer->getmetadata("IMGLOC"); //indica o local onde estão os ícones |
1280 | $tips = $layer->getmetadata("TIP"); | 1280 | $tips = $layer->getmetadata("TIP"); |
1281 | - $itensLayer = pegaItens($layer); | 1281 | + $itensLayer = pegaItens($layer,$mapa); |
1282 | $nitens = count($itensLayer); | 1282 | $nitens = count($itensLayer); |
1283 | if($itens == "") | 1283 | if($itens == "") |
1284 | {$itens = $itensLayer;} | 1284 | {$itens = $itensLayer;} |
classesphp/funcoes_gerais.php
@@ -1403,7 +1403,7 @@ function pegaItens($layer,$mapa="") | @@ -1403,7 +1403,7 @@ function pegaItens($layer,$mapa="") | ||
1403 | else{ | 1403 | else{ |
1404 | if($layer->type == MS_LAYER_RASTER && $mapa != ""){ | 1404 | if($layer->type == MS_LAYER_RASTER && $mapa != ""){ |
1405 | $pt = ms_newPointObj(); | 1405 | $pt = ms_newPointObj(); |
1406 | - $pt->setXY($mapa->extent->minx,$mapa->extent->miny); | 1406 | + $pt->setXY($mapa->extent->minx + (($mapa->extent->maxx - $mapa->extent->minx) / 2) ,$mapa->extent->miny + (($mapa->extent->maxy - $mapa->extent->miny) / 2)); |
1407 | $layer->queryByPoint($pt,0,0); | 1407 | $layer->queryByPoint($pt,0,0); |
1408 | } | 1408 | } |
1409 | $sopen = $layer->open(); | 1409 | $sopen = $layer->open(); |
@@ -1411,6 +1411,8 @@ function pegaItens($layer,$mapa="") | @@ -1411,6 +1411,8 @@ function pegaItens($layer,$mapa="") | ||
1411 | {$items = $layer->getItems();} | 1411 | {$items = $layer->getItems();} |
1412 | else | 1412 | else |
1413 | {$items = array();} | 1413 | {$items = array();} |
1414 | + if($layer->type == MS_LAYER_RASTER) | ||
1415 | + {$items[] = "pixel";} | ||
1414 | $layer->close(); | 1416 | $layer->close(); |
1415 | } | 1417 | } |
1416 | return $items; | 1418 | return $items; |