Commit f77b5543c17874f17ba3f44aed775a451a57d724
1 parent
1324c709
Exists in
master
and in
7 other branches
correção na acentuação dos xmls em KMZ e da árvore hiperbólica
Showing
6 changed files
with
631 additions
and
17 deletions
Show diff stats
admin/hiperbolica.php
| ... | ... | @@ -19,6 +19,7 @@ foreach ($menus as $menu) |
| 19 | 19 | {continue;} |
| 20 | 20 | $id = $menu["id_menu"]; |
| 21 | 21 | $nome = html_entity_decode($menu["nome_menu"]); |
| 22 | + $nome = h_converteTexto($nome); | |
| 22 | 23 | //menu |
| 23 | 24 | $xml .= '<item cor="#FFFF99" id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; |
| 24 | 25 | $grupos = pegaDados("select i3geoadmin_grupos.nome_grupo,id_n1,id_menu from i3geoadmin_n1 LEFT JOIN i3geoadmin_grupos ON i3geoadmin_n1.id_grupo = i3geoadmin_grupos.id_grupo where id_menu='$id' order by ordem",$locaplic); |
| ... | ... | @@ -26,6 +27,7 @@ foreach ($menus as $menu) |
| 26 | 27 | { |
| 27 | 28 | $contador++; |
| 28 | 29 | $nome = html_entity_decode($grupos[$i]["nome_grupo"]); |
| 30 | + $nome = h_converteTexto($nome); | |
| 29 | 31 | $idgrupo = $grupos[$i]["id_n1"]; |
| 30 | 32 | //grupo |
| 31 | 33 | $xml .= '<item cor="#FFCC99" id="'.$contador.'" tipo="TE3" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; |
| ... | ... | @@ -37,6 +39,7 @@ foreach ($menus as $menu) |
| 37 | 39 | { |
| 38 | 40 | $contador++; |
| 39 | 41 | $nome = html_entity_decode($subgrupos[$j]["nome_subgrupo"]); |
| 42 | + $nome = h_converteTexto($nome); | |
| 40 | 43 | //subgrupo |
| 41 | 44 | $xml .= '<item cor="#FF9900" id="'.$contador.'" tipo="TE5" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; |
| 42 | 45 | $contador++; |
| ... | ... | @@ -47,6 +50,7 @@ foreach ($menus as $menu) |
| 47 | 50 | { |
| 48 | 51 | $contador++; |
| 49 | 52 | $nome = html_entity_decode($temas[$k]["nome_tema"]); |
| 53 | + $nome = h_converteTexto($nome); | |
| 50 | 54 | $nid = "tema,".$temas[$k]["codigo_tema"]; |
| 51 | 55 | if($nome != "") |
| 52 | 56 | { |
| ... | ... | @@ -62,6 +66,7 @@ foreach ($menus as $menu) |
| 62 | 66 | { |
| 63 | 67 | $contador++; |
| 64 | 68 | $tag = html_entity_decode($tag); |
| 69 | + $tag = h_converteTexto($tag); | |
| 65 | 70 | if($tag != "") |
| 66 | 71 | $xml .= '<item cor="#ffffff" id="'.$contador.'" tipo="TE9" nome="'.$tag.'" familia="tag,'.$tag.'" /> '."\n"; |
| 67 | 72 | } |
| ... | ... | @@ -79,6 +84,7 @@ for($i=0;$i < count($grupos);++$i) |
| 79 | 84 | { |
| 80 | 85 | $contador++; |
| 81 | 86 | $nome = html_entity_decode($grupos[$i]["nome_grupo"]); |
| 87 | + $nome = h_converteTexto($nome); | |
| 82 | 88 | $idgrupo = $grupos[$i]["id_n1"]; |
| 83 | 89 | $xml .= '<item cor="#FFFF99" id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; |
| 84 | 90 | $temastag = pegaDados("select d.tags_tema as tags,d.id_tema as tema from i3geoadmin_n2 as b,i3geoadmin_n1 as a,i3geoadmin_n3 as c,i3geoadmin_temas as d where a.id_grupo = '$idgrupo' and a.id_n1 = b.id_n1 and c.id_n2 = b.id_n2 and c.id_tema = d.id_tema group by tema,d.tags_tema",$locaplic); |
| ... | ... | @@ -96,6 +102,7 @@ for($i=0;$i < count($grupos);++$i) |
| 96 | 102 | foreach($arrayTag as $tag) |
| 97 | 103 | { |
| 98 | 104 | $tag = html_entity_decode($tag); |
| 105 | + $tag = h_converteTexto($tag); | |
| 99 | 106 | $contador++; |
| 100 | 107 | if($tag != "") |
| 101 | 108 | $xml .= '<item cor="#33CCFF" id="'.$contador.'" tipo="TE4" nome="'.$tag.'" familia="tag,'.$tag.'" /> '."\n"; |
| ... | ... | @@ -114,6 +121,7 @@ foreach ($tipos as $tipo) |
| 114 | 121 | { |
| 115 | 122 | $contador++; |
| 116 | 123 | $nome = html_entity_decode($w["nome_ws"]); |
| 124 | + $nome = h_converteTexto($nome); | |
| 117 | 125 | $link = str_replace("&","&",$w["link_ws"]); |
| 118 | 126 | if($nome != "") |
| 119 | 127 | $xml .= '<item cor="#33CCFF" id="'.$contador.'" tipo="TE3" nome="'.$nome.'" familia="'.$tipo["tipo_ws"].",".$link.'" /> '."\n"; |
| ... | ... | @@ -130,4 +138,11 @@ $xml .= "</capa>"; |
| 130 | 138 | header("Content-type: application/xml"); |
| 131 | 139 | |
| 132 | 140 | echo $xml; |
| 141 | + | |
| 142 | +function h_converteTexto($i) | |
| 143 | +{ | |
| 144 | + $encoding = mb_detect_encoding($i, 'UTF-8, UTF-7, ASCII, ISO-8859-1'); | |
| 145 | + return mb_convert_encoding($i,"UTF-8",$encoding); | |
| 146 | +} | |
| 147 | + | |
| 133 | 148 | ?> | ... | ... |
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| 2 | +<html> | |
| 3 | +<head> | |
| 4 | +<script type="text/javascript" src="../../classesjs/i3geo.js"></script> | |
| 5 | +</head> | |
| 6 | +<body name="ancora" id="i3geo" class=yui-skin-sam > | |
| 7 | +<script type="text/javascript"> | |
| 8 | +i3GEO.configura.locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo"; | |
| 9 | +var g_localimg = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo/imagens"; | |
| 10 | +i3GEO.parametros.mapfile = "x" | |
| 11 | +i3GEO.selecao.janelaOpcoes() | |
| 12 | +</script> | |
| 13 | +</body> | |
| 14 | +</html> | |
| 0 | 15 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,139 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="../../css/i3geo_ferramentas.css"> | |
| 5 | +<title></title> | |
| 6 | +<style type="text/css" >button{background:url(../../imagens/tic.png) 98% 50% no-repeat;}</style> | |
| 7 | +<link rel="stylesheet" type="text/css" href="../../pacotes/yui270/build/button/assets/skins/sam/button.css"/> | |
| 8 | +<style type="text/css"> | |
| 9 | +body { | |
| 10 | + margin:0; | |
| 11 | + padding:0; | |
| 12 | + border:0px; | |
| 13 | +} | |
| 14 | +</style> | |
| 15 | +</head> | |
| 16 | +<body name="ancora" class="yui-skin-sam" > | |
| 17 | + <div id=guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;"> | |
| 18 | + <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;"> | |
| 19 | + <li><a href="#ancora"><em><div id="guia1" style="text-align:center;font-size:10px;left:0px;" >Pegar no mapa</div></em></a></li> | |
| 20 | + <li><a href="#ancora"><em><div id="guia2" style="text-align:center;font-size:10px;left:0px;" >Por atributo</div></em></a></li> | |
| 21 | + <li><a href="#ancora"><em><div id="guia3" style="text-align:center;font-size:10px;left:0px;" >Por tema</div></em></a></li> | |
| 22 | + <li><a href="#ancora"><em><div id="guia5" style="text-align:center;font-size:10px;left:0px;" >Gráfico</div></em></a></li> | |
| 23 | + <li><a href="#ancora"><em><div id="guia4" style="text-align:center;font-size:10px;left:0px;" >Opções</div></em></a></li> | |
| 24 | + </ul> | |
| 25 | + </div> | |
| 26 | + <div id=geral style="left:0px;top:0px;"> | |
| 27 | + <div id="botoesopc" style=top:1px;left:0px;text-align:center;width:90%; > | |
| 28 | + <img alt="selpt.png" id=selecaopt onclick="tiposel(this)" src="../../imagens/selpt.png" title="Clique no mapa para selecionar" style="cursor:pointer;border:1px solid white" /> | |
| 29 | + <img alt="selext.png" id=selecaoext onclick="tiposel(this)" src="../../imagens/selext.png" title="Seleciona o que estiver visível no mapa" style="cursor:pointer;border:1px solid gray" /> | |
| 30 | + <img alt="selbox.png" id=selecaobox onclick="tiposel(this)" src="../../imagens/selbox.png" title="Desenhe um retângulo no mapa para selecionar" style="cursor:pointer;border:1px solid gray" /> | |
| 31 | + <img alt="selpoli.png" id=selecaopoli onclick="tiposel(this)" src="../../imagens/selpoli.png" title="Desenhe um polígono no mapa para selecionar" style="cursor:pointer;border:1px solid gray" /> | |
| 32 | + </div> | |
| 33 | + <input type=button id=parapoli style="cursor:pointer;display:none;text-align:center" value="concluir polígono" onclick="concluipoligono()"/> | |
| 34 | + <div id=opc1 style=top:0px;left:10px;text-align:left;width:90%; > | |
| 35 | + Escolha um ou mais temas: | |
| 36 | + <div id="temas" > | |
| 37 | + </div> | |
| 38 | + <br>Tipo de seleção: | |
| 39 | + <div id="operacao" > | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div id=guia1obj style="text-align:left;top:10px;left:10px;width:95%;"> | |
| 43 | + <div id=opc2 onclick="criatemaf()" style="text-align:left;top:0px;left:0px;"> | |
| 44 | + <input id=botao1 size=40 type=button value="Criar um tema novo com a seleção"/> | |
| 45 | + </div> | |
| 46 | + <div id=men1 style=top:20px;left:0px;width:100%; > | |
| 47 | + Escolha o tema que receberá a seleção e o tipo de operação. | |
| 48 | + Depois, clique no mapa no elemento desejado para selecionar. | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + <div id=guia2obj style="width:95%;display:none;left:10px;top:5px"> | |
| 52 | + <div id=opc3 style=top:0px;left:0px;text-align:left;display:none;> | |
| 53 | + Utilize as opções abaixo para construir a expressção: | |
| 54 | + <table summary="" id="parametros" > | |
| 55 | + </table> | |
| 56 | + <div onclick="aplicaselecao()" style="text-align:left;position:relative;top:10px;left:0px"> | |
| 57 | + <input id=botao2 size=10 type=button value="Aplicar" /> | |
| 58 | + </div> | |
| 59 | + <div id=valores class=digitar style="width:100%;height:60px;text-align:left;top:15px;left:0px;overflow:auto"> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + <div id=guia3obj style="width:95%;display:none;left:10px;top:10px"> | |
| 64 | + <div id=opc4 style=top:0px;left:0px;text-align:left;width:100%;> | |
| 65 | + Tema que será utilizado para selecionar o outro (esse tema deve possuir elementos já selecionados): | |
| 66 | + <div id="overlay" style="text-align:left;top:0px;left:0px"> | |
| 67 | + </div> | |
| 68 | + <div onclick="aplicaselecaoTema()" style="text-align:left;top:0px;left:0px"> | |
| 69 | + <br><input id=botao3 size=10 type=button value="Aplicar"> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + <div id=guia4obj style="width:95%;display:none;left:10px;top:10px"> | |
| 74 | + <table summary="" class=lista3 width="90%"> | |
| 75 | + <tr> | |
| 76 | + <td>Distância utilizada ao selecionar por ponto (em metros):</td> | |
| 77 | + <td><input style="cursor:text" size=4 class=digitar type='text' id=toleranciapt value='0' /></td> | |
| 78 | + </tr> | |
| 79 | + <tr> | |
| 80 | + <td>Esquema de cores para o gráfico:</td> | |
| 81 | + <td> | |
| 82 | + <select id="colorScheme" > | |
| 83 | + <option value="Blue">Azul</option> | |
| 84 | + <option value="Red">Vermelho</option> | |
| 85 | + <option value="Green">Verde</option> | |
| 86 | + <option value="Purple">Roxo</option> | |
| 87 | + <option value="Cyan">Ciano</option> | |
| 88 | + <option value="Orange">Laranja</option> | |
| 89 | + </select> | |
| 90 | + </td> | |
| 91 | + <tr> | |
| 92 | + </tr> | |
| 93 | + <td>Tipo de gráfico</td> | |
| 94 | + <td> | |
| 95 | + <select id="chartStyle"> | |
| 96 | + <option value="bar">Barras</option> | |
| 97 | + <option value="line">Linhas</option> | |
| 98 | + <option value="pie">Pizza</option> | |
| 99 | + </select> | |
| 100 | + </td> | |
| 101 | + </tr> | |
| 102 | + </table> | |
| 103 | + </div> | |
| 104 | + <div id=guia5obj style="width:95%;display:block;left:10px;top:5px"> | |
| 105 | + <div id=opcgr style=top:0px;left:0px;text-align:left;display:block;> | |
| 106 | + Defina as colunas que comporão os eixos x e y do gráfico: | |
| 107 | + <table summary="" id="itensgrafico" > | |
| 108 | + <tr> | |
| 109 | + <td>Eixo X (Classes)</td><td>Eixo Y (Valores)</td><td onclick="atualizaGrafico()"><input id=botaoGr size=10 type=button value="Gerar"></td> | |
| 110 | + </tr> | |
| 111 | + <tr> | |
| 112 | + <td id=lugarComboX ></td><td id=lugarComboY ></td><td></td> | |
| 113 | + </tr> | |
| 114 | + </table> | |
| 115 | + </div> | |
| 116 | + <div id=lugarGrafico style="text-align:center;left:5px;width:95%" ></div> | |
| 117 | + </div> | |
| 118 | + | |
| 119 | + </div> | |
| 120 | +<!--- | |
| 121 | +O Mochikit possui uma incompatibilidade com o CPAINT | |
| 122 | +Para resolver o problema, foi criado uma cópia de cpaint2.inc.js | |
| 123 | +no diretório desta ferramenta. | |
| 124 | +Por isso, a carga dos js é feita de cada componente | |
| 125 | +---> | |
| 126 | +<script src="../funcoes_compacto.js"></script> | |
| 127 | +<script src="../../pacotes/yui270/build/yahoo-dom-event/yahoo-dom-event.js"></script> | |
| 128 | +<script src="../../pacotes/yui270/build/element/element-min.js"></script> | |
| 129 | +<script src="../../pacotes/yui270/build/button/button-min.js"></script> | |
| 130 | +<script src="../../pacotes/yui270/build/tabview/tabview-min.js"></script> | |
| 131 | +<script src="../../pacotes/yui270/build/animation/animation-min.js"></script> | |
| 132 | +<script src="cpaint2.inc.js"></script> | |
| 133 | +<script language="JavaScript" type="text/javascript" src="index.js"></script> | |
| 134 | +<script src="../../pacotes/MochiKit/packed/MochiKit/MochiKit.js" type="text/javascript"></script> | |
| 135 | +<script src="../../pacotes/plotkit/PlotKit/excanvas.js" type="text/javascript"></script> | |
| 136 | +<script src="../../pacotes/plotkit/PlotKit/PlotKit.js" type="text/javascript"></script> | |
| 137 | + | |
| 138 | +</body> | |
| 139 | +</html> | |
| 0 | 140 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,441 @@ |
| 1 | +/* | |
| 2 | +About: Licença | |
| 3 | + | |
| 4 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 5 | + | |
| 6 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 7 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 8 | + | |
| 9 | +Este programa é software livre; você pode redistribuí-lo | |
| 10 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 11 | +GNU conforme publicada pela Free Software Foundation; | |
| 12 | +tanto a versão 2 da Licença. | |
| 13 | +Este programa é distribuído na expectativa de que seja útil, | |
| 14 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 15 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 16 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 17 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 18 | +GNU junto com este programa; se não, escreva para a | |
| 19 | +Free Software Foundation, Inc., no endereço | |
| 20 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 21 | +*/ | |
| 22 | + | |
| 23 | +YAHOO.example.init = function () | |
| 24 | +{ | |
| 25 | + function onPushButtonsMarkupReady() | |
| 26 | + { | |
| 27 | + new YAHOO.widget.Button("botao1"); | |
| 28 | + new YAHOO.widget.Button("botao2"); | |
| 29 | + new YAHOO.widget.Button("botao3"); | |
| 30 | + new YAHOO.widget.Button("botao4"); | |
| 31 | + new YAHOO.widget.Button("botaoGr"); | |
| 32 | + } | |
| 33 | + YAHOO.util.Event.onContentReady("botao1", onPushButtonsMarkupReady); | |
| 34 | +}() | |
| 35 | + | |
| 36 | +//inicializa | |
| 37 | +mensagemAjuda("men1",$i("men1").innerHTML) | |
| 38 | +parametrosURL() | |
| 39 | +aguarde("block") | |
| 40 | +ativaGuias("") | |
| 41 | +mostraGuia("guia1") | |
| 42 | +comboi = "" | |
| 43 | +tema = "" | |
| 44 | +//eventos das guias | |
| 45 | +$i("guia1").onclick = function() | |
| 46 | +{mostraGuia("guia1");$i("opc1").style.display="block";$i("botoesopc").style.display="block";} | |
| 47 | +$i("guia2").onclick = function() | |
| 48 | +{ | |
| 49 | + mostraGuia("guia2"); | |
| 50 | + if ($i("comboTemas").value == "") | |
| 51 | + {alert("Escolha um tema");} | |
| 52 | + $i("opc1").style.display="block"; | |
| 53 | + $i("botoesopc").style.display="block"; | |
| 54 | +} | |
| 55 | +$i("guia3").onclick = function() | |
| 56 | +{ | |
| 57 | + mostraGuia("guia3") | |
| 58 | + comboTemasSel("comboOverlay",function(retorno) | |
| 59 | + { | |
| 60 | + $i("overlay").innerHTML = retorno.dados | |
| 61 | + },"overlay") | |
| 62 | + $i("opc1").style.display="block"; | |
| 63 | + $i("botoesopc").style.display="block"; | |
| 64 | +} | |
| 65 | +$i("guia4").onclick = function() | |
| 66 | +{ | |
| 67 | + mostraGuia("guia4") | |
| 68 | + $i("opc1").style.display="block"; | |
| 69 | + $i("botoesopc").style.display="block"; | |
| 70 | +} | |
| 71 | +$i("guia5").onclick = function() | |
| 72 | +{ | |
| 73 | + var temp = pegaTemasSel().split(",") | |
| 74 | + if(temp.length > 1) | |
| 75 | + {alert("Escolha apenas um tema!");return;} | |
| 76 | + mostraGuia("guia5") | |
| 77 | + $i("opc1").style.display="none"; | |
| 78 | + $i("botoesopc").style.display="none"; | |
| 79 | + if ($i("comboTemas").value == "") | |
| 80 | + {alert("Escolha um tema");} | |
| 81 | + else | |
| 82 | + { | |
| 83 | + if(!$i("itemX")) | |
| 84 | + { | |
| 85 | + comboitens("itemX",$i("comboTemas").value,function(retorno) | |
| 86 | + { | |
| 87 | + $i("lugarComboX").innerHTML = retorno.dados; | |
| 88 | + },"lugarComboX") | |
| 89 | + } | |
| 90 | + if(!$i("itemY")) | |
| 91 | + { | |
| 92 | + comboitens("itemY",$i("comboTemas").value,function(retorno) | |
| 93 | + { | |
| 94 | + $i("lugarComboY").innerHTML = retorno.dados; | |
| 95 | + },"lugarComboY") | |
| 96 | + } | |
| 97 | + if($i("itemX") && $i("itemY")) | |
| 98 | + {atualizaGrafico();} | |
| 99 | + } | |
| 100 | +} | |
| 101 | + | |
| 102 | +//combo com o tipo de operacao | |
| 103 | +var combot = "<select id=tipoOperacao onchange='operacao(this)' >" | |
| 104 | +combot += "<option value='adiciona' >Adiciona</option>" | |
| 105 | +combot += "<option value='retira' >Retira</option>" | |
| 106 | +combot += "<option value='inverte' >Inverte</option>" | |
| 107 | +combot += "<option value='limpa' >Limpa</option>" | |
| 108 | +combot += "</select>" | |
| 109 | +$i("operacao").innerHTML = combot | |
| 110 | + | |
| 111 | +function mudaicone() | |
| 112 | +{ | |
| 113 | + $i("selecaopt").style.border = "1px solid gray" | |
| 114 | + $i("selecaoext").style.border = "1px solid gray" | |
| 115 | + $i("selecaobox").style.border = "1px solid gray" | |
| 116 | + $i("selecaopoli").style.border = "1px solid gray" | |
| 117 | + if(window.parent.richdraw) | |
| 118 | + window.parent.richdraw.fecha() | |
| 119 | + if(window.parent.$i("img")) | |
| 120 | + window.parent.$i("img").style.cursor="pointer"; | |
| 121 | +} | |
| 122 | +//pega os temas selecionados | |
| 123 | +function pegaTemasSel() | |
| 124 | +{ | |
| 125 | + var selObj = $i("comboTemas"); | |
| 126 | + var selectedArray = new Array(); | |
| 127 | + for (i=0; i<selObj.options.length; i++) { | |
| 128 | + if (selObj.options[i].selected) { | |
| 129 | + selectedArray.push(selObj.options[i].value); | |
| 130 | + } | |
| 131 | + } | |
| 132 | + return selectedArray.toString(); | |
| 133 | +} | |
| 134 | +//botoes de tipo | |
| 135 | +function tiposel(obj) | |
| 136 | +{ | |
| 137 | + var combotemas = $i("comboTemas"); | |
| 138 | + window.parent.i3GEO.mapa.ativaTema(pegaTemasSel()); | |
| 139 | + window.parent.i3GEO.eventos.MOUSEDOWN.remove("i3GEO.selecao.box.inicia()") | |
| 140 | + $i("parapoli").style.display = "none"; | |
| 141 | + var fim = function() | |
| 142 | + {aguarde("none");window.parent.i3GEO.atualiza("");} | |
| 143 | + if (combotemas.value == ""){alert("Escolha um tema");return;} | |
| 144 | + | |
| 145 | + if (obj.id == "selecaoext") | |
| 146 | + { | |
| 147 | + if (window.parent.i3GEO.parametros.mapscale > 500000) | |
| 148 | + {alert("A escala do mapa deve ser pelo menos 1:500.000");return;} | |
| 149 | + aguarde("block") | |
| 150 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=selecaoext&tema="+pegaTemasSel()+"&tipo="+$i("tipoOperacao").value | |
| 151 | + var cp = new cpaint(); | |
| 152 | + //cp.set_debug(2) | |
| 153 | + cp.set_response_type("JSON"); | |
| 154 | + cp.call(p,"selecaoEXT",fim); | |
| 155 | + } | |
| 156 | + if (obj.id == "selecaobox") | |
| 157 | + { | |
| 158 | + mudaicone() | |
| 159 | + obj.style.border = "1px solid white"; | |
| 160 | + window.parent.g_tipoacao = "selecaobox"; | |
| 161 | + window.parent.i3GEO.selecao.box.criaBox(); | |
| 162 | + if(window.parent.i3GEO.eventos.MOUSEDOWN.toString().search("i3GEO.selecao.box.inicia()") < 0) | |
| 163 | + {window.parent.i3GEO.eventos.MOUSEDOWN.push("i3GEO.selecao.box.inicia()");} | |
| 164 | + } | |
| 165 | + if (obj.id == "selecaopt") | |
| 166 | + { | |
| 167 | + mudaicone() | |
| 168 | + obj.style.border = "1px solid white" | |
| 169 | + window.parent.g_tipoacao = "selecao"; | |
| 170 | + if(window.parent.i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.selecao.clique()") < 0) | |
| 171 | + {window.parent.i3GEO.eventos.MOUSECLIQUE.push("i3GEO.selecao.clique()");} | |
| 172 | + } | |
| 173 | + if (obj.id == "selecaopoli") | |
| 174 | + { | |
| 175 | + var temp = pegaTemasSel().split(",") | |
| 176 | + if(temp.length > 1) | |
| 177 | + {alert("Escolha apenas um tema!");return;} | |
| 178 | + mudaicone() | |
| 179 | + obj.style.border = "1px solid white" | |
| 180 | + window.parent.g_tipoacao = "selecaopoli"; | |
| 181 | + window.parent.i3GEO.selecao.poligono.inicia() | |
| 182 | + } | |
| 183 | +} | |
| 184 | + | |
| 185 | +//cria combo com os temas | |
| 186 | + | |
| 187 | +comboTemasLigados("comboTemas",function(retorno) | |
| 188 | +{ | |
| 189 | + $i("temas").innerHTML = retorno.dados | |
| 190 | + aguarde("none") | |
| 191 | + $i("comboTemas").onchange = function() | |
| 192 | + { | |
| 193 | + $i("lugarComboX").innerHTML = ""; | |
| 194 | + $i("lugarComboY").innerHTML = ""; | |
| 195 | + window.parent.i3GEO.mapa.ativaTema(pegaTemasSel()); | |
| 196 | + comboitens("selItem",$i("comboTemas").value,function(retorno) | |
| 197 | + { | |
| 198 | + comboi = retorno.dados | |
| 199 | + var p = $i("parametros") | |
| 200 | + for (i = 0; i < p.childNodes.length;i++) | |
| 201 | + {p.removeChild(p.childNodes[i])} | |
| 202 | + adicionalinha() | |
| 203 | + }) | |
| 204 | + if ($i("comboTemas").value != "") | |
| 205 | + {$i("opc3").style.display="block"} | |
| 206 | + else | |
| 207 | + { | |
| 208 | + alert("Selecione um tema"); | |
| 209 | + $i("opc3").style.display="block" | |
| 210 | + } | |
| 211 | + } | |
| 212 | +},"temas","",true) | |
| 213 | + | |
| 214 | +//adiciona uma linha de parametros | |
| 215 | +function adicionalinha() | |
| 216 | +{ | |
| 217 | + var comboitens = comboi | |
| 218 | + //interrogacao abre a lista de valores | |
| 219 | + var interrogacao = document.createElement("img") | |
| 220 | + interrogacao.src = '../../imagens/interrogacao.gif' | |
| 221 | + interrogacao.title='lista' | |
| 222 | + interrogacao.style.cursor="pointer" | |
| 223 | + interrogacao.onclick = function() | |
| 224 | + { | |
| 225 | + var itemTema = (this.parentNode.parentNode.getElementsByTagName("select"))[0].value | |
| 226 | + if (itemTema == "") | |
| 227 | + { | |
| 228 | + alert("Selecione um campo") | |
| 229 | + return | |
| 230 | + } | |
| 231 | + aguarde("block") | |
| 232 | + valoresItem | |
| 233 | + ( | |
| 234 | + $i("comboTemas").value, | |
| 235 | + itemTema, | |
| 236 | + function(retorno) | |
| 237 | + { | |
| 238 | + aguarde("none") | |
| 239 | + $i("valores").innerHTML = "<br>Valores:<br>"+retorno.dados | |
| 240 | + } | |
| 241 | + ,"valores" | |
| 242 | + ) | |
| 243 | + } | |
| 244 | + var operador = "<select>" | |
| 245 | + operador += "<option value=',=,'>igual</option>" | |
| 246 | + operador += "<option value=',!=,'>dif</option>" | |
| 247 | + operador += "<option value=',<,'>menor</option>" | |
| 248 | + operador += "<option value=',>,'>maior</option>" | |
| 249 | + operador += "<option value=',<=,'><=</option>" | |
| 250 | + operador += "<option value=',>=,'>=</option>" | |
| 251 | + operador += "<option value=',in,'>in</option>" | |
| 252 | + operador += "<option value=',~=,'>regExp</option></select>" | |
| 253 | + var valor = document.createElement("input") | |
| 254 | + valor.type = "text" | |
| 255 | + valor.value = "" | |
| 256 | + valor.size = "20" | |
| 257 | + var ntb = document.createElement("tbody") | |
| 258 | + var ntr = document.createElement("tr") | |
| 259 | + ntb.appendChild(ntr) | |
| 260 | + var ntd1 = document.createElement("td") | |
| 261 | + ntd1.innerHTML = comboi | |
| 262 | + ntr.appendChild(ntd1) | |
| 263 | + var ntd2 = document.createElement("td") | |
| 264 | + ntd2.innerHTML = operador | |
| 265 | + ntr.appendChild(ntd2) | |
| 266 | + var ntd3 = document.createElement("td") | |
| 267 | + ntd3.appendChild(valor) | |
| 268 | + ntr.appendChild(ntd3) | |
| 269 | + var ntd4 = document.createElement("td") | |
| 270 | + ntd4.appendChild(interrogacao) | |
| 271 | + ntr.appendChild(ntd4) | |
| 272 | + tabela = $i("parametros") | |
| 273 | + tabela.appendChild(ntb) | |
| 274 | +} | |
| 275 | +//executa o tipo de operacao selecionada se for o caso | |
| 276 | +function operacao(tipo) | |
| 277 | +{ | |
| 278 | + if ($i("comboTemas").value == ""){alert("Escolha um tema");return;} | |
| 279 | + if((tipo.value == "limpa") || (tipo.value == "inverte")) | |
| 280 | + { | |
| 281 | + aguarde("block") | |
| 282 | + var fim = function() | |
| 283 | + {aguarde("none");window.parent.i3GEO.atualiza("")} | |
| 284 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=selecaopt&tema="+pegaTemasSel()+"&tipo="+tipo.value+"&tolerancia="+$i("toleranciapt").value | |
| 285 | + var cp = new cpaint(); | |
| 286 | + //cp.set_debug(2) | |
| 287 | + cp.set_response_type("JSON"); | |
| 288 | + window.parent.g_operacao = "selecao" | |
| 289 | + cp.call(p,"selecaoPT",fim); | |
| 290 | + } | |
| 291 | +} | |
| 292 | +//aplica a selecao por atributo | |
| 293 | +function aplicaselecao() | |
| 294 | +{ | |
| 295 | + var temp = pegaTemasSel().split(",") | |
| 296 | + if(temp.length > 1) | |
| 297 | + {alert("Escolha apenas um tema!");return;} | |
| 298 | + if ($i("comboTemas").value == ""){alert("Escolha um tema");return;} | |
| 299 | + aguarde("block") | |
| 300 | + var g = $i("parametros") | |
| 301 | + var ipt = g.getElementsByTagName("tr") | |
| 302 | + if (ipt.length > 0) | |
| 303 | + { | |
| 304 | + var filtro = "" | |
| 305 | + for (i=0;i<ipt.length; i++) | |
| 306 | + { | |
| 307 | + var nos = ipt[i].childNodes | |
| 308 | + var s = nos[0].getElementsByTagName("select") | |
| 309 | + var itemsel = s[0].value | |
| 310 | + var s = nos[1].getElementsByTagName("select") | |
| 311 | + var operador = s[0].value | |
| 312 | + var s = nos[2].getElementsByTagName("input") | |
| 313 | + var valor = s[0].value | |
| 314 | + } | |
| 315 | + var tipo = $i("tipoOperacao").value | |
| 316 | + var fim = function() | |
| 317 | + {aguarde("none");window.parent.i3GEO.atualiza("")} | |
| 318 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=selecaoatrib&tipo="+tipo+"&tema="+pegaTemasSel()+"&valor="+valor+"&operador="+operador+"&item="+itemsel | |
| 319 | + var cp = new cpaint(); | |
| 320 | + //cp.set_debug(2) | |
| 321 | + cp.set_response_type("JSON"); | |
| 322 | + window.parent.g_operacao = "selecao" | |
| 323 | + cp.call(p,"selecaoAtributos",fim); | |
| 324 | + } | |
| 325 | +} | |
| 326 | +//aplica a selecao por tema | |
| 327 | +function aplicaselecaoTema() | |
| 328 | +{ | |
| 329 | + aguarde("block") | |
| 330 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=selecaotema&temao="+$i("comboOverlay").value+"&tema="+pegaTemasSel()+"&tipo="+$i("tipoOperacao").value | |
| 331 | + var cp = new cpaint(); | |
| 332 | + //cp.set_debug(2) | |
| 333 | + cp.set_response_type("JSON"); | |
| 334 | + window.parent.g_operacao = "selecao" | |
| 335 | + cp.call(p,"selecaoTema",mostraSelecaoTema); | |
| 336 | +} | |
| 337 | +//mostra a seleção por tema | |
| 338 | +function mostraSelecaoTema(retorno) | |
| 339 | +{ | |
| 340 | + aguarde("none") | |
| 341 | + window.parent.remapaf(); | |
| 342 | +} | |
| 343 | +//cria um novo tema | |
| 344 | +function criatemaf() | |
| 345 | +{ | |
| 346 | + var temp = pegaTemasSel().split(",") | |
| 347 | + if(temp.length > 1) | |
| 348 | + {alert("Escolha apenas um tema!");return;} | |
| 349 | + if ($i("comboTemas").value == "") | |
| 350 | + {alert("Escolha um tema!");} | |
| 351 | + else | |
| 352 | + { | |
| 353 | + aguarde("block") | |
| 354 | + var fim = function() | |
| 355 | + {aguarde("none");window.parent.i3GEO.atualiza("")} | |
| 356 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=criatemasel&tema="+$i("comboTemas").value+"&nome=Novo tema "+$i("comboTemas").value | |
| 357 | + var cp = new cpaint(); | |
| 358 | + //cp.set_debug(2) | |
| 359 | + cp.set_response_type("JSON"); | |
| 360 | + cp.call(p,"selecao2tema",fim); | |
| 361 | + } | |
| 362 | +} | |
| 363 | +function concluidof() | |
| 364 | +{ | |
| 365 | + window.parent.remapaf() | |
| 366 | + aguarde("none") | |
| 367 | +} | |
| 368 | +function concluipoligono() | |
| 369 | +{ | |
| 370 | + $i("parapoli").style.display = "none"; | |
| 371 | + tiposel($i("selecaopt")) | |
| 372 | + var pontos = window.parent.pontosdistobj; | |
| 373 | + window.parent.richdraw.fecha() | |
| 374 | + var n = pontos.xpt.length; | |
| 375 | + if (n > 2) | |
| 376 | + { | |
| 377 | + aguarde("block") | |
| 378 | + var xs = pontos.xpt.toString(",") | |
| 379 | + var ys = pontos.ypt.toString(",") | |
| 380 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=selecaoPoli" | |
| 381 | + var cp = new cpaint(); | |
| 382 | + //cp.set_debug(2) | |
| 383 | + cp.set_transfer_mode('POST'); | |
| 384 | + cp.set_response_type("JSON"); | |
| 385 | + cp.call(p,"selecaoPoli",concluidof,xs,ys,pegaTemasSel(),$i("tipoOperacao").value); | |
| 386 | + } | |
| 387 | + else | |
| 388 | + {alert("Sao necessarios pelo menos tres pontos");} | |
| 389 | +} | |
| 390 | +function atualizaGrafico() | |
| 391 | +{ | |
| 392 | + $i("lugarGrafico").innerHTML = "" | |
| 393 | + var monta = function(retorno) | |
| 394 | + { | |
| 395 | + var dados = retorno.data.dados; | |
| 396 | + var values = new Array(); | |
| 397 | + var labels = new Array(); | |
| 398 | + for (i=1;i<dados.length; i++) | |
| 399 | + { | |
| 400 | + var celula = dados[i].split(";"); | |
| 401 | + values.push(eval("["+i+","+celula[1]+"]")); | |
| 402 | + var temp = '{v:'+(i)+',label:'+'"'+celula[0]+'"}'; | |
| 403 | + labels.push(temp); | |
| 404 | + } | |
| 405 | + var options = { | |
| 406 | + "colorScheme": "", | |
| 407 | + "padding": {left: 2, right: 2, top: 5, bottom: 2}, | |
| 408 | + "xTicks": eval("["+labels+"]") | |
| 409 | + }; | |
| 410 | + layout = new Layout("bar", options); | |
| 411 | + renderer = new SweetCanvasRenderer($('canvasTest'), layout, options); | |
| 412 | + var chartStyle = "bar"; //document.forms["options"].chartStyle[chartStyleSelected].value; | |
| 413 | + var colorScheme = "Blue"; //document.forms["options"].colorScheme[colorSchemeSelected].value; | |
| 414 | + // setup layout options | |
| 415 | + var themeName = "office" + $i("colorScheme").value; | |
| 416 | + var theme = PlotKit.Base[themeName](); | |
| 417 | + MochiKit.Base.update(options, theme); | |
| 418 | + layout.style = $i("chartStyle").value; | |
| 419 | + MochiKit.Base.update(layout.options, options); | |
| 420 | + MochiKit.Base.update(renderer.options, options); | |
| 421 | + layout.addDataset("data", values); | |
| 422 | + layout.evaluate(); | |
| 423 | + renderer.clear(); | |
| 424 | + renderer.render(); | |
| 425 | + } | |
| 426 | + if(!$i("canvasTest")) | |
| 427 | + $i("lugarGrafico").innerHTML = "<canvas id='canvasTest' width='350' height='180' style='border: 1px solid #eee;'></canvas>" | |
| 428 | + if ($i("canvasTest").getContext) | |
| 429 | + { | |
| 430 | + if($i("itemX").value == "" || $i("itemY").value == "") | |
| 431 | + {alert("Escolha as colunas primeiro");} | |
| 432 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=graficoSelecao&tema="+$i("comboTemas").value+"&itemclasses="+$i("itemX").value+"&itemvalores="+$i("itemY").value | |
| 433 | + var cp = new cpaint(); | |
| 434 | + cp.set_response_type("JSON"); | |
| 435 | + cp.call(p,"graficoSelecao",monta); | |
| 436 | + } | |
| 437 | + else | |
| 438 | + { | |
| 439 | + $i("lugarGrafico").innerHTML = "<span style=color:red >Você precisa atuallizar seu navegador para que o gráfico possa ser mostrado</span>"; | |
| 440 | + } | |
| 441 | +} | ... | ... |
kml.php
| ... | ... | @@ -78,14 +78,14 @@ if ($menutemas != "" || is_array($menutemas)) |
| 78 | 78 | {kml_tema($tema);} |
| 79 | 79 | foreach($xml->GRUPO as $grupo) |
| 80 | 80 | { |
| 81 | - $nome = mb_convert_encoding($grupo->GTIPO,"auto","auto"); | |
| 82 | - $desc = mb_convert_encoding($grupo->DTIPO,"auto","auto"); | |
| 81 | + $nome = kml_converteTexto($grupo->GTIPO); | |
| 82 | + $desc = kml_converteTexto($grupo->DTIPO); | |
| 83 | 83 | kml_cabecalho($nome,$desc); |
| 84 | 84 | foreach($grupo->TEMA as $tema) |
| 85 | 85 | {kml_tema($tema);} |
| 86 | 86 | foreach($grupo->SGRUPO as $sgrupo) |
| 87 | 87 | { |
| 88 | - $nome = mb_convert_encoding($sgrupo->SDTIPO,"auto","auto"); | |
| 88 | + $nome = kml_converteTexto($sgrupo->SDTIPO); | |
| 89 | 89 | kml_folder($nome); |
| 90 | 90 | foreach($sgrupo->TEMA as $tema) |
| 91 | 91 | {kml_tema($tema);} |
| ... | ... | @@ -193,30 +193,30 @@ function kml_tema_bd($tema) |
| 193 | 193 | function kml_cabecalho($nome,$desc) |
| 194 | 194 | { |
| 195 | 195 | echo "<Folder>\n"; |
| 196 | - echo " <name>".str_replace("&","&",$nome)."</name>\n"; | |
| 197 | - echo " <description>".str_replace("&","&",$desc)."</description>\n"; | |
| 196 | + echo " <name>".str_replace("&","&",kml_converteTexto($nome))."</name>\n"; | |
| 197 | + echo " <description>".str_replace("&","&",kml_converteTexto($desc))."</description>\n"; | |
| 198 | 198 | echo " <open>0</open><visibility>0</visibility>\n"; |
| 199 | 199 | } |
| 200 | 200 | function kml_folder($nome) |
| 201 | 201 | { |
| 202 | 202 | echo " <Folder>\n"; |
| 203 | - echo " <name>".str_replace("&","&",$nome)."</name>\n"; | |
| 203 | + echo " <name>".str_replace("&","&",kml_converteTexto($nome))."</name>\n"; | |
| 204 | 204 | echo " <description></description>\n"; |
| 205 | 205 | echo " <open>0</open><visibility>0</visibility>\n"; |
| 206 | 206 | } |
| 207 | 207 | function kml_tema($tema) |
| 208 | 208 | { |
| 209 | 209 | global $urli3geo; |
| 210 | - $nome = mb_convert_encoding($tema->TNOME,"auto","auto"); | |
| 211 | - $desc = mb_convert_encoding($tema->TDESC,"auto","auto"); | |
| 212 | - $id = mb_convert_encoding($tema->TID,"auto","auto"); | |
| 213 | - $fonte = mb_convert_encoding($tema->TLINK,"auto","auto"); | |
| 210 | + $nome = kml_converteTexto($tema->TNOME); | |
| 211 | + $desc = kml_converteTexto($tema->TDESC); | |
| 212 | + $id = kml_converteTexto($tema->TID); | |
| 213 | + $fonte = kml_converteTexto($tema->TLINK); | |
| 214 | 214 | $tipoa = ""; |
| 215 | 215 | if($tema->TIPOA) |
| 216 | - $tipoa = mb_convert_encoding($tema->TIPOA,"auto","auto"); | |
| 216 | + $tipoa = kml_converteTexto($tema->TIPOA); | |
| 217 | 217 | $ogc = sim; |
| 218 | 218 | if($tema->TID) |
| 219 | - {$kml = mb_convert_encoding($tema->KML,"auto","auto");} | |
| 219 | + {$kml = kml_converteTexto($tema->KML);} | |
| 220 | 220 | if(strtolower($kml) != "nao" && strtolower($tipoa) != "wms") |
| 221 | 221 | { |
| 222 | 222 | if($fonte != "") |
| ... | ... | @@ -232,7 +232,7 @@ function kml_tema($tema) |
| 232 | 232 | function kml_servico($nome,$fonte,$legenda,$desc,$href) |
| 233 | 233 | { |
| 234 | 234 | echo " <GroundOverlay>\n"; |
| 235 | - echo " <name>".str_replace("&","&",$nome)."</name>\n"; | |
| 235 | + echo " <name>".str_replace("&","&",kml_converteTexto($nome))."</name>\n"; | |
| 236 | 236 | echo " <description><![CDATA[".$fonte.$legenda.$desc."]]></description>\n"; |
| 237 | 237 | echo " <visibility>0</visibility>\n"; |
| 238 | 238 | echo " <Icon>\n"; |
| ... | ... | @@ -245,7 +245,7 @@ function kml_servico($nome,$fonte,$legenda,$desc,$href) |
| 245 | 245 | function kml_networklink($nome,$fonte,$legenda,$desc,$href) |
| 246 | 246 | { |
| 247 | 247 | echo " <NetworkLink>\n"; |
| 248 | - echo " <name>".str_replace("&","&",$nome)."</name>\n"; | |
| 248 | + echo " <name>".str_replace("&","&",kml_converteTexto($nome))."</name>\n"; | |
| 249 | 249 | echo " <description><![CDATA[".$fonte.$legenda.$desc."]]></description>\n"; |
| 250 | 250 | echo " <visibility>0</visibility>\n"; |
| 251 | 251 | echo " <Link>\n"; |
| ... | ... | @@ -254,5 +254,9 @@ function kml_networklink($nome,$fonte,$legenda,$desc,$href) |
| 254 | 254 | echo " </Link>\n"; |
| 255 | 255 | echo " </NetworkLink>\n"; |
| 256 | 256 | } |
| 257 | - | |
| 257 | +function kml_converteTexto($i) | |
| 258 | +{ | |
| 259 | + $encoding = mb_detect_encoding($i, 'UTF-8, UTF-7, ASCII, ISO-8859-1'); | |
| 260 | + return mb_convert_encoding($i,"UTF-8",$encoding); | |
| 261 | +} | |
| 258 | 262 | ?> |
| 259 | 263 | \ No newline at end of file | ... | ... |
pacotes/kmlmapserver/classes/layerserver.class.php
| ... | ... | @@ -448,8 +448,9 @@ class LayerServer { |
| 448 | 448 | */ |
| 449 | 449 | function &add_feature(&$folder, &$wkt, $featurename, $attributes, $description_template, $style_data,$itens,$itensdesc){ |
| 450 | 450 | $pm = $folder->addChild('Placemark'); |
| 451 | - $pm->addChild('name',mb_convert_encoding($featurename,"UTF-8",mb_detect_encoding($featurename,"UTF-8, ISO-8859-1"))); | |
| 452 | - $pm->addChild('description', $this->get_feature_description($featurename, $attributes, $description_template,$itens,$itensdesc)); | |
| 451 | + $fname = mb_convert_encoding($featurename,"UTF-8",mb_detect_encoding($featurename,'UTF-8, UTF-7, ASCII, ISO-8859-1')); | |
| 452 | + $pm->addChild('name',$fname); | |
| 453 | + $pm->addChild('description', $this->get_feature_description($fname, $attributes, $description_template,$itens,$itensdesc)); | |
| 453 | 454 | // Now parse the wkt |
| 454 | 455 | if(strpos($wkt, 'MULTILINESTRING') !== false){ |
| 455 | 456 | $this->add_multilinestring($wkt, $pm, $featurename, $style_data['icon']); | ... | ... |