From 04fe92c1915fcc4cd717c158093d919650ac0c17 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 19 Sep 2011 20:47:42 +0000 Subject: [PATCH] Conclusão da integração com o TME --- admin/admin.db | Bin 75776 -> 0 bytes pacotes/tme/TME_Engine.php | 7 ++++++- pacotes/tme/TME_i3geo.php | 1 + pacotes/tme/TME_i3geo_DataConnector.php | 14 ++++++++++---- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 0b70e36..3fe8ae6 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/pacotes/tme/TME_Engine.php b/pacotes/tme/TME_Engine.php index 86454bc..ad55463 100644 --- a/pacotes/tme/TME_Engine.php +++ b/pacotes/tme/TME_Engine.php @@ -388,7 +388,8 @@ class ThematicMap // Add timespan if time animation if ($this->timeType == 'slider') { - $end = ''; + + $end = ''; // Check if there is more years if (array_key_exists($key+1, $this->yearArray)) { $end = '' . intval($this->yearArray[$key+1]-1) . '-12-31'; @@ -396,12 +397,16 @@ class ThematicMap $kmlFolder .= " " . PHP_EOL . " $year-01-01$end" . PHP_EOL . " " . PHP_EOL; + } // Loop thorough all features (values without features will not be shown) foreach ($this->dataStore['features'] as $featureID => $feature) { $name = $feature['name']; + //if (!mb_detect_encoding($name,"UTF-8",true)) + //{$name = mb_convert_encoding($name,"UTF-8","ISO-8859-1");} + $name = ""; $value = ''; // use null? $valueText = 'no data'; $valueLabel = ''; diff --git a/pacotes/tme/TME_i3geo.php b/pacotes/tme/TME_i3geo.php index 49fbcf1..4c769fa 100644 --- a/pacotes/tme/TME_i3geo.php +++ b/pacotes/tme/TME_i3geo.php @@ -58,6 +58,7 @@ $map = new ThematicMap($dataStore, $parameters); $file = $map->getKML($dataConnector->url); if(!function_exists("cpjson")) {require("../../classesphp/funcoes_gerais.php");} + cpjson(array('url' => $file)); //echo "

$file"; diff --git a/pacotes/tme/TME_i3geo_DataConnector.php b/pacotes/tme/TME_i3geo_DataConnector.php index 1d8db07..d6ed1d4 100644 --- a/pacotes/tme/TME_i3geo_DataConnector.php +++ b/pacotes/tme/TME_i3geo_DataConnector.php @@ -171,10 +171,16 @@ class DataConnector ); //[0] é o ano foreach($colunasvalor as $colunavalor){ - $valor = number_format($shape->values[$colunavalor], 2, '.', ''); - $dataStore['indicators']['valores']['values'][$colunavalor][$i] = $valor; - $indicatorYears[$colunavalor] = $colunavalor; - $todosV[] = $valor; + $valor = $shape->values[$colunavalor]; + + settype($valor,"float"); + //echo $valor; + if(is_numeric($valor)){ + $valor = number_format($valor, 2, '.', ''); + $dataStore['indicators']['valores']['values'][$colunavalor][$i] = $valor; + $indicatorYears[$colunavalor] = $colunavalor; + $todosV[] = $valor; + } } } $fechou = $layer->close(); -- libgit2 0.21.2