Commit 36d641c64fa41408a9a929cabdbb780ddb8c7834
1 parent
39424616
Exists in
master
and in
7 other branches
Compactação via PHP
Showing
3 changed files
with
465 additions
and
504 deletions
Show diff stats
ferramentas/identifica/index.htm
| @@ -1,40 +0,0 @@ | @@ -1,40 +0,0 @@ | ||
| 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;border:0px; | ||
| 12 | -} | ||
| 13 | -</style> | ||
| 14 | -</head> | ||
| 15 | -<body name="ancora" class="yui-skin-sam" > | ||
| 16 | -</body> | ||
| 17 | -<script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script> | ||
| 18 | -<script language="JavaScript" type="text/javascript" src="index.js"></script> | ||
| 19 | -<script type="text/javascript" > | ||
| 20 | -// | ||
| 21 | -//pega os dados da url | ||
| 22 | -// | ||
| 23 | -var locaplic = window.parent.i3GEO.configura.locaplic; | ||
| 24 | -var sid = window.parent.i3GEO.configura.sid; | ||
| 25 | -var xpt = unescape(((((window.location.href).split("x="))[1]).split("&"))[0] ); | ||
| 26 | -var ypt = unescape(((((window.location.href).split("y="))[1]).split("&"))[0] ); | ||
| 27 | -var tema = window.parent.i3GEO.temaAtivo; | ||
| 28 | - | ||
| 29 | -i3GEOidentifica.inicia( | ||
| 30 | - locaplic, | ||
| 31 | - sid, | ||
| 32 | - tema, | ||
| 33 | - xpt, | ||
| 34 | - ypt, | ||
| 35 | - document.body, | ||
| 36 | - true, | ||
| 37 | - true | ||
| 38 | -); | ||
| 39 | -</script> | ||
| 40 | -</html> | ||
| 41 | \ No newline at end of file | 0 | \ No newline at end of file |
ferramentas/identifica/index.js
| @@ -1,464 +0,0 @@ | @@ -1,464 +0,0 @@ | ||
| 1 | -/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | ||
| 2 | - | ||
| 3 | -/* | ||
| 4 | -Title: Ferramenta Identifica | ||
| 5 | - | ||
| 6 | -File: i3geo/ferramentas/identifica/index.js | ||
| 7 | - | ||
| 8 | -About: Licença | ||
| 9 | - | ||
| 10 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 11 | - | ||
| 12 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 13 | -Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
| 14 | - | ||
| 15 | -Este programa é software livre; você pode redistribuí-lo | ||
| 16 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 17 | -GNU conforme publicada pela Free Software Foundation; | ||
| 18 | -tanto a versão 2 da Licença. | ||
| 19 | -Este programa é distribuído na expectativa de que seja útil, | ||
| 20 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 21 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 22 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 23 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 24 | -GNU junto com este programa; se não, escreva para a | ||
| 25 | -Free Software Foundation, Inc., no endereço | ||
| 26 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 27 | -*/ | ||
| 28 | -if(typeof(i3GEOF) === 'undefined'){ | ||
| 29 | - i3GEOF = []; | ||
| 30 | -} | ||
| 31 | -/* | ||
| 32 | -Class: i3GEOF.identifica | ||
| 33 | - | ||
| 34 | -Obtém os atributos de um tema para uma coordenada. | ||
| 35 | - | ||
| 36 | -Abre uma janela com várias opções e lista de temas disponíveis no mapa atual. | ||
| 37 | - | ||
| 38 | -Essa classe depende da classe i3geo/classesjs/classe_php.php | ||
| 39 | -*/ | ||
| 40 | -i3GEOF.identifica = { | ||
| 41 | - /* | ||
| 42 | - Variavel: mostraLinkGeohack | ||
| 43 | - | ||
| 44 | - Mostra ou não o link para abrir o site GeoHack. | ||
| 45 | - | ||
| 46 | - Este site permite o uso de vários buscadores disponíveis na internet. | ||
| 47 | - | ||
| 48 | - Type: | ||
| 49 | - {boolean} | ||
| 50 | - */ | ||
| 51 | - mostraLinkGeohack: true, | ||
| 52 | - /* | ||
| 53 | - Variavel: mostraSistemasAdicionais | ||
| 54 | - | ||
| 55 | - Mostra ou não a lista de sistemas adicionais de busca de dados. | ||
| 56 | - | ||
| 57 | - Type: | ||
| 58 | - {boolean} | ||
| 59 | - */ | ||
| 60 | - mostraSistemasAdicionais: true, | ||
| 61 | - /* | ||
| 62 | - Variavel: locaplic | ||
| 63 | - | ||
| 64 | - Localização do i3geo | ||
| 65 | - | ||
| 66 | - Type: | ||
| 67 | - {String} | ||
| 68 | - */ | ||
| 69 | - locaplic: "", | ||
| 70 | - /* | ||
| 71 | - Variavel: sid | ||
| 72 | - | ||
| 73 | - Código da seção aberta pelo i3geo | ||
| 74 | - | ||
| 75 | - Type: | ||
| 76 | - {String} | ||
| 77 | - */ | ||
| 78 | - sid: "", | ||
| 79 | - /* | ||
| 80 | - Variavel: tema | ||
| 81 | - | ||
| 82 | - Código do tema que será pesquisado | ||
| 83 | - | ||
| 84 | - Type: | ||
| 85 | - {String} | ||
| 86 | - */ | ||
| 87 | - tema: "", | ||
| 88 | - /* | ||
| 89 | - Variavel: x | ||
| 90 | - | ||
| 91 | - Coordenada x | ||
| 92 | - | ||
| 93 | - Type: | ||
| 94 | - {Numeric} | ||
| 95 | - */ | ||
| 96 | - x: 0, | ||
| 97 | - /* | ||
| 98 | - Variavel: y | ||
| 99 | - | ||
| 100 | - Coordenada y | ||
| 101 | - | ||
| 102 | - Type: | ||
| 103 | - {Numeric} | ||
| 104 | - */ | ||
| 105 | - y: 0, | ||
| 106 | - /* | ||
| 107 | - Variavel: sistemasAdicionais | ||
| 108 | - | ||
| 109 | - Guarda a lista de sistemas adicionais que são incluídos na seleção de temas | ||
| 110 | - | ||
| 111 | - Type: | ||
| 112 | - {Array} | ||
| 113 | - */ | ||
| 114 | - sistemasAdicionais: [], | ||
| 115 | - /* | ||
| 116 | - Function: inicia | ||
| 117 | - | ||
| 118 | - Inicia a janela de informações | ||
| 119 | - | ||
| 120 | - Parameters: | ||
| 121 | - | ||
| 122 | - locaplic {String} - url onde o i3geo está instalado, pe, http://localhost/i3geo | ||
| 123 | - | ||
| 124 | - sid {String} - código da seção aberta no servidor eplo i3Geo | ||
| 125 | - | ||
| 126 | - tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado já na inicialização | ||
| 127 | - | ||
| 128 | - x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos | ||
| 129 | - | ||
| 130 | - y {Numeric} - coordenada y do ponto | ||
| 131 | - | ||
| 132 | - iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido | ||
| 133 | - | ||
| 134 | - mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks | ||
| 135 | - | ||
| 136 | - mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados | ||
| 137 | - */ | ||
| 138 | - inicia: function(locaplic,sid,tema,x,y,iddiv,mostraLinkGeohack,mostraSistemasAdicionais){ | ||
| 139 | - try{ | ||
| 140 | - var g_locidentifica; | ||
| 141 | - $i(iddiv).innerHTML += i3GEOF.identifica.html(); | ||
| 142 | - i3GEOF.identifica.locaplic = locaplic; | ||
| 143 | - i3GEOF.identifica.sid = sid; | ||
| 144 | - i3GEOF.identifica.tema = tema; | ||
| 145 | - i3GEOF.identifica.x = x; | ||
| 146 | - i3GEOF.identifica.y = y; | ||
| 147 | - i3GEOF.identifica.mostraLinkGeohack = mostraLinkGeohack; | ||
| 148 | - i3GEOF.identifica.mostraSistemasAdicionais = mostraSistemasAdicionais; | ||
| 149 | - i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia1","i3GEOidentificaguia"); | ||
| 150 | - //eventos das guias | ||
| 151 | - $i("i3GEOidentificaguia1").onclick = function(){i3GEOF.identifica.listaTemas("ligados");i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia1","i3GEOidentificaguia");}; | ||
| 152 | - $i("i3GEOidentificaguia2").onclick = function(){i3GEOF.identifica.listaTemas("todos");i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia1","i3GEOidentificaguia");}; | ||
| 153 | - $i("i3GEOidentificaguia3").onclick = function(){i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia3","i3GEOidentificaguia");}; | ||
| 154 | - $i("i3GEOidentificaguia4").onclick = function(){ | ||
| 155 | - i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia4","i3GEOidentificaguia"); | ||
| 156 | - new YAHOO.widget.Button("i3GEOidentificabotao1",{onclick:{fn: function(){ | ||
| 157 | - //window.location.href = "../etiqueta/index.htm?tema="+tema; | ||
| 158 | - if(i3GEO.temaAtivo !== "") | ||
| 159 | - {i3GEO.tema.dialogo.etiquetas(i3GEO.temaAtivo);} | ||
| 160 | - else | ||
| 161 | - {alert("Nenhum tema definido");} | ||
| 162 | - }}}); | ||
| 163 | - }; | ||
| 164 | - i3GEOF.identifica.listaTemas("ligados"); | ||
| 165 | - // | ||
| 166 | - //verifica se existem sistemas para identificar | ||
| 167 | - // | ||
| 168 | - if(i3GEOF.identifica.mostraSistemasAdicionais === true){ | ||
| 169 | - g_locidentifica = i3GEO.parametros.locidentifica; | ||
| 170 | - if (g_locidentifica !== ""){ | ||
| 171 | - if(window.parent.tempXMLSISTEMAS === undefined) | ||
| 172 | - {i3GEO.util.ajaxexecASXml(g_locidentifica,"i3GEOF.identifica.montaListaSistemas");} | ||
| 173 | - else | ||
| 174 | - {i3GEOF.identifica.montaListaSistemas(window.parent.tempXMLSISTEMAS);} | ||
| 175 | - } | ||
| 176 | - } | ||
| 177 | - if (i3GEO.temaAtivo !== "") | ||
| 178 | - {i3GEOF.identifica.buscaDadosTema(window.parent.i3GEO.temaAtivo);} | ||
| 179 | - } | ||
| 180 | - catch(erro){alert(erro);} | ||
| 181 | - }, | ||
| 182 | - ativaFoco: function(){ | ||
| 183 | - i3GEOF.identifica.listaTemas("ligados"); | ||
| 184 | - }, | ||
| 185 | - /* | ||
| 186 | - Function: html | ||
| 187 | - | ||
| 188 | - Gera o código html para apresentação das opções da ferramenta | ||
| 189 | - | ||
| 190 | - Retorno: | ||
| 191 | - | ||
| 192 | - String com o código html | ||
| 193 | - */ | ||
| 194 | - html:function(){ | ||
| 195 | - var ins = ''; | ||
| 196 | - ins += '<div id=i3GEOidentificaguiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">'; | ||
| 197 | - ins += ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">'; | ||
| 198 | - ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia1" style="text-align:center;font-size:10px;left:0px;" >Temas visíveis</div></em></a></li>'; | ||
| 199 | - ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia2" style="text-align:center;font-size:10px;left:0px;" >Todos os temas</div></em></a></li>'; | ||
| 200 | - ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia3" style="text-align:center;font-size:10px;left:0px;" >Propriedades</div></em></a></li>'; | ||
| 201 | - ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia4" style="text-align:center;font-size:10px;left:0px;" >Etiquetas</div></em></a></li>'; | ||
| 202 | - ins += ' </ul>'; | ||
| 203 | - ins += '</div>'; | ||
| 204 | - ins += '<div class="geralFerramentas" style="left:0px;top:0px;width:98%;height:86%;">'; | ||
| 205 | - ins += ' <div class=guiaobj id="i3GEOidentificaguia1obj" style="left:1px;90%">'; | ||
| 206 | - ins += ' <div style="display:block;position:relative;top:-5px;left:0px;width:150px">'; | ||
| 207 | - ins += ' <div style="left:0px;width:120px;text-align:left;font-size:10px;" id="i3GEOidentificalistaTemas" >Aguarde...</div>'; | ||
| 208 | - ins += ' <div style="left:0px;width:120px;text-align:left;font-size:10px;" id="i3GEOidentificalistaSistemas" >Aguarde...</div>'; | ||
| 209 | - ins += ' </div>'; | ||
| 210 | - ins += ' <div id="i3GEOidentificaocorrencia" style="font-size: 10px;overflow:auto;height:200px;display:block;position:absolute;top:5px;left:160px;width:60%"></div>'; | ||
| 211 | - ins += ' </div>'; | ||
| 212 | - ins += ' <div class=guiaobj id="i3GEOidentificaguia2obj" style="left:1px">'; | ||
| 213 | - ins += ' </div>'; | ||
| 214 | - ins += ' <div class=guiaobj id="i3GEOidentificaguia3obj" style="left:1px;top:10px;display:none;font-size:12px;overflow:hidden" >'; | ||
| 215 | - ins += ' Resolução de busca - número de pixels, no entorno do ponto clicado no mapa, que serão utilizados na busca de dados:<br> <input onclick="javascript:this.select();" type=text class=digitar value=5 id="i3GEOidentificaresolucao" size=2 />'; | ||
| 216 | - ins += ' </div>'; | ||
| 217 | - ins += ' <div class=guiaobj id="i3GEOidentificaguia4obj" style="left:1px;top:10px;display:none;font-size:12px;overflow:hidden" >'; | ||
| 218 | - ins += ' As etiquetas são mostradas quando o mouse é estacionado sobre um elemento.'; | ||
| 219 | - ins += ' <br><br><input id=i3GEOidentificabotao1 size=20 type=button value="Configurar etiquetas" />'; | ||
| 220 | - ins += ' </div>'; | ||
| 221 | - ins += '</div> '; | ||
| 222 | - return ins; | ||
| 223 | - }, | ||
| 224 | - /* | ||
| 225 | - Function: listaTemas | ||
| 226 | - | ||
| 227 | - Incluí a lista de temas para o usuário escolher | ||
| 228 | - | ||
| 229 | - Parametros: | ||
| 230 | - | ||
| 231 | - tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas | ||
| 232 | - */ | ||
| 233 | - listaTemas: function(tipo){ | ||
| 234 | - if(i3GEO.arvoreDeCamadas.CAMADAS !== ""){ | ||
| 235 | - var lista = i3GEO.arvoreDeCamadas.CAMADAS; | ||
| 236 | - if(tipo === "ligados") | ||
| 237 | - {lista = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",lista);} | ||
| 238 | - lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica","nao","diferente",lista); | ||
| 239 | - i3GEOF.identifica.montaListaTemas(lista); | ||
| 240 | - } | ||
| 241 | - else | ||
| 242 | - {i3GEO.php.listaTemas(i3GEOF.identifica.montaListaTemas,tipo,i3GEOF.identifica.locaplic,i3GEOF.identifica.sid);} | ||
| 243 | - }, | ||
| 244 | - /* | ||
| 245 | - Function: montaListaTemas | ||
| 246 | - | ||
| 247 | - Monta a lista de temas na forma de botões 'radio' | ||
| 248 | - | ||
| 249 | - O resultado é inserido no div com id "listaTemas" | ||
| 250 | - | ||
| 251 | - Parametros: | ||
| 252 | - | ||
| 253 | - retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas | ||
| 254 | - */ | ||
| 255 | - montaListaTemas: function(retorno){ | ||
| 256 | - var lista,linhas,linhas1,l,nome,tema,divResultado; | ||
| 257 | - if(retorno.data) | ||
| 258 | - {lista = retorno.data;} | ||
| 259 | - else | ||
| 260 | - {lista = retorno;} | ||
| 261 | - // | ||
| 262 | - //ativa o link para o site geohack | ||
| 263 | - // | ||
| 264 | - if(i3GEOF.identifica.mostraLinkGeohack === true) | ||
| 265 | - {linhas = i3GEOF.identifica.montaLinkGeohack();} | ||
| 266 | - else | ||
| 267 | - {linhas = "";} | ||
| 268 | - // | ||
| 269 | - //monta a lista de temas | ||
| 270 | - // | ||
| 271 | - linhas += "Clique no tema para ver os dados"; | ||
| 272 | - linhas1 = ""; | ||
| 273 | - for (l=0;l<lista.length;l++) | ||
| 274 | - { | ||
| 275 | - if(lista[l].nome){ | ||
| 276 | - nome = lista[l].nome; | ||
| 277 | - tema = lista[l].tema; | ||
| 278 | - } | ||
| 279 | - else{ | ||
| 280 | - nome = lista[l].tema; | ||
| 281 | - tema = lista[l].name; | ||
| 282 | - } | ||
| 283 | - | ||
| 284 | - if(lista[l].identifica !== "nao") | ||
| 285 | - {linhas1 += "<tr><td style='border-top:1px solid beige;'><input onclick='i3GEOF.identifica.buscaDadosTema(\""+tema+"\")' style=cursor:pointer type=radio name=i3GEOidentificatema /></td><td style='border-top:1px solid beige;' >"+nome+"</td></tr>";} | ||
| 286 | - } | ||
| 287 | - divResultado = $i("i3GEOidentificalistaTemas"); | ||
| 288 | - if(divResultado) | ||
| 289 | - {divResultado.innerHTML = linhas+"<table class=lista2 ><tr><td style=text-align:left ><input onclick='i3GEOF.identifica.buscaDadosTema(\"ligados\")' style=cursor:pointer type=radio name=i3GEOidentificatema /></td><td>Todos</td></tr>"+linhas1+"</table>";} | ||
| 290 | - }, | ||
| 291 | - /* | ||
| 292 | - Function: montaLinkGeohack | ||
| 293 | - | ||
| 294 | - Monta o link para o site geohack | ||
| 295 | - | ||
| 296 | - Return: | ||
| 297 | - | ||
| 298 | - {String} | ||
| 299 | - */ | ||
| 300 | - montaLinkGeohack: function(){ | ||
| 301 | - var b,x,y,w,s,param,url,linhas; | ||
| 302 | - b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x,i3GEOF.identifica.y); | ||
| 303 | - x = b[0].split(" "); | ||
| 304 | - y = b[1].split(" "); | ||
| 305 | - w = "W"; | ||
| 306 | - s = "S"; | ||
| 307 | - if (x[0]*1 > 0) | ||
| 308 | - {w = "L";} | ||
| 309 | - if (y[0]*1 > 0) | ||
| 310 | - {s = "N";} | ||
| 311 | - if (x[0]*1 < 0) | ||
| 312 | - {x[0] = x[0]*-1;} | ||
| 313 | - if (y[0]*1 < 0) | ||
| 314 | - {y[0] = y[0]*-1;} | ||
| 315 | - param = y[0]+"_"+y[1]+"_"+y[2]+"_"+s+"_"+x[0]+"_"+x[1]+"_"+x[2]+"_"+w; | ||
| 316 | - url = "http://tools.wikimedia.de/~magnus/geo/geohack.php?params="+param; | ||
| 317 | - linhas = "<a href='"+url+"' target=blank >Buscadores web</a><br>"; | ||
| 318 | - return linhas; | ||
| 319 | - }, | ||
| 320 | - /* | ||
| 321 | - Function: montaListaSistemas | ||
| 322 | - | ||
| 323 | - Obtém a lista de sistemas especiais de consulta. | ||
| 324 | - | ||
| 325 | - O resultado é inserido no div com id "listaSistemas". | ||
| 326 | - | ||
| 327 | - A lista de sistemas é obtida de um XML definido no i3Geo na variável window.parent.i3GEO.parametros.locidentifica | ||
| 328 | - | ||
| 329 | - Cada sistema consiste em uma URL para a qual serão passados os parâmetros x e y. | ||
| 330 | - | ||
| 331 | - Parametros: | ||
| 332 | - | ||
| 333 | - xmlDoc - documento xml | ||
| 334 | - */ | ||
| 335 | - montaListaSistemas: function(xmlDoc){ | ||
| 336 | - var divins,sisig,sistema,pub,exec,temp,t,linhas,ltema; | ||
| 337 | - if (xmlDoc !== undefined) | ||
| 338 | - { | ||
| 339 | - window.parent.tempXMLSISTEMAS = xmlDoc; | ||
| 340 | - divins = $i("i3GEOidentificalistaSistemas"); | ||
| 341 | - sis = xmlDoc.getElementsByTagName("FUNCAO"); | ||
| 342 | - for (ig=0;ig<sis.length;ig++) | ||
| 343 | - { | ||
| 344 | - sistema = sis[ig].getElementsByTagName("NOMESIS")[0].firstChild.nodeValue; | ||
| 345 | - if(sis[ig].getElementsByTagName("PUBLICADO")[0]) | ||
| 346 | - { | ||
| 347 | - if(sis[ig].getElementsByTagName("PUBLICADO")[0].firstChild) | ||
| 348 | - { | ||
| 349 | - pub = sis[ig].getElementsByTagName("PUBLICADO")[0].firstChild.nodeValue; | ||
| 350 | - if(pub === "NAO" || pub === "nao") | ||
| 351 | - {sistema = "<s>"+sistema+"</s>";} | ||
| 352 | - } | ||
| 353 | - } | ||
| 354 | - exec = sis[ig].getElementsByTagName("ABRIR")[0].firstChild.nodeValue; | ||
| 355 | - temp = exec.split('"'); | ||
| 356 | - if(temp.length === 1) | ||
| 357 | - {exec = '"'+exec+'"';} | ||
| 358 | - temp = exec.split("?"); | ||
| 359 | - if(temp.length !== 2) | ||
| 360 | - {exec += '+"?"';} | ||
| 361 | - t = "blank"; | ||
| 362 | - if (sis[ig].getElementsByTagName("TARGET")[0]) | ||
| 363 | - {t = sis[ig].getElementsByTagName("TARGET")[0].firstChild.nodeValue;} | ||
| 364 | - i3GEOF.identifica.sistemasAdicionais.push(sistema+","+exec+","+t); | ||
| 365 | - } | ||
| 366 | - if (i3GEOF.identifica.sistemasAdicionais.length > 0) | ||
| 367 | - { | ||
| 368 | - linhas = ""; | ||
| 369 | - for (l=0;l<i3GEOF.identifica.sistemasAdicionais.length;l++) | ||
| 370 | - { | ||
| 371 | - ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); | ||
| 372 | - if (ltema.length > 1) | ||
| 373 | - {linhas += "<tr><td style='border-top:1px solid beige;'><input onclick='i3GEOF.identifica.mostraDadosSistema("+ltema[1]+",\""+ltema[2]+"\")' style=cursor:pointer type=radio name=i3GEOidentificatema /></td><td style='border-top:1px solid beige;' >"+ltema[0]+"</td></tr>";} | ||
| 374 | - | ||
| 375 | - } | ||
| 376 | - if(divins){ | ||
| 377 | - divins.innerHTML = "<table class='lista2' >"+linhas+"</table>"; | ||
| 378 | - return; | ||
| 379 | - } | ||
| 380 | - } | ||
| 381 | - } | ||
| 382 | - divins.innerHTML = ""; | ||
| 383 | - }, | ||
| 384 | - /* | ||
| 385 | - Function: buscaDadosTema | ||
| 386 | - | ||
| 387 | - Obtém os dados de um tema para o ponto de coordenadas clicado no mapa | ||
| 388 | - */ | ||
| 389 | - buscaDadosTema: function(tema){ | ||
| 390 | - var res,opcao,resolucao; | ||
| 391 | - $i("i3GEOidentificaocorrencia").innerHTML = "<img src='"+i3GEOF.identifica.locaplic+"/imagens/aguarde.gif' />"; | ||
| 392 | - res = $i("i3GEOidentificaresolucao"); | ||
| 393 | - if(res) | ||
| 394 | - {resolucao = res.value;} | ||
| 395 | - else | ||
| 396 | - {res = 5;} | ||
| 397 | - i3GEO.temaAtivo = tema; | ||
| 398 | - //var resolucao = "0.01" | ||
| 399 | - if (tema === "ligados") | ||
| 400 | - {opcao = "ligados";} | ||
| 401 | - else | ||
| 402 | - {opcao = "tema";} | ||
| 403 | - i3GEO.php.identifica2(i3GEOF.identifica.mostraDadosTema,i3GEOF.identifica.x,i3GEOF.identifica.y,resolucao,opcao,i3GEOF.identifica.locaplic,i3GEOF.identifica.sid,tema); | ||
| 404 | - }, | ||
| 405 | - /* | ||
| 406 | - Function: mostraDadosSistema | ||
| 407 | - | ||
| 408 | - Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa | ||
| 409 | - | ||
| 410 | - Parametros: | ||
| 411 | - | ||
| 412 | - exec {String} - url que será aberta | ||
| 413 | - | ||
| 414 | - target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso contrário, em uma nova página do navegador | ||
| 415 | - */ | ||
| 416 | - mostraDadosSistema: function(exec,target){ | ||
| 417 | - exec += "&x="+i3GEOF.identifica.x+"&y="+i3GEOF.identifica.y; | ||
| 418 | - window.open(exec); | ||
| 419 | - }, | ||
| 420 | - /* | ||
| 421 | - Function: mostraDadosTema | ||
| 422 | - | ||
| 423 | - Mostra os dados obtidos de um ou mais temas. | ||
| 424 | - | ||
| 425 | - Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para apresentação na tela. | ||
| 426 | - | ||
| 427 | - Parametros: | ||
| 428 | - | ||
| 429 | - retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica2> | ||
| 430 | - */ | ||
| 431 | - mostraDadosTema: function(retorno){ | ||
| 432 | - var res,div0,ntemas,i,resultados,nres,cor,j; | ||
| 433 | - if (retorno.data !== undefined) | ||
| 434 | - { | ||
| 435 | - retorno = retorno.data; | ||
| 436 | - divO = $i("i3GEOidentificaocorrencia"); | ||
| 437 | - divO.innerHTML=""; | ||
| 438 | - ntemas = retorno.length; | ||
| 439 | - for(i=0;i<ntemas;i++) | ||
| 440 | - { | ||
| 441 | - resultados = retorno[i].resultado[0]; | ||
| 442 | - if(resultados !== " ") | ||
| 443 | - { | ||
| 444 | - res += "<div style='padding-top:6px;left:2px;text-align:left;width:80%;' >"+retorno[i].nome+"</div>"; | ||
| 445 | - nres = resultados.length; | ||
| 446 | - cor = "RGB(250,250,250)"; | ||
| 447 | - for(j=0;j<nres;j++) | ||
| 448 | - { | ||
| 449 | - if(resultados[j].link === "") | ||
| 450 | - {res += "<div style='width:80%;text-align:left;background-color:"+cor+"' > "+resultados[j].alias+": "+resultados[j].valor+"</div>";} | ||
| 451 | - else | ||
| 452 | - {res += "<div style='width:80%;text-align:left;background-color:"+cor+"' > "+resultados[j].alias+": <a href='"+resultados[j].link+"' target=_blank >"+resultados[j].valor+"</a></div>";} | ||
| 453 | - if(resultados[j].img !== "") | ||
| 454 | - {res += "<div style='width:80%;text-align:left;background-color:"+cor+"' >"+resultados[j].img+"</div>";} | ||
| 455 | - if (cor === "RGB(250,250,250)"){cor = "beige";} | ||
| 456 | - else | ||
| 457 | - {cor = "RGB(250,250,250)";} | ||
| 458 | - } | ||
| 459 | - } | ||
| 460 | - } | ||
| 461 | - $i("i3GEOidentificaocorrencia").innerHTML=res; | ||
| 462 | - } | ||
| 463 | - } | ||
| 464 | -}; | ||
| 465 | \ No newline at end of file | 0 | \ No newline at end of file |
| @@ -0,0 +1,465 @@ | @@ -0,0 +1,465 @@ | ||
| 1 | +<?php if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/javascript"); ?> | ||
| 2 | +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | ||
| 3 | +/* | ||
| 4 | +Title: Ferramenta Identifica | ||
| 5 | + | ||
| 6 | +File: i3geo/ferramentas/identifica/index.js | ||
| 7 | + | ||
| 8 | +About: Licença | ||
| 9 | + | ||
| 10 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 11 | + | ||
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
| 14 | + | ||
| 15 | +Este programa é software livre; você pode redistribuí-lo | ||
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 17 | +GNU conforme publicada pela Free Software Foundation; | ||
| 18 | +tanto a versão 2 da Licença. | ||
| 19 | +Este programa é distribuído na expectativa de que seja útil, | ||
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 24 | +GNU junto com este programa; se não, escreva para a | ||
| 25 | +Free Software Foundation, Inc., no endereço | ||
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 27 | +*/ | ||
| 28 | +if(typeof(i3GEOF) === 'undefined'){ | ||
| 29 | + i3GEOF = []; | ||
| 30 | +} | ||
| 31 | +/* | ||
| 32 | +Class: i3GEOF.identifica | ||
| 33 | + | ||
| 34 | +Obtém os atributos de um tema para uma coordenada. | ||
| 35 | + | ||
| 36 | +Abre uma janela com várias opções e lista de temas disponíveis no mapa atual. | ||
| 37 | + | ||
| 38 | +Essa classe depende da classe i3geo/classesjs/classe_php.php | ||
| 39 | +*/ | ||
| 40 | +i3GEOF.identifica = { | ||
| 41 | + /* | ||
| 42 | + Variavel: mostraLinkGeohack | ||
| 43 | + | ||
| 44 | + Mostra ou não o link para abrir o site GeoHack. | ||
| 45 | + | ||
| 46 | + Este site permite o uso de vários buscadores disponíveis na internet. | ||
| 47 | + | ||
| 48 | + Type: | ||
| 49 | + {boolean} | ||
| 50 | + */ | ||
| 51 | + mostraLinkGeohack: true, | ||
| 52 | + /* | ||
| 53 | + Variavel: mostraSistemasAdicionais | ||
| 54 | + | ||
| 55 | + Mostra ou não a lista de sistemas adicionais de busca de dados. | ||
| 56 | + | ||
| 57 | + Type: | ||
| 58 | + {boolean} | ||
| 59 | + */ | ||
| 60 | + mostraSistemasAdicionais: true, | ||
| 61 | + /* | ||
| 62 | + Variavel: locaplic | ||
| 63 | + | ||
| 64 | + Localização do i3geo | ||
| 65 | + | ||
| 66 | + Type: | ||
| 67 | + {String} | ||
| 68 | + */ | ||
| 69 | + locaplic: "", | ||
| 70 | + /* | ||
| 71 | + Variavel: sid | ||
| 72 | + | ||
| 73 | + Código da seção aberta pelo i3geo | ||
| 74 | + | ||
| 75 | + Type: | ||
| 76 | + {String} | ||
| 77 | + */ | ||
| 78 | + sid: "", | ||
| 79 | + /* | ||
| 80 | + Variavel: tema | ||
| 81 | + | ||
| 82 | + Código do tema que será pesquisado | ||
| 83 | + | ||
| 84 | + Type: | ||
| 85 | + {String} | ||
| 86 | + */ | ||
| 87 | + tema: "", | ||
| 88 | + /* | ||
| 89 | + Variavel: x | ||
| 90 | + | ||
| 91 | + Coordenada x | ||
| 92 | + | ||
| 93 | + Type: | ||
| 94 | + {Numeric} | ||
| 95 | + */ | ||
| 96 | + x: 0, | ||
| 97 | + /* | ||
| 98 | + Variavel: y | ||
| 99 | + | ||
| 100 | + Coordenada y | ||
| 101 | + | ||
| 102 | + Type: | ||
| 103 | + {Numeric} | ||
| 104 | + */ | ||
| 105 | + y: 0, | ||
| 106 | + /* | ||
| 107 | + Variavel: sistemasAdicionais | ||
| 108 | + | ||
| 109 | + Guarda a lista de sistemas adicionais que são incluídos na seleção de temas | ||
| 110 | + | ||
| 111 | + Type: | ||
| 112 | + {Array} | ||
| 113 | + */ | ||
| 114 | + sistemasAdicionais: [], | ||
| 115 | + /* | ||
| 116 | + Function: inicia | ||
| 117 | + | ||
| 118 | + Inicia a janela de informações | ||
| 119 | + | ||
| 120 | + Parameters: | ||
| 121 | + | ||
| 122 | + locaplic {String} - url onde o i3geo está instalado, pe, http://localhost/i3geo | ||
| 123 | + | ||
| 124 | + sid {String} - código da seção aberta no servidor eplo i3Geo | ||
| 125 | + | ||
| 126 | + tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado já na inicialização | ||
| 127 | + | ||
| 128 | + x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos | ||
| 129 | + | ||
| 130 | + y {Numeric} - coordenada y do ponto | ||
| 131 | + | ||
| 132 | + iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido | ||
| 133 | + | ||
| 134 | + mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks | ||
| 135 | + | ||
| 136 | + mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados | ||
| 137 | + */ | ||
| 138 | + inicia: function(locaplic,sid,tema,x,y,iddiv,mostraLinkGeohack,mostraSistemasAdicionais){ | ||
| 139 | + try{ | ||
| 140 | + var g_locidentifica; | ||
| 141 | + $i(iddiv).innerHTML += i3GEOF.identifica.html(); | ||
| 142 | + i3GEOF.identifica.locaplic = locaplic; | ||
| 143 | + i3GEOF.identifica.sid = sid; | ||
| 144 | + i3GEOF.identifica.tema = tema; | ||
| 145 | + i3GEOF.identifica.x = x; | ||
| 146 | + i3GEOF.identifica.y = y; | ||
| 147 | + i3GEOF.identifica.mostraLinkGeohack = mostraLinkGeohack; | ||
| 148 | + i3GEOF.identifica.mostraSistemasAdicionais = mostraSistemasAdicionais; | ||
| 149 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia1","i3GEOidentificaguia"); | ||
| 150 | + //eventos das guias | ||
| 151 | + $i("i3GEOidentificaguia1").onclick = function(){i3GEOF.identifica.listaTemas("ligados");i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia1","i3GEOidentificaguia");}; | ||
| 152 | + $i("i3GEOidentificaguia2").onclick = function(){i3GEOF.identifica.listaTemas("todos");i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia1","i3GEOidentificaguia");}; | ||
| 153 | + $i("i3GEOidentificaguia3").onclick = function(){i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia3","i3GEOidentificaguia");}; | ||
| 154 | + $i("i3GEOidentificaguia4").onclick = function(){ | ||
| 155 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia4","i3GEOidentificaguia"); | ||
| 156 | + new YAHOO.widget.Button("i3GEOidentificabotao1",{onclick:{fn: function(){ | ||
| 157 | + //window.location.href = "../etiqueta/index.htm?tema="+tema; | ||
| 158 | + if(i3GEO.temaAtivo !== "") | ||
| 159 | + {i3GEO.tema.dialogo.etiquetas(i3GEO.temaAtivo);} | ||
| 160 | + else | ||
| 161 | + {alert("Nenhum tema definido");} | ||
| 162 | + }}}); | ||
| 163 | + }; | ||
| 164 | + i3GEOF.identifica.listaTemas("ligados"); | ||
| 165 | + // | ||
| 166 | + //verifica se existem sistemas para identificar | ||
| 167 | + // | ||
| 168 | + if(i3GEOF.identifica.mostraSistemasAdicionais === true){ | ||
| 169 | + g_locidentifica = i3GEO.parametros.locidentifica; | ||
| 170 | + if (g_locidentifica !== ""){ | ||
| 171 | + if(window.parent.tempXMLSISTEMAS === undefined) | ||
| 172 | + {i3GEO.util.ajaxexecASXml(g_locidentifica,"i3GEOF.identifica.montaListaSistemas");} | ||
| 173 | + else | ||
| 174 | + {i3GEOF.identifica.montaListaSistemas(window.parent.tempXMLSISTEMAS);} | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + if (i3GEO.temaAtivo !== "") | ||
| 178 | + {i3GEOF.identifica.buscaDadosTema(window.parent.i3GEO.temaAtivo);} | ||
| 179 | + } | ||
| 180 | + catch(erro){alert(erro);} | ||
| 181 | + }, | ||
| 182 | + ativaFoco: function(){ | ||
| 183 | + i3GEOF.identifica.listaTemas("ligados"); | ||
| 184 | + }, | ||
| 185 | + /* | ||
| 186 | + Function: html | ||
| 187 | + | ||
| 188 | + Gera o código html para apresentação das opções da ferramenta | ||
| 189 | + | ||
| 190 | + Retorno: | ||
| 191 | + | ||
| 192 | + String com o código html | ||
| 193 | + */ | ||
| 194 | + html:function(){ | ||
| 195 | + var ins = ''; | ||
| 196 | + ins += '<div id=i3GEOidentificaguiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">'; | ||
| 197 | + ins += ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">'; | ||
| 198 | + ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia1" style="text-align:center;font-size:10px;left:0px;" >Temas visíveis</div></em></a></li>'; | ||
| 199 | + ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia2" style="text-align:center;font-size:10px;left:0px;" >Todos os temas</div></em></a></li>'; | ||
| 200 | + ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia3" style="text-align:center;font-size:10px;left:0px;" >Propriedades</div></em></a></li>'; | ||
| 201 | + ins += ' <li><a href="#ancora"><em><div id="i3GEOidentificaguia4" style="text-align:center;font-size:10px;left:0px;" >Etiquetas</div></em></a></li>'; | ||
| 202 | + ins += ' </ul>'; | ||
| 203 | + ins += '</div>'; | ||
| 204 | + ins += '<div class="geralFerramentas" style="left:0px;top:0px;width:98%;height:86%;">'; | ||
| 205 | + ins += ' <div class=guiaobj id="i3GEOidentificaguia1obj" style="left:1px;90%">'; | ||
| 206 | + ins += ' <div style="display:block;position:relative;top:-5px;left:0px;width:150px">'; | ||
| 207 | + ins += ' <div style="left:0px;width:120px;text-align:left;font-size:10px;" id="i3GEOidentificalistaTemas" >Aguarde...</div>'; | ||
| 208 | + ins += ' <div style="left:0px;width:120px;text-align:left;font-size:10px;" id="i3GEOidentificalistaSistemas" >Aguarde...</div>'; | ||
| 209 | + ins += ' </div>'; | ||
| 210 | + ins += ' <div id="i3GEOidentificaocorrencia" style="font-size: 10px;overflow:auto;height:200px;display:block;position:absolute;top:5px;left:160px;width:60%"></div>'; | ||
| 211 | + ins += ' </div>'; | ||
| 212 | + ins += ' <div class=guiaobj id="i3GEOidentificaguia2obj" style="left:1px">'; | ||
| 213 | + ins += ' </div>'; | ||
| 214 | + ins += ' <div class=guiaobj id="i3GEOidentificaguia3obj" style="left:1px;top:10px;display:none;font-size:12px;overflow:hidden" >'; | ||
| 215 | + ins += ' Resolução de busca - número de pixels, no entorno do ponto clicado no mapa, que serão utilizados na busca de dados:<br> <input onclick="javascript:this.select();" type=text class=digitar value=5 id="i3GEOidentificaresolucao" size=2 />'; | ||
| 216 | + ins += ' </div>'; | ||
| 217 | + ins += ' <div class=guiaobj id="i3GEOidentificaguia4obj" style="left:1px;top:10px;display:none;font-size:12px;overflow:hidden" >'; | ||
| 218 | + ins += ' As etiquetas são mostradas quando o mouse é estacionado sobre um elemento.'; | ||
| 219 | + ins += ' <br><br><input id=i3GEOidentificabotao1 size=20 type=button value="Configurar etiquetas" />'; | ||
| 220 | + ins += ' </div>'; | ||
| 221 | + ins += '</div> '; | ||
| 222 | + return ins; | ||
| 223 | + }, | ||
| 224 | + /* | ||
| 225 | + Function: listaTemas | ||
| 226 | + | ||
| 227 | + Incluí a lista de temas para o usuário escolher | ||
| 228 | + | ||
| 229 | + Parametros: | ||
| 230 | + | ||
| 231 | + tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas | ||
| 232 | + */ | ||
| 233 | + listaTemas: function(tipo){ | ||
| 234 | + if(i3GEO.arvoreDeCamadas.CAMADAS !== ""){ | ||
| 235 | + var lista = i3GEO.arvoreDeCamadas.CAMADAS; | ||
| 236 | + if(tipo === "ligados") | ||
| 237 | + {lista = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",lista);} | ||
| 238 | + lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica","nao","diferente",lista); | ||
| 239 | + i3GEOF.identifica.montaListaTemas(lista); | ||
| 240 | + } | ||
| 241 | + else | ||
| 242 | + {i3GEO.php.listaTemas(i3GEOF.identifica.montaListaTemas,tipo,i3GEOF.identifica.locaplic,i3GEOF.identifica.sid);} | ||
| 243 | + }, | ||
| 244 | + /* | ||
| 245 | + Function: montaListaTemas | ||
| 246 | + | ||
| 247 | + Monta a lista de temas na forma de botões 'radio' | ||
| 248 | + | ||
| 249 | + O resultado é inserido no div com id "listaTemas" | ||
| 250 | + | ||
| 251 | + Parametros: | ||
| 252 | + | ||
| 253 | + retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas | ||
| 254 | + */ | ||
| 255 | + montaListaTemas: function(retorno){ | ||
| 256 | + var lista,linhas,linhas1,l,nome,tema,divResultado; | ||
| 257 | + if(retorno.data) | ||
| 258 | + {lista = retorno.data;} | ||
| 259 | + else | ||
| 260 | + {lista = retorno;} | ||
| 261 | + // | ||
| 262 | + //ativa o link para o site geohack | ||
| 263 | + // | ||
| 264 | + if(i3GEOF.identifica.mostraLinkGeohack === true) | ||
| 265 | + {linhas = i3GEOF.identifica.montaLinkGeohack();} | ||
| 266 | + else | ||
| 267 | + {linhas = "";} | ||
| 268 | + // | ||
| 269 | + //monta a lista de temas | ||
| 270 | + // | ||
| 271 | + linhas += "Clique no tema para ver os dados"; | ||
| 272 | + linhas1 = ""; | ||
| 273 | + for (l=0;l<lista.length;l++) | ||
| 274 | + { | ||
| 275 | + if(lista[l].nome){ | ||
| 276 | + nome = lista[l].nome; | ||
| 277 | + tema = lista[l].tema; | ||
| 278 | + } | ||
| 279 | + else{ | ||
| 280 | + nome = lista[l].tema; | ||
| 281 | + tema = lista[l].name; | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + if(lista[l].identifica !== "nao") | ||
| 285 | + {linhas1 += "<tr><td style='border-top:1px solid beige;'><input onclick='i3GEOF.identifica.buscaDadosTema(\""+tema+"\")' style=cursor:pointer type=radio name=i3GEOidentificatema /></td><td style='border-top:1px solid beige;' >"+nome+"</td></tr>";} | ||
| 286 | + } | ||
| 287 | + divResultado = $i("i3GEOidentificalistaTemas"); | ||
| 288 | + if(divResultado) | ||
| 289 | + {divResultado.innerHTML = linhas+"<table class=lista2 ><tr><td style=text-align:left ><input onclick='i3GEOF.identifica.buscaDadosTema(\"ligados\")' style=cursor:pointer type=radio name=i3GEOidentificatema /></td><td>Todos</td></tr>"+linhas1+"</table>";} | ||
| 290 | + }, | ||
| 291 | + /* | ||
| 292 | + Function: montaLinkGeohack | ||
| 293 | + | ||
| 294 | + Monta o link para o site geohack | ||
| 295 | + | ||
| 296 | + Return: | ||
| 297 | + | ||
| 298 | + {String} | ||
| 299 | + */ | ||
| 300 | + montaLinkGeohack: function(){ | ||
| 301 | + var b,x,y,w,s,param,url,linhas; | ||
| 302 | + b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x,i3GEOF.identifica.y); | ||
| 303 | + x = b[0].split(" "); | ||
| 304 | + y = b[1].split(" "); | ||
| 305 | + w = "W"; | ||
| 306 | + s = "S"; | ||
| 307 | + if (x[0]*1 > 0) | ||
| 308 | + {w = "L";} | ||
| 309 | + if (y[0]*1 > 0) | ||
| 310 | + {s = "N";} | ||
| 311 | + if (x[0]*1 < 0) | ||
| 312 | + {x[0] = x[0]*-1;} | ||
| 313 | + if (y[0]*1 < 0) | ||
| 314 | + {y[0] = y[0]*-1;} | ||
| 315 | + param = y[0]+"_"+y[1]+"_"+y[2]+"_"+s+"_"+x[0]+"_"+x[1]+"_"+x[2]+"_"+w; | ||
| 316 | + url = "http://tools.wikimedia.de/~magnus/geo/geohack.php?params="+param; | ||
| 317 | + linhas = "<a href='"+url+"' target=blank >Buscadores web</a><br>"; | ||
| 318 | + return linhas; | ||
| 319 | + }, | ||
| 320 | + /* | ||
| 321 | + Function: montaListaSistemas | ||
| 322 | + | ||
| 323 | + Obtém a lista de sistemas especiais de consulta. | ||
| 324 | + | ||
| 325 | + O resultado é inserido no div com id "listaSistemas". | ||
| 326 | + | ||
| 327 | + A lista de sistemas é obtida de um XML definido no i3Geo na variável window.parent.i3GEO.parametros.locidentifica | ||
| 328 | + | ||
| 329 | + Cada sistema consiste em uma URL para a qual serão passados os parâmetros x e y. | ||
| 330 | + | ||
| 331 | + Parametros: | ||
| 332 | + | ||
| 333 | + xmlDoc - documento xml | ||
| 334 | + */ | ||
| 335 | + montaListaSistemas: function(xmlDoc){ | ||
| 336 | + var divins,sisig,sistema,pub,exec,temp,t,linhas,ltema; | ||
| 337 | + if (xmlDoc !== undefined) | ||
| 338 | + { | ||
| 339 | + window.parent.tempXMLSISTEMAS = xmlDoc; | ||
| 340 | + divins = $i("i3GEOidentificalistaSistemas"); | ||
| 341 | + sis = xmlDoc.getElementsByTagName("FUNCAO"); | ||
| 342 | + for (ig=0;ig<sis.length;ig++) | ||
| 343 | + { | ||
| 344 | + sistema = sis[ig].getElementsByTagName("NOMESIS")[0].firstChild.nodeValue; | ||
| 345 | + if(sis[ig].getElementsByTagName("PUBLICADO")[0]) | ||
| 346 | + { | ||
| 347 | + if(sis[ig].getElementsByTagName("PUBLICADO")[0].firstChild) | ||
| 348 | + { | ||
| 349 | + pub = sis[ig].getElementsByTagName("PUBLICADO")[0].firstChild.nodeValue; | ||
| 350 | + if(pub === "NAO" || pub === "nao") | ||
| 351 | + {sistema = "<s>"+sistema+"</s>";} | ||
| 352 | + } | ||
| 353 | + } | ||
| 354 | + exec = sis[ig].getElementsByTagName("ABRIR")[0].firstChild.nodeValue; | ||
| 355 | + temp = exec.split('"'); | ||
| 356 | + if(temp.length === 1) | ||
| 357 | + {exec = '"'+exec+'"';} | ||
| 358 | + temp = exec.split("?"); | ||
| 359 | + if(temp.length !== 2) | ||
| 360 | + {exec += '+"?"';} | ||
| 361 | + t = "blank"; | ||
| 362 | + if (sis[ig].getElementsByTagName("TARGET")[0]) | ||
| 363 | + {t = sis[ig].getElementsByTagName("TARGET")[0].firstChild.nodeValue;} | ||
| 364 | + i3GEOF.identifica.sistemasAdicionais.push(sistema+","+exec+","+t); | ||
| 365 | + } | ||
| 366 | + if (i3GEOF.identifica.sistemasAdicionais.length > 0) | ||
| 367 | + { | ||
| 368 | + linhas = ""; | ||
| 369 | + for (l=0;l<i3GEOF.identifica.sistemasAdicionais.length;l++) | ||
| 370 | + { | ||
| 371 | + ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); | ||
| 372 | + if (ltema.length > 1) | ||
| 373 | + {linhas += "<tr><td style='border-top:1px solid beige;'><input onclick='i3GEOF.identifica.mostraDadosSistema("+ltema[1]+",\""+ltema[2]+"\")' style=cursor:pointer type=radio name=i3GEOidentificatema /></td><td style='border-top:1px solid beige;' >"+ltema[0]+"</td></tr>";} | ||
| 374 | + | ||
| 375 | + } | ||
| 376 | + if(divins){ | ||
| 377 | + divins.innerHTML = "<table class='lista2' >"+linhas+"</table>"; | ||
| 378 | + return; | ||
| 379 | + } | ||
| 380 | + } | ||
| 381 | + } | ||
| 382 | + divins.innerHTML = ""; | ||
| 383 | + }, | ||
| 384 | + /* | ||
| 385 | + Function: buscaDadosTema | ||
| 386 | + | ||
| 387 | + Obtém os dados de um tema para o ponto de coordenadas clicado no mapa | ||
| 388 | + */ | ||
| 389 | + buscaDadosTema: function(tema){ | ||
| 390 | + var res,opcao,resolucao; | ||
| 391 | + $i("i3GEOidentificaocorrencia").innerHTML = "<img src='"+i3GEOF.identifica.locaplic+"/imagens/aguarde.gif' />"; | ||
| 392 | + res = $i("i3GEOidentificaresolucao"); | ||
| 393 | + if(res) | ||
| 394 | + {resolucao = res.value;} | ||
| 395 | + else | ||
| 396 | + {res = 5;} | ||
| 397 | + i3GEO.temaAtivo = tema; | ||
| 398 | + //var resolucao = "0.01" | ||
| 399 | + if (tema === "ligados") | ||
| 400 | + {opcao = "ligados";} | ||
| 401 | + else | ||
| 402 | + {opcao = "tema";} | ||
| 403 | + i3GEO.php.identifica2(i3GEOF.identifica.mostraDadosTema,i3GEOF.identifica.x,i3GEOF.identifica.y,resolucao,opcao,i3GEOF.identifica.locaplic,i3GEOF.identifica.sid,tema); | ||
| 404 | + }, | ||
| 405 | + /* | ||
| 406 | + Function: mostraDadosSistema | ||
| 407 | + | ||
| 408 | + Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa | ||
| 409 | + | ||
| 410 | + Parametros: | ||
| 411 | + | ||
| 412 | + exec {String} - url que será aberta | ||
| 413 | + | ||
| 414 | + target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso contrário, em uma nova página do navegador | ||
| 415 | + */ | ||
| 416 | + mostraDadosSistema: function(exec,target){ | ||
| 417 | + exec += "&x="+i3GEOF.identifica.x+"&y="+i3GEOF.identifica.y; | ||
| 418 | + window.open(exec); | ||
| 419 | + }, | ||
| 420 | + /* | ||
| 421 | + Function: mostraDadosTema | ||
| 422 | + | ||
| 423 | + Mostra os dados obtidos de um ou mais temas. | ||
| 424 | + | ||
| 425 | + Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para apresentação na tela. | ||
| 426 | + | ||
| 427 | + Parametros: | ||
| 428 | + | ||
| 429 | + retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica2> | ||
| 430 | + */ | ||
| 431 | + mostraDadosTema: function(retorno){ | ||
| 432 | + var res,div0,ntemas,i,resultados,nres,cor,j; | ||
| 433 | + if (retorno.data !== undefined) | ||
| 434 | + { | ||
| 435 | + retorno = retorno.data; | ||
| 436 | + divO = $i("i3GEOidentificaocorrencia"); | ||
| 437 | + divO.innerHTML=""; | ||
| 438 | + ntemas = retorno.length; | ||
| 439 | + for(i=0;i<ntemas;i++) | ||
| 440 | + { | ||
| 441 | + resultados = retorno[i].resultado[0]; | ||
| 442 | + if(resultados !== " ") | ||
| 443 | + { | ||
| 444 | + res += "<div style='padding-top:6px;left:2px;text-align:left;width:80%;' >"+retorno[i].nome+"</div>"; | ||
| 445 | + nres = resultados.length; | ||
| 446 | + cor = "RGB(250,250,250)"; | ||
| 447 | + for(j=0;j<nres;j++) | ||
| 448 | + { | ||
| 449 | + if(resultados[j].link === "") | ||
| 450 | + {res += "<div style='width:80%;text-align:left;background-color:"+cor+"' > "+resultados[j].alias+": "+resultados[j].valor+"</div>";} | ||
| 451 | + else | ||
| 452 | + {res += "<div style='width:80%;text-align:left;background-color:"+cor+"' > "+resultados[j].alias+": <a href='"+resultados[j].link+"' target=_blank >"+resultados[j].valor+"</a></div>";} | ||
| 453 | + if(resultados[j].img !== "") | ||
| 454 | + {res += "<div style='width:80%;text-align:left;background-color:"+cor+"' >"+resultados[j].img+"</div>";} | ||
| 455 | + if (cor === "RGB(250,250,250)"){cor = "beige";} | ||
| 456 | + else | ||
| 457 | + {cor = "RGB(250,250,250)";} | ||
| 458 | + } | ||
| 459 | + } | ||
| 460 | + } | ||
| 461 | + $i("i3GEOidentificaocorrencia").innerHTML=res; | ||
| 462 | + } | ||
| 463 | + } | ||
| 464 | +}; | ||
| 465 | +<?php if(extension_loaded('zlib')){ob_end_flush();}?> | ||
| 0 | \ No newline at end of file | 466 | \ No newline at end of file |