Commit 8dfa7cf0a37b07a105ebc35ed49f5506e5629bd1
1 parent
ff39b103
Exists in
master
and in
7 other branches
adicionada opção de ativação de toponimia na versão mobile
Showing
2 changed files
with
149 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,146 @@ | @@ -0,0 +1,146 @@ | ||
| 1 | +<?php | ||
| 2 | +/* | ||
| 3 | +Title: Ativa a toponimia de um tema | ||
| 4 | + | ||
| 5 | +File: i3geo/mobile/desligar.php | ||
| 6 | + | ||
| 7 | +About: Licença | ||
| 8 | + | ||
| 9 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 10 | + | ||
| 11 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 12 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
| 13 | + | ||
| 14 | +Este programa é software livre; você pode redistribuí-lo | ||
| 15 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 16 | +GNU conforme publicada pela Free Software Foundation; | ||
| 17 | +tanto a versão 2 da Licença. | ||
| 18 | +Este programa é distribuído na expectativa de que seja útil, | ||
| 19 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 20 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 21 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 22 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 23 | +GNU junto com este programa; se não, escreva para a | ||
| 24 | +Free Software Foundation, Inc., no endereço | ||
| 25 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 26 | + | ||
| 27 | +Parameters: | ||
| 28 | + | ||
| 29 | +tmpfname - nome do mapfile em uso | ||
| 30 | +*/ | ||
| 31 | + | ||
| 32 | +require_once("../classesphp/funcoes_gerais.php"); | ||
| 33 | +include_once ("../classesphp/pega_variaveis.php"); | ||
| 34 | +include_once("../classesphp/carrega_ext.php"); | ||
| 35 | +include("../classesphp/classe_vermultilayer.php"); | ||
| 36 | +if (!isset($tema)){$tema = "";} | ||
| 37 | +if (!isset($item)){$item = "";} | ||
| 38 | +?> | ||
| 39 | +<html> | ||
| 40 | +<style> | ||
| 41 | +body | ||
| 42 | +{ | ||
| 43 | + font:14pt arial,helvetica,clean,sans-serif; | ||
| 44 | + color:rgb(100,100,100); | ||
| 45 | +} | ||
| 46 | +p | ||
| 47 | +{ | ||
| 48 | + font:12pt arial,helvetica,clean,sans-serif; | ||
| 49 | + color:black; | ||
| 50 | +} | ||
| 51 | +input | ||
| 52 | +{ | ||
| 53 | + font:14pt arial,helvetica,clean,sans-serif; | ||
| 54 | + color:black; | ||
| 55 | + cursor:pointer; | ||
| 56 | + background-color:white; | ||
| 57 | +} | ||
| 58 | +h1 | ||
| 59 | +{ | ||
| 60 | + font:16pt arial,helvetica,clean,sans-serif; | ||
| 61 | + color:brown; | ||
| 62 | +} | ||
| 63 | +</style> | ||
| 64 | +<body> | ||
| 65 | +<form id='f' action='ativatexto.php?' method='get'> | ||
| 66 | + <input type='hidden' name='tmpfname' value='<?php echo $tmpfname; ?>' /> | ||
| 67 | + <input id='tipo' type=hidden name='tipo' value='retorno' /> | ||
| 68 | + <input id='tema' type=hidden name='tema' value='<?php echo $tema; ?>' /> | ||
| 69 | + <input id='item' type=hidden name='item' value='' /> | ||
| 70 | +</form> | ||
| 71 | +<input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> | ||
| 72 | +<?php | ||
| 73 | +// | ||
| 74 | +//ativa a toponímia de um tema baseado no item selecionado | ||
| 75 | +// | ||
| 76 | +if ($item != "") | ||
| 77 | +{ | ||
| 78 | + include("../classesphp/classe_toponimia.php"); | ||
| 79 | + $m = new Toponimia($tmpfname,$tema); | ||
| 80 | + $m->criaToponimia($item,"MS_AUTO",1,0,0,auto,auto,0,"off",1,1,"off","100 100 100",1,1,"off","off",0,8,"bitmap",""); | ||
| 81 | + $m->salva(); | ||
| 82 | + $tema = ""; | ||
| 83 | +} | ||
| 84 | +// | ||
| 85 | +//monta a lista de itens de um tema | ||
| 86 | +// | ||
| 87 | +if (($tema != '') && ($item == "")) | ||
| 88 | +{ | ||
| 89 | + include("../classesphp/classe_atributos.php"); | ||
| 90 | + $m = new Atributos($tmpfname,$tema); | ||
| 91 | + $itens = $m->listaItens(); | ||
| 92 | + echo "<h1>Escolha o item que contém os textos:</h1>"; | ||
| 93 | + foreach($itens["valores"] as $i) | ||
| 94 | + { | ||
| 95 | + echo "<input type=radio value='".$i["item"]."' onclick='ativar(this.value)' />".$i["item"]."<br>"; | ||
| 96 | + } | ||
| 97 | +} | ||
| 98 | +// | ||
| 99 | +//monta a lista de temas | ||
| 100 | +// | ||
| 101 | +if ($tema == '') | ||
| 102 | +{ | ||
| 103 | + include("../classesphp/classe_mapa.php"); | ||
| 104 | + $m = New Mapa($tmpfname); | ||
| 105 | + $par = $m->parametrosTemas(); | ||
| 106 | + //var_dump($par); | ||
| 107 | + $par = mb_convert_encoding($par,"ISO-8859-1","UTF-8"); | ||
| 108 | + $par = explode("'",$par); | ||
| 109 | + $par = explode(";",$par[1]); | ||
| 110 | + echo "<h1>Escolha o tema que vc quer mostrar os textos no mapa:</h1>"; | ||
| 111 | + $existe = false; | ||
| 112 | + foreach($par as $p) | ||
| 113 | + { | ||
| 114 | + $p = explode("*",$p); | ||
| 115 | + if(($p[1] == 2) && ($p[4] < 3 )) | ||
| 116 | + { | ||
| 117 | + $existe=true; | ||
| 118 | + echo "<input type=radio value='$p[0]' onclick='ativartema(this.value)' />".$p[2]."<br>"; | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + if (!$existe) | ||
| 122 | + echo "<span style='color:red' >Nenhum tema disponível.</br>"; | ||
| 123 | +} | ||
| 124 | +?> | ||
| 125 | +<br><input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /> | ||
| 126 | +</body> | ||
| 127 | +<script> | ||
| 128 | +function retorno() | ||
| 129 | +{ | ||
| 130 | + document.getElementById('tipo').value='retorno'; | ||
| 131 | + document.getElementById('f').action = 'mobile.php'; | ||
| 132 | + document.getElementById('f').submit(); | ||
| 133 | +} | ||
| 134 | +function ativar(item) | ||
| 135 | +{ | ||
| 136 | + document.getElementById('item').value=item; | ||
| 137 | + document.getElementById('f').submit(); | ||
| 138 | +} | ||
| 139 | +function ativartema(tema) | ||
| 140 | +{ | ||
| 141 | + document.getElementById('tema').value=tema; | ||
| 142 | + document.getElementById('f').submit(); | ||
| 143 | +} | ||
| 144 | +</script> | ||
| 145 | +</html> | ||
| 146 | + |
mobile/mobile.php
| @@ -181,6 +181,7 @@ if(!isset($maparef)){$maparef = "";} | @@ -181,6 +181,7 @@ if(!isset($maparef)){$maparef = "";} | ||
| 181 | <option value='ligar'>ligar camadas</option> | 181 | <option value='ligar'>ligar camadas</option> |
| 182 | <option value='desligar'>desligar camadas</option> | 182 | <option value='desligar'>desligar camadas</option> |
| 183 | <option value='adicionar'>adicionar camadas</option> | 183 | <option value='adicionar'>adicionar camadas</option> |
| 184 | + <option value='ativatexto'>ativar textos</option> | ||
| 184 | <option value='legenda'>ver a legenda</option> | 185 | <option value='legenda'>ver a legenda</option> |
| 185 | <option value='localizar'>localizar lugares</option> | 186 | <option value='localizar'>localizar lugares</option> |
| 186 | </select> | 187 | </select> |
| @@ -296,6 +297,8 @@ function op(valor) | @@ -296,6 +297,8 @@ function op(valor) | ||
| 296 | {document.getElementById('f').action = "adicionatema.php?"} | 297 | {document.getElementById('f').action = "adicionatema.php?"} |
| 297 | if (valor=="reiniciar") | 298 | if (valor=="reiniciar") |
| 298 | {document.getElementById('f').action = "index.php?"} | 299 | {document.getElementById('f').action = "index.php?"} |
| 300 | + if (valor=="ativatexto") | ||
| 301 | + {document.getElementById('f').action = "ativatexto.php?"} | ||
| 299 | document.getElementById('f').submit(); | 302 | document.getElementById('f').submit(); |
| 300 | } | 303 | } |
| 301 | function maparef() | 304 | function maparef() |