Commit 0b99eec41b44bd5b18f26db6d52fb87c7ed265f2

Authored by Edmar Moretti
1 parent 3c414ef7

Adaptação da ferramenta de escolha do tipo de imagem para a interface openlayers

classesphp/mapa_openlayers.php
... ... @@ -60,6 +60,7 @@ if($qy)
60 60 {$mapa->loadquery($qyfile);}
61 61  
62 62 $layersNames = $mapa->getalllayernames();
  63 +$fundo = true;
63 64 foreach ($layersNames as $layerName)
64 65 {
65 66 $l = $mapa->getLayerByname($layerName);
... ... @@ -71,7 +72,10 @@ foreach ($layersNames as $layerName)
71 72 if($layerName != $_GET["layer"])
72 73 {$l->set("status",MS_OFF);}
73 74 if($layerName == $_GET["layer"] || $l->group == $_GET["layer"] && $l->group != "")
74   - {$l->set("status",MS_DEFAULT);}
  75 + {
  76 + $l->set("status",MS_DEFAULT);
  77 + $fundo = false;
  78 + }
75 79 $l->set("template","none.htm");
76 80 }
77 81 $map_size = explode(" ",$_GET["map_size"]);
... ... @@ -82,6 +86,11 @@ $mapa->setExtent($mapext[0],$mapext[1],$mapext[2],$mapext[3]);
82 86  
83 87 $o = $mapa->outputformat;
84 88 $o->set("imagemode",MS_IMAGEMODE_RGBA);
  89 +//
  90 +//não se aplica nos mapas que não desenham layers
  91 +//
  92 +if($fundo == false)
  93 +{$o->set("transparent",MS_TRUE);}
85 94  
86 95 if(!$qy)
87 96 {$img = $mapa->draw();}
... ...
ferramentas/outputformat/index.js.php
... ... @@ -129,8 +129,12 @@ i3GEOF.outputformat = {
129 129 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=mudaOutputFormat&tipo="+tipo,
130 130 temp = function(retorno){
131 131 i3GEOF.outputformat.aguarde.visibility = "hidden";
132   - if(retorno.data != "erro")
133   - {i3GEO.atualiza();}
  132 + if(retorno.data != "erro"){
  133 + if(i3GEO.Interface.ATUAL === "openlayers")
  134 + {i3GEO.Interface.openlayers.atualizaMapa();}
  135 + else
  136 + {i3GEO.atualiza();}
  137 + }
134 138 else
135 139 {alert("Nao foi possivel alterar o tipo");}
136 140 };
... ...