From c233b02c3fb70d2cc2eed6867c0b4b666d2be349 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 5 Nov 2012 23:11:27 +0000 Subject: [PATCH] Correções na ferramenta de geração de KML 3d (TME) --- admin/admin.db | Bin 152576 -> 0 bytes admin/js/core.js | 20 ++++++++++++++------ admin/js/editormapfile.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------------- admin/php/editormapfile.php | 42 +++++++++++++++++++++++++++++++++++------- classesjs/classe_gadgets.js | 2 +- classesjs/classe_janela.js | 15 ++++++++------- ferramentas/metaestat/index.js | 12 ++++++++---- ferramentas/tme/index.js | 11 +++++++---- pacotes/tme/TME_Engine.php | 64 +++++++++++++++++++++++++++++++++++++++------------------------- pacotes/tme/TME_i3geo.php | 33 ++++++++++++++++++++++----------- pacotes/tme/TME_i3geo_DataConnector.php | 8 +++++++- temas/bairros.map | 12 +++++++++--- 12 files changed, 202 insertions(+), 84 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index ed5cc64..5fea3b1 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/js/core.js b/admin/js/core.js index 7469c2f..a721107 100644 --- a/admin/js/core.js +++ b/admin/js/core.js @@ -953,7 +953,7 @@ function core_menuCheckBox(valores,textos,selecionados,target,record,key){ { label: "Cancel", value: "CANCEL", checked: false } ]); og_core.on("checkedButtonChange", on_menuCheckBoxChange); - YAHOO.admin.container.panelCK = new YAHOO.widget.Overlay("core_menuCK", { zindex:"100",close:false,underlay:false,width:"300px", height:"200px",overflow:"auto", visible:false,constraintoviewport:true } ); + YAHOO.admin.container.panelCK = new YAHOO.widget.Overlay("core_menuCK", { zindex:"100",close:false,underlay:false,width:"300px", height:"200px",overflow:"auto", visible:false,constraintoviewport:false } ); YAHOO.admin.container.panelCK.render(); } onde = $i("core_menuCK_bd"); @@ -1428,7 +1428,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal) }}} ); } - YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:true,close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); + YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:"contained",close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); YAHOO.admin.container.panelEditor.render(); } else @@ -1479,16 +1479,24 @@ function core_abreCor(janela,elemento) } function core_desativaforms(lista){ var n = lista.length, - i; + i,t; for (i=0;i"}, {ajuda:"Type of connection. Default is local.", titulo:"Connectiontype",id:"",value:"",div:"
",tipo:"text"}, {ajuda:"Aplica a conversão de caracteres nas ferramentas que obtém os dados descritivos referentes aos elementos do LAYER. Em alguns casos, a conversão pode provocar problemas de acentuação. Se isso ocorrer, na ferramenta tabela por exemplo, experimente marcar essa opção como 'nao'", @@ -1468,7 +1475,7 @@ function montaEditorDados(dados) {ajuda:"Name of the tileindex file or layer. A tileindex is similar to an ArcInfo library index. The tileindex contains polygon features for each tile. The item that contains the location of the tiled data is given using the TILEITEM parameter. When a file is used as the tileindex for shapefile or raster layers, the tileindex should be a shapefile. For CONNECTIONTYPE OGR layers, any OGR supported datasource can be a tileindex. Normally the location should contain the path to the tile file relative to the shapepath, not relative to the tileindex itself. If the DATA parameter contains a value then it is added to the end of the location. When a tileindex layer is used, it works similarly to directly referring to a file, but any supported feature source can be used (ie. postgres, oracle).NOTE: All files in the tileindex should have the same coordinate system, and for vector files the same set of attributes in the same order.", titulo:"tileindex",id:"tileindex",value:dados.tileindex,tipo:"text"}, {ajuda:"Tipo de representação das feições mostradas da camada. É importante definir esse parâmetro para que as funções de geração de SLD funcionem corretamente.", - titulo:"Tipo de representação (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"
"} + titulo:"Tipo de representação (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"
"} ] }; var ins = ""; @@ -1488,17 +1495,24 @@ function montaEditorDados(dados) ins += core_geraLinhas(param); ins += "


"; $i("editor_bd").innerHTML = ins; + + if($i("cMetaestat")){ + temp = ""; + $i("cMetaestat").innerHTML = temp; + } if($i("cCache")){ temp = ""; $i("cCache").innerHTML = temp; } - if($i("cTipooriginal")){ + if($i("cTipoOriginal")){ temp = ""; - $i("cTipooriginal").innerHTML = temp; + $i("cTipoOriginal").innerHTML = temp; } temp = "

' + '

' + 'Título que será mostrado no mapa'; ins += $inputText("","","i3GEOTMEtitulo","",48,"") + '

Descrição do mapa'; ins += $inputText("","","i3GEOTMEdesc","",48,"") + + '

Altura máxima das barras (em metros)'; + ins += $inputText("","","i3GEOTMEbarSize","",20,"50000") + + '

Largura máxima das barras (em metros)'; + ins += $inputText("","","i3GEOTMEmaxHeight","",20,"100") + '

Coluna que contém os nomes das regiões (exemplo: nomes dos Estados ou nomes dos municípios):' + '

' + '

' + '
Escolha uma ou mais colunas com os dados estatísticos que serão representados:' + '

' + '
' + - '' + '

Será criado um arquivo KML que pode ser aberto com o Google Earth. A coluna com os nomes das regiões define o nome que será mostrado para cada elemento mapeado. Quando os nomes das colunas com os valores corresponderem a um determinado ano, será mostrado um botão do tipo slide no Google Earth, mas isso só ocorre se o nome da coluna for o mesmo nome do ano, exemplo, para o ano de 1980 o nome da coluna deverá ser 1980

'; return ins; }, @@ -284,9 +288,8 @@ i3GEOF.tme = { var ins = "

Clique no arquivo para fazer o download:
"+retorno.data.url+"
"; ins += "
Ou clique para abrir no i3Geo:
interface Google Earth
"; $i("i3GEOTMEresultado").innerHTML = ins; - }; - p = i3GEO.configura.locaplic+"/pacotes/tme/TME_i3geo.php?sid="+i3GEO.configura.sid+"&nomelayer="+i3GEO.temaAtivo+"&colunasvalor="+lista.toString(",")+"&colunanomeregiao="+colunanomeregiao+"&titulo="+$i("i3GEOTMEtitulo").value+"&descricao="+$i("i3GEOTMEdesc").value; + p = i3GEO.configura.locaplic+"/pacotes/tme/TME_i3geo.php?maxHeight="+$i("i3GEOTMEmaxHeight").value+"&barSize="+$i("i3GEOTMEbarSize").value+"&sid="+i3GEO.configura.sid+"&nomelayer="+i3GEO.temaAtivo+"&colunasvalor="+lista.toString(",")+"&colunanomeregiao="+colunanomeregiao+"&titulo="+$i("i3GEOTMEtitulo").value+"&descricao="+$i("i3GEOTMEdesc").value; cp.set_response_type("JSON"); cp.call(p,"tme",temp); }catch(e){i3GEO.janela.tempoMsg("Erro: "+e);i3GEOF.tme.aguarde.visibility = "hidden";} diff --git a/pacotes/tme/TME_Engine.php b/pacotes/tme/TME_Engine.php index c90697c..43d4370 100644 --- a/pacotes/tme/TME_Engine.php +++ b/pacotes/tme/TME_Engine.php @@ -40,7 +40,7 @@ class ThematicMap public $showNames = false; public $timeType = 'year'; // year / series / slider public $maxHeight = 2000000; // Prism / Bar - public $symbolMaxSize; // Symbol + public $symbolMaxSize; // Symbol$imgBrand public $barSize = 50000; public $maxValue; public $minValue; @@ -105,7 +105,9 @@ class ThematicMap else $this->mapDescription = $this->indicator['description']; // Use default from indicator if (isset($paramArray['mapSource'])) $this->mapSource = $paramArray['mapSource']; - else $this->mapSource = 'Statistics from ' . $this->indicator['source']; // Use default from indicator + else { + //$this->mapSource = 'Statistics from ' . $this->indicator['source']; // Use default from indicator + } // Other optional parameters if (isset($paramArray['timeType'])) $this->timeType = $paramArray['timeType']; @@ -172,7 +174,7 @@ class ThematicMap include(__DIR__."/../kmlmapserver/classes/zip.class.php"); $zip = new zipfile(); // Add balloon logo to archieve (300 x 30 px) - $zip->addFile($this->logoline, 'files/balloonlogo.png'); + $zip->addFile($this->logoline, 'files/balloonlogo.png'); // KML header $kml = "" . PHP_EOL @@ -186,12 +188,12 @@ class ThematicMap . " 1" . PHP_EOL . " $this->mapSource" . PHP_EOL . " mapDescription

$this->mapSource

$this->engine ]]>" . PHP_EOL; - +//TODO logomarca? // Add style for indicator balloon $kmlStyles = "