Commit c233b02c3fb70d2cc2eed6867c0b4b666d2be349
1 parent
61c03a21
Exists in
master
and in
7 other branches
Correções na ferramenta de geração de KML 3d (TME)
Showing
12 changed files
with
202 additions
and
84 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/js/core.js
... | ... | @@ -953,7 +953,7 @@ function core_menuCheckBox(valores,textos,selecionados,target,record,key){ |
953 | 953 | { label: "Cancel", value: "CANCEL", checked: false } |
954 | 954 | ]); |
955 | 955 | og_core.on("checkedButtonChange", on_menuCheckBoxChange); |
956 | - 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 } ); | |
956 | + 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 } ); | |
957 | 957 | YAHOO.admin.container.panelCK.render(); |
958 | 958 | } |
959 | 959 | onde = $i("core_menuCK_bd"); |
... | ... | @@ -1428,7 +1428,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal) |
1428 | 1428 | }}} |
1429 | 1429 | ); |
1430 | 1430 | } |
1431 | - YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:true,close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); | |
1431 | + YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:"contained",close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); | |
1432 | 1432 | YAHOO.admin.container.panelEditor.render(); |
1433 | 1433 | } |
1434 | 1434 | else |
... | ... | @@ -1479,16 +1479,24 @@ function core_abreCor(janela,elemento) |
1479 | 1479 | } |
1480 | 1480 | function core_desativaforms(lista){ |
1481 | 1481 | var n = lista.length, |
1482 | - i; | |
1482 | + i,t; | |
1483 | 1483 | for (i=0;i<n;i++){ |
1484 | - $i(lista[i]).style.background = "pink"; | |
1484 | + t = $i(lista[i]); | |
1485 | + if(t){ | |
1486 | + //t.style.background = "pink"; | |
1487 | + t.disabled = true; | |
1488 | + } | |
1485 | 1489 | } |
1486 | 1490 | } |
1487 | 1491 | function core_ativaforms(lista){ |
1488 | 1492 | var n = lista.length, |
1489 | - i; | |
1493 | + i,t; | |
1490 | 1494 | for (i=0;i<n;i++){ |
1491 | - $i(lista[i]).style.background = "white"; | |
1495 | + t = $i(lista[i]); | |
1496 | + if(t){ | |
1497 | + //t.style.background = "white"; | |
1498 | + t.disabled = false; | |
1499 | + } | |
1492 | 1500 | } |
1493 | 1501 | } |
1494 | 1502 | function core_listaDeLetras(onde,nomeFuncao){ | ... | ... |
admin/js/editormapfile.js
... | ... | @@ -183,6 +183,10 @@ function ativaBotaoAdicionaMapfile(idBotao) |
183 | 183 | core_montaEditor("adicionaNovoMapfile()","450px","660px","","","Mapfile"); |
184 | 184 | ins = "<p><b>Nome do novo arquivo mapfile (sem .map) </b>não utilize caracteres acentuados ou espaços em branco</p>"; |
185 | 185 | ins += "<input size=50 type=text id='Ecodigo' value='' /></p>"; |
186 | + ins += "<p><b>Esse mapfile baseia-se no sistema de metadados estatísticos?</b> Caso escolha sim, a conexão com o banco e o sql de acesso aos dados serão construídos de forma dinâmica</p>"; | |
187 | + ins += "<select id='Emetaestat' >"; | |
188 | + ins += core_combosimnao("nao"); | |
189 | + ins += "</select>"; | |
186 | 190 | ins += "<p><b>Título do novo tema</b></p>"; |
187 | 191 | ins += "<p>Em português: </p>"; |
188 | 192 | ins += "<input size=50 type=text id='Etitulo' value='' /></p>"; |
... | ... | @@ -657,17 +661,17 @@ Adiciona um novo mapfile |
657 | 661 | */ |
658 | 662 | function adicionaNovoMapfile() |
659 | 663 | { |
660 | - var nome = $i("Etitulo").value; | |
661 | - var it = $i("EtituloIT").value; | |
662 | - var es = $i("EtituloES").value; | |
663 | - var en = $i("EtituloEN").value; | |
664 | - var codigo = $i("Ecodigo").value; | |
664 | + var nome = $i("Etitulo").value, | |
665 | + it = $i("EtituloIT").value, | |
666 | + es = $i("EtituloES").value, | |
667 | + en = $i("EtituloEN").value, | |
668 | + codigo = $i("Ecodigo").value, | |
669 | + metaestat = $i("Emetaestat").value; | |
665 | 670 | if(codigo === "") |
666 | 671 | {alert("Digite o nome do arquivo");return;} |
667 | - sUrl = "../php/editormapfile.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo+"&it="+it+"&en="+en+"&es="+es; | |
672 | + sUrl = "../php/editormapfile.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo+"&it="+it+"&en="+en+"&es="+es+"&metaestat="+metaestat; | |
668 | 673 | core_carregando("ativa"); |
669 | 674 | core_carregando(" adicionando um novo mapfile"); |
670 | - | |
671 | 675 | var callback = |
672 | 676 | { |
673 | 677 | success:function(o) |
... | ... | @@ -1443,8 +1447,11 @@ function montaEditorDispo(dados) |
1443 | 1447 | function montaEditorDados(dados) |
1444 | 1448 | { |
1445 | 1449 | var idsForms = ["connection","data","tileitem","tileindex","type","tipooriginal"]; |
1450 | + var idsMetaestat = ["connection","data","tileitem","tileindex","tipooriginal"]; | |
1446 | 1451 | var param = { |
1447 | 1452 | "linhas":[ |
1453 | + {ajuda:"Indica se as definições da camada estão relacionadas ao sistema de metadados estatísticos. Se estiver, alguns parâmetros são obtidos de forma automática, como a conexão e o SQL de acesso aos dados.", | |
1454 | + titulo:"Esse mapfile está integrado ao sistema de metadados estatísticos?",id:"",value:dados.metaestat,tipo:"text",div:"<div id=cMetaestat ></div>"}, | |
1448 | 1455 | {ajuda:"Type of connection. Default is local.", |
1449 | 1456 | titulo:"Connectiontype",id:"",value:"",div:"<div id=cConnectiontype ></div>",tipo:"text"}, |
1450 | 1457 | {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) |
1468 | 1475 | {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.", |
1469 | 1476 | titulo:"tileindex",id:"tileindex",value:dados.tileindex,tipo:"text"}, |
1470 | 1477 | {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.", |
1471 | - titulo:"Tipo de representação (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipooriginal ></div>"} | |
1478 | + titulo:"Tipo de representação (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipoOriginal ></div>"} | |
1472 | 1479 | ] |
1473 | 1480 | }; |
1474 | 1481 | var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; |
... | ... | @@ -1488,17 +1495,24 @@ function montaEditorDados(dados) |
1488 | 1495 | ins += core_geraLinhas(param); |
1489 | 1496 | ins += "<br><br><br>"; |
1490 | 1497 | $i("editor_bd").innerHTML = ins; |
1498 | + | |
1499 | + if($i("cMetaestat")){ | |
1500 | + temp = "<select id='metaestat' >"; | |
1501 | + temp += core_combosimnao(dados.metaestat); | |
1502 | + temp += "</select>"; | |
1503 | + $i("cMetaestat").innerHTML = temp; | |
1504 | + } | |
1491 | 1505 | if($i("cCache")){ |
1492 | 1506 | temp = "<select id='cache' >"; |
1493 | 1507 | temp += core_combosimnao(dados.cache); |
1494 | 1508 | temp += "</select>"; |
1495 | 1509 | $i("cCache").innerHTML = temp; |
1496 | 1510 | } |
1497 | - if($i("cTipooriginal")){ | |
1511 | + if($i("cTipoOriginal")){ | |
1498 | 1512 | temp = "<select id='tipooriginal' >"; |
1499 | 1513 | temp += core_comboObjeto(objtipooriginal,"valor","texto",dados.tipooriginal); |
1500 | 1514 | temp += "</select>"; |
1501 | - $i("cTipooriginal").innerHTML = temp; | |
1515 | + $i("cTipoOriginal").innerHTML = temp; | |
1502 | 1516 | } |
1503 | 1517 | |
1504 | 1518 | temp = "<select id='connectiontype' >"; |
... | ... | @@ -1526,7 +1540,6 @@ function montaEditorDados(dados) |
1526 | 1540 | {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,"","",true);}; |
1527 | 1541 | new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); |
1528 | 1542 | |
1529 | - core_desativaforms(idsForms); | |
1530 | 1543 | $i("connectiontype").onchange = function(){ |
1531 | 1544 | core_desativaforms(idsForms); |
1532 | 1545 | var valor = $i("connectiontype").value, |
... | ... | @@ -1546,7 +1559,26 @@ function montaEditorDados(dados) |
1546 | 1559 | {d = ["connection","type","tipooriginal"];} |
1547 | 1560 | core_ativaforms(d); |
1548 | 1561 | }; |
1549 | - $i("connectiontype").onchange.call(); | |
1562 | + $i("metaestat").onchange = function(){ | |
1563 | + core_desativaforms(idsMetaestat); | |
1564 | + var valor = $i("metaestat").value, | |
1565 | + d = []; | |
1566 | + if(valor === "SIM"){ | |
1567 | + d = []; | |
1568 | + } | |
1569 | + else{ | |
1570 | + core_desativaforms(idsForms); | |
1571 | + $i("connectiontype").onchange.call(); | |
1572 | + } | |
1573 | + core_ativaforms(d); | |
1574 | + }; | |
1575 | + if(dados.metaestat === "SIM"){ | |
1576 | + core_desativaforms(idsMetaestat); | |
1577 | + } | |
1578 | + else{ | |
1579 | + core_desativaforms(idsForms); | |
1580 | + $i("connectiontype").onchange.call(); | |
1581 | + } | |
1550 | 1582 | } |
1551 | 1583 | |
1552 | 1584 | function montaEditorMetadados(dados) |
... | ... | @@ -1979,7 +2011,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, |
1979 | 2011 | } |
1980 | 2012 | if(tipo == "conexao") |
1981 | 2013 | { |
1982 | - campos = new Array("cache","projection","type","connection","data","connectiontype","tileitem","tileindex","filteritem","filter","tipooriginal","convcaracter"); | |
2014 | + campos = new Array("metaestat","cache","projection","type","connection","data","connectiontype","tileitem","tileindex","filteritem","filter","tipooriginal","convcaracter"); | |
1983 | 2015 | par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; |
1984 | 2016 | prog = "../php/editormapfile.php?funcao=alterarConexao"; |
1985 | 2017 | } |
... | ... | @@ -2018,8 +2050,13 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, |
2018 | 2050 | prog += "&testar="+testar; |
2019 | 2051 | try{ |
2020 | 2052 | for (var i=0;i<campos.length;i++){ |
2021 | - if($i(campos[i])) | |
2022 | - {par += "&"+campos[i]+"="+($i(campos[i]).value);} | |
2053 | + if($i(campos[i])){ | |
2054 | + var valor = ""; | |
2055 | + if($i(campos[i]).disabled === false){ | |
2056 | + valor = $i(campos[i]).value; | |
2057 | + } | |
2058 | + par += "&"+campos[i]+"="+ valor; | |
2059 | + } | |
2023 | 2060 | } |
2024 | 2061 | }catch(e){alert(e);} |
2025 | 2062 | core_carregando("ativa"); | ... | ... |
admin/php/editormapfile.php
... | ... | @@ -1160,7 +1160,7 @@ function sobeDesce() |
1160 | 1160 | } |
1161 | 1161 | function criarNovoMap() |
1162 | 1162 | { |
1163 | - global $nome,$codigo,$locaplic,$it,$en,$es,$esquemaadmin; | |
1163 | + global $nome,$codigo,$locaplic,$it,$en,$es,$esquemaadmin,$metaestat; | |
1164 | 1164 | $arq = $locaplic."/temas/".$codigo.".map"; |
1165 | 1165 | if(!file_exists($arq)) |
1166 | 1166 | { |
... | ... | @@ -1169,11 +1169,21 @@ function criarNovoMap() |
1169 | 1169 | $dados[] = 'FONTSET "../symbols/fontes.txt"'; |
1170 | 1170 | $dados[] = "LAYER"; |
1171 | 1171 | $dados[] = " NAME $codigo"; |
1172 | - $dados[] = " TYPE line"; | |
1172 | + $dados[] = ' TEMPLATE "none.htm"'; | |
1173 | + if(!empty($metaestat) && $metaestat == "SIM"){ | |
1174 | + $dados[] = ' CONNECTIONTYPE POSTGIS'; | |
1175 | + $dados[] = " TYPE polygon"; | |
1176 | + } | |
1177 | + else{ | |
1178 | + $dados[] = " TYPE line"; | |
1179 | + } | |
1173 | 1180 | $dados[] = ' DATA ""'; |
1174 | 1181 | $dados[] = ' METADATA'; |
1175 | 1182 | $dados[] = ' TEMA "'.$nome.'"'; |
1176 | 1183 | $dados[] = ' CLASSE "SIM"'; |
1184 | + if(!empty($metaestat) && $metaestat == "SIM"){ | |
1185 | + $dados[] = ' METAESTAT "SIM"'; | |
1186 | + } | |
1177 | 1187 | $dados[] = ' END'; |
1178 | 1188 | $dados[] = ' CLASS'; |
1179 | 1189 | $dados[] = ' NAME ""'; |
... | ... | @@ -1575,6 +1585,12 @@ function pegaConexao() |
1575 | 1585 | } |
1576 | 1586 | $dados["projection"] = str_replace("+i","i",$dados["projection"]); |
1577 | 1587 | $dados["convcaracter"] = $layer->getmetadata("convcaracter"); |
1588 | + //informacoes sobre a integracao com o sistema de metadados estatisticos | |
1589 | + $dados["metaestat"] = $layer->getmetadata("metaestat"); | |
1590 | + if($dados["metaestat"] == ""){ | |
1591 | + $dados["metaestat"] = "NAO"; | |
1592 | + } | |
1593 | + | |
1578 | 1594 | $dados["colunas"] = implode(",",pegaItens($layer)); |
1579 | 1595 | if($layer->connectiontype == 7 || $layer->connectiontype == 9){ |
1580 | 1596 | $dados["tipooriginal"] = $layer->getmetadata("tipooriginal"); |
... | ... | @@ -1583,17 +1599,29 @@ function pegaConexao() |
1583 | 1599 | } |
1584 | 1600 | function alterarConexao() |
1585 | 1601 | { |
1586 | - global $convcaracter,$cache,$tipooriginal,$filteritem,$filter,$projection,$type,$dir_tmp,$testar,$codigoMap,$codigoLayer,$locaplic,$connection,$connectiontype,$data,$tileitem,$tileindex; | |
1602 | + global $metaestat,$convcaracter,$cache,$tipooriginal,$filteritem,$filter,$projection,$type,$dir_tmp,$testar,$codigoMap,$codigoLayer,$locaplic,$connection,$connectiontype,$data,$tileitem,$tileindex; | |
1587 | 1603 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; |
1588 | 1604 | $mapa = ms_newMapObj($mapfile); |
1589 | 1605 | $layer = $mapa->getlayerbyname($codigoLayer); |
1606 | + //quando o layer estiver conectado com o METAESTAT, alguns parametros sao default | |
1607 | + if(strtoupper($metaestat) == "SIM"){ | |
1608 | + $connectiontype = 6; | |
1609 | + $filteritem = ""; | |
1610 | + $filter = ""; | |
1611 | + $data = ""; | |
1612 | + $connection = ""; | |
1613 | + } | |
1614 | + else{ | |
1615 | + $layer->setmetadata("METAESTAT_CODIGO_TIPO_REGIAO",""); | |
1616 | + $layer->setmetadata("ID_MEDIDA_VARIAVEL",""); | |
1617 | + } | |
1618 | + $layer->setmetadata("metaestat",$metaestat); | |
1590 | 1619 | $layer->set("connection",$connection); |
1591 | - if(ms_GetVersionInt() > 50201) | |
1592 | - { | |
1620 | + if(ms_GetVersionInt() > 50201){ | |
1593 | 1621 | $layer->setconnectiontype($connectiontype); |
1594 | 1622 | } |
1595 | - else | |
1596 | - {$layer->set("connectiontype",$connectiontype); | |
1623 | + else{ | |
1624 | + $layer->set("connectiontype",$connectiontype); | |
1597 | 1625 | } |
1598 | 1626 | $layer->set("data",$data); |
1599 | 1627 | $layer->set("tileitem",$tileitem); | ... | ... |
classesjs/classe_gadgets.js
... | ... | @@ -550,7 +550,7 @@ i3GEO.gadgets = { |
550 | 550 | if(!temp.style.height || parseInt(temp.style.height) === 0) |
551 | 551 | {temp.style.height = "21px";} |
552 | 552 | } |
553 | - ins += '<div class="bd" style="top:0px;'+alinhamento+'display:block;align:right;border: 0px solid white;z-index:6000;line-height:1.4" >' + | |
553 | + ins += '<div class="bd" style="top:0px;'+alinhamento+'display:block;align:right;border: 0px solid white;z-index:3;line-height:1.4" >' + | |
554 | 554 | '<ul class="first-of-type" style="display:block;border:0px solid white;top:10px;">'; |
555 | 555 | n = confm.menu.length; |
556 | 556 | estilo = "padding-bottom:3px;top:0px;border: 0px solid white;"; | ... | ... |
classesjs/classe_janela.js
... | ... | @@ -188,7 +188,7 @@ i3GEO.janela = { |
188 | 188 | |
189 | 189 | Cada vez que uma janela flutuante é criada, esse valor é acrescido de 1 |
190 | 190 | */ |
191 | - ULTIMOZINDEX : 0, | |
191 | + ULTIMOZINDEX : 5, | |
192 | 192 | /* |
193 | 193 | Function: prepara |
194 | 194 | |
... | ... | @@ -274,7 +274,7 @@ i3GEO.janela = { |
274 | 274 | i3GEO.janela.TRANSICAOSUAVE = false; |
275 | 275 | ifr = true; |
276 | 276 | } |
277 | - fix = false; | |
277 | + fix = "contained"; | |
278 | 278 | if(nx === "" || nx === "center") |
279 | 279 | {fix = true;} |
280 | 280 | //no IE, com CSS3, a sombra não funciona |
... | ... | @@ -324,8 +324,8 @@ i3GEO.janela = { |
324 | 324 | } |
325 | 325 | //cria a janela |
326 | 326 | if(waltura === "auto") |
327 | - {janela = new YAHOO.widget.Panel(id, { iframe:ifr,modal:modal, width: wlargurA,underlay:"none", fixedcenter: fix, constraintoviewport: false, visible: true,monitorresize:false,dragOnly:true,keylisteners:null} );} | |
328 | - else{janela = new YAHOO.widget.ResizePanel(id, { hideMode:'offsets',iframe:ifr,underlay:underlay, modal:modal, width: wlargurA, fixedcenter: fix, constraintoviewport: false, visible: true,monitorresize:false,dragOnly:true,keylisteners:null} );} | |
327 | + {janela = new YAHOO.widget.Panel(id, { iframe:ifr,modal:modal, width: wlargurA,underlay:"none", fixedcenter: fix, constraintoviewport: true, visible: true,monitorresize:false,dragOnly:true,keylisteners:null} );} | |
328 | + else{janela = new YAHOO.widget.ResizePanel(id, { hideMode:'offsets',iframe:ifr,underlay:underlay, modal:modal, width: wlargurA, fixedcenter: fix, constraintoviewport: true, visible: true,monitorresize:false,dragOnly:true,keylisteners:null} );} | |
329 | 329 | if(nx !== "" && nx !== "center"){ |
330 | 330 | janela.moveTo(nx,ny + 50); |
331 | 331 | } |
... | ... | @@ -335,14 +335,14 @@ i3GEO.janela = { |
335 | 335 | {effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5} |
336 | 336 | ]); |
337 | 337 | } |
338 | - janela.cfg.setProperty("zIndex",[10000]); | |
338 | + janela.cfg.setProperty("zIndex",[4]); | |
339 | 339 | janela.render(); |
340 | 340 | janela.bringToTop(); |
341 | 341 | //ajusta estilos e outras características da janela criada |
342 | 342 | if(navm && id !== "i3geo_janelaMensagens" && i3GEO.Interface.ATUAL === "googleearth") |
343 | 343 | {janela.moveTo(0,0);} |
344 | 344 | if(ifr === true) |
345 | - {janela.iframe.style.zIndex = 0;} | |
345 | + {janela.iframe.style.zIndex = 4;} | |
346 | 346 | temp = $i(id+"_corpo"); |
347 | 347 | if(temp){ |
348 | 348 | if(navm) |
... | ... | @@ -355,7 +355,8 @@ i3GEO.janela = { |
355 | 355 | if(funcaoMinimiza) |
356 | 356 | {$i(id+"_minimizaCabecalho").onclick = funcaoMinimiza;} |
357 | 357 | YAHOO.util.Event.addListener(janela.close, "click", i3GEO.janela.fecha,janela,{id:id},true); |
358 | - return([janela,$i(id+"_cabecalho"),$i(id+"_corpo")]); | |
358 | + $i(id+"_c").style.zIndex = 20000; | |
359 | + return([janela,$i(id+"_cabecalho"),temp]); | |
359 | 360 | }, |
360 | 361 | /* |
361 | 362 | function: minimiza | ... | ... |
ferramentas/metaestat/index.js
... | ... | @@ -647,10 +647,14 @@ i3GEOF.metaestat = { |
647 | 647 | temp = function(retorno){ |
648 | 648 | if(i3GEO.arvoreDeCamadas.pegaTema(retorno.layer) == ""){ |
649 | 649 | i3GEOF.metaestat.comum.desligaCamadas(); |
650 | - i3GEO.php.adtema(i3GEO.atualiza,retorno.mapfile); | |
651 | - i3GEOF.metaestat.CAMADAS.push(retorno.layer); | |
652 | - i3GEO.mapa.ativaTema(retorno.layer); | |
653 | - i3GEOF.metaestat.analise.comboCamadas(); | |
650 | + var atualiza = function(){ | |
651 | + i3GEO.atualiza(); | |
652 | + i3GEOF.metaestat.CAMADAS.push(retorno.layer); | |
653 | + i3GEO.mapa.ativaTema(retorno.layer); | |
654 | + i3GEOF.metaestat.analise.comboCamadas(); | |
655 | + }; | |
656 | + i3GEO.php.adtema(atualiza,retorno.mapfile); | |
657 | + | |
654 | 658 | } |
655 | 659 | }; |
656 | 660 | if(v != true){ | ... | ... |
ferramentas/tme/index.js
... | ... | @@ -140,19 +140,23 @@ i3GEOF.tme = { |
140 | 140 | */ |
141 | 141 | html:function(){ |
142 | 142 | var ins = '' + |
143 | - '<div style="text-align:left;" id=i3GEOTMEresultado ></div>' + | |
143 | + '<div style="text-align:left;background:yellow;" id=i3GEOTMEresultado ></div>' + | |
144 | + '<input id=i3GEOtmebotao1 size=35 type=button value="Gerar KML" /><br><br>' + | |
144 | 145 | '<p class="paragrafo" >' + |
145 | 146 | 'Título que será mostrado no mapa'; |
146 | 147 | ins += $inputText("","","i3GEOTMEtitulo","",48,"") + |
147 | 148 | '<br><br>Descrição do mapa'; |
148 | 149 | ins += $inputText("","","i3GEOTMEdesc","",48,"") + |
150 | + '<br><br>Altura máxima das barras (em metros)'; | |
151 | + ins += $inputText("","","i3GEOTMEbarSize","",20,"50000") + | |
152 | + '<br><br>Largura máxima das barras (em metros)'; | |
153 | + ins += $inputText("","","i3GEOTMEmaxHeight","",20,"100") + | |
149 | 154 | '<br><br>Coluna que contém os nomes das regiões (exemplo: nomes dos Estados ou nomes dos municípios):' + |
150 | 155 | '<div id="i3GEOTMEregioeslista" style="text-align:left;" ></div>' + |
151 | 156 | '<p class="paragrafo" >' + |
152 | 157 | '<br>Escolha uma ou mais colunas com os dados estatísticos que serão representados:' + |
153 | 158 | '<div id=i3GEOtmelistai class=digitar style="text-align:left;left:0px;top:0px;330px;height:80px;overflow:auto;display:block;"></div>' + |
154 | 159 | '<br>' + |
155 | - '<input id=i3GEOtmebotao1 size=35 type=button value="Aplicar" />' + | |
156 | 160 | '<div id=i3GEOtmemen1 style=top:15px;left:0px; ><p class=paragrafo >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</div>'; |
157 | 161 | return ins; |
158 | 162 | }, |
... | ... | @@ -284,9 +288,8 @@ i3GEOF.tme = { |
284 | 288 | var ins = "<p class=paragrafo >Clique no arquivo para fazer o download:<br><a href='"+retorno.data.url+"' target=new >"+retorno.data.url+"</a><br>"; |
285 | 289 | ins += "<br>Ou clique para abrir no i3Geo:<br><a href='"+i3GEO.configura.locaplic+"/ms_criamapa.php?interface=googleearth.phtml&kmlurl="+retorno.data.url+"' target='new' >interface Google Earth</a><br>"; |
286 | 290 | $i("i3GEOTMEresultado").innerHTML = ins; |
287 | - | |
288 | 291 | }; |
289 | - 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; | |
292 | + 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; | |
290 | 293 | cp.set_response_type("JSON"); |
291 | 294 | cp.call(p,"tme",temp); |
292 | 295 | }catch(e){i3GEO.janela.tempoMsg("Erro: "+e);i3GEOF.tme.aguarde.visibility = "hidden";} | ... | ... |
pacotes/tme/TME_Engine.php
... | ... | @@ -40,7 +40,7 @@ class ThematicMap |
40 | 40 | public $showNames = false; |
41 | 41 | public $timeType = 'year'; // year / series / slider |
42 | 42 | public $maxHeight = 2000000; // Prism / Bar |
43 | - public $symbolMaxSize; // Symbol | |
43 | + public $symbolMaxSize; // Symbol$imgBrand | |
44 | 44 | public $barSize = 50000; |
45 | 45 | public $maxValue; |
46 | 46 | public $minValue; |
... | ... | @@ -105,7 +105,9 @@ class ThematicMap |
105 | 105 | else $this->mapDescription = $this->indicator['description']; // Use default from indicator |
106 | 106 | |
107 | 107 | if (isset($paramArray['mapSource'])) $this->mapSource = $paramArray['mapSource']; |
108 | - else $this->mapSource = 'Statistics from ' . $this->indicator['source']; // Use default from indicator | |
108 | + else { | |
109 | + //$this->mapSource = 'Statistics from ' . $this->indicator['source']; // Use default from indicator | |
110 | + } | |
109 | 111 | |
110 | 112 | // Other optional parameters |
111 | 113 | if (isset($paramArray['timeType'])) $this->timeType = $paramArray['timeType']; |
... | ... | @@ -172,7 +174,7 @@ class ThematicMap |
172 | 174 | include(__DIR__."/../kmlmapserver/classes/zip.class.php"); |
173 | 175 | $zip = new zipfile(); |
174 | 176 | // Add balloon logo to archieve (300 x 30 px) |
175 | - $zip->addFile($this->logoline, 'files/balloonlogo.png'); | |
177 | + $zip->addFile($this->logoline, 'files/balloonlogo.png'); | |
176 | 178 | |
177 | 179 | // KML header |
178 | 180 | $kml = "<?xml version='1.0' encoding='UTF-8'?>" . PHP_EOL |
... | ... | @@ -186,12 +188,12 @@ class ThematicMap |
186 | 188 | . " <open>1</open>" . PHP_EOL |
187 | 189 | . " <Snippet maxLines='1'>$this->mapSource</Snippet>" . PHP_EOL |
188 | 190 | . " <description><![CDATA[ $this->mapDescription <p>$this->mapSource</p>$this->engine ]]></description>" . PHP_EOL; |
189 | - | |
191 | +//TODO logomarca? | |
190 | 192 | // Add style for indicator balloon |
191 | 193 | $kmlStyles = " <Style id='balloonStyle'>" . PHP_EOL |
192 | 194 | . " <BalloonStyle>" . PHP_EOL |
193 | 195 | . " <text><![CDATA[" . PHP_EOL |
194 | - . " <a href='http://thematicmapping.org'><img src='files/balloonlogo.png'></a>" . PHP_EOL | |
196 | + . " <a href='http://thematicmapping.org'><img src='http://localhost/ms_tmp/balloonlogo.png'></a>" . PHP_EOL | |
195 | 197 | . " <p><b><font size='+2'>$[name]</font></b></p>" . PHP_EOL |
196 | 198 | . " <p>$[description]</p>" . PHP_EOL |
197 | 199 | . " ]]></text>" . PHP_EOL |
... | ... | @@ -210,7 +212,8 @@ class ThematicMap |
210 | 212 | |
211 | 213 | // Add colour legend to KMZ archieve |
212 | 214 | if ($this->showLegend) { |
213 | - $zip->addFile(self::getColourLegend(), 'files/legend.png'); | |
215 | + $imgLegenda = self::getColourLegend(); | |
216 | + $zip->addFile($imgLegenda,'files/legend.png'); | |
214 | 217 | } |
215 | 218 | $kmlSingleColour = ''; // Colours needs to be defined for each feature |
216 | 219 | //$kmlColour = self::rgb2bgr($this->noDataColour); // Not in use, only so the variable has a value |
... | ... | @@ -342,10 +345,10 @@ class ThematicMap |
342 | 345 | } // switch symbol |
343 | 346 | } // switch type |
344 | 347 | |
345 | - | |
348 | +//TODO corrigir logo | |
346 | 349 | $kmlStyles .= " <BalloonStyle>" . PHP_EOL |
347 | 350 | . " <text><![CDATA[" . PHP_EOL |
348 | - . " <a href='http://thematicmapping.org'><img src='files/balloonlogo.png'></a>" . PHP_EOL | |
351 | + . " <a href='http://thematicmapping.org'><img src='http://localhost/ms_tmp/balloonlogo.png'></a>" . PHP_EOL | |
349 | 352 | . " <p><b><font size='+2'>$[name]</font></b></p>" . PHP_EOL |
350 | 353 | . " <p>$this->mapTitle: $[Snippet]</p>" . PHP_EOL |
351 | 354 | . " <p>$this->mapDescription</p>" . PHP_EOL |
... | ... | @@ -408,6 +411,7 @@ class ThematicMap |
408 | 411 | foreach ($this->dataStore['features'] as $featureID => $feature) |
409 | 412 | { |
410 | 413 | $name = $feature['name']; |
414 | + //TODO corrigir acentuacao | |
411 | 415 | //if (!mb_detect_encoding($name,"UTF-8",true)) |
412 | 416 | //{$name = mb_convert_encoding($name,"UTF-8","ISO-8859-1");} |
413 | 417 | $name = "<![CDATA[ ".$name." ]]>"; |
... | ... | @@ -428,8 +432,7 @@ class ThematicMap |
428 | 432 | if (isset($this->indicator['values'][$year][$featureID])) { |
429 | 433 | // Extract value from dataStore |
430 | 434 | $value = $this->indicator['values'][$year][$featureID]; |
431 | - $valueText = $valueLabel = number_format($value); | |
432 | - | |
435 | + $valueText = $valueLabel = number_format($value, 2, ',', '.'); | |
433 | 436 | // Colour scale |
434 | 437 | if ($this->colourType == 'scale') { |
435 | 438 | if ($this->classification != 'unclassed') { |
... | ... | @@ -607,11 +610,19 @@ $z->close();age': |
607 | 610 | // Close Years folder |
608 | 611 | $kmlFolder .= " </Folder>" . PHP_EOL; |
609 | 612 | |
613 | + // Create logo with title and source and add to archieve | |
614 | + if ($this->showTitle) { | |
615 | + $imgBrand = self::mapTitleImage(); | |
616 | + $zip->addFile($imgBrand, 'files/brand.png'); | |
617 | + } | |
618 | + else { | |
619 | + $zip->addFile($this->logo, 'files/brand.png'); | |
620 | + } | |
610 | 621 | // Add title |
611 | 622 | $kml .= " <ScreenOverlay>" . PHP_EOL |
612 | 623 | . " <name>Título</name>" . PHP_EOL |
613 | 624 | . " <Icon>" . PHP_EOL |
614 | - . " <href>files/brand.png</href>" . PHP_EOL | |
625 | + . " <href>http://localhost/ms_tmp/".basename($imgBrand)."</href>" . PHP_EOL | |
615 | 626 | . " </Icon>" . PHP_EOL |
616 | 627 | . " <overlayXY x='0.01' y='0.99' xunits='fraction' yunits='fraction'/>" . PHP_EOL |
617 | 628 | . " <screenXY x='0.01' y='0.99' xunits='fraction' yunits='fraction'/>" . PHP_EOL |
... | ... | @@ -623,7 +634,7 @@ $z->close();age': |
623 | 634 | $kml .= " <ScreenOverlay>" . PHP_EOL |
624 | 635 | . " <name>Legenda</name>" . PHP_EOL |
625 | 636 | . " <Icon>" . PHP_EOL |
626 | - . " <href>files/legend.png</href>" . PHP_EOL | |
637 | + . " <href>http://localhost/ms_tmp/".basename($imgLegenda)."</href>" . PHP_EOL | |
627 | 638 | . " </Icon>" . PHP_EOL |
628 | 639 | . " <overlayXY x='0.01' y='0.14' xunits='fraction' yunits='fraction'/>" . PHP_EOL |
629 | 640 | . " <screenXY x='0.01' y='0.14' xunits='fraction' yunits='fraction'/>" . PHP_EOL |
... | ... | @@ -652,13 +663,7 @@ $z->close();age': |
652 | 663 | //$zip->addFromString("doc.kml", $kml); |
653 | 664 | $zip->addFile($kml, 'doc.kml');//edmar |
654 | 665 | |
655 | - // Create logo with title and source and add to archieve | |
656 | - if ($this->showTitle) { | |
657 | - $zip->addFile(self::mapTitleImage(), 'files/brand.png'); | |
658 | - } | |
659 | - else { | |
660 | - $zip->addFile($this->logo, 'files/brand.png'); | |
661 | - } | |
666 | + | |
662 | 667 | //$zip->close(); |
663 | 668 | $zip->output($file);//edmar |
664 | 669 | if($download){ |
... | ... | @@ -875,8 +880,11 @@ $z->close();age': |
875 | 880 | } |
876 | 881 | |
877 | 882 | // print min and max values |
878 | - imagestring($legend, 3, $width+29, $height-6, number_format($this->minValue, $this->precision), $fontColour); | |
879 | - imagestring($legend, 3, $width+29, -3, number_format($this->maxValue, $this->precision), $fontColour); | |
883 | + //number_format(($s / $ocorrencias),2,",",".") | |
884 | + //imagestring($legend, 3, $width+29, $height-6, number_format($this->minValue, $this->precision), $fontColour); | |
885 | + //imagestring($legend, 3, $width+29, -3, number_format($this->maxValue, $this->precision), $fontColour); | |
886 | + imagestring($legend, 3, $width+29, $height-6, number_format($this->minValue, 2,",","."), $fontColour); | |
887 | + imagestring($legend, 3, $width+29, -3, number_format($this->maxValue, 2,",","."), $fontColour); | |
880 | 888 | |
881 | 889 | break; |
882 | 890 | |
... | ... | @@ -884,7 +892,8 @@ $z->close();age': |
884 | 892 | default: |
885 | 893 | $ypos = 0; |
886 | 894 | $interval = $height / $this->numClasses; |
887 | - foreach($this->classColours as $key => $colour){ | |
895 | + $v = $this->classColours; | |
896 | + foreach($v as $key => $colour){ | |
888 | 897 | $red = hexdec(substr($colour, 0, 2)); |
889 | 898 | $green = hexdec(substr($colour, 2, 2)); |
890 | 899 | $blue = hexdec(substr($colour, 4, 2)); |
... | ... | @@ -892,11 +901,14 @@ $z->close();age': |
892 | 901 | $classColour = imagecolorallocate($legend, $red, $green, $blue); |
893 | 902 | imagefilledrectangle($legend, 21, $height-$ypos+2, $width+20, $height-$ypos-$interval, $classColour); |
894 | 903 | |
895 | - imagestring($legend, 3, $width+29, $height-$ypos-5, number_format($this->classBreaks[$key], $this->precision), $fontColour); | |
904 | + //imagestring($legend, 3, $width+29, $height-$ypos-5, number_format($this->classBreaks[$key], $this->precision), $fontColour); | |
905 | + imagestring($legend, 3, $width+29, $height-$ypos-5, number_format($this->classBreaks[$key], 2,",","."), $fontColour); | |
896 | 906 | |
897 | 907 | $ypos += $interval; |
898 | 908 | } |
899 | - imagestring($legend, 3, $width+29, -3, number_format($this->classBreaks[$key+1], $this->precision), $fontColour); | |
909 | + //imagestring($legend, 3, $width+29, -3, number_format($this->classBreaks[$key+1], $this->precision), $fontColour); | |
910 | + imagestring($legend, 3, $width+29, -3, number_format($this->classBreaks[$key+1], 2,",","."), $fontColour); | |
911 | + | |
900 | 912 | } |
901 | 913 | |
902 | 914 | // Border around colour scale |
... | ... | @@ -904,7 +916,7 @@ $z->close();age': |
904 | 916 | imagerectangle($legend, 20, 1, $width+21, $height+3, $white); |
905 | 917 | |
906 | 918 | // Legend title |
907 | - imagestringup($legend, 3, 0, ($height/2)+(strlen($this->mapTitle)/2)*7, $this->mapTitle, $white); | |
919 | + //imagestringup($legend, 3, 0, ($height/2)+(strlen($this->mapTitle)/2)*7, $this->mapTitle, $white); | |
908 | 920 | |
909 | 921 | // Save legend |
910 | 922 | $file = $this->dirtmp.'/legend'. time() .'.png'; |
... | ... | @@ -944,6 +956,7 @@ $z->close();age': |
944 | 956 | |
945 | 957 | case 'quantile': |
946 | 958 | $values = array_values($this->indicator['values'][$this->year]); |
959 | + sort($values); | |
947 | 960 | $numValues = count($values); |
948 | 961 | $classNum = $numValues / $numClasses; // Number in each class |
949 | 962 | for ($i = 0; $i < $numClasses; $i++) { |
... | ... | @@ -966,6 +979,7 @@ $z->close();age': |
966 | 979 | |
967 | 980 | function getClass($value){ |
968 | 981 | $class = 0; |
982 | + //var_dump($this->classBreaks);exit; | |
969 | 983 | for ($i = 1; $i < count($this->classBreaks); $i++) { |
970 | 984 | if ($value > $this->classBreaks[$i] && $value <= $this->classBreaks[$i+1]) { |
971 | 985 | $class = $i; | ... | ... |
pacotes/tme/TME_i3geo.php
... | ... | @@ -39,7 +39,9 @@ if(!isset($download)){ |
39 | 39 | $download = false; |
40 | 40 | } |
41 | 41 | if(!isset($_GET["sid"]) && $verificaSID == true) |
42 | -{echo "Erro. Acesso não permitido";exit;} | |
42 | +{ | |
43 | + echo "Erro. Acesso não permitido";exit; | |
44 | +} | |
43 | 45 | if(!isset($dir_tmp)){ |
44 | 46 | include(__DIR__."/../../ms_configura.php"); |
45 | 47 | } |
... | ... | @@ -54,15 +56,22 @@ if(!isset($parametersTME)){ |
54 | 56 | $ano = $colunas[0]; |
55 | 57 | $tipo = "year"; |
56 | 58 | } |
57 | - $parametersTME = array( 'mapType' => 'bar', | |
58 | - 'indicator' => 'valores', | |
59 | - 'year' => $ano, | |
60 | - 'classification' => 'equal', | |
61 | - 'mapTitle' => $_GET["titulo"], | |
62 | - 'timeType' => $tipo, //para mais de um ano, escolha slider ou series | |
63 | - 'dirtmp' => $dir_tmp, | |
64 | - 'barSize'=> 5000 | |
65 | - ); | |
59 | + if(empty($barSize)){ | |
60 | + $barSize = 5000; | |
61 | + } | |
62 | + if(empty($maxHeight)){ | |
63 | + $maxHeight = 2000000; | |
64 | + } | |
65 | + $parametersTME = array( 'mapType' => 'bar', | |
66 | + 'indicator' => 'valores', | |
67 | + 'year' => $ano, | |
68 | + 'classification' => 'quantile', | |
69 | + 'mapTitle' => $_GET["titulo"], | |
70 | + 'timeType' => $tipo, //para mais de um ano, escolha slider ou series | |
71 | + 'dirtmp' => $dir_tmp, | |
72 | + 'barSize'=> $barSize, | |
73 | + 'maxHeight' => $maxHeight | |
74 | + ); | |
66 | 75 | } |
67 | 76 | $dataConnector = new DataConnector($_GET["sid"],$verificaSID); |
68 | 77 | $dataStore = $dataConnector->getDataStore($_GET["nomelayer"],$colunas,$_GET["colunanomeregiao"],$_GET["titulo"],$_GET["descricao"],""); |
... | ... | @@ -72,7 +81,9 @@ $map = new ThematicMap($dataStore, $parametersTME); |
72 | 81 | $file = $map->getKML($dataConnector->url,$download); |
73 | 82 | if(!$download){ |
74 | 83 | if(!function_exists("cpjson")) |
75 | - {require(__DIR__."/../../classesphp/funcoes_gerais.php");} | |
84 | + { | |
85 | + require(__DIR__."/../../classesphp/funcoes_gerais.php"); | |
86 | + } | |
76 | 87 | cpjson(array('url' => $file)); |
77 | 88 | } |
78 | 89 | //echo "<p><a href='$file'>$file</a>"; | ... | ... |
pacotes/tme/TME_i3geo_DataConnector.php
... | ... | @@ -169,9 +169,15 @@ class DataConnector |
169 | 169 | {$shape = $layer->getShape($layer->getResult($i));} |
170 | 170 | else{$shape = $layer->getFeature($layer->getResult($i)->shapeindex);} |
171 | 171 | $pt = $shape->getCentroid(); |
172 | + $texto = $shape->values[$colunanomeregiao]; | |
173 | + /* | |
174 | + if(!mb_detect_encoding($texto,"ISO-8859-1",true)){ | |
175 | + $texto = mb_convert_encoding($texto,"ISO-8859-1","UTF-8"); | |
176 | + } | |
177 | + */ | |
172 | 178 | $dataStore['features'][$i] = array( |
173 | 179 | "featureID"=>$i, |
174 | - "name"=>$shape->values[$colunanomeregiao], | |
180 | + "name"=>$texto, | |
175 | 181 | "lon"=>$pt->x, |
176 | 182 | "lat"=>$pt->y, |
177 | 183 | "wkt"=>$shape->toWkt() | ... | ... |
temas/bairros.map
1 | 1 | MAP |
2 | 2 | FONTSET "/var/www/i3geo/symbols/fontes.txt" |
3 | 3 | SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" |
4 | -LAYER | |
4 | + LAYER | |
5 | 5 | CONNECTION "user=postgres password=postgres dbname=geosaude host=localhost port=5432" |
6 | 6 | CONNECTIONTYPE POSTGIS |
7 | 7 | DATA "the_geom from (select * from i3geo_metaestat.bairros) as foo using unique gid using srid=4326" |
8 | 8 | METADATA |
9 | + "ID_MEDIDA_VARIAVEL" "" | |
10 | + "cache" "" | |
9 | 11 | "CLASSE" "SIM" |
12 | + "METAESTAT_CODIGO_TIPO_REGIAO" "" | |
13 | + "metaestat" "NAO" | |
14 | + "convcaracter" "" | |
10 | 15 | "TEMA" "Bairros IBGE" |
11 | 16 | END # METADATA |
12 | 17 | NAME "bairros" |
13 | 18 | STATUS DEFAULT |
14 | 19 | TEMPLATE "none.htm" |
15 | - TILEITEM "location" | |
16 | 20 | TYPE POLYGON |
17 | 21 | UNITS METERS |
18 | 22 | CLASS |
... | ... | @@ -30,4 +34,6 @@ LAYER |
30 | 34 | END # STYLE |
31 | 35 | END # CLASS |
32 | 36 | END # LAYER |
33 | -END | |
34 | 37 | \ No newline at end of file |
38 | + | |
39 | +END # MAP | |
40 | + | ... | ... |