Commit 1e641cb9d056ef61c5c459b7ec87a3a8db68b0d1

Authored by Edmar Moretti
1 parent fccde65f
Exists in master

Correção na montagem dos mapas no saiku

Showing 1 changed file with 16 additions and 6 deletions   Show diff stats
ferramentas/saiku/cartograma.php
... ... @@ -121,6 +121,8 @@ else{
121 121 $nlayers = $mapa->numlayers;
122 122 for($i=0;$i<$nlayers;$i++){
123 123 $ll = $mapa->getlayer($i);
  124 + $ll->set("status",MS_DELETE);
  125 + /*
124 126 if($ll->getmetadata("SAIKU") == $opcoes["tipo"]){
125 127 $ll->set("status",MS_DELETE);
126 128 }
... ... @@ -129,6 +131,7 @@ else{
129 131 $ll->set("status",MS_OFF);
130 132 }
131 133 }
  134 + */
132 135 if($ll->getmetadata("tema") == "Limites"){
133 136 $ll->set("status",MS_DELETE);
134 137 }
... ... @@ -149,13 +152,19 @@ else{
149 152 $l[] = ' TEMPLATE "none.htm"';
150 153 $l[] = ' STATUS DEFAULT';
151 154 $l[] = ' METADATA';
152   - $l[] = ' TEMA "'.$titulolayer.' - '.$nomesColunas[1].' - '.$opcoes["tipo"].'"';
  155 + if($opcoes["tipo"] == "mapaBarras" || $opcoes["tipo"] == "mapaPizzas"){
  156 + $l[] = ' TEMA "'.$titulolayer.' - '.$opcoes["tipo"].'"';
  157 + }
  158 + else{
  159 + $l[] = ' TEMA "'.$titulolayer.' - '.$metadataItens[1].' - '.$opcoes["tipo"].'"';
  160 + }
153 161 $l[] = ' CLASSE "SIM"';
154 162 $l[] = ' SAIKU "'.$opcoes["tipo"].'"';
155 163 $l[] = ' TIP "'.$meta["colunanomeregiao"].','.implode(',',$nomesColunas).'"';
156 164 $l[] = ' ITENSDESC "'.$meta["colunanomeregiao"].','.implode(',',$metadataItens).'"';
157 165 $l[] = ' ITENS "'.$meta["colunanomeregiao"].','.implode(',',$nomesColunas).'"';
158 166 $l[] = ' METAESTAT_CODIGO_TIPO_REGIAO "'.$codigo_tipo_regiao.'"';
  167 + $l[] = ' TILES "NAO"';
159 168 $l[] = ' END ';
160 169  
161 170 $l = implode(PHP_EOL,$l);
... ... @@ -174,12 +183,12 @@ else{
174 183 if($opcoes["tipo"] == "mapaBarras"){
175 184 $l .= PHP_EOL.' PROCESSING "CHART_SIZE='.$opcoes["size"].' '.$opcoes["size"].'"';
176 185 $l .= PHP_EOL.' PROCESSING "CHART_TYPE=bar"';
177   - $l .= implode(PHP_EOL,mapaBarras($nomesColunas));
  186 + $l .= implode(PHP_EOL,mapaBarras($nomesColunas,$metadataItens));
178 187 }
179 188 if($opcoes["tipo"] == "mapaPizzas"){
180 189 $l .= PHP_EOL.' PROCESSING "CHART_SIZE='.$opcoes["size"].' '.$opcoes["size"].'"';
181 190 $l .= PHP_EOL.' PROCESSING "CHART_TYPE=pie"';
182   - $l .= implode(PHP_EOL,mapaBarras($nomesColunas));
  191 + $l .= implode(PHP_EOL,mapaBarras($nomesColunas,$metadataItens));
183 192 }
184 193 $l .= PHP_EOL.'END';
185 194  
... ... @@ -203,7 +212,8 @@ else{
203 212 $l[] = ' TEMA "Limites"';
204 213 $l[] = ' CLASSE "SIM"';
205 214 $l[] = ' SAIKU "'.$opcoes["tipo"].'"';
206   - $l[] = ' METAESTAT_CODIGO_TIPO_REGIAO "'.$codigo_tipo_regiao.'"';
  215 + $l[] = ' METAESTAT_CODIGO_TIPO_REGIAO "'.$codigo_tipo_regiao.'"';
  216 + $l[] = ' TILES "NAO"';
207 217 $l[] = ' END ';
208 218 $l[] = ' CLASS ';
209 219 $l[] = ' OUTLINECOLOR 255 255 255 ';
... ... @@ -235,7 +245,7 @@ else{
235 245  
236 246 header("Location:".$opcoes["locaplic"]."/mashups/openlayers.php?temas=".$map_file."&DESLIGACACHE=sim&botoes=legenda,pan,zoombox,zoomtot,zoomin,zoomout,distancia,area,identifica&controles=navigation,layerswitcher,scaleline,mouseposition,overviewmap,keyboarddefaults&tiles=false&mapext=".$opcoes["mapext"]);
237 247  
238   -function mapaBarras($colunas){
  248 +function mapaBarras($colunas,$metadataItens){
239 249 global $opcoes;
240 250 //$opcoes["coreshex"] = array_reverse($opcoes["coreshex"]);
241 251 //$valores = retornaDadosColuna($coluna);
... ... @@ -245,7 +255,7 @@ function mapaBarras($colunas){
245 255 $classes = array();
246 256 for($i=1;$i<$nclasses;$i++){
247 257 $classes[] = PHP_EOL.'CLASS';
248   - $classes[] = ' NAME "'.$colunas[$i].'"';
  258 + $classes[] = ' NAME "'.$metadataItens[$i].'"';
249 259 $classes[] = ' STYLE';
250 260 $cor = $opcoes["outlinecolor"];
251 261 $classes[] = ' OUTLINECOLOR '.$cor["red"].' '.$cor["green"].' '.$cor["blue"];
... ...