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,6 +121,8 @@ else{
121 $nlayers = $mapa->numlayers; 121 $nlayers = $mapa->numlayers;
122 for($i=0;$i<$nlayers;$i++){ 122 for($i=0;$i<$nlayers;$i++){
123 $ll = $mapa->getlayer($i); 123 $ll = $mapa->getlayer($i);
  124 + $ll->set("status",MS_DELETE);
  125 + /*
124 if($ll->getmetadata("SAIKU") == $opcoes["tipo"]){ 126 if($ll->getmetadata("SAIKU") == $opcoes["tipo"]){
125 $ll->set("status",MS_DELETE); 127 $ll->set("status",MS_DELETE);
126 } 128 }
@@ -129,6 +131,7 @@ else{ @@ -129,6 +131,7 @@ else{
129 $ll->set("status",MS_OFF); 131 $ll->set("status",MS_OFF);
130 } 132 }
131 } 133 }
  134 + */
132 if($ll->getmetadata("tema") == "Limites"){ 135 if($ll->getmetadata("tema") == "Limites"){
133 $ll->set("status",MS_DELETE); 136 $ll->set("status",MS_DELETE);
134 } 137 }
@@ -149,13 +152,19 @@ else{ @@ -149,13 +152,19 @@ else{
149 $l[] = ' TEMPLATE "none.htm"'; 152 $l[] = ' TEMPLATE "none.htm"';
150 $l[] = ' STATUS DEFAULT'; 153 $l[] = ' STATUS DEFAULT';
151 $l[] = ' METADATA'; 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 $l[] = ' CLASSE "SIM"'; 161 $l[] = ' CLASSE "SIM"';
154 $l[] = ' SAIKU "'.$opcoes["tipo"].'"'; 162 $l[] = ' SAIKU "'.$opcoes["tipo"].'"';
155 $l[] = ' TIP "'.$meta["colunanomeregiao"].','.implode(',',$nomesColunas).'"'; 163 $l[] = ' TIP "'.$meta["colunanomeregiao"].','.implode(',',$nomesColunas).'"';
156 $l[] = ' ITENSDESC "'.$meta["colunanomeregiao"].','.implode(',',$metadataItens).'"'; 164 $l[] = ' ITENSDESC "'.$meta["colunanomeregiao"].','.implode(',',$metadataItens).'"';
157 $l[] = ' ITENS "'.$meta["colunanomeregiao"].','.implode(',',$nomesColunas).'"'; 165 $l[] = ' ITENS "'.$meta["colunanomeregiao"].','.implode(',',$nomesColunas).'"';
158 $l[] = ' METAESTAT_CODIGO_TIPO_REGIAO "'.$codigo_tipo_regiao.'"'; 166 $l[] = ' METAESTAT_CODIGO_TIPO_REGIAO "'.$codigo_tipo_regiao.'"';
  167 + $l[] = ' TILES "NAO"';
159 $l[] = ' END '; 168 $l[] = ' END ';
160 169
161 $l = implode(PHP_EOL,$l); 170 $l = implode(PHP_EOL,$l);
@@ -174,12 +183,12 @@ else{ @@ -174,12 +183,12 @@ else{
174 if($opcoes["tipo"] == "mapaBarras"){ 183 if($opcoes["tipo"] == "mapaBarras"){
175 $l .= PHP_EOL.' PROCESSING "CHART_SIZE='.$opcoes["size"].' '.$opcoes["size"].'"'; 184 $l .= PHP_EOL.' PROCESSING "CHART_SIZE='.$opcoes["size"].' '.$opcoes["size"].'"';
176 $l .= PHP_EOL.' PROCESSING "CHART_TYPE=bar"'; 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 if($opcoes["tipo"] == "mapaPizzas"){ 188 if($opcoes["tipo"] == "mapaPizzas"){
180 $l .= PHP_EOL.' PROCESSING "CHART_SIZE='.$opcoes["size"].' '.$opcoes["size"].'"'; 189 $l .= PHP_EOL.' PROCESSING "CHART_SIZE='.$opcoes["size"].' '.$opcoes["size"].'"';
181 $l .= PHP_EOL.' PROCESSING "CHART_TYPE=pie"'; 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 $l .= PHP_EOL.'END'; 193 $l .= PHP_EOL.'END';
185 194
@@ -203,7 +212,8 @@ else{ @@ -203,7 +212,8 @@ else{
203 $l[] = ' TEMA "Limites"'; 212 $l[] = ' TEMA "Limites"';
204 $l[] = ' CLASSE "SIM"'; 213 $l[] = ' CLASSE "SIM"';
205 $l[] = ' SAIKU "'.$opcoes["tipo"].'"'; 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 $l[] = ' END '; 217 $l[] = ' END ';
208 $l[] = ' CLASS '; 218 $l[] = ' CLASS ';
209 $l[] = ' OUTLINECOLOR 255 255 255 '; 219 $l[] = ' OUTLINECOLOR 255 255 255 ';
@@ -235,7 +245,7 @@ else{ @@ -235,7 +245,7 @@ else{
235 245
236 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"]); 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 global $opcoes; 249 global $opcoes;
240 //$opcoes["coreshex"] = array_reverse($opcoes["coreshex"]); 250 //$opcoes["coreshex"] = array_reverse($opcoes["coreshex"]);
241 //$valores = retornaDadosColuna($coluna); 251 //$valores = retornaDadosColuna($coluna);
@@ -245,7 +255,7 @@ function mapaBarras($colunas){ @@ -245,7 +255,7 @@ function mapaBarras($colunas){
245 $classes = array(); 255 $classes = array();
246 for($i=1;$i<$nclasses;$i++){ 256 for($i=1;$i<$nclasses;$i++){
247 $classes[] = PHP_EOL.'CLASS'; 257 $classes[] = PHP_EOL.'CLASS';
248 - $classes[] = ' NAME "'.$colunas[$i].'"'; 258 + $classes[] = ' NAME "'.$metadataItens[$i].'"';
249 $classes[] = ' STYLE'; 259 $classes[] = ' STYLE';
250 $cor = $opcoes["outlinecolor"]; 260 $cor = $opcoes["outlinecolor"];
251 $classes[] = ' OUTLINECOLOR '.$cor["red"].' '.$cor["green"].' '.$cor["blue"]; 261 $classes[] = ' OUTLINECOLOR '.$cor["red"].' '.$cor["green"].' '.$cor["blue"];