Commit 5818fc92dc1567af7866a03672d08c6335cb12b2
1 parent
8a246e14
Exists in
master
and in
7 other branches
Reformulação dos scripts utilizados na ferramenta "buscarrapida". essa estrutura…
… deverá ser utilizada na revisão da programação das outras ferramentas. Incluia opção "gadget" no sistema de ajuda ao usuários, permitindo documentar as ferramentas que podem ser utilizadas como gadgets.
Showing
19 changed files
with
2675 additions
and
395 deletions
Show diff stats
.project
ajuda_usuario.php
@@ -51,6 +51,10 @@ function pegaAjuda(tipo,categoria){ | @@ -51,6 +51,10 @@ function pegaAjuda(tipo,categoria){ | ||
51 | if(obj[k].tela){ | 51 | if(obj[k].tela){ |
52 | ins += "<p><a href='"+obj[k].tela+"' target=_blank style='padding-left:20px' >Exemplo de tela</a></p>" | 52 | ins += "<p><a href='"+obj[k].tela+"' target=_blank style='padding-left:20px' >Exemplo de tela</a></p>" |
53 | } | 53 | } |
54 | + if(obj[k].gadget){ | ||
55 | + ins += "<p><a href='"+obj[k].gadget+"' target=_blank style='padding-left:20px' >Gadget</a></p>" | ||
56 | + } | ||
57 | + | ||
54 | ins += "</div>" | 58 | ins += "</div>" |
55 | } | 59 | } |
56 | 60 |
classesjs/classe_calculo.js
@@ -107,16 +107,7 @@ i3GEO.calculo = { | @@ -107,16 +107,7 @@ i3GEO.calculo = { | ||
107 | if(arguments.length == 4){ | 107 | if(arguments.length == 4){ |
108 | var cellsize = i3GEO.parametros.pixelsize; | 108 | var cellsize = i3GEO.parametros.pixelsize; |
109 | } | 109 | } |
110 | - /* | ||
111 | - if(!docmapa) | ||
112 | - {var docmapa = window.document;} | ||
113 | - try{ | ||
114 | - var dc = docmapa.getElementById("img"); | ||
115 | - if(!dc){var dc = docmapa;} | ||
116 | - | ||
117 | - } | ||
118 | - catch(e){var dc = docmapa;} | ||
119 | - */ | 110 | + |
120 | if(!docmapa) | 111 | if(!docmapa) |
121 | {var docmapa = window.document;} | 112 | {var docmapa = window.document;} |
122 | var dc = docmapa; | 113 | var dc = docmapa; |
classesjs/classe_gadgets.js
@@ -297,7 +297,7 @@ i3GEO.gadgets = { | @@ -297,7 +297,7 @@ i3GEO.gadgets = { | ||
297 | e.value = parseInt(i3GEO.parametros.mapscale); | 297 | e.value = parseInt(i3GEO.parametros.mapscale); |
298 | }; | 298 | }; |
299 | if(!$i("i3geo_escalanum")){ | 299 | if(!$i("i3geo_escalanum")){ |
300 | - var i = $inputText(id,"145","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale)); | 300 | + var i = $inputText(id,"155","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale)); |
301 | var ins = "<table><tr><td>1:"+i; | 301 | var ins = "<table><tr><td>1:"+i; |
302 | var temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; | 302 | var temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; |
303 | temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; | 303 | temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; |
classesjs/classe_php.js
@@ -323,7 +323,7 @@ i3GEO.php = { | @@ -323,7 +323,7 @@ i3GEO.php = { | ||
323 | /* | 323 | /* |
324 | Function: desativacgi | 324 | Function: desativacgi |
325 | 325 | ||
326 | - <desativacgi> | 326 | + <desativacgi> |
327 | */ | 327 | */ |
328 | desativacgi: function(funcao){ | 328 | desativacgi: function(funcao){ |
329 | i3GEO.php.verifica(); | 329 | i3GEO.php.verifica(); |
@@ -336,7 +336,7 @@ i3GEO.php = { | @@ -336,7 +336,7 @@ i3GEO.php = { | ||
336 | PHP: | 336 | PHP: |
337 | classesphp/classe_menutemas.php | 337 | classesphp/classe_menutemas.php |
338 | 338 | ||
339 | - <Menutemas->pegaListaDeMapas> | 339 | + <Menutemas->pegaListaDeMapas> |
340 | */ | 340 | */ |
341 | pegaMapas: function(funcao){ | 341 | pegaMapas: function(funcao){ |
342 | i3GEO.php.verifica(); | 342 | i3GEO.php.verifica(); |
@@ -349,7 +349,7 @@ i3GEO.php = { | @@ -349,7 +349,7 @@ i3GEO.php = { | ||
349 | PHP: | 349 | PHP: |
350 | classesphp/classe_mapa.php | 350 | classesphp/classe_mapa.php |
351 | 351 | ||
352 | - <Mapa->mudaQS> | 352 | + <Mapa->mudaQS> |
353 | */ | 353 | */ |
354 | mudatamanho: function(funcao,altura,largura){ | 354 | mudatamanho: function(funcao,altura,largura){ |
355 | i3GEO.php.verifica(); | 355 | i3GEO.php.verifica(); |
@@ -362,7 +362,7 @@ i3GEO.php = { | @@ -362,7 +362,7 @@ i3GEO.php = { | ||
362 | PHP: | 362 | PHP: |
363 | classesphp/classe_mapa.php | 363 | classesphp/classe_mapa.php |
364 | 364 | ||
365 | - <Mapa->ativalogo> | 365 | + <Mapa->ativalogo> |
366 | */ | 366 | */ |
367 | ativalogo: function(funcao,altura,largura){ | 367 | ativalogo: function(funcao,altura,largura){ |
368 | i3GEO.php.verifica(); | 368 | i3GEO.php.verifica(); |
@@ -375,7 +375,7 @@ i3GEO.php = { | @@ -375,7 +375,7 @@ i3GEO.php = { | ||
375 | PHP: | 375 | PHP: |
376 | classesphp/classe_temas.php | 376 | classesphp/classe_temas.php |
377 | 377 | ||
378 | - <Temas->insereFeature> | 378 | + <Temas->insereFeature> |
379 | */ | 379 | */ |
380 | insereAnnotation: function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){ | 380 | insereAnnotation: function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){ |
381 | i3GEO.php.verifica(); | 381 | i3GEO.php.verifica(); |
@@ -388,7 +388,7 @@ i3GEO.php = { | @@ -388,7 +388,7 @@ i3GEO.php = { | ||
388 | PHP: | 388 | PHP: |
389 | classesphp/classe_atributos.php | 389 | classesphp/classe_atributos.php |
390 | 390 | ||
391 | - <Atributos->identificaQBP> | 391 | + <Atributos->identificaQBP> |
392 | */ | 392 | */ |
393 | identificaunico: function(funcao,xy,tema,item){ | 393 | identificaunico: function(funcao,xy,tema,item){ |
394 | i3GEO.php.verifica(); | 394 | i3GEO.php.verifica(); |
@@ -401,7 +401,7 @@ i3GEO.php = { | @@ -401,7 +401,7 @@ i3GEO.php = { | ||
401 | PHP: | 401 | PHP: |
402 | classesphp/mapa_controle.php | 402 | classesphp/mapa_controle.php |
403 | 403 | ||
404 | - <recuperamapa> | 404 | + <recuperamapa> |
405 | */ | 405 | */ |
406 | recuperamapa: function(funcao){ | 406 | recuperamapa: function(funcao){ |
407 | i3GEO.php.verifica(); | 407 | i3GEO.php.verifica(); |
@@ -414,7 +414,7 @@ i3GEO.php = { | @@ -414,7 +414,7 @@ i3GEO.php = { | ||
414 | PHP: | 414 | PHP: |
415 | classesphp/classe_legenda.php | 415 | classesphp/classe_legenda.php |
416 | 416 | ||
417 | - <Atributos->legendaGrafica> | 417 | + <Atributos->legendaGrafica> |
418 | */ | 418 | */ |
419 | criaLegendaImagem: function(funcao){ | 419 | criaLegendaImagem: function(funcao){ |
420 | i3GEO.php.verifica(); | 420 | i3GEO.php.verifica(); |
@@ -427,7 +427,7 @@ i3GEO.php = { | @@ -427,7 +427,7 @@ i3GEO.php = { | ||
427 | PHP: | 427 | PHP: |
428 | classesphp/funcoes_gerais.php | 428 | classesphp/funcoes_gerais.php |
429 | 429 | ||
430 | - <retornaReferenciaDinamica> | 430 | + <retornaReferenciaDinamica> |
431 | */ | 431 | */ |
432 | referenciadinamica: function(funcao,zoom,tipo){ | 432 | referenciadinamica: function(funcao,zoom,tipo){ |
433 | i3GEO.php.verifica(); | 433 | i3GEO.php.verifica(); |
@@ -455,7 +455,7 @@ i3GEO.php = { | @@ -455,7 +455,7 @@ i3GEO.php = { | ||
455 | PHP: | 455 | PHP: |
456 | classesphp/classe_navegacao.php | 456 | classesphp/classe_navegacao.php |
457 | 457 | ||
458 | - <Navegacao->pan> | 458 | + <Navegacao->pan> |
459 | */ | 459 | */ |
460 | pan: function(funcao,escala,tipo,x,y){ | 460 | pan: function(funcao,escala,tipo,x,y){ |
461 | i3GEO.php.verifica(); | 461 | i3GEO.php.verifica(); |
@@ -520,10 +520,13 @@ i3GEO.php = { | @@ -520,10 +520,13 @@ i3GEO.php = { | ||
520 | 520 | ||
521 | <Navegacao->mudaExtensao> | 521 | <Navegacao->mudaExtensao> |
522 | */ | 522 | */ |
523 | - mudaext: function(funcao,tipoimagem,ext){ | ||
524 | - i3GEO.php.verifica(); | 523 | + mudaext: function(funcao,tipoimagem,ext,locaplic,sid){ |
524 | + if(arguments.length == 3){ | ||
525 | + var locaplic = i3GEO.configura.locaplic; | ||
526 | + var sid = i3GEO.configura.sid; | ||
527 | + } | ||
525 | if(ext == 'undefined'){alert("extensao nao definida");return;} | 528 | if(ext == 'undefined'){alert("extensao nao definida");return;} |
526 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+i3GEO.configura.sid; | 529 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid; |
527 | cpJSON.call(p,"mudaext",funcao); | 530 | cpJSON.call(p,"mudaext",funcao); |
528 | }, | 531 | }, |
529 | /* | 532 | /* |
@@ -610,7 +613,7 @@ i3GEO.php = { | @@ -610,7 +613,7 @@ i3GEO.php = { | ||
610 | PHP: | 613 | PHP: |
611 | classesphp/classe_temas.php | 614 | classesphp/classe_temas.php |
612 | 615 | ||
613 | - <Temas->desceTema> | 616 | + <Temas->desceTema> |
614 | */ | 617 | */ |
615 | descetema: function(funcao,tema){ | 618 | descetema: function(funcao,tema){ |
616 | i3GEO.php.verifica(); | 619 | i3GEO.php.verifica(); |
@@ -703,9 +706,12 @@ i3GEO.php = { | @@ -703,9 +706,12 @@ i3GEO.php = { | ||
703 | 706 | ||
704 | <Mapa->adicionatemawms> | 707 | <Mapa->adicionatemawms> |
705 | */ | 708 | */ |
706 | - adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo){ | ||
707 | - i3GEO.php.verifica(); | ||
708 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | 709 | + adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo,locaplic,sid){ |
710 | + if(arguments.length == 11){ | ||
711 | + var locaplic = i3GEO.configura.locaplic; | ||
712 | + var sid = i3GEO.configura.sid; | ||
713 | + } | ||
714 | + var p = locaplic+"/classesphp/mapa_controle.php?g_sid="+sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | ||
709 | cpJSON.call(p,"adicionatemawms",funcao); | 715 | cpJSON.call(p,"adicionatemawms",funcao); |
710 | }, | 716 | }, |
711 | /* | 717 | /* |
@@ -766,9 +772,10 @@ i3GEO.php = { | @@ -766,9 +772,10 @@ i3GEO.php = { | ||
766 | 772 | ||
767 | <Menutemas->procurartemas> | 773 | <Menutemas->procurartemas> |
768 | */ | 774 | */ |
769 | - procurartemas: function(funcao,procurar){ | ||
770 | - i3GEO.php.verifica(); | ||
771 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&procurar="+procurar+"&g_sid="+i3GEO.configura.sid; | 775 | + procurartemas: function(funcao,procurar,locaplic){ |
776 | + if(arguments.length == 2) | ||
777 | + {var locaplic = i3GEO.configura.locaplic;} | ||
778 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&map_file=&procurar="+procurar; | ||
772 | cpJSON.call(p,"procurartemas",funcao); | 779 | cpJSON.call(p,"procurartemas",funcao); |
773 | }, | 780 | }, |
774 | /* | 781 | /* |
@@ -779,9 +786,13 @@ i3GEO.php = { | @@ -779,9 +786,13 @@ i3GEO.php = { | ||
779 | 786 | ||
780 | <Mapa->adicionaTema> | 787 | <Mapa->adicionaTema> |
781 | */ | 788 | */ |
782 | - adtema: function(funcao,temas){ | ||
783 | - i3GEO.php.verifica(); | ||
784 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+i3GEO.configura.sid; | 789 | + adtema: function(funcao,temas,locaplic,sid){ |
790 | + if(arguments.length == 2){ | ||
791 | + i3GEO.php.verifica(); | ||
792 | + var locaplic = i3GEO.configura.locaplic; | ||
793 | + var sid = i3GEO.configura.sid; | ||
794 | + } | ||
795 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+sid; | ||
785 | cpJSON.call(p,"adtema",funcao); | 796 | cpJSON.call(p,"adtema",funcao); |
786 | }, | 797 | }, |
787 | /* | 798 | /* |
@@ -897,6 +908,18 @@ i3GEO.php = { | @@ -897,6 +908,18 @@ i3GEO.php = { | ||
897 | listaLayersWMS: function(funcao,servico,nivel,id_ws,nomelayer){ | 908 | listaLayersWMS: function(funcao,servico,nivel,id_ws,nomelayer){ |
898 | var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer; | 909 | var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer; |
899 | cpJSON.call(p,"listaLayersWMS",funcao); | 910 | cpJSON.call(p,"listaLayersWMS",funcao); |
911 | + }, | ||
912 | + /* | ||
913 | + Function: buscaRapida | ||
914 | + | ||
915 | + PHP: | ||
916 | + classesphp/funcoes_gerais.php | ||
917 | + | ||
918 | + <buscaRapida> | ||
919 | + */ | ||
920 | + buscaRapida: function(funcao,locaplic,servico,palavra){ | ||
921 | + var p = locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=buscaRapida&palavra="+palavra+"&servico="+servico | ||
922 | + cpJSON.call(p,"buscaRapida",funcao); | ||
900 | } | 923 | } |
901 | }; | 924 | }; |
902 | //YAHOO.log("carregou classe php", "Classes i3geo"); | 925 | //YAHOO.log("carregou classe php", "Classes i3geo"); |
903 | \ No newline at end of file | 926 | \ No newline at end of file |
classesjs/classe_util.js
@@ -143,7 +143,6 @@ i3GEO.util = { | @@ -143,7 +143,6 @@ i3GEO.util = { | ||
143 | var sUrl = sUrl.replace(re,'&'); | 143 | var sUrl = sUrl.replace(re,'&'); |
144 | return sUrl; | 144 | return sUrl; |
145 | }, | 145 | }, |
146 | - | ||
147 | /* | 146 | /* |
148 | Function: insereCookie | 147 | Function: insereCookie |
149 | Cria um novo cookie. | 148 | Cria um novo cookie. |
@@ -279,15 +278,13 @@ i3GEO.util = { | @@ -279,15 +278,13 @@ i3GEO.util = { | ||
279 | //YAHOO.log("arvore", "i3geo"); | 278 | //YAHOO.log("arvore", "i3geo"); |
280 | if(!$i(onde)){return;} | 279 | if(!$i(onde)){return;} |
281 | var currentIconMode; | 280 | var currentIconMode; |
282 | - YAHOO.example.treeExample = new function(){ | ||
283 | - function buildTree(){ | ||
284 | - arvore = new YAHOO.widget.TreeView(onde); | ||
285 | - root = arvore.getRoot(); | ||
286 | - var tempNode = new YAHOO.widget.TextNode('', root, false); | ||
287 | - tempNode.isLeaf = false; | ||
288 | - } | ||
289 | - buildTree(); | ||
290 | - }(); | 281 | + try{ |
282 | + arvore = new YAHOO.widget.TreeView(onde); | ||
283 | + root = arvore.getRoot(); | ||
284 | + var tempNode = new YAHOO.widget.TextNode('', root, false); | ||
285 | + tempNode.isLeaf = false; | ||
286 | + } | ||
287 | + catch(e){} | ||
291 | var titulo = "<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>"; | 288 | var titulo = "<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>"; |
292 | var d = {html:titulo}; | 289 | var d = {html:titulo}; |
293 | var tempNode = new YAHOO.widget.HTMLNode(d, root, true,true); | 290 | var tempNode = new YAHOO.widget.HTMLNode(d, root, true,true); |
@@ -360,6 +357,8 @@ i3GEO.util = { | @@ -360,6 +357,8 @@ i3GEO.util = { | ||
360 | pegaPosicaoObjeto: function(obj){ | 357 | pegaPosicaoObjeto: function(obj){ |
361 | if(obj) | 358 | if(obj) |
362 | { | 359 | { |
360 | + if(!obj.style) | ||
361 | + {return [0,0];} | ||
363 | if(obj.style.position == "absolute") | 362 | if(obj.style.position == "absolute") |
364 | {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} | 363 | {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} |
365 | else{ | 364 | else{ |
@@ -379,7 +378,7 @@ i3GEO.util = { | @@ -379,7 +378,7 @@ i3GEO.util = { | ||
379 | {return [0,0];} | 378 | {return [0,0];} |
380 | }, | 379 | }, |
381 | /* | 380 | /* |
382 | - Function: i3geo_pegaElementoPai | 381 | + Function: pegaElementoPai |
383 | 382 | ||
384 | Pega o elemento pai de um elemento clicado para identificar o código do tema. | 383 | Pega o elemento pai de um elemento clicado para identificar o código do tema. |
385 | 384 | ||
@@ -466,6 +465,8 @@ i3GEO.util = { | @@ -466,6 +465,8 @@ i3GEO.util = { | ||
466 | novoel.onmouseout = function(){novoel.style.display='block';}; | 465 | novoel.onmouseout = function(){novoel.style.display='block';}; |
467 | i3GEO.util.BOXES.push(id); | 466 | i3GEO.util.BOXES.push(id); |
468 | } | 467 | } |
468 | + else | ||
469 | + $i(id).style.display="block"; | ||
469 | }, | 470 | }, |
470 | /* | 471 | /* |
471 | Function: escondeBox | 472 | Function: escondeBox |
@@ -530,6 +531,10 @@ i3GEO.util = { | @@ -530,6 +531,10 @@ i3GEO.util = { | ||
530 | Function: posicionaImagemNoMapa | 531 | Function: posicionaImagemNoMapa |
531 | 532 | ||
532 | Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa | 533 | Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa |
534 | + | ||
535 | + Parameters: | ||
536 | + | ||
537 | + id {string} - id do elemento que será posicionado | ||
533 | */ | 538 | */ |
534 | posicionaImagemNoMapa: function(id){ | 539 | posicionaImagemNoMapa: function(id){ |
535 | var i = $i(id); | 540 | var i = $i(id); |
@@ -926,6 +931,59 @@ i3GEO.util = { | @@ -926,6 +931,59 @@ i3GEO.util = { | ||
926 | } | 931 | } |
927 | }; | 932 | }; |
928 | var tempoFade = setTimeout(fade, tempo); | 933 | var tempoFade = setTimeout(fade, tempo); |
934 | + }, | ||
935 | + /* | ||
936 | + Function: wkt2ext | ||
937 | + | ||
938 | + Calcula a extensão geográfica de uma geometria fornecida no formato WKT | ||
939 | + | ||
940 | + Parameters: | ||
941 | + | ||
942 | + wkt {String} - geometria no formato wkt | ||
943 | + | ||
944 | + tipo {String} - tipo de geometria (polygon,point,line) | ||
945 | + | ||
946 | + Return: | ||
947 | + | ||
948 | + {String} - extensão geográfica (xmin ymin xmax ymax) | ||
949 | + */ | ||
950 | + wkt2ext:function(wkt,tipo){ | ||
951 | + var tipo = tipo.toLowerCase(); | ||
952 | + ext = false; | ||
953 | + if(tipo == "polygon"){ | ||
954 | + try{ | ||
955 | + var re = new RegExp("POLYGON", "g"); | ||
956 | + var wkt = wkt.replace(re,""); | ||
957 | + var wkt = wkt.split("(")[2].split(")")[0]; | ||
958 | + var wkt = wkt.split(","); | ||
959 | + var x = new Array(); | ||
960 | + var y = new Array(); | ||
961 | + for (w=0;w<wkt.length; w++){ | ||
962 | + var temp = wkt[w].split(" "); | ||
963 | + x.push(temp[0]); | ||
964 | + y.push(temp[1]); | ||
965 | + } | ||
966 | + x.sort(i3GEO.util.sortNumber); | ||
967 | + var xMin = x[0]; | ||
968 | + var xMax = x[(x.length)-1]; | ||
969 | + y.sort(i3GEO.util.sortNumber); | ||
970 | + var yMin = y[0]; | ||
971 | + var yMax = y[(y.length)-1]; | ||
972 | + return xMin+" "+yMin+" "+xMax+" "+yMax; | ||
973 | + } | ||
974 | + catch(e){} | ||
975 | + } | ||
976 | + return ext; | ||
977 | + }, | ||
978 | + /* | ||
979 | + Function: sortNumber | ||
980 | + | ||
981 | + Ordena um array contendo números. Deve ser usado como parâmetro do método "sort", exemplo | ||
982 | + | ||
983 | + y.sort(i3GEO.util.sortNumber), onde y é um array de números | ||
984 | + */ | ||
985 | + sortNumber: function(a,b){ | ||
986 | + return a - b; | ||
929 | } | 987 | } |
930 | }; | 988 | }; |
931 | // | 989 | // |
classesjs/compactados/classe_gadgets_compacto.js
1 | -if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}i3GEO.gadgets={PARAMETROS:{"mostraCoordenadasUTM":{idhtml:"localizarxy"},"mostraCoordenadasGEO":{idhtml:"localizarxy"},"mostraInserirKml":{idhtml:"inserirKml"},"mostraEscalaNumerica":{idhtml:"escala"},"mostraEscalaGrafica":{idhtml:"escalaGrafica"},"mostraBuscaRapida":{idhtml:"buscaRapida"},"mostraVisual":{idhtml:"visual"},"mostraQuadros":{idhtml:"lugarquadros"},"mostraHistoricoZoom":{idhtml:"historicozoom"},"mostraMenuSuspenso":{idhtml:"menus",deslocaEsquerda:0}},mostraCoordenadasUTM:function(id){if(arguments.length==0||id==""){var id=i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml}else{i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml=id}var temp=$i(id);if(!temp){return}atualizaCoordenadasUTM=function(){if(objposicaocursor.imgx<10||objposicaocursor.imgy<10){return}if($i("wdoca")){return}var tempUtm=function(retorno){var funcao="";funcao+="$i(i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml).style.display='none';";funcao+="if(i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml == i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml)";funcao+="{$i(i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml).style.display='block';i3GEO.gadgets.mostraCoordenadasGEO();}";setTimeout(funcao,3400);var temp=$i(i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml);if(retorno.data){temp.style.display="block";temp.innerHTML="UTM: x="+retorno.data.x+" y="+retorno.data.y+" zona="+retorno.data.zona+" "+retorno.data.datum}};i3GEO.php.geo2utm(tempUtm,objposicaocursor.ddx,objposicaocursor.ddy)};if(i3GEO.eventos.MOUSEPARADO.toString().search("atualizaCoordenadasUTM()")<0){i3GEO.eventos.MOUSEPARADO.push("atualizaCoordenadasUTM()")}},mostraCoordenadasGEO:function(id){try{if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml}else{i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml=id}if($i(id)){if(!$i("xm")){var ins="<table style='text-align:center'><tr>";ins+="<td>X: </td>";ins+="<td>"+$inputText(id,"315","xg","grau","3","-00")+" </td>";ins+="<td>"+$inputText("","","xm","minuto","3","00")+" </td>";ins+="<td>"+$inputText("","","xs","segundo","5","00.00")+" </td>";ins+="<td>Y:"+$inputText("","","yg","grau","3","-00")+" </td>";ins+="<td>"+$inputText("","","ym","minuto","3","00")+" </td>";ins+="<td>"+$inputText("","","ys","segundo","5","00.00")+"</td>";var temp='var xxx = i3GEO.calculo.dms2dd($i("xg").value,$i("xm").value,$i("xs").value);';temp+='var yyy = i3GEO.calculo.dms2dd($i("yg").value,$i("ym").value,$i("ys").value);';temp+='i3GEO.navega.zoomponto(i3GEO.configura.locaplic,i3GEO.configura.sid,xxx,yyy);';ins+="<td><img class='tic' title='zoom' onclick='"+temp+"' src='"+i3GEO.util.$im("branco.gif")+"' id=procurarxy /></td>";ins+="</tr></table>";$i(id).innerHTML=ins;$i3geo_temp_xg=$i("xg");$i3geo_temp_xm=$i("xm");$i3geo_temp_xs=$i("xs");$i3geo_temp_yg=$i("yg");$i3geo_temp_ym=$i("ym");$i3geo_temp_ys=$i("ys");atualizaLocalizarxy=function(){try{var x=objposicaocursor.dmsx.split(" ");var y=objposicaocursor.dmsy.split(" ");$i3geo_temp_xg.value=x[0];$i3geo_temp_xm.value=x[1];$i3geo_temp_xs.value=x[2];$i3geo_temp_yg.value=y[0];$i3geo_temp_ym.value=y[1];$i3geo_temp_ys.value=y[2]}catch(m){}};if($i(i3GEO.interface.IDMAPA)){YAHOO.util.Event.addListener($i(i3GEO.interface.IDMAPA),"mousemove",atualizaLocalizarxy)}}}}catch(e){alert("mostraCoordenadasGeo: "+e.description)}},mostraInserirKml:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraInserirKml.idhtml}if($i(id)){if(!$i("i3geo_urlkml")){var i=$inputText(id,"280","i3geo_urlkml","kml url","40","");var ins="<table><tr><td>Kml: "+i;var temp='i3GEO.mapa.insereKml(true);';ins+="</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='"+temp+"' /></td></tr></table>";$i(id).innerHTML=ins}}},mostraEscalaNumerica:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraEscalaNumerica.idhtml}if($i(id)){atualizaEscalaNumerica=function(escala){var e=$i("i3geo_escalanum");if(!e){i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaNumerica()");return}if(arguments.length==1)e.value=escala;else e.value=parseInt(i3GEO.parametros.mapscale)};if(!$i("i3geo_escalanum")){var i=$inputText(id,"145","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale));var ins="<table><tr><td>1:"+i;var temp='var nova = document.getElementById("i3geo_escalanum").value;';temp+='i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);';ins+="</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='"+temp+"' /></td></tr></table>";$i(id).innerHTML=ins}if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaNumerica()")<0){i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaNumerica()")}}},mostraEscalaGrafica:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraEscalaGrafica.idhtml}if($i(id)){atualizaEscalaGrafica=function(){var e=$i("imagemEscalaGrafica");if(!e){i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaGrafica()");return}var temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("escala",scaimagem);$i("imagemEscalaGrafica").src=scaimagem};i3GEO.php.escalagrafica(temp)};if(!$i("imagemEscalaGrafica")){var ins="<img class='menuarrow' src=\""+g_localimg+"/branco.gif\" title='opções' onclick='i3GEO.mapa.dialogo.opcoesEscala()' style='cursor:pointer'/><img id=imagemEscalaGrafica src='' />"$i(id).innerHTML=ins}atualizaEscalaGrafica();if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaGrafica()")<0){i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaGrafica()")}}},mostraBuscaRapida:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.idhtml}if($i(id)){i3geo_buscaRapida=function(){if($i("valorBuscaRapida").value==""){alert("Digite uma palavra para busca!");return}wdocaf("300px","280px",i3GEO.configura.locaplic+"/ferramentas/buscarapida/index.htm","","","Busca rapida")}var i=$inputText(id,"200","valorBuscaRapida","digite o texto para busca","30",$trad("o2"));var ins="<table><tr><td><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=8&idajuda=71' > </a></td><td>"+i;ins+="</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='i3geo_buscaRapida()' /></td></tr></table>";var temp=$i(id);if(temp){temp.innerHTML=ins}}},mostraHistoricoZoom:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraHistoricoZoom.idhtml}if($i(id)){marcadorZoom="";var ins="<table style='text-align:center;position:relative;left:";if(navm){ins+="0px;'>"}else{ins+="6px;'>"}ins+="<tr><td><img id='i3geo_zoomanterior' class='zoomAnterior' title='anterior' src='"+i3GEO.util.$im("branco.gif")+"' /></td>";ins+="<td> </td>";ins+="<td><img id='i3geo_zoomproximo' class='zoomProximo' title='proximo' src='"+i3GEO.util.$im("branco.gif")+"' /></td>";ins+="</tr></table>";$i(id).innerHTML=ins;$i("i3geo_zoomanterior").onclick=function(){if(marcadorZoom==""){marcadorZoom=i3GEO.gadgets.quadros.quadroatual}if(i3GEO.gadgets.quadros.quadroatual>0){marcadorZoom=marcadorZoom-1;if(marcadorZoom>=0)i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"",i3GEO.gadgets.quadros.quadrosfilme[marcadorZoom].extensao);else marcadorZoom=0}};$i("i3geo_zoomproximo").onclick=function(){if(marcadorZoom==""){marcadorZoom=i3GEO.gadgets.quadros.quadroatual}if(i3GEO.gadgets.quadros.quadroatual<i3GEO.gadgets.quadros.quadrosfilme.length){marcadorZoom=marcadorZoom+1 if(marcadorZoom<i3GEO.gadgets.quadros.quadrosfilme.length)i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"",i3GEO.gadgets.quadros.quadrosfilme[marcadorZoom].extensao)}else marcadorZoom=i3GEO.gadgets.quadros.quadrosfilme.length}}},visual:{inicia:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraVisual.idhtml}if($i(id)){if(i3GEO.parametros.listavisual!=""){var l=i3GEO.parametros.listavisual.split(",");var visuais="";var li=l.length-1;if(li>=0){do{visuais+="<img title='"+l[li]+"' style=cursor:pointer onclick='i3GEO.gadgets.visual.troca(\""+l[li]+"\")' src='"+i3GEO.configura.locaplic+"/imagens/visual/"+l[li]+".png' /> "}while(li--)}$i(id).innerHTML=visuais;$i(id).onmouseover=function(){i3GEO.ajuda.mostraJanela($trad("d26"))};$i(id).onmouseout=function(){i3GEO.ajuda.mostraJanela("")}}}},troca:function(visual){var monta=function(retorno){try{i3GEO.janela.fechaAguarde("i3GEO.atualiza");var imgstemp=retorno.data.arquivos;var imgs=new Array();var i=imgstemp.length-1;if(i>=0){do{var temp=imgstemp[i].split(".");if((temp[1]=="png")||(temp[1]=="gif")||(temp[1]=="jpg")){imgs.push(imgstemp[i])}}while(i--)}var elementos=document.getElementsByTagName("img");var elt=elementos.length;var caminho=i3GEO.configura.locaplic+"/imagens/visual/"+visual+"/";var j=imgs.length-1;if(j>=0){do{for(var i=0;i<elt;i++){if((elementos[i].src.search("branco")>-1)&&((elementos[i].className!="")||(elementos[i].id!=""))){elementos[i].src=caminho+"branco.gif"}if(elementos[i].src.search("visual")>-1){elementos[i].style.backgroundImage="url('"+caminho+imgs[j]+"')"}}}while(j--)}var j=imgs.length-1;if(j>=0){do{var busca=imgs[j].split(".");if($i(busca[0])){$i(busca[0]).src=caminho+imgs[j]}}while(j--)}var elementos=new Array("barraSuperior","barraInferior","vertMaisZoom","vertMenosZoom","foldermapa","foldermapa1","tic");var i=elementos.length-1;if(i>=0){do{if($i(elementos[i])){var nimagem=$i(elementos[i]).style.backgroundImage.replace(i3GEO.configura.visual,visual);$i(elementos[i]).style.backgroundImage=nimagem}}while(i--)}i3GEO.configura.visual=visual}catch(e){alert("Ocorreu um erro. mudaVisual"+e);i3GEO.janela.fechaAguarde("i3GEO.atualiza")}};i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.php.listaarquivos(monta,"imagens/visual/"+visual)}},quadros:{quadrosfilme:new Array(),quadroatual:0,inicia:function(qs,lugarquadros){if(arguments.length==1){var lugarquadros=i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml}var q="<table class=tablefilme ><tr><td><div class='menuarrow' title='opções' onclick='i3GEO.gadgets.quadros.opcoes(this)' style='cursor:pointer'></div></td>";for(var i=0;i<qs;i++){q+="<td><img class='quadro' src=\""+i3GEO.configura.locaplic+"/imagens/branco.gif\" id='quadro"+i+"' ";q+="onmouseover='i3GEO.gadgets.quadros.trocaMapa(this.id);i3GEO.ajuda.mostraJanela(\"Clique para aplicar a extensão geográfica do quadro ao mapa\")' ";q+="onclick='i3GEO.gadgets.quadros.zoom(this.id)' /></td>";i3GEO.gadgets.quadros.quadrosfilme[i]=new Array()}q+="</tr></table>";if($i(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml)){document.getElementById(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml).innerHTML=q;$i(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml).onmouseout=function(){$i("img").style.display="block";if($i("imgClone")){var temp=$i("imgClone");var p=temp.parentNode;p.removeChild(temp);i3GEO.ajuda.mostraJanela('')}}}i3GEO.gadgets.quadros.quadroatual=0;if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.gadgets.quadros.avanca()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.gadgets.quadros.avanca()")}},grava:function(variavel,valor){eval("i3GEO.gadgets.quadros.quadrosfilme["+i3GEO.gadgets.quadros.quadroatual+"]."+variavel+" = '"+valor+"'");if($i(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml)){$i("quadro"+i3GEO.gadgets.quadros.quadroatual).className="quadro1"}},avanca:function(){try{var nquadros=i3GEO.gadgets.quadros.quadrosfilme.length;if((nquadros-1)==(i3GEO.gadgets.quadros.quadroatual)){i3GEO.gadgets.quadros.inicia(nquadros)}else{i3GEO.gadgets.quadros.quadroatual++}}catch(e){var e=""}},zoom:function(quadro){var indice=quadro.replace("quadro","");i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"",i3GEO.gadgets.quadros.quadrosfilme[indice].extensao)},trocaMapa:function(quadro){var indice=quadro.replace("quadro","");var i=$i("img");var c=$i("imgClone");if(i){if(!c){var iclone=document.createElement('IMG');iclone.style.position="relative";iclone.id="imgClone";iclone.style.border="1px solid blue";i.parentNode.appendChild(iclone);iclone.src=i.src;iclone.style.width=i3GEO.parametros.w;iclone.style.heigth=i3GEO.parametros.h;iclone.style.top=i.style.top;iclone.style.left=i.style.left;var c=$i("imgClone")}try{if(!i3GEO.gadgets.quadros.quadrosfilme[indice].imagem){return}c.src=i3GEO.gadgets.quadros.quadrosfilme[indice].imagem;c.style.display="block";i.style.display="none"}catch(e){var e=""}}},opcoes:function(obj){if(i3GEO.parametros.utilizacgi=="sim"){i3GEO.parametros.utilizacgi="nao";var volta=function(){alert("Armazenamento de imagens ativado. As proximas imagens ficarao disponiveis")};i3GEO.php.desativacgi(volta)}else{i3GEO.janela.cria("150px","150px",i3GEO.configura.locaplic+"/ferramentas/opcoes_quadros/index.htm","center","","Quadros <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=54' > </a>")}},anima:function(Qanima,t){if(arguments.length==0){Qanima=0;var doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument;var t=doc.getElementById("tempoanima").value}if(Qanima>i3GEO.gadgets.quadros.quadrosfilme.length){clearTimeout(tAnima);$i("imgClone").style.display="none";$i("img").style.display="block";return}i3GEO.gadgets.quadros.trocaMapa("quadro"+Qanima);Qanima++;tAnima=setTimeout('i3GEO.gadgets.quadros.anima('+Qanima+','+t+')',t)},listaImagens:function(){if(i3GEO.parametros.utilizacgi=="sim"){i3GEO.parametros.utilizacgi="nao";var volta=function(){alert("Armazenamento de imagens ativado. As proximas imagens ficarao disponiveis")};i3GEO.php.desativacgi(volta)}else{var wi=window.open("");var mensagem="<br><b>Não existem imagens guardadas.";wi.document.write("<html><body><p style='font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;'>Click com o botão da direita do mouse sobre a imagem para fazer o download<br>");var i=i3GEO.gadgets.quadros.quadrosfilme.length-1;if(i>=0){do{if(i3GEO.gadgets.quadros.quadrosfilme[i].imagem){wi.document.write("<p style='font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;'>Imagem: "+i+"<br>");wi.document.write("<p style='font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;'>Abrangência: "+i3GEO.gadgets.quadros.quadrosfilme[i].extensao+"<br>");wi.document.write("<img src='"+i3GEO.gadgets.quadros.quadrosfilme[i].imagem+"' />");wi.document.write("<img src='"+i3GEO.gadgets.quadros.quadrosfilme[i].referencia+"' />");wi.document.write("<img src='"+i3GEO.gadgets.quadros.quadrosfilme[i].legenda+"' />")}i--}while(i>=0)}wi.document.write("<br>Fim</body></html>")}}},mostraMenuSuspenso:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.idhtml}else{i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.idhtml=id}var objid=$i(id);if(objid){objid.className="yuimenubar";if($i("contemMenu")){$i("contemMenu").className="yui-navset"}if(!i3GEO.configura.oMenuData.menu){var ins="";ins+='<div class="bd" style="display:block;align:right;border: 0px solid white;z-index:6000;line-height:1.4" >';ins+='<ul class="first-of-type" style="display:block;border:0px solid white;top:10px;">';var sobe="";if(navn){var sobe="line-height:0px;"}ins+='<li class="yuimenubaritem" style="padding-bottom:5px" ><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuajuda" > '+$trad("s1")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuanalise" > '+$trad("s2")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menujanelas" > '+$trad("s3")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuarquivos" > '+$trad("s4")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuinterface" > '+$trad("d27")+'</a></li>';ins+='</ul>';ins+='</div>';objid.innerHTML=ins}else{var ins="";var alinhamento="";if(i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda){var alinhamento="left:"+i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda*-1+"px;"}ins+='<div class="bd" style="'+alinhamento+'display:block;align:right;border: 0px solid white;z-index:6000;line-height:1.4" >';ins+='<ul class="first-of-type" style="display:block;border:0px solid white;top:10px;">';var n=i3GEO.configura.oMenuData.menu.length;for(i=0;i<n;i++){if(i3GEO.parametros.w<550){i3GEO.configura.oMenuData.menu[i].id="";var estilo="padding-bottom:3px;top:0px;border: 0px solid white;"}else var estilo="padding-bottom:3px;top:0px;border: 0px solid white;";var t="";if(i3GEO.configura.oMenuData.menu[i].target){var t="target="+i3GEO.configura.oMenuData.menu[i].target}ins+='<li class="yuimenubaritem" style="padding-top:2px;"><a style="'+estilo+'" href="#" class="yuimenubaritemlabel" '+t+'id="menu'+i3GEO.configura.oMenuData.menu[i].id+'" > '+i3GEO.configura.oMenuData.menu[i].nome+'</a></li>'}ins+='</ul>';ins+='</div>';objid.innerHTML=ins}var onMenuBarBeforeRender=function(p_sType,p_sArgs){if(i3GEO.parametros.w>=500){var conta=0}else{var conta=0}for(var nomeMenu in i3GEO.configura.oMenuData.submenus){if(i3GEO.configura.oMenuData.submenus[nomeMenu]!="")i3GEOoMenuBar.getItem(conta).cfg.setProperty('submenu',{id:nomeMenu,itemdata:i3GEO.configura.oMenuData.submenus[nomeMenu]});var conta=conta+1}}i3GEOoMenuBar=new YAHOO.widget.MenuBar(id,{autosubmenudisplay:true,showdelay:100,hidedelay:500,lazyload:false});i3GEOoMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender);i3GEOoMenuBar.render();var temp=objid.style;temp.backgroundPosition="0px -1px";if(navn)temp.border="0px solid white";else temp.border="1px dotted white"}}}; | ||
2 | \ No newline at end of file | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}i3GEO.gadgets={PARAMETROS:{"mostraCoordenadasUTM":{idhtml:"localizarxy"},"mostraCoordenadasGEO":{idhtml:"localizarxy"},"mostraInserirKml":{idhtml:"inserirKml"},"mostraEscalaNumerica":{idhtml:"escala"},"mostraEscalaGrafica":{idhtml:"escalaGrafica"},"mostraBuscaRapida":{idhtml:"buscaRapida"},"mostraVisual":{idhtml:"visual"},"mostraQuadros":{idhtml:"lugarquadros"},"mostraHistoricoZoom":{idhtml:"historicozoom"},"mostraMenuSuspenso":{idhtml:"menus",deslocaEsquerda:0}},mostraCoordenadasUTM:function(id){if(arguments.length==0||id==""){var id=i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml}else{i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml=id}var temp=$i(id);if(!temp){return}atualizaCoordenadasUTM=function(){if(objposicaocursor.imgx<10||objposicaocursor.imgy<10){return}if($i("wdoca")){return}var tempUtm=function(retorno){var funcao="";funcao+="$i(i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml).style.display='none';";funcao+="if(i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml == i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml)";funcao+="{$i(i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml).style.display='block';i3GEO.gadgets.mostraCoordenadasGEO();}";setTimeout(funcao,3400);var temp=$i(i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml);if(retorno.data){temp.style.display="block";temp.innerHTML="UTM: x="+retorno.data.x+" y="+retorno.data.y+" zona="+retorno.data.zona+" "+retorno.data.datum}};i3GEO.php.geo2utm(tempUtm,objposicaocursor.ddx,objposicaocursor.ddy)};if(i3GEO.eventos.MOUSEPARADO.toString().search("atualizaCoordenadasUTM()")<0){i3GEO.eventos.MOUSEPARADO.push("atualizaCoordenadasUTM()")}},mostraCoordenadasGEO:function(id){try{if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml}else{i3GEO.gadgets.PARAMETROS.mostraCoordenadasGEO.idhtml=id}if($i(id)){if(!$i("xm")){var ins="<table style='text-align:center'><tr>";ins+="<td>X: </td>";ins+="<td>"+$inputText(id,"315","xg","grau","3","-00")+" </td>";ins+="<td>"+$inputText("","","xm","minuto","3","00")+" </td>";ins+="<td>"+$inputText("","","xs","segundo","5","00.00")+" </td>";ins+="<td>Y:"+$inputText("","","yg","grau","3","-00")+" </td>";ins+="<td>"+$inputText("","","ym","minuto","3","00")+" </td>";ins+="<td>"+$inputText("","","ys","segundo","5","00.00")+"</td>";var temp='var xxx = i3GEO.calculo.dms2dd($i("xg").value,$i("xm").value,$i("xs").value);';temp+='var yyy = i3GEO.calculo.dms2dd($i("yg").value,$i("ym").value,$i("ys").value);';temp+='i3GEO.navega.zoomponto(i3GEO.configura.locaplic,i3GEO.configura.sid,xxx,yyy);';ins+="<td><img class='tic' title='zoom' onclick='"+temp+"' src='"+i3GEO.util.$im("branco.gif")+"' id=procurarxy /></td>";ins+="</tr></table>";$i(id).innerHTML=ins;$i3geo_temp_xg=$i("xg");$i3geo_temp_xm=$i("xm");$i3geo_temp_xs=$i("xs");$i3geo_temp_yg=$i("yg");$i3geo_temp_ym=$i("ym");$i3geo_temp_ys=$i("ys");atualizaLocalizarxy=function(){try{var x=objposicaocursor.dmsx.split(" ");var y=objposicaocursor.dmsy.split(" ");$i3geo_temp_xg.value=x[0];$i3geo_temp_xm.value=x[1];$i3geo_temp_xs.value=x[2];$i3geo_temp_yg.value=y[0];$i3geo_temp_ym.value=y[1];$i3geo_temp_ys.value=y[2]}catch(m){}};if($i(i3GEO.interface.IDMAPA)){YAHOO.util.Event.addListener($i(i3GEO.interface.IDMAPA),"mousemove",atualizaLocalizarxy)}}}}catch(e){alert("mostraCoordenadasGeo: "+e.description)}},mostraInserirKml:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraInserirKml.idhtml}if($i(id)){if(!$i("i3geo_urlkml")){var i=$inputText(id,"280","i3geo_urlkml","kml url","40","");var ins="<table><tr><td>Kml: "+i;var temp='i3GEO.mapa.insereKml(true);';ins+="</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='"+temp+"' /></td></tr></table>";$i(id).innerHTML=ins}}},mostraEscalaNumerica:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraEscalaNumerica.idhtml}if($i(id)){atualizaEscalaNumerica=function(escala){var e=$i("i3geo_escalanum");if(!e){i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaNumerica()");return}if(arguments.length==1)e.value=escala;else e.value=parseInt(i3GEO.parametros.mapscale)};if(!$i("i3geo_escalanum")){var i=$inputText(id,"155","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale));var ins="<table><tr><td>1:"+i;var temp='var nova = document.getElementById("i3geo_escalanum").value;';temp+='i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);';ins+="</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='"+temp+"' /></td></tr></table>";$i(id).innerHTML=ins}if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaNumerica()")<0){i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaNumerica()")}}},mostraEscalaGrafica:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraEscalaGrafica.idhtml}if($i(id)){atualizaEscalaGrafica=function(){var e=$i("imagemEscalaGrafica");if(!e){i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaGrafica()");return}var temp=function(retorno){eval(retorno.data);i3GEO.gadgets.quadros.grava("escala",scaimagem);$i("imagemEscalaGrafica").src=scaimagem};i3GEO.php.escalagrafica(temp)};if(!$i("imagemEscalaGrafica")){var ins="<img class='menuarrow' src=\""+g_localimg+"/branco.gif\" title='opções' onclick='i3GEO.mapa.dialogo.opcoesEscala()' style='cursor:pointer'/><img id=imagemEscalaGrafica src='' />"$i(id).innerHTML=ins}atualizaEscalaGrafica();if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaGrafica()")<0){i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaGrafica()")}}},mostraBuscaRapida:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.idhtml}if($i(id)){i3geo_buscaRapida=function(){if($i("valorBuscaRapida").value==""){alert("Digite uma palavra para busca!");return}wdocaf("300px","280px",i3GEO.configura.locaplic+"/ferramentas/buscarapida/index.htm","","","Busca rapida")}var i=$inputText(id,"200","valorBuscaRapida","digite o texto para busca","30",$trad("o2"));var ins="<table><tr><td><a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=8&idajuda=71' > </a></td><td>"+i;ins+="</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='i3geo_buscaRapida()' /></td></tr></table>";var temp=$i(id);if(temp){temp.innerHTML=ins}}},mostraHistoricoZoom:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraHistoricoZoom.idhtml}if($i(id)){marcadorZoom="";var ins="<table style='text-align:center;position:relative;left:";if(navm){ins+="0px;'>"}else{ins+="6px;'>"}ins+="<tr><td><img id='i3geo_zoomanterior' class='zoomAnterior' title='anterior' src='"+i3GEO.util.$im("branco.gif")+"' /></td>";ins+="<td> </td>";ins+="<td><img id='i3geo_zoomproximo' class='zoomProximo' title='proximo' src='"+i3GEO.util.$im("branco.gif")+"' /></td>";ins+="</tr></table>";$i(id).innerHTML=ins;$i("i3geo_zoomanterior").onclick=function(){if(marcadorZoom==""){marcadorZoom=i3GEO.gadgets.quadros.quadroatual}if(i3GEO.gadgets.quadros.quadroatual>0){marcadorZoom=marcadorZoom-1;if(marcadorZoom>=0)i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"",i3GEO.gadgets.quadros.quadrosfilme[marcadorZoom].extensao);else marcadorZoom=0}};$i("i3geo_zoomproximo").onclick=function(){if(marcadorZoom==""){marcadorZoom=i3GEO.gadgets.quadros.quadroatual}if(i3GEO.gadgets.quadros.quadroatual<i3GEO.gadgets.quadros.quadrosfilme.length){marcadorZoom=marcadorZoom+1 if(marcadorZoom<i3GEO.gadgets.quadros.quadrosfilme.length)i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"",i3GEO.gadgets.quadros.quadrosfilme[marcadorZoom].extensao)}else marcadorZoom=i3GEO.gadgets.quadros.quadrosfilme.length}}},visual:{inicia:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraVisual.idhtml}if($i(id)){if(i3GEO.parametros.listavisual!=""){var l=i3GEO.parametros.listavisual.split(",");var visuais="";var li=l.length-1;if(li>=0){do{visuais+="<img title='"+l[li]+"' style=cursor:pointer onclick='i3GEO.gadgets.visual.troca(\""+l[li]+"\")' src='"+i3GEO.configura.locaplic+"/imagens/visual/"+l[li]+".png' /> "}while(li--)}$i(id).innerHTML=visuais;$i(id).onmouseover=function(){i3GEO.ajuda.mostraJanela($trad("d26"))};$i(id).onmouseout=function(){i3GEO.ajuda.mostraJanela("")}}}},troca:function(visual){var monta=function(retorno){try{i3GEO.janela.fechaAguarde("i3GEO.atualiza");var imgstemp=retorno.data.arquivos;var imgs=new Array();var i=imgstemp.length-1;if(i>=0){do{var temp=imgstemp[i].split(".");if((temp[1]=="png")||(temp[1]=="gif")||(temp[1]=="jpg")){imgs.push(imgstemp[i])}}while(i--)}var elementos=document.getElementsByTagName("img");var elt=elementos.length;var caminho=i3GEO.configura.locaplic+"/imagens/visual/"+visual+"/";var j=imgs.length-1;if(j>=0){do{for(var i=0;i<elt;i++){if((elementos[i].src.search("branco")>-1)&&((elementos[i].className!="")||(elementos[i].id!=""))){elementos[i].src=caminho+"branco.gif"}if(elementos[i].src.search("visual")>-1){elementos[i].style.backgroundImage="url('"+caminho+imgs[j]+"')"}}}while(j--)}var j=imgs.length-1;if(j>=0){do{var busca=imgs[j].split(".");if($i(busca[0])){$i(busca[0]).src=caminho+imgs[j]}}while(j--)}var elementos=new Array("barraSuperior","barraInferior","vertMaisZoom","vertMenosZoom","foldermapa","foldermapa1","tic");var i=elementos.length-1;if(i>=0){do{if($i(elementos[i])){var nimagem=$i(elementos[i]).style.backgroundImage.replace(i3GEO.configura.visual,visual);$i(elementos[i]).style.backgroundImage=nimagem}}while(i--)}i3GEO.configura.visual=visual}catch(e){alert("Ocorreu um erro. mudaVisual"+e);i3GEO.janela.fechaAguarde("i3GEO.atualiza")}};i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));i3GEO.php.listaarquivos(monta,"imagens/visual/"+visual)}},quadros:{quadrosfilme:new Array(),quadroatual:0,inicia:function(qs,lugarquadros){if(arguments.length==1){var lugarquadros=i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml}var q="<table class=tablefilme ><tr><td><div class='menuarrow' title='opções' onclick='i3GEO.gadgets.quadros.opcoes(this)' style='cursor:pointer'></div></td>";for(var i=0;i<qs;i++){q+="<td><img class='quadro' src=\""+i3GEO.configura.locaplic+"/imagens/branco.gif\" id='quadro"+i+"' ";q+="onmouseover='i3GEO.gadgets.quadros.trocaMapa(this.id);i3GEO.ajuda.mostraJanela(\"Clique para aplicar a extensão geográfica do quadro ao mapa\")' ";q+="onclick='i3GEO.gadgets.quadros.zoom(this.id)' /></td>";i3GEO.gadgets.quadros.quadrosfilme[i]=new Array()}q+="</tr></table>";if($i(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml)){document.getElementById(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml).innerHTML=q;$i(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml).onmouseout=function(){$i("img").style.display="block";if($i("imgClone")){var temp=$i("imgClone");var p=temp.parentNode;p.removeChild(temp);i3GEO.ajuda.mostraJanela('')}}}i3GEO.gadgets.quadros.quadroatual=0;if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.gadgets.quadros.avanca()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.gadgets.quadros.avanca()")}},grava:function(variavel,valor){eval("i3GEO.gadgets.quadros.quadrosfilme["+i3GEO.gadgets.quadros.quadroatual+"]."+variavel+" = '"+valor+"'");if($i(i3GEO.gadgets.PARAMETROS.mostraQuadros.idhtml)){$i("quadro"+i3GEO.gadgets.quadros.quadroatual).className="quadro1"}},avanca:function(){try{var nquadros=i3GEO.gadgets.quadros.quadrosfilme.length;if((nquadros-1)==(i3GEO.gadgets.quadros.quadroatual)){i3GEO.gadgets.quadros.inicia(nquadros)}else{i3GEO.gadgets.quadros.quadroatual++}}catch(e){var e=""}},zoom:function(quadro){var indice=quadro.replace("quadro","");i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"",i3GEO.gadgets.quadros.quadrosfilme[indice].extensao)},trocaMapa:function(quadro){var indice=quadro.replace("quadro","");var i=$i("img");var c=$i("imgClone");if(i){if(!c){var iclone=document.createElement('IMG');iclone.style.position="relative";iclone.id="imgClone";iclone.style.border="1px solid blue";i.parentNode.appendChild(iclone);iclone.src=i.src;iclone.style.width=i3GEO.parametros.w;iclone.style.heigth=i3GEO.parametros.h;iclone.style.top=i.style.top;iclone.style.left=i.style.left;var c=$i("imgClone")}try{if(!i3GEO.gadgets.quadros.quadrosfilme[indice].imagem){return}c.src=i3GEO.gadgets.quadros.quadrosfilme[indice].imagem;c.style.display="block";i.style.display="none"}catch(e){var e=""}}},opcoes:function(obj){if(i3GEO.parametros.utilizacgi=="sim"){i3GEO.parametros.utilizacgi="nao";var volta=function(){alert("Armazenamento de imagens ativado. As proximas imagens ficarao disponiveis")};i3GEO.php.desativacgi(volta)}else{i3GEO.janela.cria("150px","150px",i3GEO.configura.locaplic+"/ferramentas/opcoes_quadros/index.htm","center","","Quadros <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=54' > </a>")}},anima:function(Qanima,t){if(arguments.length==0){Qanima=0;var doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument;var t=doc.getElementById("tempoanima").value}if(Qanima>i3GEO.gadgets.quadros.quadrosfilme.length){clearTimeout(tAnima);$i("imgClone").style.display="none";$i("img").style.display="block";return}i3GEO.gadgets.quadros.trocaMapa("quadro"+Qanima);Qanima++;tAnima=setTimeout('i3GEO.gadgets.quadros.anima('+Qanima+','+t+')',t)},listaImagens:function(){if(i3GEO.parametros.utilizacgi=="sim"){i3GEO.parametros.utilizacgi="nao";var volta=function(){alert("Armazenamento de imagens ativado. As proximas imagens ficarao disponiveis")};i3GEO.php.desativacgi(volta)}else{var wi=window.open("");var mensagem="<br><b>Não existem imagens guardadas.";wi.document.write("<html><body><p style='font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;'>Click com o botão da direita do mouse sobre a imagem para fazer o download<br>");var i=i3GEO.gadgets.quadros.quadrosfilme.length-1;if(i>=0){do{if(i3GEO.gadgets.quadros.quadrosfilme[i].imagem){wi.document.write("<p style='font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;'>Imagem: "+i+"<br>");wi.document.write("<p style='font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;'>Abrangência: "+i3GEO.gadgets.quadros.quadrosfilme[i].extensao+"<br>");wi.document.write("<img src='"+i3GEO.gadgets.quadros.quadrosfilme[i].imagem+"' />");wi.document.write("<img src='"+i3GEO.gadgets.quadros.quadrosfilme[i].referencia+"' />");wi.document.write("<img src='"+i3GEO.gadgets.quadros.quadrosfilme[i].legenda+"' />")}i--}while(i>=0)}wi.document.write("<br>Fim</body></html>")}}},mostraMenuSuspenso:function(id){if(arguments.length==0){var id=i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.idhtml}else{i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.idhtml=id}var objid=$i(id);if(objid){objid.className="yuimenubar";if($i("contemMenu")){$i("contemMenu").className="yui-navset"}if(!i3GEO.configura.oMenuData.menu){var ins="";ins+='<div class="bd" style="display:block;align:right;border: 0px solid white;z-index:6000;line-height:1.4" >';ins+='<ul class="first-of-type" style="display:block;border:0px solid white;top:10px;">';var sobe="";if(navn){var sobe="line-height:0px;"}ins+='<li class="yuimenubaritem" style="padding-bottom:5px" ><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuajuda" > '+$trad("s1")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuanalise" > '+$trad("s2")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menujanelas" > '+$trad("s3")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuarquivos" > '+$trad("s4")+'</a></li>';ins+='<li class="yuimenubaritem" style="padding-bottom:5px"><a style="border: 0px solid white;" href="#" class="yuimenubaritemlabel" id="menuinterface" > '+$trad("d27")+'</a></li>';ins+='</ul>';ins+='</div>';objid.innerHTML=ins}else{var ins="";var alinhamento="";if(i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda){var alinhamento="left:"+i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda*-1+"px;"}ins+='<div class="bd" style="'+alinhamento+'display:block;align:right;border: 0px solid white;z-index:6000;line-height:1.4" >';ins+='<ul class="first-of-type" style="display:block;border:0px solid white;top:10px;">';var n=i3GEO.configura.oMenuData.menu.length;for(i=0;i<n;i++){if(i3GEO.parametros.w<550){i3GEO.configura.oMenuData.menu[i].id="";var estilo="padding-bottom:3px;top:0px;border: 0px solid white;"}else var estilo="padding-bottom:3px;top:0px;border: 0px solid white;";var t="";if(i3GEO.configura.oMenuData.menu[i].target){var t="target="+i3GEO.configura.oMenuData.menu[i].target}ins+='<li class="yuimenubaritem" style="padding-top:2px;"><a style="'+estilo+'" href="#" class="yuimenubaritemlabel" '+t+'id="menu'+i3GEO.configura.oMenuData.menu[i].id+'" > '+i3GEO.configura.oMenuData.menu[i].nome+'</a></li>'}ins+='</ul>';ins+='</div>';objid.innerHTML=ins}var onMenuBarBeforeRender=function(p_sType,p_sArgs){if(i3GEO.parametros.w>=500){var conta=0}else{var conta=0}for(var nomeMenu in i3GEO.configura.oMenuData.submenus){if(i3GEO.configura.oMenuData.submenus[nomeMenu]!="")i3GEOoMenuBar.getItem(conta).cfg.setProperty('submenu',{id:nomeMenu,itemdata:i3GEO.configura.oMenuData.submenus[nomeMenu]});var conta=conta+1}}i3GEOoMenuBar=new YAHOO.widget.MenuBar(id,{autosubmenudisplay:true,showdelay:100,hidedelay:500,lazyload:false});i3GEOoMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender);i3GEOoMenuBar.render();var temp=objid.style;temp.backgroundPosition="0px -1px";if(navn)temp.border="0px solid white";else temp.border="1px dotted white"}}}; | ||
3 | \ No newline at end of file | 3 | \ No newline at end of file |
classesjs/compactados/classe_php_compacto.js
1 | -if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}cpJSON=new cpaint();cpJSON.set_response_type("JSON");i3GEO.php={verifica:function(){if(i3GEO.configura.locaplic==undefined){alert("variavel i3GEO.configura.locaplic não esta definida")}if(i3GEO.configura.sid==undefined){alert("variavel i3GEO.configura.locaplic não esta definida")}},insereSHPgrafico:function(funcao,tema,x,y,itens,shadow_height,width,inclinacao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=insereSHPgrafico&tipo=pizza&tema="+tema+"&x="+x+"&y="+y+"&itens="+itens+"&shadow_height="+shadow_height+"&width="+width+"&inclinacao="+inclinacao+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"insereSHPgrafico",funcao)},insereSHP:function(funcao,tema,item,valoritem,xy){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=insereSHP&item="+item+"&valor="+valoritem+"&tema="+tema+"&xy="+xy+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"insereSHPgrafico",funcao)},pegaMensagens:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaMensagens&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaMensagem",funcao)},areaPixel:function(funcao,g_celula){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=areaPixel&celsize="+g_celula+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"areaPixel",funcao)},excluitema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=excluitema&temas="+tema+"&g_sid="+i3GEO.arvoreDeCamadas.SID;cpJSON.call(p,"excluitema",funcao)},reordenatemas:function(funcao,lista){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=reordenatemas&lista="+lista+"&g_sid="+i3GEO.arvoreDeCamadas.SID;cpJSON.call(p,"reordenatemas",funcao)},criaLegendaHTML:function(funcao,tema,template){i3GEO.php.verifica();var c="sim";if(arguments.length==1){var tema="";var template="legenda2.htm"}if(arguments.length==2){var template="legenda2.htm"}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=criaLegendaHTML&tema="+tema+"&templateLegenda="+template+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"criaLegendaHTML",funcao)},inverteStatusClasse:function(funcao,tema,classe){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=inverteStatusClasse&g_sid="+i3GEO.arvoreDeCamadas.SID+"&tema="+tema+"&classe="+classe;cpJSON.call(p,"inverteStatusClasse",funcao)},ligatemas:function(funcao,desligar,ligar){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=ligatemas&desligar="+desligar+"&ligar="+ligar+"&g_sid="+i3GEO.arvoreDeCamadas.SID;cpJSON.call(p,"ligaDesligaTemas",funcao)},pegalistademenus:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistademenus&g_sid="+i3GEO.configura.sid+"&map_file=";cpJSON.call(p,"pegalistademenus",funcao)},pegalistadegrupos:function(funcao,id_menu,listasgrupos){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistadegrupos&map_file=&g_sid="+i3GEO.configura.sid+"&idmenu="+id_menu+"&listasistemas=nao&listasgrupos="+listasgrupos;cpJSON.call(p,"pegalistadegrupos",funcao)},pegalistadeSubgrupos:function(funcao,id_menu,id_grupo){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistadeSubgrupos&g_sid="+i3GEO.configura.sid+"&idmenu="+id_menu+"&grupo="+id_grupo+"&map_file=";cpJSON.call(p,"pegalistadeSubgrupos",funcao)},pegalistadetemas:function(funcao,id_menu,id_grupo,id_subgrupo){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistadetemas&g_sid="+i3GEO.configura.sid+"&idmenu="+id_menu+"&grupo="+id_grupo+"&subgrupo="+id_subgrupo+"&map_file=";cpJSON.call(p,"pegalistadetemas",funcao)},pegaSistemas:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaSistemas&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaSistemas",funcao)},listadrives:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaDrives&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"listaDrives",funcao)},listaarquivos:function(funcao,caminho){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=listaArquivos&diretorio="+caminho;cpJSON.call(p,"listaArquivos",funcao)},geo2utm:function(funcao,x,y){i3GEO.php.verifica();if($i("aguardeGifAberto")){return}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=geo2utm&x="+x+"&y="+y+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"geo2utm",funcao)},desativacgi:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=desativacgi&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"desativacgi",funcao)},pegaMapas:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaMapas&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaSistemas",funcao)},mudatamanho:function(funcao,altura,largura){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudatamanho&altura="+altura+"&largura="+largura+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaSistemas",funcao)},ativalogo:function(funcao,altura,largura){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=ativalogo&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"ativalogo",funcao)},insereAnnotation:function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=inserefeature&pin="+pin+"&tipo=ANNOTATION&xy="+xy+"&texto="+texto+"&position="+position+"&partials="+partials+"&offsetx="+offsetx+"&offsety="+offsety+"&minfeaturesize="+minfeaturesize+"&mindistance="+mindistance+"&force="+force+"&shadowcolor="+shadowcolor+"&shadowsizex="+shadowsizex+"&shadowsizey="+shadowsizey+"&outlinecolor="+outlinecolor+"&cor="+cor+"&sombray="+sombray+"&sombrax="+sombrax+"&sombra="+sombra+"&fundo="+fundo+"&angulo="+angulo+"&tamanho="+tamanho+"&fonte="+fonte+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"inserefeature",funcao)},identificaunico:function(funcao,xy,tema,item){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identificaunico&xy="+xy+"&resolucao=5&tema="+tema+"&item="+item+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"identificaunico",funcao)},recuperamapa:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=recuperamapa&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"recuperamapa",funcao)},criaLegendaImagem:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=criaLegendaImagem&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"criaLegendaImagem",funcao)},referenciadinamica:function(funcao,zoom,tipo){i3GEO.php.verifica();if(arguments.length==2){var tipo="dinamico"}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=referenciadinamica&g_sid="+i3GEO.configura.sid+"&zoom="+zoom+"&tipo="+tipo;cpJSON.call(p,"retornaReferenciaDinamica",funcao)},referencia:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=referencia&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"retornaReferencia",funcao)},pan:function(funcao,escala,tipo,x,y){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pan&escala="+escala+"&tipo="+tipo+"&x="+x+"&y="+y+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pan",funcao)},aproxima:function(funcao,nivel){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=aproxima&nivel="+nivel+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"aproxima",funcao)},afasta:function(funcao,nivel){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=afasta&nivel="+nivel+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"afasta",funcao)},zoomponto:function(funcao,x,y){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomponto&pin=pin&xy="+x+" "+y+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"zoomponto",funcao)},localizaIP:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=localizaIP&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"localizaIP",funcao)},mudaext:function(funcao,tipoimagem,ext){i3GEO.php.verifica();if(ext=='undefined'){alert("extensao nao definida");return}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudaext",funcao)},mudaescala:function(funcao,escala){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaescala&escala="+escala+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudaescala",funcao)},aplicaResolucao:function(funcao,resolucao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=crialente&resolucao="+resolucao+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"crialente",funcao)},geradestaque:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=geradestaque&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"geradestaque",funcao)},selecaopt:function(funcao,tema,xy,tipo,tolerancia){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=selecaopt&tema="+tema+"&tipo="+tipo+"&xy="+xy+"&tolerancia="+tolerancia+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"selecaoPT",funcao)},selecaobox:function(funcao,tema,tipo,box){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=selecaobox&ext="+box+"&g_sid="+i3GEO.configura.sid+"&tipo="+tipo+"&tema="+tema;cpJSON.call(p,"selecaobox",funcao)},sobetema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=sobetema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"sobetema",funcao)},descetema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?&funcao=descetema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"descetema",funcao)},fontetema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=fontetema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"fontetema",funcao)},zoomtema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomtema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"zoomtema",funcao)},zoomsel:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomsel&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"zoomsel",funcao)},limpasel:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=limpasel&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"limpasel",funcao)},mudatransp:function(funcao,tema,valor){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudatransp&tema="+tema+"&valor="+valor+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudatransp",funcao)},mudanome:function(funcao,tema,valor){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudanome&tema="+tema+"&valor="+valor+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudanome",funcao)},adicionaTemaWMS:function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo;cpJSON.call(p,"adicionatemawms",funcao)},adicionaTemaSHP:function(funcao,path){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionaTemaSHP&arq="+path;cpJSON.call(p,"adicionaTemaSHP",funcao)},adicionaTemaIMG:function(funcao,path){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionaTemaIMG&arq="+path;cpJSON.call(p,"adicionaTemaIMG",funcao)},identifica:function(funcao,x,y,resolucao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"identifica",funcao)},reiniciaMapa:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=reiniciaMapa&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"reiniciaMapa",funcao)},procurartemas:function(funcao,procurar,locaplic){if(arguments.length==2){var locaplic=i3GEO.configura.locaplic}var p=locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&map_file=&procurar="+procurar;cpJSON.call(p,"procurartemas",funcao)},adtema:function(funcao,temas){i3GEO.php.verifica();var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"adtema",funcao)},escalagrafica:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=escalagrafica&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"escalagrafica",funcao)},flamingo:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=montaFlamingo&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"montaFlamingo",funcao)},openlayers:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=openlayers&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"openlayers",funcao)},corpo:function(funcao,tipoimagem){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=corpo&tipoimagem="+tipoimagem+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"corpo",funcao)},criamapa:function(funcao,parametros){var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa&"+parametros;cpJSON.call(p,"criaMapa",funcao)},inicia:function(funcao,embedLegenda,w,h){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=inicia&embedLegenda="+embedLegenda+"&w="+w+"&h="+h+"&g_sid="+i3GEO.configura.sid+"&interface="+i3GEO.interface.ATUAL;cpJSON.call(p,"iniciaMapa",funcao)},chaveGoogle:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=chavegoogle&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"chavegoogle",funcao)},listaRSSwsARRAY:function(funcao,tipo){var p=i3GEO.configura.locaplic+"/classesphp/wscliente.php?funcao=listaRSSwsARRAY&rss="+new Array("|")+"&tipo="+tipo;cpJSON.call(p,"listaRSSwsARRAY",funcao)},listaLayersWMS:function(funcao,servico,nivel,id_ws,nomelayer){var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer;cpJSON.call(p,"listaLayersWMS",funcao)},buscaRapida:function(funcao,locaplic,servico,palavra){var p=locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=buscaRapida&palavra="+palavra+"&servico="+servico cpJSON.call(p,"buscaRapida",funcao)}}; | ||
2 | \ No newline at end of file | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}cpJSON=new cpaint();cpJSON.set_response_type("JSON");i3GEO.php={verifica:function(){if(i3GEO.configura.locaplic==undefined){alert("variavel i3GEO.configura.locaplic não esta definida")}if(i3GEO.configura.sid==undefined){alert("variavel i3GEO.configura.locaplic não esta definida")}},insereSHPgrafico:function(funcao,tema,x,y,itens,shadow_height,width,inclinacao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=insereSHPgrafico&tipo=pizza&tema="+tema+"&x="+x+"&y="+y+"&itens="+itens+"&shadow_height="+shadow_height+"&width="+width+"&inclinacao="+inclinacao+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"insereSHPgrafico",funcao)},insereSHP:function(funcao,tema,item,valoritem,xy){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=insereSHP&item="+item+"&valor="+valoritem+"&tema="+tema+"&xy="+xy+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"insereSHPgrafico",funcao)},pegaMensagens:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaMensagens&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaMensagem",funcao)},areaPixel:function(funcao,g_celula){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=areaPixel&celsize="+g_celula+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"areaPixel",funcao)},excluitema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=excluitema&temas="+tema+"&g_sid="+i3GEO.arvoreDeCamadas.SID;cpJSON.call(p,"excluitema",funcao)},reordenatemas:function(funcao,lista){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=reordenatemas&lista="+lista+"&g_sid="+i3GEO.arvoreDeCamadas.SID;cpJSON.call(p,"reordenatemas",funcao)},criaLegendaHTML:function(funcao,tema,template){i3GEO.php.verifica();var c="sim";if(arguments.length==1){var tema="";var template="legenda2.htm"}if(arguments.length==2){var template="legenda2.htm"}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=criaLegendaHTML&tema="+tema+"&templateLegenda="+template+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"criaLegendaHTML",funcao)},inverteStatusClasse:function(funcao,tema,classe){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=inverteStatusClasse&g_sid="+i3GEO.arvoreDeCamadas.SID+"&tema="+tema+"&classe="+classe;cpJSON.call(p,"inverteStatusClasse",funcao)},ligatemas:function(funcao,desligar,ligar){i3GEO.php.verifica();var p=i3GEO.arvoreDeCamadas.LOCAPLIC+"/classesphp/mapa_controle.php?funcao=ligatemas&desligar="+desligar+"&ligar="+ligar+"&g_sid="+i3GEO.arvoreDeCamadas.SID;cpJSON.call(p,"ligaDesligaTemas",funcao)},pegalistademenus:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistademenus&g_sid="+i3GEO.configura.sid+"&map_file=";cpJSON.call(p,"pegalistademenus",funcao)},pegalistadegrupos:function(funcao,id_menu,listasgrupos){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistadegrupos&map_file=&g_sid="+i3GEO.configura.sid+"&idmenu="+id_menu+"&listasistemas=nao&listasgrupos="+listasgrupos;cpJSON.call(p,"pegalistadegrupos",funcao)},pegalistadeSubgrupos:function(funcao,id_menu,id_grupo){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistadeSubgrupos&g_sid="+i3GEO.configura.sid+"&idmenu="+id_menu+"&grupo="+id_grupo+"&map_file=";cpJSON.call(p,"pegalistadeSubgrupos",funcao)},pegalistadetemas:function(funcao,id_menu,id_grupo,id_subgrupo){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegalistadetemas&g_sid="+i3GEO.configura.sid+"&idmenu="+id_menu+"&grupo="+id_grupo+"&subgrupo="+id_subgrupo+"&map_file=";cpJSON.call(p,"pegalistadetemas",funcao)},pegaSistemas:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaSistemas&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaSistemas",funcao)},listadrives:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaDrives&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"listaDrives",funcao)},listaarquivos:function(funcao,caminho){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=listaArquivos&diretorio="+caminho;cpJSON.call(p,"listaArquivos",funcao)},geo2utm:function(funcao,x,y){i3GEO.php.verifica();if($i("aguardeGifAberto")){return}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=geo2utm&x="+x+"&y="+y+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"geo2utm",funcao)},desativacgi:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=desativacgi&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"desativacgi",funcao)},pegaMapas:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaMapas&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaSistemas",funcao)},mudatamanho:function(funcao,altura,largura){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudatamanho&altura="+altura+"&largura="+largura+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pegaSistemas",funcao)},ativalogo:function(funcao,altura,largura){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=ativalogo&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"ativalogo",funcao)},insereAnnotation:function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=inserefeature&pin="+pin+"&tipo=ANNOTATION&xy="+xy+"&texto="+texto+"&position="+position+"&partials="+partials+"&offsetx="+offsetx+"&offsety="+offsety+"&minfeaturesize="+minfeaturesize+"&mindistance="+mindistance+"&force="+force+"&shadowcolor="+shadowcolor+"&shadowsizex="+shadowsizex+"&shadowsizey="+shadowsizey+"&outlinecolor="+outlinecolor+"&cor="+cor+"&sombray="+sombray+"&sombrax="+sombrax+"&sombra="+sombra+"&fundo="+fundo+"&angulo="+angulo+"&tamanho="+tamanho+"&fonte="+fonte+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"inserefeature",funcao)},identificaunico:function(funcao,xy,tema,item){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identificaunico&xy="+xy+"&resolucao=5&tema="+tema+"&item="+item+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"identificaunico",funcao)},recuperamapa:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=recuperamapa&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"recuperamapa",funcao)},criaLegendaImagem:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=criaLegendaImagem&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"criaLegendaImagem",funcao)},referenciadinamica:function(funcao,zoom,tipo){i3GEO.php.verifica();if(arguments.length==2){var tipo="dinamico"}var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=referenciadinamica&g_sid="+i3GEO.configura.sid+"&zoom="+zoom+"&tipo="+tipo;cpJSON.call(p,"retornaReferenciaDinamica",funcao)},referencia:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=referencia&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"retornaReferencia",funcao)},pan:function(funcao,escala,tipo,x,y){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pan&escala="+escala+"&tipo="+tipo+"&x="+x+"&y="+y+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"pan",funcao)},aproxima:function(funcao,nivel){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=aproxima&nivel="+nivel+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"aproxima",funcao)},afasta:function(funcao,nivel){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=afasta&nivel="+nivel+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"afasta",funcao)},zoomponto:function(funcao,x,y){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomponto&pin=pin&xy="+x+" "+y+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"zoomponto",funcao)},localizaIP:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=localizaIP&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"localizaIP",funcao)},mudaext:function(funcao,tipoimagem,ext,locaplic,sid){if(arguments.length==3){var locaplic=i3GEO.configura.locaplic;var sid=i3GEO.configura.sid}if(ext=='undefined'){alert("extensao nao definida");return}var p=locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid;cpJSON.call(p,"mudaext",funcao)},mudaescala:function(funcao,escala){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaescala&escala="+escala+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudaescala",funcao)},aplicaResolucao:function(funcao,resolucao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=crialente&resolucao="+resolucao+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"crialente",funcao)},geradestaque:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=geradestaque&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"geradestaque",funcao)},selecaopt:function(funcao,tema,xy,tipo,tolerancia){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=selecaopt&tema="+tema+"&tipo="+tipo+"&xy="+xy+"&tolerancia="+tolerancia+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"selecaoPT",funcao)},selecaobox:function(funcao,tema,tipo,box){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=selecaobox&ext="+box+"&g_sid="+i3GEO.configura.sid+"&tipo="+tipo+"&tema="+tema;cpJSON.call(p,"selecaobox",funcao)},sobetema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=sobetema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"sobetema",funcao)},descetema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?&funcao=descetema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"descetema",funcao)},fontetema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=fontetema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"fontetema",funcao)},zoomtema:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomtema&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"zoomtema",funcao)},zoomsel:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomsel&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"zoomsel",funcao)},limpasel:function(funcao,tema){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=limpasel&tema="+tema+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"limpasel",funcao)},mudatransp:function(funcao,tema,valor){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudatransp&tema="+tema+"&valor="+valor+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudatransp",funcao)},mudanome:function(funcao,tema,valor){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudanome&tema="+tema+"&valor="+valor+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"mudanome",funcao)},adicionaTemaWMS:function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo,locaplic,sid){if(arguments.length==11){var locaplic=i3GEO.configura.locaplic;var sid=i3GEO.configura.sid}var p=locaplic+"/classesphp/mapa_controle.php?g_sid="+sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo;cpJSON.call(p,"adicionatemawms",funcao)},adicionaTemaSHP:function(funcao,path){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionaTemaSHP&arq="+path;cpJSON.call(p,"adicionaTemaSHP",funcao)},adicionaTemaIMG:function(funcao,path){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionaTemaIMG&arq="+path;cpJSON.call(p,"adicionaTemaIMG",funcao)},identifica:function(funcao,x,y,resolucao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"identifica",funcao)},reiniciaMapa:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=reiniciaMapa&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"reiniciaMapa",funcao)},procurartemas:function(funcao,procurar,locaplic){if(arguments.length==2){var locaplic=i3GEO.configura.locaplic}var p=locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&map_file=&procurar="+procurar;cpJSON.call(p,"procurartemas",funcao)},adtema:function(funcao,temas,locaplic,sid){if(arguments.length==2){i3GEO.php.verifica();var locaplic=i3GEO.configura.locaplic;var sid=i3GEO.configura.sid}var p=locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+sid;cpJSON.call(p,"adtema",funcao)},escalagrafica:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=escalagrafica&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"escalagrafica",funcao)},flamingo:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=montaFlamingo&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"montaFlamingo",funcao)},openlayers:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=openlayers&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"openlayers",funcao)},corpo:function(funcao,tipoimagem){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=corpo&tipoimagem="+tipoimagem+"&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"corpo",funcao)},criamapa:function(funcao,parametros){var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa&"+parametros;cpJSON.call(p,"criaMapa",funcao)},inicia:function(funcao,embedLegenda,w,h){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=inicia&embedLegenda="+embedLegenda+"&w="+w+"&h="+h+"&g_sid="+i3GEO.configura.sid+"&interface="+i3GEO.interface.ATUAL;cpJSON.call(p,"iniciaMapa",funcao)},chaveGoogle:function(funcao){i3GEO.php.verifica();var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=chavegoogle&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"chavegoogle",funcao)},listaRSSwsARRAY:function(funcao,tipo){var p=i3GEO.configura.locaplic+"/classesphp/wscliente.php?funcao=listaRSSwsARRAY&rss="+new Array("|")+"&tipo="+tipo;cpJSON.call(p,"listaRSSwsARRAY",funcao)},listaLayersWMS:function(funcao,servico,nivel,id_ws,nomelayer){var p=i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer;cpJSON.call(p,"listaLayersWMS",funcao)},buscaRapida:function(funcao,locaplic,servico,palavra){var p=locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=buscaRapida&palavra="+palavra+"&servico="+servico cpJSON.call(p,"buscaRapida",funcao)}}; | ||
3 | \ No newline at end of file | 3 | \ No newline at end of file |
classesjs/compactados/classe_util_compacto.js
1 | -if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}navm=false;navn=false;var app=navigator.appName.substring(0,1);if(app=='N')navn=true;else navm=true;g_operacao="";g_tipoacao="zoomli";g_postpx="px";g_tipotop="top";g_tipoleft="left";if(navm){g_postpx="";g_tipotop="pixelTop";g_tipoleft="pixelLeft"}$i=function(id){return document.getElementById(id)};Array.prototype.remove=function(s){try{var i=this.indexOf(s);if(i!=-1)this.splice(i,1)}catch(e){}};i3GEO.util={PINS:new Array(),BOXES:new Array(),escapeURL:function(sUrl){var sUrl=escape(sUrl);var re=new RegExp("%3F","g");var sUrl=sUrl.replace(re,'?');var re=new RegExp("%3D","g");var sUrl=sUrl.replace(re,'=');var re=new RegExp("%26","g");var sUrl=sUrl.replace(re,'&');return sUrl},insereCookie:function(nome,valor){document.cookie=nome+"="+valor+";path=/"},pegaCookie:function(nome){var cookies=document.cookie;var i=cookies.indexOf(nome);if(i==-1){return null}var fim=cookies.indexOf(";",i);if(fim==-1){var fim=cookies.length}return(unescape(cookies.substring(i,fim))).split("=")[1]},listaChaves:function(obj){var keys=[];for(var key in obj){keys.push(key)}return keys},criaBotaoAplicar:function(nomeFuncao,titulo,classe,obj){try{clearTimeout(tempoBotaoAplicar)}catch(e){};tempoBotaoAplicar=eval("setTimeout('"+nomeFuncao+"\(\)',(i3GEO.configura.tempoAplicar))");autoRedesenho("reinicia");if(arguments.length==1){var titulo="Aplicar"}if(arguments.length==1||arguments.length==2){var classe="i3geoBotaoAplicar"}if(!document.getElementById("i3geo_aplicar")){var novoel=document.createElement("input");novoel.id='i3geo_aplicar';novoel.type='button';novoel.value=titulo;novoel.style.cursor="pointer";novoel.style.fontSize="10px";novoel.style.zIndex=15000;novoel.style.position="absolute";novoel.style.display="none";novoel.onmouseover=function(){this.style.display="block"};novoel.onmouseout=function(){this.style.display="none"};novoel.className=classe;document.body.appendChild(novoel)}else{var novoel=document.getElementById("i3geo_aplicar")}novoel.onclick=function(){clearTimeout(i3GEO.parametros.tempo);i3GEO.parametros.tempo="";this.style.display='none';eval(nomeFuncao+"\(\)")};if(arguments.length==4){novoel.style.display="block";var xy=YAHOO.util.Dom.getXY(obj);YAHOO.util.Dom.setXY(novoel,xy)}return(novoel)},arvore:function(titulo,onde,obj){if(!$i(onde)){return}var currentIconMode;try{arvore=new YAHOO.widget.TreeView(onde);root=arvore.getRoot();var tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false}catch(e){}var titulo="<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>";var d={html:titulo};var tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);var c=obj.propriedades.length;for(var i=0,j=c;i<j;i++){var linha=obj.propriedades[i];var conteudo="<a href='#' onclick='"+linha.url+"'>"+$trad(linha.text)+"</a>";var d={html:conteudo};var temaNode=new YAHOO.widget.HTMLNode(d,tempNode,false,true)}arvore.collapseAll();arvore.draw()},removeAcentos:function(palavra){var re=/ã|á|à|â/gi;palavra=palavra.replace(re,"a");var re=/é/gi;palavra=palavra.replace(re,"e");var re=/í/gi;palavra=palavra.replace(re,"i");var re=/ó|õ/gi;palavra=palavra.replace(re,"o");var re=/ç/gi;palavra=palavra.replace(re,"c");var re=/ú/gi;palavra=palavra.replace(re,"u");return(palavra)},protocolo:function(){var u=window.location.href;var u=u.split(":");return(u[0])},pegaPosicaoObjeto:function(obj){if(obj){if(obj.style.position=="absolute"){return[(parseInt(obj.style.left)),(parseInt(obj.style.top))]}else{var curleft=curtop=0;if(obj){if(obj.offsetParent){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop}while(obj=obj.offsetParent)}}return[curleft+document.body.scrollLeft,curtop+document.body.scrollTop]}}else{return[0,0]}},pegaElementoPai:function(e){var targ;if(!e){var e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.nodeType==3){targ=targ.parentNode}var tname;tparent=targ.parentNode;return(tparent)},mudaCursor:function(cursores,tipo,idobjeto,locaplic){var o=document.getElementById(idobjeto);var c=eval("cursores."+tipo+".ie");if(c=="default"||c=="pointer"||c=="crosshair"||c=="help"||c=="move"||c=="text")o.style.cursor=c;else{if(o){if(navm){o.style.cursor="URL(\""+locaplic+eval("cursores."+tipo+".ie")+"\"),auto"}else{o.style.cursor="URL(\""+locaplic+eval("cursores."+tipo+".ff")+"\"),auto"}}}},criaBox:function(id){if(arguments.length==0){var id="boxg"}if(!$i(id)){var novoel=document.createElement("div");novoel.id=id;novoel.style.zIndex=1;novoel.innerHTML='<font face="Arial" size=0></font>';document.body.appendChild(novoel);novoel.onmouseover=function(){novoel.style.display='none'};novoel.onmouseout=function(){novoel.style.display='block'};i3GEO.util.BOXES.push(id)}},escondeBox:function(){var l=i3GEO.util.BOXES.length;for(i=0;i<l;i++){if($i(i3GEO.util.BOXES[i])){$i(i3GEO.util.BOXES[i]).style.display="none"}}},criaPin:function(id,imagem,w,h){if(arguments.length<1||id==""){var id="boxpin"}if(arguments.length<2||imagem==""){var imagem=i3GEO.configura.locaplic+'/imagens/marker.png'}if(arguments.length<3||w==""){var w="21px"}if(arguments.length<4||h==""){var h="25px"}if(!$i(id)){var novoel=document.createElement("img");novoel.id=id;novoel.style.zIndex=10000;novoel.style.position="absolute";novoel.style.width=w;novoel.style.height=h;novoel.src=imagem;if(id=="boxpin"){novoel.onmouseover=function(){$i("boxpin").style.display="none"}}document.body.appendChild(novoel);i3GEO.util.PINS.push(id)}},posicionaImagemNoMapa:function(id){var i=$i(id);var mx=parseInt(i.style.width)/2;var my=parseInt(i.style.height)/2;i.style.position="absolute";i.style.top=objposicaocursor.telay-my;i.style.left=objposicaocursor.telax-mx},escondePin:function(){var l=i3GEO.util.PINS.length;for(i=0;i<l;i++){if($i(i3GEO.util.PINS[i])){$i(i3GEO.util.PINS[i]).style.display="none"}}},$im:function(g){return i3GEO.configura.locaplic+"/imagens/visual/"+i3GEO.configura.visual+"/"+g},$inputText:function(idPai,larguraIdPai,idInput,titulo,digitos,valor){if(idPai!=""){if(larguraIdPai!=""){$i(idPai).style.width=larguraIdPai+"px"}$i(idPai).style.padding="3";$i(idPai).style.textAlign="center";$i(idPai).onmouseover=function(){this.className="digitarMouseover"};$i(idPai).onmouseout=function(){this.className=""}}var i="<input onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' onclick='javascript:this.className=\"digitarMouseclick\";' id="+idInput+" title='"+titulo+"' type=text size="+digitos+" class=digitar value='"+valor+"' />";return i},$top:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelTop){document.getElementById(id).style.pixelTop=valor}else{document.getElementById(id).style.top=valor+"px"}}},$left:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelLeft){document.getElementById(id).style.pixelLeft=valor}else{document.getElementById(id).style.left=valor+"px"}}},insereMarca:{CONTAINER:new Array(),cria:function(xi,yi,funcaoOnclick,container){try{if(i3GEO.util.insereMarca.CONTAINER.toString().search(container)<0)i3GEO.util.insereMarca.CONTAINER.push(container);if(!$i(container)){var novoel=document.createElement("div");novoel.id=container;var i=novoel.style;i.position="absolute";i.top=parseInt($i("img").style.top);i.left=parseInt($i("img").style.left);document.body.appendChild(novoel)}var container=$i(container);var novoel=document.createElement("div");var i=novoel.style;i.position="absolute";i.zIndex=2000;i.top=(yi-4)+"px";i.left=(xi-4)+"px";i.width="4px";i.height="4px";var novoimg=document.createElement("img");if(funcaoOnclick!=""){novoimg.onclick=funcaoOnclick}else{novoimg.onclick=function(){i3GEO.util.insereMarca.limpa()}}novoimg.src=i3GEO.configura.locaplic+"/imagens/dot1.gif";with(novoimg.style){width="6px";height="6px";zIndex=2000}novoel.appendChild(novoimg);container.appendChild(novoel);if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()")}}catch(e){alert("Ocorreu um erro. inseremarca"+e)}},limpa:function(){try{var n=i3GEO.util.insereMarca.CONTAINER.length;for(i=0;i<n;i++){if($i(i3GEO.util.insereMarca.CONTAINER[i]))$i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML=""}i3GEO.util.insereMarca.CONTAINER=new Array();i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()")}catch(e){}}},adicionaSHP:function(path){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));var temp=path.split(".");if((temp[1]=="SHP")||(temp[1]=="shp")){i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path)}else{i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path)}},abreCor:function(janela,elemento){i3GEO.janela.cria("400","240",i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janela+"&elemento="+elemento,"","","Cor","i3geo_janelaCor",true)},ajaxhttp:function(){try{var objhttp1=new XMLHttpRequest()}catch(ee){try{var objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{var objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){var objhttp1=false}}}return(objhttp1)},ajaxexecASXml:function(programa,funcao){if(programa.search("http")==0){var h=window.location.host;if(programa.search(h)<0){alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php");return}}var ohttp=i3GEO.util.ajaxhttp();ohttp.open("GET",programa,true);var retorno="";ohttp.onreadystatechange=function(){if(ohttp.readyState==4){var retorno=ohttp.responseText;if(retorno!=undefined){if(document.implementation.createDocument){var parser=new DOMParser();var dom=parser.parseFromString(retorno,"text/xml")}else{var dom=new ActiveXObject("Microsoft.XMLDOM");dom.async="false";dom.load(programa)}}else{var dom="erro"}if(funcao!="volta"){eval(funcao+'(dom)')}else{return dom}}};ohttp.send(null)},aparece:function(id,tempo,intervalo){var n=parseInt(tempo/intervalo);var tempo=n*intervalo;var intervalo=(intervalo*100)/tempo;var obj=$i(id);var opacidade=0;if(navm){obj.style.filter='alpha(opacity=0)'}else{obj.style.opacity=0}obj.style.display="block";var fadei=function(){opacidade+=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade<100)var tempoFade=setTimeout(fadei,tempo);else{clearTimeout(tempoFadei);if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}};var tempoFadei=setTimeout(fadei,tempo)},desaparece:function(id,tempo,intervalo,removeobj){var n=parseInt(tempo/intervalo);var tempo=n*intervalo;var intervalo=(intervalo*100)/tempo;var obj=$i(id);var opacidade=100;if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}obj.style.display="block";var fade=function(){opacidade-=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade>0){var tempoFade=setTimeout(fade,tempo)}else{clearTimeout(tempoFade);obj.style.display="none";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}if(removeobj){var p=obj.parentNode;if(p)p.removeChild(obj)}}};var tempoFade=setTimeout(fade,tempo)}};$im=function(g){return i3GEO.util.$im(g)};$inputText=function(idPai,larguraIdPai,idInput,titulo,digitos,valor){return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor)};$top=function(id,valor){i3GEO.util.$top(id,valor)};$left=function(id,valor){i3GEO.util.$left(id,valor)}; | ||
2 | \ No newline at end of file | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)=='undefined'){i3GEO=new Array()}navm=false;navn=false;var app=navigator.appName.substring(0,1);if(app=='N')navn=true;else navm=true;g_operacao="";g_tipoacao="zoomli";g_postpx="px";g_tipotop="top";g_tipoleft="left";if(navm){g_postpx="";g_tipotop="pixelTop";g_tipoleft="pixelLeft"}$i=function(id){return document.getElementById(id)};Array.prototype.remove=function(s){try{var i=this.indexOf(s);if(i!=-1)this.splice(i,1)}catch(e){}};i3GEO.util={PINS:new Array(),BOXES:new Array(),escapeURL:function(sUrl){var sUrl=escape(sUrl);var re=new RegExp("%3F","g");var sUrl=sUrl.replace(re,'?');var re=new RegExp("%3D","g");var sUrl=sUrl.replace(re,'=');var re=new RegExp("%26","g");var sUrl=sUrl.replace(re,'&');return sUrl},insereCookie:function(nome,valor){document.cookie=nome+"="+valor+";path=/"},pegaCookie:function(nome){var cookies=document.cookie;var i=cookies.indexOf(nome);if(i==-1){return null}var fim=cookies.indexOf(";",i);if(fim==-1){var fim=cookies.length}return(unescape(cookies.substring(i,fim))).split("=")[1]},listaChaves:function(obj){var keys=[];for(var key in obj){keys.push(key)}return keys},criaBotaoAplicar:function(nomeFuncao,titulo,classe,obj){try{clearTimeout(tempoBotaoAplicar)}catch(e){};tempoBotaoAplicar=eval("setTimeout('"+nomeFuncao+"\(\)',(i3GEO.configura.tempoAplicar))");autoRedesenho("reinicia");if(arguments.length==1){var titulo="Aplicar"}if(arguments.length==1||arguments.length==2){var classe="i3geoBotaoAplicar"}if(!document.getElementById("i3geo_aplicar")){var novoel=document.createElement("input");novoel.id='i3geo_aplicar';novoel.type='button';novoel.value=titulo;novoel.style.cursor="pointer";novoel.style.fontSize="10px";novoel.style.zIndex=15000;novoel.style.position="absolute";novoel.style.display="none";novoel.onmouseover=function(){this.style.display="block"};novoel.onmouseout=function(){this.style.display="none"};novoel.className=classe;document.body.appendChild(novoel)}else{var novoel=document.getElementById("i3geo_aplicar")}novoel.onclick=function(){clearTimeout(i3GEO.parametros.tempo);i3GEO.parametros.tempo="";this.style.display='none';eval(nomeFuncao+"\(\)")};if(arguments.length==4){novoel.style.display="block";var xy=YAHOO.util.Dom.getXY(obj);YAHOO.util.Dom.setXY(novoel,xy)}return(novoel)},arvore:function(titulo,onde,obj){if(!$i(onde)){return}var currentIconMode;try{arvore=new YAHOO.widget.TreeView(onde);root=arvore.getRoot();var tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false}catch(e){}var titulo="<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>";var d={html:titulo};var tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);var c=obj.propriedades.length;for(var i=0,j=c;i<j;i++){var linha=obj.propriedades[i];var conteudo="<a href='#' onclick='"+linha.url+"'>"+$trad(linha.text)+"</a>";var d={html:conteudo};var temaNode=new YAHOO.widget.HTMLNode(d,tempNode,false,true)}arvore.collapseAll();arvore.draw()},removeAcentos:function(palavra){var re=/ã|á|à|â/gi;palavra=palavra.replace(re,"a");var re=/é/gi;palavra=palavra.replace(re,"e");var re=/í/gi;palavra=palavra.replace(re,"i");var re=/ó|õ/gi;palavra=palavra.replace(re,"o");var re=/ç/gi;palavra=palavra.replace(re,"c");var re=/ú/gi;palavra=palavra.replace(re,"u");return(palavra)},protocolo:function(){var u=window.location.href;var u=u.split(":");return(u[0])},pegaPosicaoObjeto:function(obj){if(obj){if(!obj.style){return[0,0]}if(obj.style.position=="absolute"){return[(parseInt(obj.style.left)),(parseInt(obj.style.top))]}else{var curleft=curtop=0;if(obj){if(obj.offsetParent){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop}while(obj=obj.offsetParent)}}return[curleft+document.body.scrollLeft,curtop+document.body.scrollTop]}}else{return[0,0]}},pegaElementoPai:function(e){var targ;if(!e){var e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.nodeType==3){targ=targ.parentNode}var tname;tparent=targ.parentNode;return(tparent)},mudaCursor:function(cursores,tipo,idobjeto,locaplic){var o=document.getElementById(idobjeto);var c=eval("cursores."+tipo+".ie");if(c=="default"||c=="pointer"||c=="crosshair"||c=="help"||c=="move"||c=="text")o.style.cursor=c;else{if(o){if(navm){o.style.cursor="URL(\""+locaplic+eval("cursores."+tipo+".ie")+"\"),auto"}else{o.style.cursor="URL(\""+locaplic+eval("cursores."+tipo+".ff")+"\"),auto"}}}},criaBox:function(id){if(arguments.length==0){var id="boxg"}if(!$i(id)){var novoel=document.createElement("div");novoel.id=id;novoel.style.zIndex=1;novoel.innerHTML='<font face="Arial" size=0></font>';document.body.appendChild(novoel);novoel.onmouseover=function(){novoel.style.display='none'};novoel.onmouseout=function(){novoel.style.display='block'};i3GEO.util.BOXES.push(id)}else $i(id).style.display="block"},escondeBox:function(){var l=i3GEO.util.BOXES.length;for(i=0;i<l;i++){if($i(i3GEO.util.BOXES[i])){$i(i3GEO.util.BOXES[i]).style.display="none"}}},criaPin:function(id,imagem,w,h){if(arguments.length<1||id==""){var id="boxpin"}if(arguments.length<2||imagem==""){var imagem=i3GEO.configura.locaplic+'/imagens/marker.png'}if(arguments.length<3||w==""){var w="21px"}if(arguments.length<4||h==""){var h="25px"}if(!$i(id)){var novoel=document.createElement("img");novoel.id=id;novoel.style.zIndex=10000;novoel.style.position="absolute";novoel.style.width=w;novoel.style.height=h;novoel.src=imagem;if(id=="boxpin"){novoel.onmouseover=function(){$i("boxpin").style.display="none"}}document.body.appendChild(novoel);i3GEO.util.PINS.push(id)}},posicionaImagemNoMapa:function(id){var i=$i(id);var mx=parseInt(i.style.width)/2;var my=parseInt(i.style.height)/2;i.style.position="absolute";i.style.top=objposicaocursor.telay-my;i.style.left=objposicaocursor.telax-mx},escondePin:function(){var l=i3GEO.util.PINS.length;for(i=0;i<l;i++){if($i(i3GEO.util.PINS[i])){$i(i3GEO.util.PINS[i]).style.display="none"}}},$im:function(g){return i3GEO.configura.locaplic+"/imagens/visual/"+i3GEO.configura.visual+"/"+g},$inputText:function(idPai,larguraIdPai,idInput,titulo,digitos,valor){if(idPai!=""){if(larguraIdPai!=""){$i(idPai).style.width=larguraIdPai+"px"}$i(idPai).style.padding="3";$i(idPai).style.textAlign="center";$i(idPai).onmouseover=function(){this.className="digitarMouseover"};$i(idPai).onmouseout=function(){this.className=""}}var i="<input onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' onclick='javascript:this.className=\"digitarMouseclick\";' id="+idInput+" title='"+titulo+"' type=text size="+digitos+" class=digitar value='"+valor+"' />";return i},$top:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelTop){document.getElementById(id).style.pixelTop=valor}else{document.getElementById(id).style.top=valor+"px"}}},$left:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelLeft){document.getElementById(id).style.pixelLeft=valor}else{document.getElementById(id).style.left=valor+"px"}}},insereMarca:{CONTAINER:new Array(),cria:function(xi,yi,funcaoOnclick,container){try{if(i3GEO.util.insereMarca.CONTAINER.toString().search(container)<0)i3GEO.util.insereMarca.CONTAINER.push(container);if(!$i(container)){var novoel=document.createElement("div");novoel.id=container;var i=novoel.style;i.position="absolute";i.top=parseInt($i("img").style.top);i.left=parseInt($i("img").style.left);document.body.appendChild(novoel)}var container=$i(container);var novoel=document.createElement("div");var i=novoel.style;i.position="absolute";i.zIndex=2000;i.top=(yi-4)+"px";i.left=(xi-4)+"px";i.width="4px";i.height="4px";var novoimg=document.createElement("img");if(funcaoOnclick!=""){novoimg.onclick=funcaoOnclick}else{novoimg.onclick=function(){i3GEO.util.insereMarca.limpa()}}novoimg.src=i3GEO.configura.locaplic+"/imagens/dot1.gif";with(novoimg.style){width="6px";height="6px";zIndex=2000}novoel.appendChild(novoimg);container.appendChild(novoel);if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()")}}catch(e){alert("Ocorreu um erro. inseremarca"+e)}},limpa:function(){try{var n=i3GEO.util.insereMarca.CONTAINER.length;for(i=0;i<n;i++){if($i(i3GEO.util.insereMarca.CONTAINER[i]))$i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML=""}i3GEO.util.insereMarca.CONTAINER=new Array();i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()")}catch(e){}}},adicionaSHP:function(path){i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));var temp=path.split(".");if((temp[1]=="SHP")||(temp[1]=="shp")){i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path)}else{i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path)}},abreCor:function(janela,elemento){i3GEO.janela.cria("400","240",i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janela+"&elemento="+elemento,"","","Cor","i3geo_janelaCor",true)},ajaxhttp:function(){try{var objhttp1=new XMLHttpRequest()}catch(ee){try{var objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{var objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){var objhttp1=false}}}return(objhttp1)},ajaxexecASXml:function(programa,funcao){if(programa.search("http")==0){var h=window.location.host;if(programa.search(h)<0){alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php");return}}var ohttp=i3GEO.util.ajaxhttp();ohttp.open("GET",programa,true);var retorno="";ohttp.onreadystatechange=function(){if(ohttp.readyState==4){var retorno=ohttp.responseText;if(retorno!=undefined){if(document.implementation.createDocument){var parser=new DOMParser();var dom=parser.parseFromString(retorno,"text/xml")}else{var dom=new ActiveXObject("Microsoft.XMLDOM");dom.async="false";dom.load(programa)}}else{var dom="erro"}if(funcao!="volta"){eval(funcao+'(dom)')}else{return dom}}};ohttp.send(null)},aparece:function(id,tempo,intervalo){var n=parseInt(tempo/intervalo);var tempo=n*intervalo;var intervalo=(intervalo*100)/tempo;var obj=$i(id);var opacidade=0;if(navm){obj.style.filter='alpha(opacity=0)'}else{obj.style.opacity=0}obj.style.display="block";var fadei=function(){opacidade+=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade<100)var tempoFade=setTimeout(fadei,tempo);else{clearTimeout(tempoFadei);if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}};var tempoFadei=setTimeout(fadei,tempo)},desaparece:function(id,tempo,intervalo,removeobj){var n=parseInt(tempo/intervalo);var tempo=n*intervalo;var intervalo=(intervalo*100)/tempo;var obj=$i(id);var opacidade=100;if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}obj.style.display="block";var fade=function(){opacidade-=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade>0){var tempoFade=setTimeout(fade,tempo)}else{clearTimeout(tempoFade);obj.style.display="none";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}if(removeobj){var p=obj.parentNode;if(p)p.removeChild(obj)}}};var tempoFade=setTimeout(fade,tempo)},wkt2ext:function(wkt,tipo){var tipo=tipo.toLowerCase();ext=false;if(tipo=="polygon"){try{var re=new RegExp("POLYGON","g");var wkt=wkt.replace(re,"");var wkt=wkt.split("(")[2].split(")")[0];var wkt=wkt.split(",");var x=new Array();var y=new Array();for(w=0;w<wkt.length;w++){var temp=wkt[w].split(" ");x.push(temp[0]);y.push(temp[1])}x.sort(i3GEO.util.sortNumber);var xMin=x[0];var xMax=x[(x.length)-1];y.sort(i3GEO.util.sortNumber);var yMin=y[0];var yMax=y[(y.length)-1];return xMin+" "+yMin+" "+xMax+" "+yMax}catch(e){}}return ext},sortNumber:function(a,b){return a-b}};$im=function(g){return i3GEO.util.$im(g)};$inputText=function(idPai,larguraIdPai,idInput,titulo,digitos,valor){return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor)};$top=function(id,valor){i3GEO.util.$top(id,valor)};$left=function(id,valor){i3GEO.util.$left(id,valor)}; | ||
3 | \ No newline at end of file | 3 | \ No newline at end of file |
classesjs/compactajs.php
@@ -168,7 +168,8 @@ $jsfiles = array( | @@ -168,7 +168,8 @@ $jsfiles = array( | ||
168 | "../pacotes/yui252/build/animation/animation-min.js", | 168 | "../pacotes/yui252/build/animation/animation-min.js", |
169 | "../pacotes/yui252/build/autocomplete/autocomplete-min.js", | 169 | "../pacotes/yui252/build/autocomplete/autocomplete-min.js", |
170 | "../pacotes/cpaint/cpaint2.inc.js", | 170 | "../pacotes/cpaint/cpaint2.inc.js", |
171 | -"classe_php.js" | 171 | +"classe_php.js", |
172 | +"classe_util.js" | ||
172 | ); | 173 | ); |
173 | $buffer = "\$i = function(id){return document.getElementById(id);}\n"; | 174 | $buffer = "\$i = function(id){return document.getElementById(id);}\n"; |
174 | salvatudojs($jsfiles,$buffer,"../ferramentas/i3geo_tudo_compacto.js","js"); | 175 | salvatudojs($jsfiles,$buffer,"../ferramentas/i3geo_tudo_compacto.js","js"); |
classesjs/dicionario_ajuda.js
@@ -614,7 +614,8 @@ g_traducao_ajuda = { | @@ -614,7 +614,8 @@ g_traducao_ajuda = { | ||
614 | pt:"Essa opção permite localizar dados com base em palavras ou frases, por esemplo 'São Paulo'. A busca é feita em um Web Service cujo banco de dados pode variar em cada instalação do i3Geo. Quando um lugar é encontrado, uma nova janela é mostrada na tela com o resultado. Clicando-se nos links disponíveis, o mapa é deslocado para o lugar definido e uma nova camada é adicionada ao mapa.", | 614 | pt:"Essa opção permite localizar dados com base em palavras ou frases, por esemplo 'São Paulo'. A busca é feita em um Web Service cujo banco de dados pode variar em cada instalação do i3Geo. Quando um lugar é encontrado, uma nova janela é mostrada na tela com o resultado. Clicando-se nos links disponíveis, o mapa é deslocado para o lugar definido e uma nova camada é adicionada ao mapa.", |
615 | complemento:"A busca é feita também no Web Service do Google, permitindo a localização de endereços.", | 615 | complemento:"A busca é feita também no Web Service do Google, permitindo a localização de endereços.", |
616 | apijs:"i3GEO.gadgets.mostraBuscaRapida(id)", | 616 | apijs:"i3GEO.gadgets.mostraBuscaRapida(id)", |
617 | - tela:"ferramentas/buscarapida/exemplo.htm" | 617 | + tela:"ferramentas/buscarapida/exemplo.htm", |
618 | + gadget:"ferramentas/buscarapida/gadget.php?palavra=tanabi&locaplic=../../../i3geo" | ||
618 | }, | 619 | }, |
619 | "72": { | 620 | "72": { |
620 | titulo: "Localizar IP", | 621 | titulo: "Localizar IP", |
classesjs/i3geo_tudo_compacto.js
@@ -4392,7 +4392,6 @@ i3GEO.util = { | @@ -4392,7 +4392,6 @@ i3GEO.util = { | ||
4392 | var sUrl = sUrl.replace(re,'&'); | 4392 | var sUrl = sUrl.replace(re,'&'); |
4393 | return sUrl; | 4393 | return sUrl; |
4394 | }, | 4394 | }, |
4395 | - | ||
4396 | /* | 4395 | /* |
4397 | Function: insereCookie | 4396 | Function: insereCookie |
4398 | Cria um novo cookie. | 4397 | Cria um novo cookie. |
@@ -4607,6 +4606,8 @@ i3GEO.util = { | @@ -4607,6 +4606,8 @@ i3GEO.util = { | ||
4607 | pegaPosicaoObjeto: function(obj){ | 4606 | pegaPosicaoObjeto: function(obj){ |
4608 | if(obj) | 4607 | if(obj) |
4609 | { | 4608 | { |
4609 | + if(!obj.style) | ||
4610 | + {return [0,0];} | ||
4610 | if(obj.style.position == "absolute") | 4611 | if(obj.style.position == "absolute") |
4611 | {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} | 4612 | {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} |
4612 | else{ | 4613 | else{ |
@@ -4626,7 +4627,7 @@ i3GEO.util = { | @@ -4626,7 +4627,7 @@ i3GEO.util = { | ||
4626 | {return [0,0];} | 4627 | {return [0,0];} |
4627 | }, | 4628 | }, |
4628 | /* | 4629 | /* |
4629 | - Function: i3geo_pegaElementoPai | 4630 | + Function: pegaElementoPai |
4630 | 4631 | ||
4631 | Pega o elemento pai de um elemento clicado para identificar o código do tema. | 4632 | Pega o elemento pai de um elemento clicado para identificar o código do tema. |
4632 | 4633 | ||
@@ -4713,6 +4714,8 @@ i3GEO.util = { | @@ -4713,6 +4714,8 @@ i3GEO.util = { | ||
4713 | novoel.onmouseout = function(){novoel.style.display='block';}; | 4714 | novoel.onmouseout = function(){novoel.style.display='block';}; |
4714 | i3GEO.util.BOXES.push(id); | 4715 | i3GEO.util.BOXES.push(id); |
4715 | } | 4716 | } |
4717 | + else | ||
4718 | + $i(id).style.display="block"; | ||
4716 | }, | 4719 | }, |
4717 | /* | 4720 | /* |
4718 | Function: escondeBox | 4721 | Function: escondeBox |
@@ -4777,6 +4780,10 @@ i3GEO.util = { | @@ -4777,6 +4780,10 @@ i3GEO.util = { | ||
4777 | Function: posicionaImagemNoMapa | 4780 | Function: posicionaImagemNoMapa |
4778 | 4781 | ||
4779 | Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa | 4782 | Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa |
4783 | + | ||
4784 | + Parameters: | ||
4785 | + | ||
4786 | + id {string} - id do elemento que será posicionado | ||
4780 | */ | 4787 | */ |
4781 | posicionaImagemNoMapa: function(id){ | 4788 | posicionaImagemNoMapa: function(id){ |
4782 | var i = $i(id); | 4789 | var i = $i(id); |
@@ -5173,6 +5180,59 @@ i3GEO.util = { | @@ -5173,6 +5180,59 @@ i3GEO.util = { | ||
5173 | } | 5180 | } |
5174 | }; | 5181 | }; |
5175 | var tempoFade = setTimeout(fade, tempo); | 5182 | var tempoFade = setTimeout(fade, tempo); |
5183 | + }, | ||
5184 | + /* | ||
5185 | + Function: wkt2ext | ||
5186 | + | ||
5187 | + Calcula a extensão geográfica de uma geometria fornecida no formato WKT | ||
5188 | + | ||
5189 | + Parameters: | ||
5190 | + | ||
5191 | + wkt {String} - geometria no formato wkt | ||
5192 | + | ||
5193 | + tipo {String} - tipo de geometria (polygon,point,line) | ||
5194 | + | ||
5195 | + Return: | ||
5196 | + | ||
5197 | + {String} - extensão geográfica (xmin ymin xmax ymax) | ||
5198 | + */ | ||
5199 | + wkt2ext:function(wkt,tipo){ | ||
5200 | + var tipo = tipo.toLowerCase(); | ||
5201 | + ext = false; | ||
5202 | + if(tipo == "polygon"){ | ||
5203 | + try{ | ||
5204 | + var re = new RegExp("POLYGON", "g"); | ||
5205 | + var wkt = wkt.replace(re,""); | ||
5206 | + var wkt = wkt.split("(")[2].split(")")[0]; | ||
5207 | + var wkt = wkt.split(","); | ||
5208 | + var x = new Array(); | ||
5209 | + var y = new Array(); | ||
5210 | + for (w=0;w<wkt.length; w++){ | ||
5211 | + var temp = wkt[w].split(" "); | ||
5212 | + x.push(temp[0]); | ||
5213 | + y.push(temp[1]); | ||
5214 | + } | ||
5215 | + x.sort(i3GEO.util.sortNumber); | ||
5216 | + var xMin = x[0]; | ||
5217 | + var xMax = x[(x.length)-1]; | ||
5218 | + y.sort(i3GEO.util.sortNumber); | ||
5219 | + var yMin = y[0]; | ||
5220 | + var yMax = y[(y.length)-1]; | ||
5221 | + return xMin+" "+yMin+" "+xMax+" "+yMax; | ||
5222 | + } | ||
5223 | + catch(e){} | ||
5224 | + } | ||
5225 | + return ext; | ||
5226 | + }, | ||
5227 | + /* | ||
5228 | + Function: sortNumber | ||
5229 | + | ||
5230 | + Ordena um array contendo números. Deve ser usado como parâmetro do método "sort", exemplo | ||
5231 | + | ||
5232 | + y.sort(i3GEO.util.sortNumber), onde y é um array de números | ||
5233 | + */ | ||
5234 | + sortNumber: function(a,b){ | ||
5235 | + return a - b; | ||
5176 | } | 5236 | } |
5177 | }; | 5237 | }; |
5178 | // | 5238 | // |
@@ -7072,10 +7132,13 @@ i3GEO.php = { | @@ -7072,10 +7132,13 @@ i3GEO.php = { | ||
7072 | 7132 | ||
7073 | <Navegacao->mudaExtensao> | 7133 | <Navegacao->mudaExtensao> |
7074 | */ | 7134 | */ |
7075 | - mudaext: function(funcao,tipoimagem,ext){ | ||
7076 | - i3GEO.php.verifica(); | 7135 | + mudaext: function(funcao,tipoimagem,ext,locaplic,sid){ |
7136 | + if(arguments.length == 3){ | ||
7137 | + var locaplic = i3GEO.configura.locaplic; | ||
7138 | + var sid = i3GEO.configura.sid; | ||
7139 | + } | ||
7077 | if(ext == 'undefined'){alert("extensao nao definida");return;} | 7140 | if(ext == 'undefined'){alert("extensao nao definida");return;} |
7078 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+i3GEO.configura.sid; | 7141 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid; |
7079 | cpJSON.call(p,"mudaext",funcao); | 7142 | cpJSON.call(p,"mudaext",funcao); |
7080 | }, | 7143 | }, |
7081 | /* | 7144 | /* |
@@ -7255,9 +7318,12 @@ i3GEO.php = { | @@ -7255,9 +7318,12 @@ i3GEO.php = { | ||
7255 | 7318 | ||
7256 | <Mapa->adicionatemawms> | 7319 | <Mapa->adicionatemawms> |
7257 | */ | 7320 | */ |
7258 | - adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo){ | ||
7259 | - i3GEO.php.verifica(); | ||
7260 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | 7321 | + adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo,locaplic,sid){ |
7322 | + if(arguments.length == 11){ | ||
7323 | + var locaplic = i3GEO.configura.locaplic; | ||
7324 | + var sid = i3GEO.configura.sid; | ||
7325 | + } | ||
7326 | + var p = locaplic+"/classesphp/mapa_controle.php?g_sid="+sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | ||
7261 | cpJSON.call(p,"adicionatemawms",funcao); | 7327 | cpJSON.call(p,"adicionatemawms",funcao); |
7262 | }, | 7328 | }, |
7263 | /* | 7329 | /* |
@@ -7332,9 +7398,13 @@ i3GEO.php = { | @@ -7332,9 +7398,13 @@ i3GEO.php = { | ||
7332 | 7398 | ||
7333 | <Mapa->adicionaTema> | 7399 | <Mapa->adicionaTema> |
7334 | */ | 7400 | */ |
7335 | - adtema: function(funcao,temas){ | ||
7336 | - i3GEO.php.verifica(); | ||
7337 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+i3GEO.configura.sid; | 7401 | + adtema: function(funcao,temas,locaplic,sid){ |
7402 | + if(arguments.length == 2){ | ||
7403 | + i3GEO.php.verifica(); | ||
7404 | + var locaplic = i3GEO.configura.locaplic; | ||
7405 | + var sid = i3GEO.configura.sid; | ||
7406 | + } | ||
7407 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+sid; | ||
7338 | cpJSON.call(p,"adtema",funcao); | 7408 | cpJSON.call(p,"adtema",funcao); |
7339 | }, | 7409 | }, |
7340 | /* | 7410 | /* |
@@ -10095,16 +10165,7 @@ i3GEO.calculo = { | @@ -10095,16 +10165,7 @@ i3GEO.calculo = { | ||
10095 | if(arguments.length == 4){ | 10165 | if(arguments.length == 4){ |
10096 | var cellsize = i3GEO.parametros.pixelsize; | 10166 | var cellsize = i3GEO.parametros.pixelsize; |
10097 | } | 10167 | } |
10098 | - /* | ||
10099 | - if(!docmapa) | ||
10100 | - {var docmapa = window.document;} | ||
10101 | - try{ | ||
10102 | - var dc = docmapa.getElementById("img"); | ||
10103 | - if(!dc){var dc = docmapa;} | ||
10104 | - | ||
10105 | - } | ||
10106 | - catch(e){var dc = docmapa;} | ||
10107 | - */ | 10168 | + |
10108 | if(!docmapa) | 10169 | if(!docmapa) |
10109 | {var docmapa = window.document;} | 10170 | {var docmapa = window.document;} |
10110 | var dc = docmapa; | 10171 | var dc = docmapa; |
@@ -20540,7 +20601,7 @@ i3GEO.gadgets = { | @@ -20540,7 +20601,7 @@ i3GEO.gadgets = { | ||
20540 | e.value = parseInt(i3GEO.parametros.mapscale); | 20601 | e.value = parseInt(i3GEO.parametros.mapscale); |
20541 | }; | 20602 | }; |
20542 | if(!$i("i3geo_escalanum")){ | 20603 | if(!$i("i3geo_escalanum")){ |
20543 | - var i = $inputText(id,"145","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale)); | 20604 | + var i = $inputText(id,"155","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale)); |
20544 | var ins = "<table><tr><td>1:"+i; | 20605 | var ins = "<table><tr><td>1:"+i; |
20545 | var temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; | 20606 | var temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; |
20546 | temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; | 20607 | temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; |
classesjs/i3geo_tudo_compacto.js.php
@@ -4392,7 +4392,6 @@ i3GEO.util = { | @@ -4392,7 +4392,6 @@ i3GEO.util = { | ||
4392 | var sUrl = sUrl.replace(re,'&'); | 4392 | var sUrl = sUrl.replace(re,'&'); |
4393 | return sUrl; | 4393 | return sUrl; |
4394 | }, | 4394 | }, |
4395 | - | ||
4396 | /* | 4395 | /* |
4397 | Function: insereCookie | 4396 | Function: insereCookie |
4398 | Cria um novo cookie. | 4397 | Cria um novo cookie. |
@@ -4607,6 +4606,8 @@ i3GEO.util = { | @@ -4607,6 +4606,8 @@ i3GEO.util = { | ||
4607 | pegaPosicaoObjeto: function(obj){ | 4606 | pegaPosicaoObjeto: function(obj){ |
4608 | if(obj) | 4607 | if(obj) |
4609 | { | 4608 | { |
4609 | + if(!obj.style) | ||
4610 | + {return [0,0];} | ||
4610 | if(obj.style.position == "absolute") | 4611 | if(obj.style.position == "absolute") |
4611 | {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} | 4612 | {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} |
4612 | else{ | 4613 | else{ |
@@ -4626,7 +4627,7 @@ i3GEO.util = { | @@ -4626,7 +4627,7 @@ i3GEO.util = { | ||
4626 | {return [0,0];} | 4627 | {return [0,0];} |
4627 | }, | 4628 | }, |
4628 | /* | 4629 | /* |
4629 | - Function: i3geo_pegaElementoPai | 4630 | + Function: pegaElementoPai |
4630 | 4631 | ||
4631 | Pega o elemento pai de um elemento clicado para identificar o código do tema. | 4632 | Pega o elemento pai de um elemento clicado para identificar o código do tema. |
4632 | 4633 | ||
@@ -4713,6 +4714,8 @@ i3GEO.util = { | @@ -4713,6 +4714,8 @@ i3GEO.util = { | ||
4713 | novoel.onmouseout = function(){novoel.style.display='block';}; | 4714 | novoel.onmouseout = function(){novoel.style.display='block';}; |
4714 | i3GEO.util.BOXES.push(id); | 4715 | i3GEO.util.BOXES.push(id); |
4715 | } | 4716 | } |
4717 | + else | ||
4718 | + $i(id).style.display="block"; | ||
4716 | }, | 4719 | }, |
4717 | /* | 4720 | /* |
4718 | Function: escondeBox | 4721 | Function: escondeBox |
@@ -4777,6 +4780,10 @@ i3GEO.util = { | @@ -4777,6 +4780,10 @@ i3GEO.util = { | ||
4777 | Function: posicionaImagemNoMapa | 4780 | Function: posicionaImagemNoMapa |
4778 | 4781 | ||
4779 | Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa | 4782 | Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa |
4783 | + | ||
4784 | + Parameters: | ||
4785 | + | ||
4786 | + id {string} - id do elemento que será posicionado | ||
4780 | */ | 4787 | */ |
4781 | posicionaImagemNoMapa: function(id){ | 4788 | posicionaImagemNoMapa: function(id){ |
4782 | var i = $i(id); | 4789 | var i = $i(id); |
@@ -5173,6 +5180,59 @@ i3GEO.util = { | @@ -5173,6 +5180,59 @@ i3GEO.util = { | ||
5173 | } | 5180 | } |
5174 | }; | 5181 | }; |
5175 | var tempoFade = setTimeout(fade, tempo); | 5182 | var tempoFade = setTimeout(fade, tempo); |
5183 | + }, | ||
5184 | + /* | ||
5185 | + Function: wkt2ext | ||
5186 | + | ||
5187 | + Calcula a extensão geográfica de uma geometria fornecida no formato WKT | ||
5188 | + | ||
5189 | + Parameters: | ||
5190 | + | ||
5191 | + wkt {String} - geometria no formato wkt | ||
5192 | + | ||
5193 | + tipo {String} - tipo de geometria (polygon,point,line) | ||
5194 | + | ||
5195 | + Return: | ||
5196 | + | ||
5197 | + {String} - extensão geográfica (xmin ymin xmax ymax) | ||
5198 | + */ | ||
5199 | + wkt2ext:function(wkt,tipo){ | ||
5200 | + var tipo = tipo.toLowerCase(); | ||
5201 | + ext = false; | ||
5202 | + if(tipo == "polygon"){ | ||
5203 | + try{ | ||
5204 | + var re = new RegExp("POLYGON", "g"); | ||
5205 | + var wkt = wkt.replace(re,""); | ||
5206 | + var wkt = wkt.split("(")[2].split(")")[0]; | ||
5207 | + var wkt = wkt.split(","); | ||
5208 | + var x = new Array(); | ||
5209 | + var y = new Array(); | ||
5210 | + for (w=0;w<wkt.length; w++){ | ||
5211 | + var temp = wkt[w].split(" "); | ||
5212 | + x.push(temp[0]); | ||
5213 | + y.push(temp[1]); | ||
5214 | + } | ||
5215 | + x.sort(i3GEO.util.sortNumber); | ||
5216 | + var xMin = x[0]; | ||
5217 | + var xMax = x[(x.length)-1]; | ||
5218 | + y.sort(i3GEO.util.sortNumber); | ||
5219 | + var yMin = y[0]; | ||
5220 | + var yMax = y[(y.length)-1]; | ||
5221 | + return xMin+" "+yMin+" "+xMax+" "+yMax; | ||
5222 | + } | ||
5223 | + catch(e){} | ||
5224 | + } | ||
5225 | + return ext; | ||
5226 | + }, | ||
5227 | + /* | ||
5228 | + Function: sortNumber | ||
5229 | + | ||
5230 | + Ordena um array contendo números. Deve ser usado como parâmetro do método "sort", exemplo | ||
5231 | + | ||
5232 | + y.sort(i3GEO.util.sortNumber), onde y é um array de números | ||
5233 | + */ | ||
5234 | + sortNumber: function(a,b){ | ||
5235 | + return a - b; | ||
5176 | } | 5236 | } |
5177 | }; | 5237 | }; |
5178 | // | 5238 | // |
@@ -7072,10 +7132,13 @@ i3GEO.php = { | @@ -7072,10 +7132,13 @@ i3GEO.php = { | ||
7072 | 7132 | ||
7073 | <Navegacao->mudaExtensao> | 7133 | <Navegacao->mudaExtensao> |
7074 | */ | 7134 | */ |
7075 | - mudaext: function(funcao,tipoimagem,ext){ | ||
7076 | - i3GEO.php.verifica(); | 7135 | + mudaext: function(funcao,tipoimagem,ext,locaplic,sid){ |
7136 | + if(arguments.length == 3){ | ||
7137 | + var locaplic = i3GEO.configura.locaplic; | ||
7138 | + var sid = i3GEO.configura.sid; | ||
7139 | + } | ||
7077 | if(ext == 'undefined'){alert("extensao nao definida");return;} | 7140 | if(ext == 'undefined'){alert("extensao nao definida");return;} |
7078 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+i3GEO.configura.sid; | 7141 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid; |
7079 | cpJSON.call(p,"mudaext",funcao); | 7142 | cpJSON.call(p,"mudaext",funcao); |
7080 | }, | 7143 | }, |
7081 | /* | 7144 | /* |
@@ -7255,9 +7318,12 @@ i3GEO.php = { | @@ -7255,9 +7318,12 @@ i3GEO.php = { | ||
7255 | 7318 | ||
7256 | <Mapa->adicionatemawms> | 7319 | <Mapa->adicionatemawms> |
7257 | */ | 7320 | */ |
7258 | - adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo){ | ||
7259 | - i3GEO.php.verifica(); | ||
7260 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | 7321 | + adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo,locaplic,sid){ |
7322 | + if(arguments.length == 11){ | ||
7323 | + var locaplic = i3GEO.configura.locaplic; | ||
7324 | + var sid = i3GEO.configura.sid; | ||
7325 | + } | ||
7326 | + var p = locaplic+"/classesphp/mapa_controle.php?g_sid="+sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | ||
7261 | cpJSON.call(p,"adicionatemawms",funcao); | 7327 | cpJSON.call(p,"adicionatemawms",funcao); |
7262 | }, | 7328 | }, |
7263 | /* | 7329 | /* |
@@ -7332,9 +7398,13 @@ i3GEO.php = { | @@ -7332,9 +7398,13 @@ i3GEO.php = { | ||
7332 | 7398 | ||
7333 | <Mapa->adicionaTema> | 7399 | <Mapa->adicionaTema> |
7334 | */ | 7400 | */ |
7335 | - adtema: function(funcao,temas){ | ||
7336 | - i3GEO.php.verifica(); | ||
7337 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+i3GEO.configura.sid; | 7401 | + adtema: function(funcao,temas,locaplic,sid){ |
7402 | + if(arguments.length == 2){ | ||
7403 | + i3GEO.php.verifica(); | ||
7404 | + var locaplic = i3GEO.configura.locaplic; | ||
7405 | + var sid = i3GEO.configura.sid; | ||
7406 | + } | ||
7407 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+sid; | ||
7338 | cpJSON.call(p,"adtema",funcao); | 7408 | cpJSON.call(p,"adtema",funcao); |
7339 | }, | 7409 | }, |
7340 | /* | 7410 | /* |
@@ -10095,16 +10165,7 @@ i3GEO.calculo = { | @@ -10095,16 +10165,7 @@ i3GEO.calculo = { | ||
10095 | if(arguments.length == 4){ | 10165 | if(arguments.length == 4){ |
10096 | var cellsize = i3GEO.parametros.pixelsize; | 10166 | var cellsize = i3GEO.parametros.pixelsize; |
10097 | } | 10167 | } |
10098 | - /* | ||
10099 | - if(!docmapa) | ||
10100 | - {var docmapa = window.document;} | ||
10101 | - try{ | ||
10102 | - var dc = docmapa.getElementById("img"); | ||
10103 | - if(!dc){var dc = docmapa;} | ||
10104 | - | ||
10105 | - } | ||
10106 | - catch(e){var dc = docmapa;} | ||
10107 | - */ | 10168 | + |
10108 | if(!docmapa) | 10169 | if(!docmapa) |
10109 | {var docmapa = window.document;} | 10170 | {var docmapa = window.document;} |
10110 | var dc = docmapa; | 10171 | var dc = docmapa; |
@@ -20540,7 +20601,7 @@ i3GEO.gadgets = { | @@ -20540,7 +20601,7 @@ i3GEO.gadgets = { | ||
20540 | e.value = parseInt(i3GEO.parametros.mapscale); | 20601 | e.value = parseInt(i3GEO.parametros.mapscale); |
20541 | }; | 20602 | }; |
20542 | if(!$i("i3geo_escalanum")){ | 20603 | if(!$i("i3geo_escalanum")){ |
20543 | - var i = $inputText(id,"145","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale)); | 20604 | + var i = $inputText(id,"155","i3geo_escalanum",$trad("d10"),"19",parseInt(i3GEO.parametros.mapscale)); |
20544 | var ins = "<table><tr><td>1:"+i; | 20605 | var ins = "<table><tr><td>1:"+i; |
20545 | var temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; | 20606 | var temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; |
20546 | temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; | 20607 | temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; |
ferramentas/buscarapida/gadget.htm
@@ -1,54 +0,0 @@ | @@ -1,54 +0,0 @@ | ||
1 | -<html xmlns="http://www.w3.org/1999/xhtml"> | ||
2 | - <head> | ||
3 | - <link rel="stylesheet" type="text/css" href="../../css/ferramentas.css"> | ||
4 | - <link rel="stylesheet" type="text/css" href="../../css/botoes.css"> | ||
5 | - <title></title> | ||
6 | - </head> | ||
7 | - <body class="yui-skin-sam;" style="overflow:auto;"> | ||
8 | -<div style="top:5px;left:1px;display:block;width:90%;" id="resultado" >Aguarde...</div> | ||
9 | - <script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | ||
10 | - <script language="JavaScript" type="text/javascript" src="../funcoes.js"></script> | ||
11 | - <script language="JavaScript" type="text/javascript" src="index.js"></script> | ||
12 | - | ||
13 | -<script type="text/javascript"> | ||
14 | - | ||
15 | - | ||
16 | -var mapaLugar = function(wkt,layer,gid,nm) | ||
17 | -{ | ||
18 | - var re = new RegExp("POLYGON", "g") | ||
19 | - wkt = wkt.replace(re,"") | ||
20 | - wkt = wkt.split("(")[2].split(")")[0] | ||
21 | - wkt = wkt.split(","); | ||
22 | - x = new Array(); | ||
23 | - y = new Array(); | ||
24 | - for (w=0;w<wkt.length; w++) | ||
25 | - { | ||
26 | - temp = wkt[w].split(" "); | ||
27 | - x.push(temp[0]) | ||
28 | - y.push(temp[1]) | ||
29 | - } | ||
30 | - x.sort(sortNumber) | ||
31 | - xMin = x[0] | ||
32 | - xMax = x[(x.length)-1] | ||
33 | - y.sort(sortNumber) | ||
34 | - yMin = y[0] | ||
35 | - yMax = y[(y.length)-1] | ||
36 | - var ext = xMin+" "+yMin+" "+xMax+" "+yMax | ||
37 | - var url = window.parent.i3GEO.configura.locaplic+"/ms_criamapa.php?srs_wms=epsg:4291&image_wms=image/png&versao_wms=1.1.1" | ||
38 | - url += "&url_wms=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; | ||
39 | - url += "&layer_wms="+layer+"&style_wms=default" | ||
40 | - url += "&nome_wms="+nm+" - "+layer | ||
41 | - url += "&mapext="+ext | ||
42 | - url += "&interface=googlemaps.phtml" | ||
43 | - window.open(url) | ||
44 | -} | ||
45 | -i3GEObuscaRapida.funcaoZoom = mapaLugar | ||
46 | -i3GEObuscaRapida.inicia( | ||
47 | - window.parent.document.getElementById("valorBuscaRapida").value, | ||
48 | - window.parent.i3GEO.configura.locaplic | ||
49 | -) | ||
50 | -</script> | ||
51 | - | ||
52 | - | ||
53 | - </body> | ||
54 | -</html> | ||
55 | \ No newline at end of file | 0 | \ No newline at end of file |
ferramentas/buscarapida/gadget.php
1 | <?php | 1 | <?php |
2 | include_once("../../classesphp/pega_variaveis.php"); | 2 | include_once("../../classesphp/pega_variaveis.php"); |
3 | +if(!isset($palavra)) | ||
4 | +{echo "Parâmetro &palavra= não foi definido. 'palavra' é a palavra que será buscada";} | ||
5 | +if(!isset($locaplic)) | ||
6 | +{echo "<br>Parâmetro &locaplic= não foi definido. 'locaplic' indica onde o i3geo está instalado";} | ||
3 | ?> | 7 | ?> |
4 | <html xmlns="http://www.w3.org/1999/xhtml"> | 8 | <html xmlns="http://www.w3.org/1999/xhtml"> |
5 | <head> | 9 | <head> |
@@ -9,8 +13,7 @@ include_once("../../classesphp/pega_variaveis.php"); | @@ -9,8 +13,7 @@ include_once("../../classesphp/pega_variaveis.php"); | ||
9 | </head> | 13 | </head> |
10 | <body class="yui-skin-sam;" style="overflow:auto;"> | 14 | <body class="yui-skin-sam;" style="overflow:auto;"> |
11 | <div style="top:5px;left:1px;display:block;width:90%;" id="resultado" >Aguarde...</div> | 15 | <div style="top:5px;left:1px;display:block;width:90%;" id="resultado" >Aguarde...</div> |
12 | - <script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | ||
13 | - <script language="JavaScript" type="text/javascript" src="../funcoes.js"></script> | 16 | + <script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script> |
14 | <script language="JavaScript" type="text/javascript" src="index.js"></script> | 17 | <script language="JavaScript" type="text/javascript" src="index.js"></script> |
15 | 18 | ||
16 | <script type="text/javascript"> | 19 | <script type="text/javascript"> |
@@ -18,25 +21,7 @@ include_once("../../classesphp/pega_variaveis.php"); | @@ -18,25 +21,7 @@ include_once("../../classesphp/pega_variaveis.php"); | ||
18 | 21 | ||
19 | var mapaLugar = function(wkt,layer,gid,nm) | 22 | var mapaLugar = function(wkt,layer,gid,nm) |
20 | { | 23 | { |
21 | - var re = new RegExp("POLYGON", "g") | ||
22 | - wkt = wkt.replace(re,"") | ||
23 | - wkt = wkt.split("(")[2].split(")")[0] | ||
24 | - wkt = wkt.split(","); | ||
25 | - x = new Array(); | ||
26 | - y = new Array(); | ||
27 | - for (w=0;w<wkt.length; w++) | ||
28 | - { | ||
29 | - temp = wkt[w].split(" "); | ||
30 | - x.push(temp[0]) | ||
31 | - y.push(temp[1]) | ||
32 | - } | ||
33 | - x.sort(sortNumber) | ||
34 | - xMin = x[0] | ||
35 | - xMax = x[(x.length)-1] | ||
36 | - y.sort(sortNumber) | ||
37 | - yMin = y[0] | ||
38 | - yMax = y[(y.length)-1] | ||
39 | - var ext = xMin+" "+yMin+" "+xMax+" "+yMax | 24 | + var ext = i3GEO.util.wkt2ext(wkt,"polygon"); |
40 | var url = "<?php echo $locaplic;?>/ms_criamapa.php?srs_wms=epsg:4291&image_wms=image/png&versao_wms=1.1.1" | 25 | var url = "<?php echo $locaplic;?>/ms_criamapa.php?srs_wms=epsg:4291&image_wms=image/png&versao_wms=1.1.1" |
41 | url += "&url_wms=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; | 26 | url += "&url_wms=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; |
42 | url += "&layer_wms="+layer+"&style_wms=default" | 27 | url += "&layer_wms="+layer+"&style_wms=default" |
@@ -45,7 +30,7 @@ var mapaLugar = function(wkt,layer,gid,nm) | @@ -45,7 +30,7 @@ var mapaLugar = function(wkt,layer,gid,nm) | ||
45 | url += "&interface=googlemaps.phtml" | 30 | url += "&interface=googlemaps.phtml" |
46 | window.open(url) | 31 | window.open(url) |
47 | } | 32 | } |
48 | -i3GEO.buscaRapida.funcaoZoom = mapaLugar | 33 | +i3GEObuscaRapida.funcaozoom = "mapaLugar" |
49 | i3GEObuscaRapida.inicia("<?php echo $palavra;?>","<?php echo $locaplic;?>") | 34 | i3GEObuscaRapida.inicia("<?php echo $palavra;?>","<?php echo $locaplic;?>") |
50 | </script> | 35 | </script> |
51 | 36 |
ferramentas/buscarapida/index.js
1 | /* | 1 | /* |
2 | +Title: Busca rápida | ||
3 | + | ||
4 | +File: i3geo/ferramentas/buscarapida/index.js | ||
5 | + | ||
2 | About: Licença | 6 | About: Licença |
3 | 7 | ||
4 | -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | 8 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet |
5 | 9 | ||
6 | Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | 10 | Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil |
7 | Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | 11 | Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br |
@@ -19,201 +23,292 @@ GNU junto com este programa; se não, escreva para a | @@ -19,201 +23,292 @@ GNU junto com este programa; se não, escreva para a | ||
19 | Free Software Foundation, Inc., no endereço | 23 | Free Software Foundation, Inc., no endereço |
20 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | 24 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
21 | */ | 25 | */ |
22 | -//inicializa | ||
23 | /* | 26 | /* |
24 | -O valor da palavra para busca deve ser devinida em um campo input com id igual a "valorBuscaRapida" | 27 | +Class: i3GEObuscaRapida |
28 | + | ||
29 | +Procura a ocorrência de uma palavra em um serviço de busca, na árvore de temas do i3geo e no serviço do Google. | ||
25 | 30 | ||
26 | -A função que será executada quando o usuário clica no ícone de zoom é definida na variável global "funcaoZoom" | 31 | +O resultado é mostrado como uma listagem, permitindo-se adicionar um novo tema ao mapa conforme o que foi encontrado. |
32 | + | ||
33 | +Essa classe depende da classe i3geo/classesjs/classe_php.php | ||
27 | */ | 34 | */ |
28 | i3GEObuscaRapida = { | 35 | i3GEObuscaRapida = { |
36 | + /* | ||
37 | + Property: servico | ||
38 | + | ||
39 | + Endereço do serviço de busca que será utilizado. Esse serviço deve ser um Web Service no padrão reconhecido pelo i3Geo. | ||
40 | + | ||
41 | + Type: | ||
42 | + {String} | ||
43 | + | ||
44 | + Default: | ||
45 | + {http://mapas.mma.gov.br/webservices/geonames.php} | ||
46 | + */ | ||
29 | servico:"http://mapas.mma.gov.br/webservices/geonames.php", | 47 | servico:"http://mapas.mma.gov.br/webservices/geonames.php", |
30 | - funcaoZoom:"default", | ||
31 | - inicia: function(palavra,locaplic){ | 48 | + /* |
49 | + Property: servicowms | ||
50 | + | ||
51 | + Endereço do serviço de busca que será utilizado para retornar a representação cartográfica do elemento encontrado. | ||
52 | + | ||
53 | + Esse serviço deve ser um Web Service no padrão OGC com o parâmetro adicional "gid" indicando o id do elemento que será mostrado na tela. | ||
54 | + | ||
55 | + Type: | ||
56 | + {String} | ||
57 | + | ||
58 | + Default: | ||
59 | + {http://mapas.mma.gov.br/webservices/geonameswms.php} | ||
60 | + */ | ||
61 | + servicowms:"http://mapas.mma.gov.br/webservices/geonameswms.php", | ||
62 | + /* | ||
63 | + Property: funcaoZoom | ||
64 | + | ||
65 | + Nome da função que será executada ao ser clicado o botão de zoom para o elemento encontrado. | ||
66 | + | ||
67 | + O botão de zoom é mostrado logo após cada elemento encontrado na busca. | ||
68 | + | ||
69 | + Alterando-se essa opção, pode-se executar o busca rápida como um gadget. | ||
70 | + | ||
71 | + Veja i3GEObuscaRapida.zoom para conhecer os parâmetros que essa função irá receber | ||
72 | + | ||
73 | + Type: | ||
74 | + {String} | ||
75 | + | ||
76 | + Default: | ||
77 | + {i3GEObuscaRapida.zoom} | ||
78 | + */ | ||
79 | + funcaozoom: "i3GEObuscaRapida.zoom", | ||
80 | + /* | ||
81 | + Property: idresultado | ||
82 | + | ||
83 | + Id do elemento HTML que receberá o resultado da busca | ||
84 | + | ||
85 | + Type: | ||
86 | + {String} | ||
87 | + | ||
88 | + Default: | ||
89 | + {resultado} | ||
90 | + */ | ||
91 | + idresultado:"resultado", | ||
92 | + /* | ||
93 | + Property: buscatemas | ||
94 | + | ||
95 | + Indica se deve ser feita a busca na árvore de temas | ||
96 | + | ||
97 | + Type: | ||
98 | + {boolean} | ||
99 | + | ||
100 | + Default: | ||
101 | + {true} | ||
102 | + */ | ||
103 | + buscaemtemas: true, | ||
104 | + /* | ||
105 | + Variable: palavra | ||
106 | + | ||
107 | + Palavra que será buscada | ||
108 | + | ||
109 | + Type: | ||
110 | + {String} | ||
111 | + */ | ||
112 | + palavra:"", | ||
113 | + /* | ||
114 | + Variable: locaplic | ||
115 | + | ||
116 | + Endereço do i3geo (url) | ||
117 | + | ||
118 | + Type:{String} | ||
119 | + */ | ||
120 | + locaplic:"", | ||
121 | + /* | ||
122 | + Function: inicia | ||
123 | + | ||
124 | + Inicia a busca de uma palavra e mostra o resultado na tela | ||
125 | + | ||
126 | + Parameters: | ||
127 | + | ||
128 | + palavra {String} - palavra que será procurada | ||
129 | + | ||
130 | + locaplic {String} - url onde o i3geo está instalado, pe, http://localhost/i3geo | ||
131 | + | ||
132 | + resultado {Function} (opcional) - função que será executada para processar o resultado da busca default é i3GEObuscaRapida.montaResultado | ||
133 | + */ | ||
134 | + inicia: function(palavra,locaplic,resultado){ | ||
135 | + if(arguments.length == 2) | ||
136 | + {var resultado = i3GEObuscaRapida.montaResultado;} | ||
32 | aguarde("block") | 137 | aguarde("block") |
33 | $i("resultado").innerHTML = "Aguarde..." | 138 | $i("resultado").innerHTML = "Aguarde..." |
34 | - palavra = removeAcentos(palavra); | ||
35 | - var p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=buscaRapida&palavra="+palavra+"&servico="+i3GEObuscaRapida.servico | ||
36 | - var cp = new cpaint(); | ||
37 | - //cp.set_debug(2) | ||
38 | - cp.set_response_type("json"); | ||
39 | - cp.call(p,"buscaRapida",i3GEObuscaRapida.montaResultado); | 139 | + var palavra = removeAcentos(palavra); |
140 | + i3GEObuscaRapida.palavra = palavra; | ||
141 | + i3GEObuscaRapida.locaplic = locaplic; | ||
142 | + i3GEO.php.buscaRapida(resultado,locaplic,i3GEObuscaRapida.servico,palavra); | ||
143 | + //i3GEObuscaRapida.montaResultado() | ||
40 | }, | 144 | }, |
145 | + /* | ||
146 | + Function: montaResultado | ||
147 | + | ||
148 | + Mostra o resultado da busca. Esta é a função default utilizada pelo método inicia | ||
149 | + | ||
150 | + Após o resultado ser mostrado, é feita a busca na base de temas, executando-se o método buscaemtemas | ||
151 | + | ||
152 | + Parameters: | ||
153 | + | ||
154 | + retorno {JSON} - resultado da função i3GEO.php.buscaRapida | ||
155 | + */ | ||
41 | montaResultado: function(retorno){ | 156 | montaResultado: function(retorno){ |
42 | - var ins = "Nada encontrado"; | ||
43 | - if (retorno.data) | ||
44 | - { | ||
45 | - if (retorno.data.geonames) | ||
46 | - { | ||
47 | - for (i=0;i<retorno.data.geonames.length; i++) | ||
48 | - { | ||
49 | - if (i == 0){var ins = "<table >";} | ||
50 | - ins += "<tr><td style='width:30%;text-align:left;background-color:rgb(220,220,220)' colspan=2 ><b>"+retorno.data.geonames[i].tema+"</b></td></tr>"; | ||
51 | - var layer = retorno.data.geonames[i].layer | ||
52 | - for (j=0;j<retorno.data.geonames[i].lugares.length; j++) | ||
53 | - { | ||
54 | - ins += "<tr><td style='text-align:left'>" | ||
55 | - var nm = retorno.data.geonames[i].lugares[j].nome; | ||
56 | - ins += nm; | ||
57 | - var wkt = retorno.data.geonames[i].lugares[j].limite | ||
58 | - var gid = retorno.data.geonames[i].lugares[j].gid | ||
59 | - ins += "</td><td onclick=\"zoom('"+wkt+"','"+layer+"','"+gid+"','"+nm+"')\" onmouseover=\"mostraxy('"+wkt+"')\" onmouseout='escondexy()' style='color:blue;cursor:pointer'><img title='localizar' src='../../imagens/branco.gif' class='tic' /></td></tr>" | 157 | + var ins = "Nada encontrado em "+i3GEObuscaRapida.servico+"<br>"; |
158 | + try{ | ||
159 | + if(retorno.data){ | ||
160 | + if (retorno.data.geonames){ | ||
161 | + for (i=0;i<retorno.data.geonames.length; i++){ | ||
162 | + if (i == 0){var ins = "<table >";} | ||
163 | + ins += "<tr><td style='width:30%;text-align:left;background-color:rgb(220,220,220)' colspan=2 ><b>"+retorno.data.geonames[i].tema+"</b></td></tr>"; | ||
164 | + var layer = retorno.data.geonames[i].layer | ||
165 | + for (j=0;j<retorno.data.geonames[i].lugares.length; j++){ | ||
166 | + ins += "<tr><td style='text-align:left'>" | ||
167 | + var nm = retorno.data.geonames[i].lugares[j].nome; | ||
168 | + ins += nm; | ||
169 | + var wkt = retorno.data.geonames[i].lugares[j].limite | ||
170 | + var gid = retorno.data.geonames[i].lugares[j].gid | ||
171 | + ins += "</td><td onclick=\""+i3GEObuscaRapida.funcaozoom+"('"+wkt+"','"+layer+"','"+gid+"','"+nm+"')\" onmouseover=\"i3GEObuscaRapida.mostraxy('"+wkt+"')\" onmouseout='i3GEObuscaRapida.escondexy()' style='color:blue;cursor:pointer'><img title='localizar' src='../../imagens/branco.gif' class='tic' /></td></tr>" | ||
172 | + } | ||
60 | } | 173 | } |
61 | } | 174 | } |
175 | + ins += "</table>" | ||
62 | } | 176 | } |
63 | - ins += "</table>" | ||
64 | } | 177 | } |
65 | - $i("resultado").innerHTML = ins | 178 | + catch(e){var ins = "Erro ao acessar o serviço "+i3GEObuscaRapida.servico+"<br>";} |
179 | + $i(i3GEObuscaRapida.idresultado).innerHTML = ins | ||
66 | aguarde("none") | 180 | aguarde("none") |
67 | - //var palavra = window.parent.document.getElementById("valorBuscaRapida").value | ||
68 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&procurar="+palavra+"&g_sid="+g_sid; | ||
69 | - var cp = new cpaint(); | ||
70 | - //cp.set_debug(2); | ||
71 | - cp.set_response_type("json"); | ||
72 | - cp.call(p,"procurartemas",resultadoTemas); | ||
73 | - } | ||
74 | -} | ||
75 | -function resultadoTemas(retorno) | ||
76 | -{ | ||
77 | - var retorno = retorno.data; | ||
78 | - if ((retorno != "erro") && (retorno != undefined)) | ||
79 | - { | ||
80 | - var ins = ""; | ||
81 | - for (ig=0;ig<retorno.length;ig++) | ||
82 | - { | ||
83 | - var ngSgrupo = retorno[ig].subgrupos; | ||
84 | - for (sg=0;sg<ngSgrupo.length;sg++) | ||
85 | - { | ||
86 | - var nomeSgrupo = ngSgrupo[sg].subgrupo; | ||
87 | - var ngTema = ngSgrupo[sg].temas; | ||
88 | - for (st=0;st<ngTema.length;st++) | ||
89 | - { | ||
90 | - if (ngTema[st].link != " ") | ||
91 | - {var lk = "<a href="+ngTema[st].link+" target=blank> fonte</a>";} | ||
92 | - var tid = ngTema[st].tid; | ||
93 | - var inp = "<input style='text-align:left;cursor:pointer;' onclick='adicionatema(this)' class=inputsb style='cursor:pointer' type=\"checkbox\" value='"+tid+"' /> ("+nomeSgrupo+")"; | ||
94 | - var nomeTema = inp+(ngTema[st].nome)+lk+"<br>"; | ||
95 | - ins += nomeTema; | 181 | + if(i3GEObuscaRapida.buscaemtemas){ |
182 | + i3GEO.php.procurartemas(i3GEObuscaRapida.resultadoTemas,i3GEObuscaRapida.palavra,i3GEObuscaRapida.locaplic); | ||
183 | + } | ||
184 | + }, | ||
185 | + /* | ||
186 | + Function: resultadoTemas | ||
187 | + | ||
188 | + Acrescenta nos resultados encontrados os dados localizados na base de temas do i3geo | ||
189 | + | ||
190 | + Essa função é cahamda pelo método montaResultado | ||
191 | + | ||
192 | + Parameters: | ||
193 | + | ||
194 | + retorno {Json} - resultado de | ||
195 | + */ | ||
196 | + resultadoTemas: function(retorno){ | ||
197 | + var retorno = retorno.data; | ||
198 | + if ((retorno != "erro") && (retorno != undefined)){ | ||
199 | + var ins = ""; | ||
200 | + for (ig=0;ig<retorno.length;ig++){ | ||
201 | + var ngSgrupo = retorno[ig].subgrupos; | ||
202 | + for (sg=0;sg<ngSgrupo.length;sg++){ | ||
203 | + var nomeSgrupo = ngSgrupo[sg].subgrupo; | ||
204 | + var ngTema = ngSgrupo[sg].temas; | ||
205 | + for (st=0;st<ngTema.length;st++){ | ||
206 | + if (ngTema[st].link != " ") | ||
207 | + {var lk = "<a href="+ngTema[st].link+" target=blank> fonte</a>";} | ||
208 | + var tid = ngTema[st].tid; | ||
209 | + var inp = "<input style='text-align:left;cursor:pointer;' onclick='i3GEObuscaRapida.adicionatema(this)' class=inputsb style='cursor:pointer' type=\"checkbox\" value='"+tid+"' /> ("+nomeSgrupo+")"; | ||
210 | + var nomeTema = inp+(ngTema[st].nome)+lk+"<br>"; | ||
211 | + ins += nomeTema; | ||
212 | + } | ||
96 | } | 213 | } |
97 | } | 214 | } |
215 | + if (ins != ""){ $i(i3GEObuscaRapida.idresultado).innerHTML += "<br><b>Temas:</b><br>"+ins} | ||
98 | } | 216 | } |
99 | - if (ins != "") | 217 | + }, |
218 | + /* | ||
219 | + Function: zoom | ||
220 | + | ||
221 | + Aplica a operação de zoom quando o usuário clica no botão de adição de um resultado ao mapa. | ||
222 | + | ||
223 | + Essa é a função default utilizada pela ferramenta, podendo ser substituída por outra se desejado. | ||
224 | + | ||
225 | + Além de enquadrar o mapa à uma extensão geográfica específica, uma nova camada é adicionada ao mapa, mostrando o limite da ocorrência desejada. | ||
226 | + | ||
227 | + Parameters: | ||
228 | + | ||
229 | + wkt {String} - string no formato wkt que será usado para definir a abrangência do zoom | ||
230 | + | ||
231 | + layer {String} - nome do layer existente no serviço definido em i3GEObuscaRapida.servicowms e que será adicionado ao mapa como uma camada WMS | ||
232 | + | ||
233 | + gid {String} - identificador que será utilizado no WMS para selecionar o elemento desejado | ||
234 | + | ||
235 | + nm {String} - nome que será dado à acamada que será adicionada ao mapa | ||
236 | + */ | ||
237 | + zoom: function(wkt,layer,gid,nm){ | ||
238 | + var adicionaCamada = function(layer,gid,nm){ | ||
239 | + var s = i3GEObuscaRapida.servicowms+"?gid="+gid+"&"; | ||
240 | + i3GEO.php.adicionaTemaWMS(window.parent.i3GEO.atualiza,s,layer,"default","EPSG:4291","image/png","1.1.0",nm+" - "+layer,"","nao","",i3GEObuscaRapida.locaplic,window.parent.i3GEO.configura.sid); | ||
241 | + }; | ||
242 | + var ext = i3GEO.util.wkt2ext(wkt,"polygon"); | ||
243 | + if(ext == false){alert("wkt invalido");return;} | ||
244 | + try{window.parent.objaguarde.abre("i3GEO.atualiza","Aguarde...");}catch(e){} | ||
245 | + i3GEO.php.mudaext(adicionaCamada(layer,gid,nm),window.parent.i3GEO.configura.tipoimagem,ext,i3GEObuscaRapida.locaplic,window.parent.i3GEO.configura.sid); | ||
246 | + }, | ||
247 | + /* | ||
248 | + Function: adicionatema | ||
249 | + | ||
250 | + Adiciona um tema ao mapa quando a busca localiza uma ocorrência nos menus de camadas | ||
251 | + | ||
252 | + Nesse caso, o tema é adicionado ao mapa | ||
253 | + | ||
254 | + Parameters: | ||
255 | + | ||
256 | + obj {Object dom} - objeto DOM do tipo INPUT tendo como valor o código do tema | ||
257 | + */ | ||
258 | + adicionatema:function(obj){ | ||
259 | + if (obj.checked) | ||
100 | { | 260 | { |
101 | - $i("resultado").innerHTML += "<br><b>Temas:</b><br>"+ins | 261 | + window.parent.objaguarde.abre("i3GEO.atualiza","Aguarde..."); |
262 | + var temp = function() | ||
263 | + {window.parent.i3GEO.atualiza("");} | ||
264 | + i3GEO.php.adtema(temp,obj.value,i3GEObuscaRapida.locaplic,window.parent.i3GEO.configura.sid); | ||
102 | } | 265 | } |
103 | - } | ||
104 | -} | ||
105 | -function adicionatema(obj) | ||
106 | -{ | ||
107 | - if (obj.checked) | ||
108 | - { | ||
109 | - window.parent.objaguarde.abre("i3GEO.atualiza","Aguarde..."); | ||
110 | - var temp = function() | ||
111 | - {window.parent.i3GEO.atualiza("");} | ||
112 | - var p = window.parent.g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+obj.value+"&g_sid="+g_sid; | ||
113 | - var cp = new cpaint(); | ||
114 | - //cp.set_debug(2) | ||
115 | - cp.set_response_type("JSON"); | ||
116 | - cp.call(p,"adicionaTema",temp); | ||
117 | - } | ||
118 | -} | ||
119 | -function mostraxy(wkt) | ||
120 | -{ | ||
121 | - try{ | ||
122 | - if(!window.parent.i3GEO){return;} | ||
123 | - if(!window.parent.i3GEO.calculo){return;} | ||
124 | - } | ||
125 | - catch(e){return;} | ||
126 | - var re = new RegExp("POLYGON", "g") | ||
127 | - wkt = wkt.replace(re,"") | ||
128 | - wkt = wkt.split("(")[2].split(")")[0] | ||
129 | - wkt = wkt.split(","); | ||
130 | - x = new Array(); | ||
131 | - y = new Array(); | ||
132 | - for (w=0;w<wkt.length; w++) | ||
133 | - { | ||
134 | - temp = wkt[w].split(" "); | ||
135 | - x.push(temp[0]) | ||
136 | - y.push(temp[1]) | ||
137 | - } | ||
138 | - x.sort(sortNumber) | ||
139 | - xMin = x[0] | ||
140 | - xMax = x[(x.length)-1] | ||
141 | - y.sort(sortNumber) | ||
142 | - yMin = y[0] | ||
143 | - yMax = y[(y.length)-1] | ||
144 | - var xyMin = window.parent.i3GEO.calculo.dd2tela(xMin,yMin,window.parent.document,window.parent.i3GEO.parametros.mapexten,window.parent.i3GEO.parametros.pixelsize) | ||
145 | - var xyMax = window.parent.i3GEO.calculo.dd2tela(xMax,yMax,window.parent.document,window.parent.i3GEO.parametros.mapexten,window.parent.i3GEO.parametros.pixelsize) | ||
146 | - window.parent.i3GEO.util.criaBox("boxg") | ||
147 | - var box = window.parent.$i("boxg") | ||
148 | - var w = xyMax[0]-xyMin[0] | ||
149 | - var h = xyMin[1]-xyMax[1] | ||
150 | - box.style.display = "block" | ||
151 | - box.style.width = w | ||
152 | - box.style.height = h | ||
153 | - box.style.top = xyMax[1]+"px" | ||
154 | - box.style.left = xyMin[0]+"px" | ||
155 | -} | ||
156 | -function zoom(wkt,layer,gid,nm) | ||
157 | -{ | ||
158 | - if(funcaoZoom != "default"){ | ||
159 | - funcaoZoom.call(this,wkt,layer,gid,nm); | ||
160 | - return; | ||
161 | - } | ||
162 | - var adicionaCamada = function(layer,gid,nm) | ||
163 | - { | ||
164 | - var s = "&tema="+layer | ||
165 | - s += "&servico=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; | ||
166 | - s += "&nome=default" | ||
167 | - s += "&proj=EPSG:4291&formato=image/png&nomecamada="+nm+" - "+layer | ||
168 | - s += "&suportasld=nao&versao=1.1.0" | ||
169 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adicionatemawms&g_sid="+g_sid+s; | ||
170 | - var cp = new cpaint(); | ||
171 | - //cp.set_debug(2) | ||
172 | - cp.set_response_type("JSON"); | ||
173 | - cp.call(p,"mudaExtensao",window.parent.i3GEO.atualiza); | ||
174 | - } | ||
175 | - var re = new RegExp("POLYGON", "g") | ||
176 | - wkt = wkt.replace(re,"") | ||
177 | - wkt = wkt.split("(")[2].split(")")[0] | ||
178 | - wkt = wkt.split(","); | ||
179 | - x = new Array(); | ||
180 | - y = new Array(); | ||
181 | - for (w=0;w<wkt.length; w++) | ||
182 | - { | ||
183 | - temp = wkt[w].split(" "); | ||
184 | - x.push(temp[0]) | ||
185 | - y.push(temp[1]) | ||
186 | - } | ||
187 | - x.sort(sortNumber) | ||
188 | - xMin = x[0] | ||
189 | - xMax = x[(x.length)-1] | ||
190 | - y.sort(sortNumber) | ||
191 | - yMin = y[0] | ||
192 | - yMax = y[(y.length)-1] | ||
193 | - var ext = xMin+" "+yMin+" "+xMax+" "+yMax | ||
194 | - window.parent.objaguarde.abre("i3GEO.atualiza","Aguarde..."); | ||
195 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+ext+"&g_sid="+g_sid; | ||
196 | - var cp = new cpaint(); | ||
197 | - //cp.set_debug(2) | ||
198 | - cp.set_response_type("JSON"); | ||
199 | - cp.call(p,"mudaExtensao",adicionaCamada(layer,gid,nm)); | ||
200 | - | ||
201 | -} | ||
202 | -function sortNumber(a,b) | ||
203 | -{ | ||
204 | - return a - b | ||
205 | -} | ||
206 | -function escondexy() | ||
207 | -{ | ||
208 | - try{ | ||
209 | - if(!window.parent.$i){return;} | ||
210 | - } | ||
211 | - catch(e){return;} | ||
212 | - if (window.parent.$i("boxg")) | ||
213 | - { | ||
214 | - var box = window.parent.$i("boxg") | ||
215 | - box.style.display = "none" | ||
216 | - box.style.top = "0px" | ||
217 | - box.style.left = "0px" | 266 | + else |
267 | + {alert("Escolha um tema");} | ||
268 | + }, | ||
269 | + /* | ||
270 | + Function: mostraxy | ||
271 | + | ||
272 | + Mostra no mapa um retângulo representando a extensão geográfica de uma ocorrência encontrada na busca | ||
273 | + | ||
274 | + Parameters: | ||
275 | + | ||
276 | + wkt {String} - coordenadas em wkt do tipo polígono representando a extensão geográfica do elemento | ||
277 | + */ | ||
278 | + mostraxy:function mostraxy(wkt){ | ||
279 | + try{ | ||
280 | + if(!window.parent){return;} | ||
281 | + if(!window.parent.i3GEO){return;} | ||
282 | + if(!window.parent.i3GEO.calculo){return;} | ||
283 | + } | ||
284 | + catch(e){return;} | ||
285 | + var ext = i3GEO.util.wkt2ext(wkt,"polygon"); | ||
286 | + if(ext == false){alert("wkt invalido");return;} | ||
287 | + var ext = ext.split(" "); | ||
288 | + var xMin = ext[0]; | ||
289 | + var xMax = ext[2]; | ||
290 | + var yMin = ext[1]; | ||
291 | + var yMax = ext[3]; | ||
292 | + | ||
293 | + var xyMin = window.parent.i3GEO.calculo.dd2tela(xMin,yMin,window.parent.document.getElementById("img"),window.parent.i3GEO.parametros.mapexten,window.parent.i3GEO.parametros.pixelsize) | ||
294 | + var xyMax = window.parent.i3GEO.calculo.dd2tela(xMax,yMax,window.parent.document.getElementById("img"),window.parent.i3GEO.parametros.mapexten,window.parent.i3GEO.parametros.pixelsize) | ||
295 | + | ||
296 | + window.parent.i3GEO.util.criaBox("boxg"); | ||
297 | + var box = window.parent.$i("boxg"); | ||
298 | + var w = xyMax[0]-xyMin[0]; | ||
299 | + var h = xyMin[1]-xyMax[1]; | ||
300 | + box.style.display = "block"; | ||
301 | + box.style.width = w; | ||
302 | + box.style.height = h; | ||
303 | + box.style.top = xyMax[1]+"px"; | ||
304 | + box.style.left = xyMin[0]+"px"; | ||
305 | + }, | ||
306 | + /* | ||
307 | + Function: escondexy | ||
308 | + | ||
309 | + Esconde o box criado com mostraxy | ||
310 | + */ | ||
311 | + escondexy: function(){ | ||
312 | + window.parent.i3GEO.util.escondeBox() | ||
218 | } | 313 | } |
219 | } | 314 | } |
220 | \ No newline at end of file | 315 | \ No newline at end of file |
ferramentas/i3geo_tudo_compacto.js
@@ -6978,7 +6978,7 @@ i3GEO.php = { | @@ -6978,7 +6978,7 @@ i3GEO.php = { | ||
6978 | /* | 6978 | /* |
6979 | Function: desativacgi | 6979 | Function: desativacgi |
6980 | 6980 | ||
6981 | - <desativacgi> | 6981 | + <desativacgi> |
6982 | */ | 6982 | */ |
6983 | desativacgi: function(funcao){ | 6983 | desativacgi: function(funcao){ |
6984 | i3GEO.php.verifica(); | 6984 | i3GEO.php.verifica(); |
@@ -6991,7 +6991,7 @@ i3GEO.php = { | @@ -6991,7 +6991,7 @@ i3GEO.php = { | ||
6991 | PHP: | 6991 | PHP: |
6992 | classesphp/classe_menutemas.php | 6992 | classesphp/classe_menutemas.php |
6993 | 6993 | ||
6994 | - <Menutemas->pegaListaDeMapas> | 6994 | + <Menutemas->pegaListaDeMapas> |
6995 | */ | 6995 | */ |
6996 | pegaMapas: function(funcao){ | 6996 | pegaMapas: function(funcao){ |
6997 | i3GEO.php.verifica(); | 6997 | i3GEO.php.verifica(); |
@@ -7004,7 +7004,7 @@ i3GEO.php = { | @@ -7004,7 +7004,7 @@ i3GEO.php = { | ||
7004 | PHP: | 7004 | PHP: |
7005 | classesphp/classe_mapa.php | 7005 | classesphp/classe_mapa.php |
7006 | 7006 | ||
7007 | - <Mapa->mudaQS> | 7007 | + <Mapa->mudaQS> |
7008 | */ | 7008 | */ |
7009 | mudatamanho: function(funcao,altura,largura){ | 7009 | mudatamanho: function(funcao,altura,largura){ |
7010 | i3GEO.php.verifica(); | 7010 | i3GEO.php.verifica(); |
@@ -7017,7 +7017,7 @@ i3GEO.php = { | @@ -7017,7 +7017,7 @@ i3GEO.php = { | ||
7017 | PHP: | 7017 | PHP: |
7018 | classesphp/classe_mapa.php | 7018 | classesphp/classe_mapa.php |
7019 | 7019 | ||
7020 | - <Mapa->ativalogo> | 7020 | + <Mapa->ativalogo> |
7021 | */ | 7021 | */ |
7022 | ativalogo: function(funcao,altura,largura){ | 7022 | ativalogo: function(funcao,altura,largura){ |
7023 | i3GEO.php.verifica(); | 7023 | i3GEO.php.verifica(); |
@@ -7030,7 +7030,7 @@ i3GEO.php = { | @@ -7030,7 +7030,7 @@ i3GEO.php = { | ||
7030 | PHP: | 7030 | PHP: |
7031 | classesphp/classe_temas.php | 7031 | classesphp/classe_temas.php |
7032 | 7032 | ||
7033 | - <Temas->insereFeature> | 7033 | + <Temas->insereFeature> |
7034 | */ | 7034 | */ |
7035 | insereAnnotation: function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){ | 7035 | insereAnnotation: function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){ |
7036 | i3GEO.php.verifica(); | 7036 | i3GEO.php.verifica(); |
@@ -7043,7 +7043,7 @@ i3GEO.php = { | @@ -7043,7 +7043,7 @@ i3GEO.php = { | ||
7043 | PHP: | 7043 | PHP: |
7044 | classesphp/classe_atributos.php | 7044 | classesphp/classe_atributos.php |
7045 | 7045 | ||
7046 | - <Atributos->identificaQBP> | 7046 | + <Atributos->identificaQBP> |
7047 | */ | 7047 | */ |
7048 | identificaunico: function(funcao,xy,tema,item){ | 7048 | identificaunico: function(funcao,xy,tema,item){ |
7049 | i3GEO.php.verifica(); | 7049 | i3GEO.php.verifica(); |
@@ -7056,7 +7056,7 @@ i3GEO.php = { | @@ -7056,7 +7056,7 @@ i3GEO.php = { | ||
7056 | PHP: | 7056 | PHP: |
7057 | classesphp/mapa_controle.php | 7057 | classesphp/mapa_controle.php |
7058 | 7058 | ||
7059 | - <recuperamapa> | 7059 | + <recuperamapa> |
7060 | */ | 7060 | */ |
7061 | recuperamapa: function(funcao){ | 7061 | recuperamapa: function(funcao){ |
7062 | i3GEO.php.verifica(); | 7062 | i3GEO.php.verifica(); |
@@ -7069,7 +7069,7 @@ i3GEO.php = { | @@ -7069,7 +7069,7 @@ i3GEO.php = { | ||
7069 | PHP: | 7069 | PHP: |
7070 | classesphp/classe_legenda.php | 7070 | classesphp/classe_legenda.php |
7071 | 7071 | ||
7072 | - <Atributos->legendaGrafica> | 7072 | + <Atributos->legendaGrafica> |
7073 | */ | 7073 | */ |
7074 | criaLegendaImagem: function(funcao){ | 7074 | criaLegendaImagem: function(funcao){ |
7075 | i3GEO.php.verifica(); | 7075 | i3GEO.php.verifica(); |
@@ -7082,7 +7082,7 @@ i3GEO.php = { | @@ -7082,7 +7082,7 @@ i3GEO.php = { | ||
7082 | PHP: | 7082 | PHP: |
7083 | classesphp/funcoes_gerais.php | 7083 | classesphp/funcoes_gerais.php |
7084 | 7084 | ||
7085 | - <retornaReferenciaDinamica> | 7085 | + <retornaReferenciaDinamica> |
7086 | */ | 7086 | */ |
7087 | referenciadinamica: function(funcao,zoom,tipo){ | 7087 | referenciadinamica: function(funcao,zoom,tipo){ |
7088 | i3GEO.php.verifica(); | 7088 | i3GEO.php.verifica(); |
@@ -7110,7 +7110,7 @@ i3GEO.php = { | @@ -7110,7 +7110,7 @@ i3GEO.php = { | ||
7110 | PHP: | 7110 | PHP: |
7111 | classesphp/classe_navegacao.php | 7111 | classesphp/classe_navegacao.php |
7112 | 7112 | ||
7113 | - <Navegacao->pan> | 7113 | + <Navegacao->pan> |
7114 | */ | 7114 | */ |
7115 | pan: function(funcao,escala,tipo,x,y){ | 7115 | pan: function(funcao,escala,tipo,x,y){ |
7116 | i3GEO.php.verifica(); | 7116 | i3GEO.php.verifica(); |
@@ -7175,10 +7175,13 @@ i3GEO.php = { | @@ -7175,10 +7175,13 @@ i3GEO.php = { | ||
7175 | 7175 | ||
7176 | <Navegacao->mudaExtensao> | 7176 | <Navegacao->mudaExtensao> |
7177 | */ | 7177 | */ |
7178 | - mudaext: function(funcao,tipoimagem,ext){ | ||
7179 | - i3GEO.php.verifica(); | 7178 | + mudaext: function(funcao,tipoimagem,ext,locaplic,sid){ |
7179 | + if(arguments.length == 3){ | ||
7180 | + var locaplic = i3GEO.configura.locaplic; | ||
7181 | + var sid = i3GEO.configura.sid; | ||
7182 | + } | ||
7180 | if(ext == 'undefined'){alert("extensao nao definida");return;} | 7183 | if(ext == 'undefined'){alert("extensao nao definida");return;} |
7181 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+i3GEO.configura.sid; | 7184 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid; |
7182 | cpJSON.call(p,"mudaext",funcao); | 7185 | cpJSON.call(p,"mudaext",funcao); |
7183 | }, | 7186 | }, |
7184 | /* | 7187 | /* |
@@ -7265,7 +7268,7 @@ i3GEO.php = { | @@ -7265,7 +7268,7 @@ i3GEO.php = { | ||
7265 | PHP: | 7268 | PHP: |
7266 | classesphp/classe_temas.php | 7269 | classesphp/classe_temas.php |
7267 | 7270 | ||
7268 | - <Temas->desceTema> | 7271 | + <Temas->desceTema> |
7269 | */ | 7272 | */ |
7270 | descetema: function(funcao,tema){ | 7273 | descetema: function(funcao,tema){ |
7271 | i3GEO.php.verifica(); | 7274 | i3GEO.php.verifica(); |
@@ -7358,9 +7361,12 @@ i3GEO.php = { | @@ -7358,9 +7361,12 @@ i3GEO.php = { | ||
7358 | 7361 | ||
7359 | <Mapa->adicionatemawms> | 7362 | <Mapa->adicionatemawms> |
7360 | */ | 7363 | */ |
7361 | - adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo){ | ||
7362 | - i3GEO.php.verifica(); | ||
7363 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | 7364 | + adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo,locaplic,sid){ |
7365 | + if(arguments.length == 11){ | ||
7366 | + var locaplic = i3GEO.configura.locaplic; | ||
7367 | + var sid = i3GEO.configura.sid; | ||
7368 | + } | ||
7369 | + var p = locaplic+"/classesphp/mapa_controle.php?g_sid="+sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | ||
7364 | cpJSON.call(p,"adicionatemawms",funcao); | 7370 | cpJSON.call(p,"adicionatemawms",funcao); |
7365 | }, | 7371 | }, |
7366 | /* | 7372 | /* |
@@ -7421,9 +7427,10 @@ i3GEO.php = { | @@ -7421,9 +7427,10 @@ i3GEO.php = { | ||
7421 | 7427 | ||
7422 | <Menutemas->procurartemas> | 7428 | <Menutemas->procurartemas> |
7423 | */ | 7429 | */ |
7424 | - procurartemas: function(funcao,procurar){ | ||
7425 | - i3GEO.php.verifica(); | ||
7426 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&procurar="+procurar+"&g_sid="+i3GEO.configura.sid; | 7430 | + procurartemas: function(funcao,procurar,locaplic){ |
7431 | + if(arguments.length == 2) | ||
7432 | + {var locaplic = i3GEO.configura.locaplic;} | ||
7433 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&map_file=&procurar="+procurar; | ||
7427 | cpJSON.call(p,"procurartemas",funcao); | 7434 | cpJSON.call(p,"procurartemas",funcao); |
7428 | }, | 7435 | }, |
7429 | /* | 7436 | /* |
@@ -7434,9 +7441,13 @@ i3GEO.php = { | @@ -7434,9 +7441,13 @@ i3GEO.php = { | ||
7434 | 7441 | ||
7435 | <Mapa->adicionaTema> | 7442 | <Mapa->adicionaTema> |
7436 | */ | 7443 | */ |
7437 | - adtema: function(funcao,temas){ | ||
7438 | - i3GEO.php.verifica(); | ||
7439 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+i3GEO.configura.sid; | 7444 | + adtema: function(funcao,temas,locaplic,sid){ |
7445 | + if(arguments.length == 2){ | ||
7446 | + i3GEO.php.verifica(); | ||
7447 | + var locaplic = i3GEO.configura.locaplic; | ||
7448 | + var sid = i3GEO.configura.sid; | ||
7449 | + } | ||
7450 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+sid; | ||
7440 | cpJSON.call(p,"adtema",funcao); | 7451 | cpJSON.call(p,"adtema",funcao); |
7441 | }, | 7452 | }, |
7442 | /* | 7453 | /* |
@@ -7552,6 +7563,1022 @@ i3GEO.php = { | @@ -7552,6 +7563,1022 @@ i3GEO.php = { | ||
7552 | listaLayersWMS: function(funcao,servico,nivel,id_ws,nomelayer){ | 7563 | listaLayersWMS: function(funcao,servico,nivel,id_ws,nomelayer){ |
7553 | var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer; | 7564 | var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer; |
7554 | cpJSON.call(p,"listaLayersWMS",funcao); | 7565 | cpJSON.call(p,"listaLayersWMS",funcao); |
7566 | + }, | ||
7567 | + /* | ||
7568 | + Function: buscaRapida | ||
7569 | + | ||
7570 | + PHP: | ||
7571 | + classesphp/funcoes_gerais.php | ||
7572 | + | ||
7573 | + <buscaRapida> | ||
7574 | + */ | ||
7575 | + buscaRapida: function(funcao,locaplic,servico,palavra){ | ||
7576 | + var p = locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=buscaRapida&palavra="+palavra+"&servico="+servico | ||
7577 | + cpJSON.call(p,"buscaRapida",funcao); | ||
7555 | } | 7578 | } |
7556 | }; | 7579 | }; |
7557 | //YAHOO.log("carregou classe php", "Classes i3geo"); | 7580 | //YAHOO.log("carregou classe php", "Classes i3geo"); |
7581 | +/* | ||
7582 | +Title: Utilitários | ||
7583 | + | ||
7584 | +File: i3geo/classesjs/classe_util.js | ||
7585 | + | ||
7586 | +About: Licença | ||
7587 | + | ||
7588 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
7589 | + | ||
7590 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
7591 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
7592 | + | ||
7593 | +Este programa é software livre; você pode redistribuí-lo | ||
7594 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
7595 | +GNU conforme publicada pela Free Software Foundation; | ||
7596 | +tanto a versão 2 da Licença. | ||
7597 | +Este programa é distribuído na expectativa de que seja útil, | ||
7598 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
7599 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
7600 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
7601 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
7602 | +GNU junto com este programa; se não, escreva para a | ||
7603 | +Free Software Foundation, Inc., no endereço | ||
7604 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
7605 | +*/ | ||
7606 | +if(typeof(i3GEO) == 'undefined'){ | ||
7607 | + i3GEO = new Array(); | ||
7608 | +} | ||
7609 | +/* | ||
7610 | +Variable: navm | ||
7611 | + | ||
7612 | +Verdadeiro (true) se o navegador for o Internet Explorer | ||
7613 | +*/ | ||
7614 | +navm = false; | ||
7615 | +/* | ||
7616 | +Variable: navn | ||
7617 | + | ||
7618 | +Verdadeiro (true) se o navegador for o Firefox | ||
7619 | +*/ | ||
7620 | +navn = false; | ||
7621 | +//seta as variáveis navn e navm | ||
7622 | +var app = navigator.appName.substring(0,1); | ||
7623 | +if (app=='N') navn=true; else navm=true; | ||
7624 | +/* | ||
7625 | +Variable: g_operacao | ||
7626 | + | ||
7627 | +Nome da última operação que foi executada. | ||
7628 | + | ||
7629 | +Dependendo do tipo de operação são aplicadas as atualizações necessárias aos componentes do mapa. Por exemplo, redesenha o corpo do mapa, atualiza a lista de temas, etc. | ||
7630 | + | ||
7631 | +Essas operações são controladas pela função ajaxiniciaparametros. | ||
7632 | +*/ | ||
7633 | +g_operacao = ""; | ||
7634 | +/* | ||
7635 | +Variable: g_tipoacao | ||
7636 | + | ||
7637 | +Tipo de ação que está sendo executada. | ||
7638 | +Quando o usuário clica no mapa, essa variável é pesquisada para definir o tipo de operação que deve ser executada. | ||
7639 | +É definida quando o usuário seleciona uma determinada ferramenta do i3Geo. | ||
7640 | +*/ | ||
7641 | +g_tipoacao = "zoomli"; | ||
7642 | +g_postpx = "px"; | ||
7643 | +g_tipotop = "top"; | ||
7644 | +g_tipoleft = "left"; | ||
7645 | +if (navm) | ||
7646 | +{ | ||
7647 | + g_postpx = ""; //utilizado para crossbrowser | ||
7648 | + g_tipotop = "pixelTop"; //utilizado para crossbrowser | ||
7649 | + g_tipoleft = "pixelLeft"; //utilizado para crossbrowser | ||
7650 | +} | ||
7651 | + | ||
7652 | +/* | ||
7653 | +Function: $i | ||
7654 | + | ||
7655 | +Obtém um elemento DOM a partir de seu id | ||
7656 | + | ||
7657 | +Parameters: | ||
7658 | + | ||
7659 | +id - {String} ID do elemento. | ||
7660 | + | ||
7661 | +Returns: | ||
7662 | + | ||
7663 | +{Object} Objeto. | ||
7664 | +*/ | ||
7665 | +$i = function(id) | ||
7666 | +{return document.getElementById(id);}; | ||
7667 | +/* | ||
7668 | +Function: Array.remove() | ||
7669 | + | ||
7670 | +Extende os métodos de um objeto Array, permitindo remover um elemento. | ||
7671 | + | ||
7672 | +*/ | ||
7673 | +Array.prototype.remove=function(s){ | ||
7674 | + try{ | ||
7675 | + var i = this.indexOf(s); | ||
7676 | + if(i != -1) this.splice(i, 1); | ||
7677 | + }catch(e){} | ||
7678 | +}; | ||
7679 | + | ||
7680 | +/* | ||
7681 | +Class: i3GEO.util | ||
7682 | + | ||
7683 | +Utilitários. | ||
7684 | +*/ | ||
7685 | +i3GEO.util = { | ||
7686 | + /* | ||
7687 | + Variable: PINS | ||
7688 | + Elementos IMG criados na função criaPin | ||
7689 | + | ||
7690 | + Type: | ||
7691 | + {Array} | ||
7692 | + */ | ||
7693 | + PINS: new Array(), | ||
7694 | + /* | ||
7695 | + Variable: BOXES | ||
7696 | + Elementos DIV criados na função criaBox | ||
7697 | + | ||
7698 | + Type: | ||
7699 | + {Array} | ||
7700 | + */ | ||
7701 | + BOXES: new Array(), | ||
7702 | + /* | ||
7703 | + Function: escapeURL | ||
7704 | + | ||
7705 | + Converte uma string em uma url válida | ||
7706 | + | ||
7707 | + Parameters: | ||
7708 | + | ||
7709 | + sUrl {String} - url que será convertida | ||
7710 | + | ||
7711 | + Return: | ||
7712 | + | ||
7713 | + Type: | ||
7714 | + {String} | ||
7715 | + */ | ||
7716 | + escapeURL: function(sUrl){ | ||
7717 | + var sUrl = escape(sUrl); | ||
7718 | + var re = new RegExp("%3F", "g"); | ||
7719 | + var sUrl = sUrl.replace(re,'?'); | ||
7720 | + var re = new RegExp("%3D", "g"); | ||
7721 | + var sUrl = sUrl.replace(re,'='); | ||
7722 | + var re = new RegExp("%26", "g"); | ||
7723 | + var sUrl = sUrl.replace(re,'&'); | ||
7724 | + return sUrl; | ||
7725 | + }, | ||
7726 | + /* | ||
7727 | + Function: insereCookie | ||
7728 | + Cria um novo cookie. | ||
7729 | + | ||
7730 | + Parameters: | ||
7731 | + nome - {String} Nome do cookie. | ||
7732 | + | ||
7733 | + valor - (String) Valor do cookie | ||
7734 | + */ | ||
7735 | + insereCookie: function(nome,valor) { | ||
7736 | + document.cookie = nome+"="+valor+";path=/"; | ||
7737 | + }, | ||
7738 | + /* | ||
7739 | + Function: pegaCookie | ||
7740 | + Pega o valor de um cookie. | ||
7741 | + | ||
7742 | + Parameters: | ||
7743 | + nome - {String} Nome do cookie. | ||
7744 | + | ||
7745 | + Returns: | ||
7746 | + (String) - valor do cookie | ||
7747 | + */ | ||
7748 | + pegaCookie: function(nome){ | ||
7749 | + var cookies = document.cookie; | ||
7750 | + var i = cookies.indexOf(nome); | ||
7751 | + if(i == -1) | ||
7752 | + {return null;} | ||
7753 | + var fim = cookies.indexOf(";",i); | ||
7754 | + if (fim == -1) | ||
7755 | + {var fim = cookies.length;} | ||
7756 | + return (unescape(cookies.substring(i,fim))).split("=")[1]; | ||
7757 | + }, | ||
7758 | + /* | ||
7759 | + Function: listaChaves | ||
7760 | + Lista as chaves de um objeto. | ||
7761 | + | ||
7762 | + Parameters: | ||
7763 | + obj - {Object} | ||
7764 | + | ||
7765 | + Return: | ||
7766 | + (Array) - array com as chaves. | ||
7767 | + */ | ||
7768 | + listaChaves: function (obj) { | ||
7769 | + var keys = []; | ||
7770 | + for(var key in obj){ | ||
7771 | + keys.push(key); | ||
7772 | + } | ||
7773 | + return keys; | ||
7774 | + }, | ||
7775 | + /* | ||
7776 | + Function: criaBotaoAplicar | ||
7777 | + Cria um botão flutuante do tipo aplicar. | ||
7778 | + | ||
7779 | + O novo botão é adicionado no DOM com ID "i3geo_aplicar" e posicionado sobre o objeto definido | ||
7780 | + | ||
7781 | + Parameters: | ||
7782 | + | ||
7783 | + nomeFuncao - {String} Nome da função que será executada quando o botão for cllicado | ||
7784 | + | ||
7785 | + titulo - (opcional) {String} Título que será mostrado no botão | ||
7786 | + | ||
7787 | + classe - (opcional) {String} Nome da classe (estilo) que será aplicado ao botão. | ||
7788 | + | ||
7789 | + obj - (opcional) {Objeto} Objeto DOM que foi clicado para provocar a criação do botão. | ||
7790 | + | ||
7791 | + Return: | ||
7792 | + (Object) - Objeto DOM criado. | ||
7793 | + | ||
7794 | + */ | ||
7795 | + criaBotaoAplicar: function (nomeFuncao,titulo,classe,obj) { | ||
7796 | + try{clearTimeout(tempoBotaoAplicar);}catch(e){}; | ||
7797 | + tempoBotaoAplicar = eval("setTimeout('"+nomeFuncao+"\(\)',(i3GEO.configura.tempoAplicar))"); | ||
7798 | + autoRedesenho("reinicia"); | ||
7799 | + if(arguments.length == 1) | ||
7800 | + {var titulo = "Aplicar";} | ||
7801 | + if(arguments.length == 1 || arguments.length == 2) | ||
7802 | + {var classe = "i3geoBotaoAplicar";} | ||
7803 | + if (!document.getElementById("i3geo_aplicar")) | ||
7804 | + { | ||
7805 | + var novoel = document.createElement("input"); | ||
7806 | + novoel.id = 'i3geo_aplicar'; | ||
7807 | + novoel.type = 'button'; | ||
7808 | + novoel.value = titulo; | ||
7809 | + novoel.style.cursor="pointer"; | ||
7810 | + novoel.style.fontSize="10px"; | ||
7811 | + novoel.style.zIndex = 15000; | ||
7812 | + novoel.style.position="absolute"; | ||
7813 | + novoel.style.display="none"; | ||
7814 | + novoel.onmouseover = function(){this.style.display="block";}; | ||
7815 | + novoel.onmouseout = function(){this.style.display="none";}; | ||
7816 | + novoel.className = classe; | ||
7817 | + document.body.appendChild(novoel); | ||
7818 | + } | ||
7819 | + else | ||
7820 | + {var novoel = document.getElementById("i3geo_aplicar");} | ||
7821 | + novoel.onclick = function(){ | ||
7822 | + clearTimeout(i3GEO.parametros.tempo); | ||
7823 | + i3GEO.parametros.tempo = ""; | ||
7824 | + this.style.display='none'; | ||
7825 | + eval(nomeFuncao+"\(\)"); | ||
7826 | + }; | ||
7827 | + //reposiciona o botao | ||
7828 | + if(arguments.length == 4){ | ||
7829 | + novoel.style.display="block"; | ||
7830 | + var xy = YAHOO.util.Dom.getXY(obj); | ||
7831 | + YAHOO.util.Dom.setXY(novoel,xy); | ||
7832 | + } | ||
7833 | + return (novoel); | ||
7834 | + }, | ||
7835 | + /* | ||
7836 | + Function: arvore | ||
7837 | + | ||
7838 | + Cria uma árvore com base em um objeto contendo aspropriedades. | ||
7839 | + | ||
7840 | + Parameters: | ||
7841 | + | ||
7842 | + titulo - {String} cabeçaljo da árvore | ||
7843 | + | ||
7844 | + onde - {String} nome do id doelemento que conterá a árvore | ||
7845 | + | ||
7846 | + obj - {Object} objeto contendo os parâmetros, exemplo | ||
7847 | + | ||
7848 | + g_listaPropriedades = { | ||
7849 | + | ||
7850 | + "propriedades": [ | ||
7851 | + | ||
7852 | + { text: "p2", url: "javascript:tipoimagem()" } | ||
7853 | + | ||
7854 | + ]} | ||
7855 | + | ||
7856 | + */ | ||
7857 | + arvore: function(titulo,onde,obj){ | ||
7858 | + //YAHOO.log("arvore", "i3geo"); | ||
7859 | + if(!$i(onde)){return;} | ||
7860 | + var currentIconMode; | ||
7861 | + try{ | ||
7862 | + arvore = new YAHOO.widget.TreeView(onde); | ||
7863 | + root = arvore.getRoot(); | ||
7864 | + var tempNode = new YAHOO.widget.TextNode('', root, false); | ||
7865 | + tempNode.isLeaf = false; | ||
7866 | + } | ||
7867 | + catch(e){} | ||
7868 | + var titulo = "<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>"; | ||
7869 | + var d = {html:titulo}; | ||
7870 | + var tempNode = new YAHOO.widget.HTMLNode(d, root, true,true); | ||
7871 | + var c = obj.propriedades.length; | ||
7872 | + for (var i=0, j=c; i<j; i++){ | ||
7873 | + var linha = obj.propriedades[i]; | ||
7874 | + var conteudo = "<a href='#' onclick='"+linha.url+"'>"+$trad(linha.text)+"</a>"; | ||
7875 | + var d = {html:conteudo}; | ||
7876 | + var temaNode = new YAHOO.widget.HTMLNode(d, tempNode, false,true); | ||
7877 | + } | ||
7878 | + arvore.collapseAll(); | ||
7879 | + arvore.draw(); | ||
7880 | + //YAHOO.log("Fim arvore", "i3geo"); | ||
7881 | + }, | ||
7882 | + /* | ||
7883 | + Function: removeAcentos | ||
7884 | + | ||
7885 | + Remove acentos de uma palavra ou frase | ||
7886 | + | ||
7887 | + Parameters: | ||
7888 | + | ||
7889 | + palavra {String} | ||
7890 | + | ||
7891 | + Return: | ||
7892 | + | ||
7893 | + {String} | ||
7894 | + */ | ||
7895 | + removeAcentos: function(palavra) { | ||
7896 | + var re = /ã|á|à|â/gi; | ||
7897 | + palavra = palavra.replace(re,"a"); | ||
7898 | + var re = /é/gi; | ||
7899 | + palavra = palavra.replace(re,"e"); | ||
7900 | + var re = /í/gi; | ||
7901 | + palavra = palavra.replace(re,"i"); | ||
7902 | + var re = /ó|õ/gi; | ||
7903 | + palavra = palavra.replace(re,"o"); | ||
7904 | + var re = /ç/gi; | ||
7905 | + palavra = palavra.replace(re,"c"); | ||
7906 | + var re = /ú/gi; | ||
7907 | + palavra = palavra.replace(re,"u"); | ||
7908 | + return(palavra); | ||
7909 | + }, | ||
7910 | + /* | ||
7911 | + Function protocolo | ||
7912 | + | ||
7913 | + Obtém o protocoloutilizado na URL atual | ||
7914 | + | ||
7915 | + Return: | ||
7916 | + | ||
7917 | + {String} - protocolo | ||
7918 | + */ | ||
7919 | + protocolo: function(){ | ||
7920 | + var u = window.location.href; | ||
7921 | + var u = u.split(":"); | ||
7922 | + return (u[0]); | ||
7923 | + }, | ||
7924 | + /* | ||
7925 | + Function: pegaPosicaoObjeto | ||
7926 | + | ||
7927 | + Retorna a posição x,y de um objeto em relação a tela do navegador | ||
7928 | + | ||
7929 | + Parameters: | ||
7930 | + | ||
7931 | + obj {Object} - objeto dom | ||
7932 | + | ||
7933 | + Return: | ||
7934 | + | ||
7935 | + {Array} - array com a posição [x,y] | ||
7936 | + */ | ||
7937 | + pegaPosicaoObjeto: function(obj){ | ||
7938 | + if(obj) | ||
7939 | + { | ||
7940 | + if(!obj.style) | ||
7941 | + {return [0,0];} | ||
7942 | + if(obj.style.position == "absolute") | ||
7943 | + {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} | ||
7944 | + else{ | ||
7945 | + var curleft = curtop = 0; | ||
7946 | + if(obj){ | ||
7947 | + if (obj.offsetParent) { | ||
7948 | + do { | ||
7949 | + curleft += obj.offsetLeft-obj.scrollLeft; | ||
7950 | + curtop += obj.offsetTop-obj.scrollTop; | ||
7951 | + } while (obj = obj.offsetParent); | ||
7952 | + } | ||
7953 | + } | ||
7954 | + return [curleft+document.body.scrollLeft,curtop+document.body.scrollTop]; | ||
7955 | + } | ||
7956 | + } | ||
7957 | + else | ||
7958 | + {return [0,0];} | ||
7959 | + }, | ||
7960 | + /* | ||
7961 | + Function: pegaElementoPai | ||
7962 | + | ||
7963 | + Pega o elemento pai de um elemento clicado para identificar o código do tema. | ||
7964 | + | ||
7965 | + Parameters: | ||
7966 | + | ||
7967 | + e - elemento do DOM. | ||
7968 | + | ||
7969 | + Return: | ||
7970 | + | ||
7971 | + {Node} - objeto DOM | ||
7972 | + */ | ||
7973 | + pegaElementoPai: function(e){ | ||
7974 | + var targ; | ||
7975 | + if (!e) | ||
7976 | + {var e = window.event;} | ||
7977 | + if (e.target) | ||
7978 | + {targ = e.target;} | ||
7979 | + else | ||
7980 | + if (e.srcElement) | ||
7981 | + {targ = e.srcElement;} | ||
7982 | + if (targ.nodeType == 3) | ||
7983 | + {targ = targ.parentNode;} | ||
7984 | + var tname; | ||
7985 | + tparent=targ.parentNode; | ||
7986 | + return(tparent); | ||
7987 | + }, | ||
7988 | + /* | ||
7989 | + Function: mudaCursor | ||
7990 | + | ||
7991 | + Altera o cursor do ponteiro do mouse. | ||
7992 | + | ||
7993 | + Os cursores disponíveis são definidos por default em classe_configura.js | ||
7994 | + | ||
7995 | + Parameters: | ||
7996 | + | ||
7997 | + cursores {i3GEO.configura.cursores} - objeto JSON com as URIs de cada cursor (veja i3GEO.configura.cursores) | ||
7998 | + | ||
7999 | + tipo {String} - tipo de cursor disponível em cursores | ||
8000 | + | ||
8001 | + idobjeto {String} - id do objeto que terá o estilo alterado para o cursor desejado | ||
8002 | + | ||
8003 | + locaplic {String} - onde está instalado o i3Geo | ||
8004 | + */ | ||
8005 | + mudaCursor: function(cursores,tipo,idobjeto,locaplic){ | ||
8006 | + var o = document.getElementById(idobjeto); | ||
8007 | + var c = eval("cursores."+tipo+".ie"); | ||
8008 | + if(c == "default" || c == "pointer" || c == "crosshair" || c == "help" || c == "move" || c == "text") | ||
8009 | + o.style.cursor = c; | ||
8010 | + else{ | ||
8011 | + if(o){ | ||
8012 | + if(navm){ | ||
8013 | + o.style.cursor = "URL(\""+locaplic+eval("cursores."+tipo+".ie")+"\"),auto"; | ||
8014 | + } | ||
8015 | + else{ | ||
8016 | + o.style.cursor = "URL(\""+locaplic+eval("cursores."+tipo+".ff")+"\"),auto"; | ||
8017 | + } | ||
8018 | + } | ||
8019 | + } | ||
8020 | + }, | ||
8021 | + /* | ||
8022 | + Function: criaBox | ||
8023 | + | ||
8024 | + Cria um elemento div na página atual. | ||
8025 | + | ||
8026 | + Esse elemento pode ser utilizado para desenhar retângulos sobre o mapa | ||
8027 | + | ||
8028 | + Parameters: | ||
8029 | + | ||
8030 | + id {String} - id do elemento que será criado. Por default, será 'boxg' | ||
8031 | + */ | ||
8032 | + criaBox: function(id){ | ||
8033 | + if(arguments.length == 0) | ||
8034 | + {var id = "boxg"} | ||
8035 | + if (!$i(id)) | ||
8036 | + { | ||
8037 | + var novoel = document.createElement("div"); | ||
8038 | + novoel.id = id; | ||
8039 | + novoel.style.zIndex=1; | ||
8040 | + novoel.innerHTML = '<font face="Arial" size=0></font>'; | ||
8041 | + document.body.appendChild(novoel); | ||
8042 | + //YAHOO.util.Event.addListener($i(id),"mouseover", "this.style.display='none'"); | ||
8043 | + //novoel.onmouseover = eval("$i('"+id+"').style.display='none';"); | ||
8044 | + novoel.onmouseover = function(){novoel.style.display='none';}; | ||
8045 | + novoel.onmouseout = function(){novoel.style.display='block';}; | ||
8046 | + i3GEO.util.BOXES.push(id); | ||
8047 | + } | ||
8048 | + else | ||
8049 | + $i(id).style.display="block"; | ||
8050 | + }, | ||
8051 | + /* | ||
8052 | + Function: escondeBox | ||
8053 | + | ||
8054 | + Esconde os BOXES com IDs registrados em i3GEO.util.BOXES | ||
8055 | + | ||
8056 | + Os ids são criado pela função criaBox | ||
8057 | + */ | ||
8058 | + escondeBox: function(){ | ||
8059 | + var l = i3GEO.util.BOXES.length; | ||
8060 | + for (i=0; i<l; i++){ | ||
8061 | + if($i(i3GEO.util.BOXES[i])) | ||
8062 | + {$i(i3GEO.util.BOXES[i]).style.display = "none";} | ||
8063 | + } | ||
8064 | + }, | ||
8065 | + /* | ||
8066 | + Function: criaPin | ||
8067 | + | ||
8068 | + Cria um elemento imagem na página atual. | ||
8069 | + | ||
8070 | + Esse elemento pode ser utilizado para desenhar pontos sobre o mapa | ||
8071 | + | ||
8072 | + Parameters: | ||
8073 | + | ||
8074 | + id {String} - (opcional) id do elemento que será criado. Por default, será 'boxpin' | ||
8075 | + | ||
8076 | + imagem {URL} - (opcional) endereço da imagem | ||
8077 | + | ||
8078 | + w {String} - (opcional) largura da imagem | ||
8079 | + | ||
8080 | + h {String} - (opcional) altura da imagem | ||
8081 | + */ | ||
8082 | + criaPin: function(id,imagem,w,h){ | ||
8083 | + if(arguments.length < 1 || id == ""){ | ||
8084 | + var id = "boxpin"; | ||
8085 | + } | ||
8086 | + if(arguments.length < 2 || imagem == ""){ | ||
8087 | + var imagem = i3GEO.configura.locaplic+'/imagens/marker.png'; | ||
8088 | + } | ||
8089 | + if(arguments.length < 3 || w == ""){ | ||
8090 | + var w = "21px"; | ||
8091 | + } | ||
8092 | + if(arguments.length < 4 || h == ""){ | ||
8093 | + var h = "25px"; | ||
8094 | + } | ||
8095 | + if (!$i(id)) | ||
8096 | + { | ||
8097 | + var novoel = document.createElement("img"); | ||
8098 | + novoel.id = id; | ||
8099 | + novoel.style.zIndex=10000; | ||
8100 | + novoel.style.position="absolute"; | ||
8101 | + novoel.style.width=w; | ||
8102 | + novoel.style.height=h; | ||
8103 | + novoel.src = imagem; | ||
8104 | + if(id == "boxpin") | ||
8105 | + {novoel.onmouseover = function(){$i("boxpin").style.display="none";};} | ||
8106 | + document.body.appendChild(novoel); | ||
8107 | + i3GEO.util.PINS.push(id); | ||
8108 | + } | ||
8109 | + }, | ||
8110 | + /* | ||
8111 | + Function: posicionaImagemNoMapa | ||
8112 | + | ||
8113 | + Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa | ||
8114 | + | ||
8115 | + Parameters: | ||
8116 | + | ||
8117 | + id {string} - id do elemento que será posicionado | ||
8118 | + */ | ||
8119 | + posicionaImagemNoMapa: function(id){ | ||
8120 | + var i = $i(id); | ||
8121 | + var mx = parseInt(i.style.width) / 2; | ||
8122 | + var my = parseInt(i.style.height) / 2; | ||
8123 | + i.style.position = "absolute"; | ||
8124 | + i.style.top = objposicaocursor.telay - my; | ||
8125 | + i.style.left = objposicaocursor.telax - mx; | ||
8126 | + }, | ||
8127 | + /* | ||
8128 | + Function: escondePin | ||
8129 | + | ||
8130 | + Esconde os PINS com IDs registrados em i3GEO.util.PINS | ||
8131 | + | ||
8132 | + Os ids são criado pela função criaPin | ||
8133 | + */ | ||
8134 | + escondePin: function(){ | ||
8135 | + var l = i3GEO.util.PINS.length; | ||
8136 | + for (i=0; i<l; i++){ | ||
8137 | + if($i(i3GEO.util.PINS[i])) | ||
8138 | + {$i(i3GEO.util.PINS[i]).style.display = "none";} | ||
8139 | + } | ||
8140 | + }, | ||
8141 | + /* | ||
8142 | + Function: $im ou nome curto $im | ||
8143 | + | ||
8144 | + Retorna o caminho correto de uma imagem incluindo o endereço da aplicação e do visual em uso. | ||
8145 | + | ||
8146 | + Exemplo: $im("imagem.png") | ||
8147 | + | ||
8148 | + Parâmetros: | ||
8149 | + | ||
8150 | + g {String} - nome da imagem | ||
8151 | + | ||
8152 | + Retorno: | ||
8153 | + | ||
8154 | + string - caminho para a imagem | ||
8155 | + */ | ||
8156 | + $im: function(g){ | ||
8157 | + return i3GEO.configura.locaplic+"/imagens/visual/"+i3GEO.configura.visual+"/"+g; | ||
8158 | + }, | ||
8159 | + /* | ||
8160 | + Function $inputText ou nome curto $inputText | ||
8161 | + | ||
8162 | + Cria um elemento html do tipo input text com formatação especial. | ||
8163 | + | ||
8164 | + Parameters: | ||
8165 | + | ||
8166 | + idPai {String} - id do elemento pai do input | ||
8167 | + | ||
8168 | + larguraIdPai {Integer} - largura em pixel | ||
8169 | + | ||
8170 | + idInput {String} - id do objeto input | ||
8171 | + | ||
8172 | + titulo {String} - texto que vai no title | ||
8173 | + | ||
8174 | + digitos {Integer} - numero de dígitos do input | ||
8175 | + | ||
8176 | + valor {String} - valor do input | ||
8177 | + */ | ||
8178 | + $inputText: function(idPai,larguraIdPai,idInput,titulo,digitos,valor) { | ||
8179 | + if(idPai != "") | ||
8180 | + { | ||
8181 | + if(larguraIdPai != "") | ||
8182 | + {$i(idPai).style.width=larguraIdPai+"px";} | ||
8183 | + $i(idPai).style.padding="3"; | ||
8184 | + $i(idPai).style.textAlign="center"; | ||
8185 | + $i(idPai).onmouseover = function() | ||
8186 | + {this.className = "digitarMouseover";}; | ||
8187 | + $i(idPai).onmouseout = function() | ||
8188 | + {this.className = "";}; | ||
8189 | + } | ||
8190 | + var i = "<input onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' onclick='javascript:this.className=\"digitarMouseclick\";' id="+idInput+" title='"+titulo+"' type=text size="+digitos+" class=digitar value='"+valor+"' />"; | ||
8191 | + return i; | ||
8192 | + }, | ||
8193 | + /* | ||
8194 | + Function: $top ou nome curto $top | ||
8195 | + | ||
8196 | + Muda a posição (superior) de um objeto tanto no IE como no Firefox. | ||
8197 | + | ||
8198 | + Exemplo: $top("imagem",100) | ||
8199 | + | ||
8200 | + Parâmetros: | ||
8201 | + | ||
8202 | + id - identificador do objeto | ||
8203 | + | ||
8204 | + valor - posição em relação ao topo. | ||
8205 | + */ | ||
8206 | + $top: function(id,valor){ | ||
8207 | + if (document.getElementById(id).style){ | ||
8208 | + if (document.getElementById(id).style.pixelTop) | ||
8209 | + {document.getElementById(id).style.pixelTop=valor;} | ||
8210 | + else | ||
8211 | + {document.getElementById(id).style.top=valor+"px";} | ||
8212 | + } | ||
8213 | + }, | ||
8214 | + /* | ||
8215 | + Function: $left ou nome curto $left | ||
8216 | + | ||
8217 | + Muda a posição (esquerda) de um objeto tanto no IE como no Firefox. | ||
8218 | + | ||
8219 | + Exemplo: $left("imagem",100) | ||
8220 | + | ||
8221 | + Parâmetros: | ||
8222 | + | ||
8223 | + id - identificador do objeto | ||
8224 | + | ||
8225 | + valor - posição em relação a esquerda. | ||
8226 | + */ | ||
8227 | + $left: function(id,valor){ | ||
8228 | + if (document.getElementById(id).style){ | ||
8229 | + if (document.getElementById(id).style.pixelLeft) | ||
8230 | + {document.getElementById(id).style.pixelLeft=valor;} | ||
8231 | + else | ||
8232 | + {document.getElementById(id).style.left=valor+"px";} | ||
8233 | + } | ||
8234 | + }, | ||
8235 | + /* | ||
8236 | + Function: insereMarca | ||
8237 | + | ||
8238 | + Insere ou remove pontos no mapa. | ||
8239 | + */ | ||
8240 | + insereMarca:{ | ||
8241 | + /* | ||
8242 | + Variable: CONTAINER | ||
8243 | + | ||
8244 | + Armazena o valor do ID do div criado para inserir pontos | ||
8245 | + | ||
8246 | + Type: | ||
8247 | + {Array} | ||
8248 | + */ | ||
8249 | + CONTAINER: new Array(), | ||
8250 | + /* | ||
8251 | + Function: cria | ||
8252 | + | ||
8253 | + Insere um ponto no mapa | ||
8254 | + | ||
8255 | + Os pontos são inseridos em um contaier de pontos e mostrados temporáriamente | ||
8256 | + | ||
8257 | + Parameters: | ||
8258 | + | ||
8259 | + xi {Numeric} - coordenada x. | ||
8260 | + | ||
8261 | + yi {Numeric} - coordenada y. | ||
8262 | + | ||
8263 | + funcaoOnclick {String} - funcao que sera executada quando a marca | ||
8264 | + for clicada, se for "", o container será esvaziado ao ser clicado na marca | ||
8265 | + | ||
8266 | + container {String} - id do container que receberá os pontos | ||
8267 | + */ | ||
8268 | + cria:function(xi,yi,funcaoOnclick,container){ | ||
8269 | + try{ | ||
8270 | + if(i3GEO.util.insereMarca.CONTAINER.toString().search(container) < 0) | ||
8271 | + i3GEO.util.insereMarca.CONTAINER.push(container); | ||
8272 | + //verifica se existe o container para os pontos | ||
8273 | + if (!$i(container)){ | ||
8274 | + var novoel = document.createElement("div"); | ||
8275 | + novoel.id = container; | ||
8276 | + var i = novoel.style; | ||
8277 | + i.position = "absolute"; | ||
8278 | + i.top = parseInt($i("img").style.top); | ||
8279 | + i.left = parseInt($i("img").style.left); | ||
8280 | + document.body.appendChild(novoel); | ||
8281 | + } | ||
8282 | + var container = $i(container); | ||
8283 | + var novoel = document.createElement("div"); | ||
8284 | + var i = novoel.style; | ||
8285 | + i.position = "absolute"; | ||
8286 | + i.zIndex=2000; | ||
8287 | + i.top=(yi - 4)+"px"; | ||
8288 | + i.left=(xi - 4)+"px"; | ||
8289 | + i.width="4px"; | ||
8290 | + i.height="4px"; | ||
8291 | + var novoimg = document.createElement("img"); | ||
8292 | + if (funcaoOnclick != "") | ||
8293 | + {novoimg.onclick = funcaoOnclick;} | ||
8294 | + else | ||
8295 | + {novoimg.onclick=function(){i3GEO.util.insereMarca.limpa();}} | ||
8296 | + novoimg.src=i3GEO.configura.locaplic+"/imagens/dot1.gif"; | ||
8297 | + with (novoimg.style){width="6px";height="6px";zIndex=2000;} | ||
8298 | + novoel.appendChild(novoimg); | ||
8299 | + container.appendChild(novoel); | ||
8300 | + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()") < 0) | ||
8301 | + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()");} | ||
8302 | + } | ||
8303 | + catch(e){alert("Ocorreu um erro. inseremarca"+e);} | ||
8304 | + }, | ||
8305 | + limpa: function(){ | ||
8306 | + try{ | ||
8307 | + var n = i3GEO.util.insereMarca.CONTAINER.length; | ||
8308 | + for(i=0;i<n;i++){ | ||
8309 | + if($i(i3GEO.util.insereMarca.CONTAINER[i])) | ||
8310 | + $i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML = ""; | ||
8311 | + } | ||
8312 | + i3GEO.util.insereMarca.CONTAINER = new Array(); | ||
8313 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()"); | ||
8314 | + } | ||
8315 | + catch(e){} | ||
8316 | + } | ||
8317 | + }, | ||
8318 | + /* | ||
8319 | + Function: adicionaSHP | ||
8320 | + | ||
8321 | + Inclui um arquivo shapefile no mapa atual como uma nova camada | ||
8322 | + | ||
8323 | + Parameters: | ||
8324 | + | ||
8325 | + path {String} - caminho completo do shapefile | ||
8326 | + */ | ||
8327 | + adicionaSHP: function(path){ | ||
8328 | + i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); | ||
8329 | + var temp = path.split("."); | ||
8330 | + if ((temp[1] == "SHP") || (temp[1] == "shp")) | ||
8331 | + {i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path);} | ||
8332 | + else | ||
8333 | + {i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path);} | ||
8334 | + }, | ||
8335 | + /* | ||
8336 | + Function: abreCor | ||
8337 | + | ||
8338 | + Abre a janela flutuante para escolha de uma cor | ||
8339 | + | ||
8340 | + Parameters: | ||
8341 | + | ||
8342 | + janela {String} - id do conteúdo da janela flutuante que chamou a função | ||
8343 | + | ||
8344 | + elemento {String} - id do elemento que receberá os valores da cor selecionada | ||
8345 | + */ | ||
8346 | + abreCor: function(janela,elemento){ | ||
8347 | + i3GEO.janela.cria("400","240",i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janela+"&elemento="+elemento,"","","Cor","i3geo_janelaCor",true); | ||
8348 | + }, | ||
8349 | + /* | ||
8350 | + Function: ajaxhttp | ||
8351 | + | ||
8352 | + Cria o objeto XMLHttpRequest para uso com funções próprias de chamada em ajax | ||
8353 | + | ||
8354 | + O uso dessa função não é recomendado. Dê preferência para uso da chamada ajax via YUI | ||
8355 | + | ||
8356 | + Return: | ||
8357 | + | ||
8358 | + {XMLHttpRequest} | ||
8359 | + */ | ||
8360 | + ajaxhttp: function(){ | ||
8361 | + try | ||
8362 | + {var objhttp1 = new XMLHttpRequest();} | ||
8363 | + catch(ee){ | ||
8364 | + try{var objhttp1 = new ActiveXObject("Msxml2.XMLHTTP");} | ||
8365 | + catch(e){ | ||
8366 | + try{var objhttp1 = new ActiveXObject("Microsoft.XMLHTTP");} | ||
8367 | + catch(E) | ||
8368 | + {var objhttp1 = false;} | ||
8369 | + } | ||
8370 | + } | ||
8371 | + return(objhttp1); | ||
8372 | + }, | ||
8373 | + /* | ||
8374 | + Function: ajaxexecASXml | ||
8375 | + | ||
8376 | + Executa uma chamada ajax no modo assíncrono retornando o resultado em XML. | ||
8377 | + | ||
8378 | + Parameters: | ||
8379 | + | ||
8380 | + programa {String} - URL do programa que será executado no servidor. | ||
8381 | + funcao {funcao} - função que tratará o resultado. | ||
8382 | + | ||
8383 | + Returns: | ||
8384 | + | ||
8385 | + O resultado em um objeto DOM. Se o retorno contiver a palavra "Erro", é gerado um alert. | ||
8386 | + */ | ||
8387 | + ajaxexecASXml: function(programa,funcao){ | ||
8388 | + if (programa.search("http") == 0){ | ||
8389 | + var h = window.location.host; | ||
8390 | + if (programa.search(h) < 0){ | ||
8391 | + alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php"); | ||
8392 | + return; | ||
8393 | + } | ||
8394 | + } | ||
8395 | + var ohttp = i3GEO.util.ajaxhttp(); | ||
8396 | + ohttp.open("GET",programa,true); | ||
8397 | + var retorno = ""; | ||
8398 | + ohttp.onreadystatechange=function(){ | ||
8399 | + if (ohttp.readyState==4){ | ||
8400 | + var retorno = ohttp.responseText; | ||
8401 | + if (retorno != undefined){ | ||
8402 | + if (document.implementation.createDocument){ | ||
8403 | + var parser = new DOMParser(); | ||
8404 | + var dom = parser.parseFromString(retorno, "text/xml"); | ||
8405 | + } | ||
8406 | + else{ | ||
8407 | + var dom = new ActiveXObject("Microsoft.XMLDOM"); | ||
8408 | + dom.async="false"; | ||
8409 | + dom.load(programa); | ||
8410 | + } | ||
8411 | + } | ||
8412 | + else | ||
8413 | + {var dom = "erro";} | ||
8414 | + if (funcao != "volta") | ||
8415 | + {eval(funcao+'(dom)');} | ||
8416 | + else | ||
8417 | + {return dom;} | ||
8418 | + } | ||
8419 | + }; | ||
8420 | + ohttp.send(null); | ||
8421 | + }, | ||
8422 | + /* | ||
8423 | + Function: aparece | ||
8424 | + | ||
8425 | + Aplica efeito de aparecimento suave de um objetov | ||
8426 | + | ||
8427 | + Parameters: | ||
8428 | + | ||
8429 | + id {String} - id do objeto | ||
8430 | + | ||
8431 | + tempo {Integer} - tempo em milesegundos que levará o efeito | ||
8432 | + | ||
8433 | + intervalo {Integer} - intervalo entre uma imagem e outra | ||
8434 | + */ | ||
8435 | + aparece: function(id,tempo,intervalo){ | ||
8436 | + var n = parseInt(tempo / intervalo); | ||
8437 | + var tempo = n * intervalo; | ||
8438 | + var intervalo = (intervalo * 100) / tempo; | ||
8439 | + var obj = $i(id); | ||
8440 | + var opacidade = 0; | ||
8441 | + if (navm) | ||
8442 | + {obj.style.filter='alpha(opacity=0)';} | ||
8443 | + else | ||
8444 | + {obj.style.opacity= 0;} | ||
8445 | + obj.style.display = "block"; | ||
8446 | + var fadei = function(){ | ||
8447 | + opacidade += intervalo; | ||
8448 | + if (navm) | ||
8449 | + {obj.style.filter='alpha(opacity='+opacidade+')';} | ||
8450 | + else | ||
8451 | + {obj.style.opacity= opacidade/100;} | ||
8452 | + if(opacidade < 100) | ||
8453 | + var tempoFade = setTimeout(fadei, tempo); | ||
8454 | + else{ | ||
8455 | + clearTimeout(tempoFadei); | ||
8456 | + if (navm) | ||
8457 | + {obj.style.filter='alpha(opacity=100)';} | ||
8458 | + else | ||
8459 | + {obj.style.opacity= 1;} | ||
8460 | + } | ||
8461 | + }; | ||
8462 | + var tempoFadei = setTimeout(fadei, tempo); | ||
8463 | + }, | ||
8464 | + /* | ||
8465 | + Function: desaparece | ||
8466 | + | ||
8467 | + Aplica efeito de desaparecimento suave de um objeto | ||
8468 | + | ||
8469 | + Parameters: | ||
8470 | + | ||
8471 | + id {String} - id do objeto | ||
8472 | + | ||
8473 | + tempo {Integer} - tempo em milesegundos que levará o efeito | ||
8474 | + | ||
8475 | + intervalo {Integer} - intervalo entre uma imagem e outra | ||
8476 | + | ||
8477 | + removeobj {Boolean} - remove ou não o objeto no final | ||
8478 | + */ | ||
8479 | + desaparece: function(id,tempo,intervalo,removeobj){ | ||
8480 | + var n = parseInt(tempo / intervalo); | ||
8481 | + var tempo = n * intervalo; | ||
8482 | + var intervalo = (intervalo * 100) / tempo; | ||
8483 | + var obj = $i(id); | ||
8484 | + var opacidade = 100; | ||
8485 | + if (navm) | ||
8486 | + {obj.style.filter='alpha(opacity=100)';} | ||
8487 | + else | ||
8488 | + {obj.style.opacity= 1;} | ||
8489 | + obj.style.display = "block"; | ||
8490 | + var fade = function(){ | ||
8491 | + opacidade -= intervalo; | ||
8492 | + if (navm) | ||
8493 | + {obj.style.filter='alpha(opacity='+opacidade+')';} | ||
8494 | + else | ||
8495 | + {obj.style.opacity= opacidade/100;} | ||
8496 | + if(opacidade > 0){ | ||
8497 | + var tempoFade = setTimeout(fade, tempo); | ||
8498 | + } | ||
8499 | + else{ | ||
8500 | + clearTimeout(tempoFade); | ||
8501 | + obj.style.display = "none"; | ||
8502 | + if (navm) | ||
8503 | + {obj.style.filter='alpha(opacity=100)';} | ||
8504 | + else | ||
8505 | + {obj.style.opacity= 1;} | ||
8506 | + if(removeobj){ | ||
8507 | + var p = obj.parentNode; | ||
8508 | + if(p) | ||
8509 | + p.removeChild(obj); | ||
8510 | + } | ||
8511 | + } | ||
8512 | + }; | ||
8513 | + var tempoFade = setTimeout(fade, tempo); | ||
8514 | + }, | ||
8515 | + /* | ||
8516 | + Function: wkt2ext | ||
8517 | + | ||
8518 | + Calcula a extensão geográfica de uma geometria fornecida no formato WKT | ||
8519 | + | ||
8520 | + Parameters: | ||
8521 | + | ||
8522 | + wkt {String} - geometria no formato wkt | ||
8523 | + | ||
8524 | + tipo {String} - tipo de geometria (polygon,point,line) | ||
8525 | + | ||
8526 | + Return: | ||
8527 | + | ||
8528 | + {String} - extensão geográfica (xmin ymin xmax ymax) | ||
8529 | + */ | ||
8530 | + wkt2ext:function(wkt,tipo){ | ||
8531 | + var tipo = tipo.toLowerCase(); | ||
8532 | + ext = false; | ||
8533 | + if(tipo == "polygon"){ | ||
8534 | + try{ | ||
8535 | + var re = new RegExp("POLYGON", "g"); | ||
8536 | + var wkt = wkt.replace(re,""); | ||
8537 | + var wkt = wkt.split("(")[2].split(")")[0]; | ||
8538 | + var wkt = wkt.split(","); | ||
8539 | + var x = new Array(); | ||
8540 | + var y = new Array(); | ||
8541 | + for (w=0;w<wkt.length; w++){ | ||
8542 | + var temp = wkt[w].split(" "); | ||
8543 | + x.push(temp[0]); | ||
8544 | + y.push(temp[1]); | ||
8545 | + } | ||
8546 | + x.sort(i3GEO.util.sortNumber); | ||
8547 | + var xMin = x[0]; | ||
8548 | + var xMax = x[(x.length)-1]; | ||
8549 | + y.sort(i3GEO.util.sortNumber); | ||
8550 | + var yMin = y[0]; | ||
8551 | + var yMax = y[(y.length)-1]; | ||
8552 | + return xMin+" "+yMin+" "+xMax+" "+yMax; | ||
8553 | + } | ||
8554 | + catch(e){} | ||
8555 | + } | ||
8556 | + return ext; | ||
8557 | + }, | ||
8558 | + /* | ||
8559 | + Function: sortNumber | ||
8560 | + | ||
8561 | + Ordena um array contendo números. Deve ser usado como parâmetro do método "sort", exemplo | ||
8562 | + | ||
8563 | + y.sort(i3GEO.util.sortNumber), onde y é um array de números | ||
8564 | + */ | ||
8565 | + sortNumber: function(a,b){ | ||
8566 | + return a - b; | ||
8567 | + } | ||
8568 | +}; | ||
8569 | +// | ||
8570 | +//alias | ||
8571 | +// | ||
8572 | +$im = function(g){ | ||
8573 | + return i3GEO.util.$im(g); | ||
8574 | +}; | ||
8575 | +$inputText = function(idPai,larguraIdPai,idInput,titulo,digitos,valor){ | ||
8576 | + return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor); | ||
8577 | +}; | ||
8578 | +$top = function(id,valor){ | ||
8579 | + i3GEO.util.$top(id,valor); | ||
8580 | +}; | ||
8581 | +$left = function(id,valor){ | ||
8582 | + i3GEO.util.$left(id,valor); | ||
8583 | +}; | ||
8584 | +//YAHOO.log("carregou classe util", "Classes i3geo"); |
ferramentas/i3geo_tudo_compacto.js.php
@@ -6978,7 +6978,7 @@ i3GEO.php = { | @@ -6978,7 +6978,7 @@ i3GEO.php = { | ||
6978 | /* | 6978 | /* |
6979 | Function: desativacgi | 6979 | Function: desativacgi |
6980 | 6980 | ||
6981 | - <desativacgi> | 6981 | + <desativacgi> |
6982 | */ | 6982 | */ |
6983 | desativacgi: function(funcao){ | 6983 | desativacgi: function(funcao){ |
6984 | i3GEO.php.verifica(); | 6984 | i3GEO.php.verifica(); |
@@ -6991,7 +6991,7 @@ i3GEO.php = { | @@ -6991,7 +6991,7 @@ i3GEO.php = { | ||
6991 | PHP: | 6991 | PHP: |
6992 | classesphp/classe_menutemas.php | 6992 | classesphp/classe_menutemas.php |
6993 | 6993 | ||
6994 | - <Menutemas->pegaListaDeMapas> | 6994 | + <Menutemas->pegaListaDeMapas> |
6995 | */ | 6995 | */ |
6996 | pegaMapas: function(funcao){ | 6996 | pegaMapas: function(funcao){ |
6997 | i3GEO.php.verifica(); | 6997 | i3GEO.php.verifica(); |
@@ -7004,7 +7004,7 @@ i3GEO.php = { | @@ -7004,7 +7004,7 @@ i3GEO.php = { | ||
7004 | PHP: | 7004 | PHP: |
7005 | classesphp/classe_mapa.php | 7005 | classesphp/classe_mapa.php |
7006 | 7006 | ||
7007 | - <Mapa->mudaQS> | 7007 | + <Mapa->mudaQS> |
7008 | */ | 7008 | */ |
7009 | mudatamanho: function(funcao,altura,largura){ | 7009 | mudatamanho: function(funcao,altura,largura){ |
7010 | i3GEO.php.verifica(); | 7010 | i3GEO.php.verifica(); |
@@ -7017,7 +7017,7 @@ i3GEO.php = { | @@ -7017,7 +7017,7 @@ i3GEO.php = { | ||
7017 | PHP: | 7017 | PHP: |
7018 | classesphp/classe_mapa.php | 7018 | classesphp/classe_mapa.php |
7019 | 7019 | ||
7020 | - <Mapa->ativalogo> | 7020 | + <Mapa->ativalogo> |
7021 | */ | 7021 | */ |
7022 | ativalogo: function(funcao,altura,largura){ | 7022 | ativalogo: function(funcao,altura,largura){ |
7023 | i3GEO.php.verifica(); | 7023 | i3GEO.php.verifica(); |
@@ -7030,7 +7030,7 @@ i3GEO.php = { | @@ -7030,7 +7030,7 @@ i3GEO.php = { | ||
7030 | PHP: | 7030 | PHP: |
7031 | classesphp/classe_temas.php | 7031 | classesphp/classe_temas.php |
7032 | 7032 | ||
7033 | - <Temas->insereFeature> | 7033 | + <Temas->insereFeature> |
7034 | */ | 7034 | */ |
7035 | insereAnnotation: function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){ | 7035 | insereAnnotation: function(funcao,pin,xy,texto,position,partials,offsetx,offsety,minfeaturesize,mindistance,force,shadowcolor,shadowsizex,shadowsizey,outlinecolor,cor,sombray,sombrax,sombra,fundo,angulo,tamanho,fonte){ |
7036 | i3GEO.php.verifica(); | 7036 | i3GEO.php.verifica(); |
@@ -7043,7 +7043,7 @@ i3GEO.php = { | @@ -7043,7 +7043,7 @@ i3GEO.php = { | ||
7043 | PHP: | 7043 | PHP: |
7044 | classesphp/classe_atributos.php | 7044 | classesphp/classe_atributos.php |
7045 | 7045 | ||
7046 | - <Atributos->identificaQBP> | 7046 | + <Atributos->identificaQBP> |
7047 | */ | 7047 | */ |
7048 | identificaunico: function(funcao,xy,tema,item){ | 7048 | identificaunico: function(funcao,xy,tema,item){ |
7049 | i3GEO.php.verifica(); | 7049 | i3GEO.php.verifica(); |
@@ -7056,7 +7056,7 @@ i3GEO.php = { | @@ -7056,7 +7056,7 @@ i3GEO.php = { | ||
7056 | PHP: | 7056 | PHP: |
7057 | classesphp/mapa_controle.php | 7057 | classesphp/mapa_controle.php |
7058 | 7058 | ||
7059 | - <recuperamapa> | 7059 | + <recuperamapa> |
7060 | */ | 7060 | */ |
7061 | recuperamapa: function(funcao){ | 7061 | recuperamapa: function(funcao){ |
7062 | i3GEO.php.verifica(); | 7062 | i3GEO.php.verifica(); |
@@ -7069,7 +7069,7 @@ i3GEO.php = { | @@ -7069,7 +7069,7 @@ i3GEO.php = { | ||
7069 | PHP: | 7069 | PHP: |
7070 | classesphp/classe_legenda.php | 7070 | classesphp/classe_legenda.php |
7071 | 7071 | ||
7072 | - <Atributos->legendaGrafica> | 7072 | + <Atributos->legendaGrafica> |
7073 | */ | 7073 | */ |
7074 | criaLegendaImagem: function(funcao){ | 7074 | criaLegendaImagem: function(funcao){ |
7075 | i3GEO.php.verifica(); | 7075 | i3GEO.php.verifica(); |
@@ -7082,7 +7082,7 @@ i3GEO.php = { | @@ -7082,7 +7082,7 @@ i3GEO.php = { | ||
7082 | PHP: | 7082 | PHP: |
7083 | classesphp/funcoes_gerais.php | 7083 | classesphp/funcoes_gerais.php |
7084 | 7084 | ||
7085 | - <retornaReferenciaDinamica> | 7085 | + <retornaReferenciaDinamica> |
7086 | */ | 7086 | */ |
7087 | referenciadinamica: function(funcao,zoom,tipo){ | 7087 | referenciadinamica: function(funcao,zoom,tipo){ |
7088 | i3GEO.php.verifica(); | 7088 | i3GEO.php.verifica(); |
@@ -7110,7 +7110,7 @@ i3GEO.php = { | @@ -7110,7 +7110,7 @@ i3GEO.php = { | ||
7110 | PHP: | 7110 | PHP: |
7111 | classesphp/classe_navegacao.php | 7111 | classesphp/classe_navegacao.php |
7112 | 7112 | ||
7113 | - <Navegacao->pan> | 7113 | + <Navegacao->pan> |
7114 | */ | 7114 | */ |
7115 | pan: function(funcao,escala,tipo,x,y){ | 7115 | pan: function(funcao,escala,tipo,x,y){ |
7116 | i3GEO.php.verifica(); | 7116 | i3GEO.php.verifica(); |
@@ -7175,10 +7175,13 @@ i3GEO.php = { | @@ -7175,10 +7175,13 @@ i3GEO.php = { | ||
7175 | 7175 | ||
7176 | <Navegacao->mudaExtensao> | 7176 | <Navegacao->mudaExtensao> |
7177 | */ | 7177 | */ |
7178 | - mudaext: function(funcao,tipoimagem,ext){ | ||
7179 | - i3GEO.php.verifica(); | 7178 | + mudaext: function(funcao,tipoimagem,ext,locaplic,sid){ |
7179 | + if(arguments.length == 3){ | ||
7180 | + var locaplic = i3GEO.configura.locaplic; | ||
7181 | + var sid = i3GEO.configura.sid; | ||
7182 | + } | ||
7180 | if(ext == 'undefined'){alert("extensao nao definida");return;} | 7183 | if(ext == 'undefined'){alert("extensao nao definida");return;} |
7181 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+i3GEO.configura.sid; | 7184 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid; |
7182 | cpJSON.call(p,"mudaext",funcao); | 7185 | cpJSON.call(p,"mudaext",funcao); |
7183 | }, | 7186 | }, |
7184 | /* | 7187 | /* |
@@ -7265,7 +7268,7 @@ i3GEO.php = { | @@ -7265,7 +7268,7 @@ i3GEO.php = { | ||
7265 | PHP: | 7268 | PHP: |
7266 | classesphp/classe_temas.php | 7269 | classesphp/classe_temas.php |
7267 | 7270 | ||
7268 | - <Temas->desceTema> | 7271 | + <Temas->desceTema> |
7269 | */ | 7272 | */ |
7270 | descetema: function(funcao,tema){ | 7273 | descetema: function(funcao,tema){ |
7271 | i3GEO.php.verifica(); | 7274 | i3GEO.php.verifica(); |
@@ -7358,9 +7361,12 @@ i3GEO.php = { | @@ -7358,9 +7361,12 @@ i3GEO.php = { | ||
7358 | 7361 | ||
7359 | <Mapa->adicionatemawms> | 7362 | <Mapa->adicionatemawms> |
7360 | */ | 7363 | */ |
7361 | - adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo){ | ||
7362 | - i3GEO.php.verifica(); | ||
7363 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | 7364 | + adicionaTemaWMS: function(funcao,servico,tema,nome,proj,formato,versao,nomecamada,tiporep,suportasld,formatosinfo,locaplic,sid){ |
7365 | + if(arguments.length == 11){ | ||
7366 | + var locaplic = i3GEO.configura.locaplic; | ||
7367 | + var sid = i3GEO.configura.sid; | ||
7368 | + } | ||
7369 | + var p = locaplic+"/classesphp/mapa_controle.php?g_sid="+sid+"&funcao=adicionatemawms&servico="+servico+"&tema="+tema+"&nome="+nome+"&proj="+proj+"&formato="+formato+"&versao="+versao+"&nomecamada="+nomecamada+"&tiporep="+tiporep+"&suportasld="+suportasld+"&formatosinfo="+formatosinfo; | ||
7364 | cpJSON.call(p,"adicionatemawms",funcao); | 7370 | cpJSON.call(p,"adicionatemawms",funcao); |
7365 | }, | 7371 | }, |
7366 | /* | 7372 | /* |
@@ -7421,9 +7427,10 @@ i3GEO.php = { | @@ -7421,9 +7427,10 @@ i3GEO.php = { | ||
7421 | 7427 | ||
7422 | <Menutemas->procurartemas> | 7428 | <Menutemas->procurartemas> |
7423 | */ | 7429 | */ |
7424 | - procurartemas: function(funcao,procurar){ | ||
7425 | - i3GEO.php.verifica(); | ||
7426 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&procurar="+procurar+"&g_sid="+i3GEO.configura.sid; | 7430 | + procurartemas: function(funcao,procurar,locaplic){ |
7431 | + if(arguments.length == 2) | ||
7432 | + {var locaplic = i3GEO.configura.locaplic;} | ||
7433 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=procurartemas&map_file=&procurar="+procurar; | ||
7427 | cpJSON.call(p,"procurartemas",funcao); | 7434 | cpJSON.call(p,"procurartemas",funcao); |
7428 | }, | 7435 | }, |
7429 | /* | 7436 | /* |
@@ -7434,9 +7441,13 @@ i3GEO.php = { | @@ -7434,9 +7441,13 @@ i3GEO.php = { | ||
7434 | 7441 | ||
7435 | <Mapa->adicionaTema> | 7442 | <Mapa->adicionaTema> |
7436 | */ | 7443 | */ |
7437 | - adtema: function(funcao,temas){ | ||
7438 | - i3GEO.php.verifica(); | ||
7439 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+i3GEO.configura.sid; | 7444 | + adtema: function(funcao,temas,locaplic,sid){ |
7445 | + if(arguments.length == 2){ | ||
7446 | + i3GEO.php.verifica(); | ||
7447 | + var locaplic = i3GEO.configura.locaplic; | ||
7448 | + var sid = i3GEO.configura.sid; | ||
7449 | + } | ||
7450 | + var p = locaplic+"/classesphp/mapa_controle.php?funcao=adtema&temas="+temas+"&g_sid="+sid; | ||
7440 | cpJSON.call(p,"adtema",funcao); | 7451 | cpJSON.call(p,"adtema",funcao); |
7441 | }, | 7452 | }, |
7442 | /* | 7453 | /* |
@@ -7552,8 +7563,1024 @@ i3GEO.php = { | @@ -7552,8 +7563,1024 @@ i3GEO.php = { | ||
7552 | listaLayersWMS: function(funcao,servico,nivel,id_ws,nomelayer){ | 7563 | listaLayersWMS: function(funcao,servico,nivel,id_ws,nomelayer){ |
7553 | var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer; | 7564 | var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=listaLayersWMS&servico="+servico+"&nivel="+nivel+"&id_ws="+id_ws+"&nomelayer="+nomelayer; |
7554 | cpJSON.call(p,"listaLayersWMS",funcao); | 7565 | cpJSON.call(p,"listaLayersWMS",funcao); |
7566 | + }, | ||
7567 | + /* | ||
7568 | + Function: buscaRapida | ||
7569 | + | ||
7570 | + PHP: | ||
7571 | + classesphp/funcoes_gerais.php | ||
7572 | + | ||
7573 | + <buscaRapida> | ||
7574 | + */ | ||
7575 | + buscaRapida: function(funcao,locaplic,servico,palavra){ | ||
7576 | + var p = locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=buscaRapida&palavra="+palavra+"&servico="+servico | ||
7577 | + cpJSON.call(p,"buscaRapida",funcao); | ||
7555 | } | 7578 | } |
7556 | }; | 7579 | }; |
7557 | //YAHOO.log("carregou classe php", "Classes i3geo"); | 7580 | //YAHOO.log("carregou classe php", "Classes i3geo"); |
7581 | +/* | ||
7582 | +Title: Utilitários | ||
7583 | + | ||
7584 | +File: i3geo/classesjs/classe_util.js | ||
7585 | + | ||
7586 | +About: Licença | ||
7587 | + | ||
7588 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
7589 | + | ||
7590 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
7591 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
7592 | + | ||
7593 | +Este programa é software livre; você pode redistribuí-lo | ||
7594 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
7595 | +GNU conforme publicada pela Free Software Foundation; | ||
7596 | +tanto a versão 2 da Licença. | ||
7597 | +Este programa é distribuído na expectativa de que seja útil, | ||
7598 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
7599 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
7600 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
7601 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
7602 | +GNU junto com este programa; se não, escreva para a | ||
7603 | +Free Software Foundation, Inc., no endereço | ||
7604 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
7605 | +*/ | ||
7606 | +if(typeof(i3GEO) == 'undefined'){ | ||
7607 | + i3GEO = new Array(); | ||
7608 | +} | ||
7609 | +/* | ||
7610 | +Variable: navm | ||
7611 | + | ||
7612 | +Verdadeiro (true) se o navegador for o Internet Explorer | ||
7613 | +*/ | ||
7614 | +navm = false; | ||
7615 | +/* | ||
7616 | +Variable: navn | ||
7617 | + | ||
7618 | +Verdadeiro (true) se o navegador for o Firefox | ||
7619 | +*/ | ||
7620 | +navn = false; | ||
7621 | +//seta as variáveis navn e navm | ||
7622 | +var app = navigator.appName.substring(0,1); | ||
7623 | +if (app=='N') navn=true; else navm=true; | ||
7624 | +/* | ||
7625 | +Variable: g_operacao | ||
7626 | + | ||
7627 | +Nome da última operação que foi executada. | ||
7628 | + | ||
7629 | +Dependendo do tipo de operação são aplicadas as atualizações necessárias aos componentes do mapa. Por exemplo, redesenha o corpo do mapa, atualiza a lista de temas, etc. | ||
7630 | + | ||
7631 | +Essas operações são controladas pela função ajaxiniciaparametros. | ||
7632 | +*/ | ||
7633 | +g_operacao = ""; | ||
7634 | +/* | ||
7635 | +Variable: g_tipoacao | ||
7636 | + | ||
7637 | +Tipo de ação que está sendo executada. | ||
7638 | +Quando o usuário clica no mapa, essa variável é pesquisada para definir o tipo de operação que deve ser executada. | ||
7639 | +É definida quando o usuário seleciona uma determinada ferramenta do i3Geo. | ||
7640 | +*/ | ||
7641 | +g_tipoacao = "zoomli"; | ||
7642 | +g_postpx = "px"; | ||
7643 | +g_tipotop = "top"; | ||
7644 | +g_tipoleft = "left"; | ||
7645 | +if (navm) | ||
7646 | +{ | ||
7647 | + g_postpx = ""; //utilizado para crossbrowser | ||
7648 | + g_tipotop = "pixelTop"; //utilizado para crossbrowser | ||
7649 | + g_tipoleft = "pixelLeft"; //utilizado para crossbrowser | ||
7650 | +} | ||
7651 | + | ||
7652 | +/* | ||
7653 | +Function: $i | ||
7654 | + | ||
7655 | +Obtém um elemento DOM a partir de seu id | ||
7656 | + | ||
7657 | +Parameters: | ||
7658 | + | ||
7659 | +id - {String} ID do elemento. | ||
7660 | + | ||
7661 | +Returns: | ||
7662 | + | ||
7663 | +{Object} Objeto. | ||
7664 | +*/ | ||
7665 | +$i = function(id) | ||
7666 | +{return document.getElementById(id);}; | ||
7667 | +/* | ||
7668 | +Function: Array.remove() | ||
7669 | + | ||
7670 | +Extende os métodos de um objeto Array, permitindo remover um elemento. | ||
7671 | + | ||
7672 | +*/ | ||
7673 | +Array.prototype.remove=function(s){ | ||
7674 | + try{ | ||
7675 | + var i = this.indexOf(s); | ||
7676 | + if(i != -1) this.splice(i, 1); | ||
7677 | + }catch(e){} | ||
7678 | +}; | ||
7679 | + | ||
7680 | +/* | ||
7681 | +Class: i3GEO.util | ||
7682 | + | ||
7683 | +Utilitários. | ||
7684 | +*/ | ||
7685 | +i3GEO.util = { | ||
7686 | + /* | ||
7687 | + Variable: PINS | ||
7688 | + Elementos IMG criados na função criaPin | ||
7689 | + | ||
7690 | + Type: | ||
7691 | + {Array} | ||
7692 | + */ | ||
7693 | + PINS: new Array(), | ||
7694 | + /* | ||
7695 | + Variable: BOXES | ||
7696 | + Elementos DIV criados na função criaBox | ||
7697 | + | ||
7698 | + Type: | ||
7699 | + {Array} | ||
7700 | + */ | ||
7701 | + BOXES: new Array(), | ||
7702 | + /* | ||
7703 | + Function: escapeURL | ||
7704 | + | ||
7705 | + Converte uma string em uma url válida | ||
7706 | + | ||
7707 | + Parameters: | ||
7708 | + | ||
7709 | + sUrl {String} - url que será convertida | ||
7710 | + | ||
7711 | + Return: | ||
7712 | + | ||
7713 | + Type: | ||
7714 | + {String} | ||
7715 | + */ | ||
7716 | + escapeURL: function(sUrl){ | ||
7717 | + var sUrl = escape(sUrl); | ||
7718 | + var re = new RegExp("%3F", "g"); | ||
7719 | + var sUrl = sUrl.replace(re,'?'); | ||
7720 | + var re = new RegExp("%3D", "g"); | ||
7721 | + var sUrl = sUrl.replace(re,'='); | ||
7722 | + var re = new RegExp("%26", "g"); | ||
7723 | + var sUrl = sUrl.replace(re,'&'); | ||
7724 | + return sUrl; | ||
7725 | + }, | ||
7726 | + /* | ||
7727 | + Function: insereCookie | ||
7728 | + Cria um novo cookie. | ||
7729 | + | ||
7730 | + Parameters: | ||
7731 | + nome - {String} Nome do cookie. | ||
7732 | + | ||
7733 | + valor - (String) Valor do cookie | ||
7734 | + */ | ||
7735 | + insereCookie: function(nome,valor) { | ||
7736 | + document.cookie = nome+"="+valor+";path=/"; | ||
7737 | + }, | ||
7738 | + /* | ||
7739 | + Function: pegaCookie | ||
7740 | + Pega o valor de um cookie. | ||
7741 | + | ||
7742 | + Parameters: | ||
7743 | + nome - {String} Nome do cookie. | ||
7744 | + | ||
7745 | + Returns: | ||
7746 | + (String) - valor do cookie | ||
7747 | + */ | ||
7748 | + pegaCookie: function(nome){ | ||
7749 | + var cookies = document.cookie; | ||
7750 | + var i = cookies.indexOf(nome); | ||
7751 | + if(i == -1) | ||
7752 | + {return null;} | ||
7753 | + var fim = cookies.indexOf(";",i); | ||
7754 | + if (fim == -1) | ||
7755 | + {var fim = cookies.length;} | ||
7756 | + return (unescape(cookies.substring(i,fim))).split("=")[1]; | ||
7757 | + }, | ||
7758 | + /* | ||
7759 | + Function: listaChaves | ||
7760 | + Lista as chaves de um objeto. | ||
7761 | + | ||
7762 | + Parameters: | ||
7763 | + obj - {Object} | ||
7764 | + | ||
7765 | + Return: | ||
7766 | + (Array) - array com as chaves. | ||
7767 | + */ | ||
7768 | + listaChaves: function (obj) { | ||
7769 | + var keys = []; | ||
7770 | + for(var key in obj){ | ||
7771 | + keys.push(key); | ||
7772 | + } | ||
7773 | + return keys; | ||
7774 | + }, | ||
7775 | + /* | ||
7776 | + Function: criaBotaoAplicar | ||
7777 | + Cria um botão flutuante do tipo aplicar. | ||
7778 | + | ||
7779 | + O novo botão é adicionado no DOM com ID "i3geo_aplicar" e posicionado sobre o objeto definido | ||
7780 | + | ||
7781 | + Parameters: | ||
7782 | + | ||
7783 | + nomeFuncao - {String} Nome da função que será executada quando o botão for cllicado | ||
7784 | + | ||
7785 | + titulo - (opcional) {String} Título que será mostrado no botão | ||
7786 | + | ||
7787 | + classe - (opcional) {String} Nome da classe (estilo) que será aplicado ao botão. | ||
7788 | + | ||
7789 | + obj - (opcional) {Objeto} Objeto DOM que foi clicado para provocar a criação do botão. | ||
7790 | + | ||
7791 | + Return: | ||
7792 | + (Object) - Objeto DOM criado. | ||
7793 | + | ||
7794 | + */ | ||
7795 | + criaBotaoAplicar: function (nomeFuncao,titulo,classe,obj) { | ||
7796 | + try{clearTimeout(tempoBotaoAplicar);}catch(e){}; | ||
7797 | + tempoBotaoAplicar = eval("setTimeout('"+nomeFuncao+"\(\)',(i3GEO.configura.tempoAplicar))"); | ||
7798 | + autoRedesenho("reinicia"); | ||
7799 | + if(arguments.length == 1) | ||
7800 | + {var titulo = "Aplicar";} | ||
7801 | + if(arguments.length == 1 || arguments.length == 2) | ||
7802 | + {var classe = "i3geoBotaoAplicar";} | ||
7803 | + if (!document.getElementById("i3geo_aplicar")) | ||
7804 | + { | ||
7805 | + var novoel = document.createElement("input"); | ||
7806 | + novoel.id = 'i3geo_aplicar'; | ||
7807 | + novoel.type = 'button'; | ||
7808 | + novoel.value = titulo; | ||
7809 | + novoel.style.cursor="pointer"; | ||
7810 | + novoel.style.fontSize="10px"; | ||
7811 | + novoel.style.zIndex = 15000; | ||
7812 | + novoel.style.position="absolute"; | ||
7813 | + novoel.style.display="none"; | ||
7814 | + novoel.onmouseover = function(){this.style.display="block";}; | ||
7815 | + novoel.onmouseout = function(){this.style.display="none";}; | ||
7816 | + novoel.className = classe; | ||
7817 | + document.body.appendChild(novoel); | ||
7818 | + } | ||
7819 | + else | ||
7820 | + {var novoel = document.getElementById("i3geo_aplicar");} | ||
7821 | + novoel.onclick = function(){ | ||
7822 | + clearTimeout(i3GEO.parametros.tempo); | ||
7823 | + i3GEO.parametros.tempo = ""; | ||
7824 | + this.style.display='none'; | ||
7825 | + eval(nomeFuncao+"\(\)"); | ||
7826 | + }; | ||
7827 | + //reposiciona o botao | ||
7828 | + if(arguments.length == 4){ | ||
7829 | + novoel.style.display="block"; | ||
7830 | + var xy = YAHOO.util.Dom.getXY(obj); | ||
7831 | + YAHOO.util.Dom.setXY(novoel,xy); | ||
7832 | + } | ||
7833 | + return (novoel); | ||
7834 | + }, | ||
7835 | + /* | ||
7836 | + Function: arvore | ||
7837 | + | ||
7838 | + Cria uma árvore com base em um objeto contendo aspropriedades. | ||
7839 | + | ||
7840 | + Parameters: | ||
7841 | + | ||
7842 | + titulo - {String} cabeçaljo da árvore | ||
7843 | + | ||
7844 | + onde - {String} nome do id doelemento que conterá a árvore | ||
7845 | + | ||
7846 | + obj - {Object} objeto contendo os parâmetros, exemplo | ||
7847 | + | ||
7848 | + g_listaPropriedades = { | ||
7849 | + | ||
7850 | + "propriedades": [ | ||
7851 | + | ||
7852 | + { text: "p2", url: "javascript:tipoimagem()" } | ||
7853 | + | ||
7854 | + ]} | ||
7855 | + | ||
7856 | + */ | ||
7857 | + arvore: function(titulo,onde,obj){ | ||
7858 | + //YAHOO.log("arvore", "i3geo"); | ||
7859 | + if(!$i(onde)){return;} | ||
7860 | + var currentIconMode; | ||
7861 | + try{ | ||
7862 | + arvore = new YAHOO.widget.TreeView(onde); | ||
7863 | + root = arvore.getRoot(); | ||
7864 | + var tempNode = new YAHOO.widget.TextNode('', root, false); | ||
7865 | + tempNode.isLeaf = false; | ||
7866 | + } | ||
7867 | + catch(e){} | ||
7868 | + var titulo = "<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>"; | ||
7869 | + var d = {html:titulo}; | ||
7870 | + var tempNode = new YAHOO.widget.HTMLNode(d, root, true,true); | ||
7871 | + var c = obj.propriedades.length; | ||
7872 | + for (var i=0, j=c; i<j; i++){ | ||
7873 | + var linha = obj.propriedades[i]; | ||
7874 | + var conteudo = "<a href='#' onclick='"+linha.url+"'>"+$trad(linha.text)+"</a>"; | ||
7875 | + var d = {html:conteudo}; | ||
7876 | + var temaNode = new YAHOO.widget.HTMLNode(d, tempNode, false,true); | ||
7877 | + } | ||
7878 | + arvore.collapseAll(); | ||
7879 | + arvore.draw(); | ||
7880 | + //YAHOO.log("Fim arvore", "i3geo"); | ||
7881 | + }, | ||
7882 | + /* | ||
7883 | + Function: removeAcentos | ||
7884 | + | ||
7885 | + Remove acentos de uma palavra ou frase | ||
7886 | + | ||
7887 | + Parameters: | ||
7888 | + | ||
7889 | + palavra {String} | ||
7890 | + | ||
7891 | + Return: | ||
7892 | + | ||
7893 | + {String} | ||
7894 | + */ | ||
7895 | + removeAcentos: function(palavra) { | ||
7896 | + var re = /ã|á|à|â/gi; | ||
7897 | + palavra = palavra.replace(re,"a"); | ||
7898 | + var re = /é/gi; | ||
7899 | + palavra = palavra.replace(re,"e"); | ||
7900 | + var re = /í/gi; | ||
7901 | + palavra = palavra.replace(re,"i"); | ||
7902 | + var re = /ó|õ/gi; | ||
7903 | + palavra = palavra.replace(re,"o"); | ||
7904 | + var re = /ç/gi; | ||
7905 | + palavra = palavra.replace(re,"c"); | ||
7906 | + var re = /ú/gi; | ||
7907 | + palavra = palavra.replace(re,"u"); | ||
7908 | + return(palavra); | ||
7909 | + }, | ||
7910 | + /* | ||
7911 | + Function protocolo | ||
7912 | + | ||
7913 | + Obtém o protocoloutilizado na URL atual | ||
7914 | + | ||
7915 | + Return: | ||
7916 | + | ||
7917 | + {String} - protocolo | ||
7918 | + */ | ||
7919 | + protocolo: function(){ | ||
7920 | + var u = window.location.href; | ||
7921 | + var u = u.split(":"); | ||
7922 | + return (u[0]); | ||
7923 | + }, | ||
7924 | + /* | ||
7925 | + Function: pegaPosicaoObjeto | ||
7926 | + | ||
7927 | + Retorna a posição x,y de um objeto em relação a tela do navegador | ||
7928 | + | ||
7929 | + Parameters: | ||
7930 | + | ||
7931 | + obj {Object} - objeto dom | ||
7932 | + | ||
7933 | + Return: | ||
7934 | + | ||
7935 | + {Array} - array com a posição [x,y] | ||
7936 | + */ | ||
7937 | + pegaPosicaoObjeto: function(obj){ | ||
7938 | + if(obj) | ||
7939 | + { | ||
7940 | + if(!obj.style) | ||
7941 | + {return [0,0];} | ||
7942 | + if(obj.style.position == "absolute") | ||
7943 | + {return [(parseInt(obj.style.left)),(parseInt(obj.style.top))];} | ||
7944 | + else{ | ||
7945 | + var curleft = curtop = 0; | ||
7946 | + if(obj){ | ||
7947 | + if (obj.offsetParent) { | ||
7948 | + do { | ||
7949 | + curleft += obj.offsetLeft-obj.scrollLeft; | ||
7950 | + curtop += obj.offsetTop-obj.scrollTop; | ||
7951 | + } while (obj = obj.offsetParent); | ||
7952 | + } | ||
7953 | + } | ||
7954 | + return [curleft+document.body.scrollLeft,curtop+document.body.scrollTop]; | ||
7955 | + } | ||
7956 | + } | ||
7957 | + else | ||
7958 | + {return [0,0];} | ||
7959 | + }, | ||
7960 | + /* | ||
7961 | + Function: pegaElementoPai | ||
7962 | + | ||
7963 | + Pega o elemento pai de um elemento clicado para identificar o código do tema. | ||
7964 | + | ||
7965 | + Parameters: | ||
7966 | + | ||
7967 | + e - elemento do DOM. | ||
7968 | + | ||
7969 | + Return: | ||
7970 | + | ||
7971 | + {Node} - objeto DOM | ||
7972 | + */ | ||
7973 | + pegaElementoPai: function(e){ | ||
7974 | + var targ; | ||
7975 | + if (!e) | ||
7976 | + {var e = window.event;} | ||
7977 | + if (e.target) | ||
7978 | + {targ = e.target;} | ||
7979 | + else | ||
7980 | + if (e.srcElement) | ||
7981 | + {targ = e.srcElement;} | ||
7982 | + if (targ.nodeType == 3) | ||
7983 | + {targ = targ.parentNode;} | ||
7984 | + var tname; | ||
7985 | + tparent=targ.parentNode; | ||
7986 | + return(tparent); | ||
7987 | + }, | ||
7988 | + /* | ||
7989 | + Function: mudaCursor | ||
7990 | + | ||
7991 | + Altera o cursor do ponteiro do mouse. | ||
7992 | + | ||
7993 | + Os cursores disponíveis são definidos por default em classe_configura.js | ||
7994 | + | ||
7995 | + Parameters: | ||
7996 | + | ||
7997 | + cursores {i3GEO.configura.cursores} - objeto JSON com as URIs de cada cursor (veja i3GEO.configura.cursores) | ||
7998 | + | ||
7999 | + tipo {String} - tipo de cursor disponível em cursores | ||
8000 | + | ||
8001 | + idobjeto {String} - id do objeto que terá o estilo alterado para o cursor desejado | ||
8002 | + | ||
8003 | + locaplic {String} - onde está instalado o i3Geo | ||
8004 | + */ | ||
8005 | + mudaCursor: function(cursores,tipo,idobjeto,locaplic){ | ||
8006 | + var o = document.getElementById(idobjeto); | ||
8007 | + var c = eval("cursores."+tipo+".ie"); | ||
8008 | + if(c == "default" || c == "pointer" || c == "crosshair" || c == "help" || c == "move" || c == "text") | ||
8009 | + o.style.cursor = c; | ||
8010 | + else{ | ||
8011 | + if(o){ | ||
8012 | + if(navm){ | ||
8013 | + o.style.cursor = "URL(\""+locaplic+eval("cursores."+tipo+".ie")+"\"),auto"; | ||
8014 | + } | ||
8015 | + else{ | ||
8016 | + o.style.cursor = "URL(\""+locaplic+eval("cursores."+tipo+".ff")+"\"),auto"; | ||
8017 | + } | ||
8018 | + } | ||
8019 | + } | ||
8020 | + }, | ||
8021 | + /* | ||
8022 | + Function: criaBox | ||
8023 | + | ||
8024 | + Cria um elemento div na página atual. | ||
8025 | + | ||
8026 | + Esse elemento pode ser utilizado para desenhar retângulos sobre o mapa | ||
8027 | + | ||
8028 | + Parameters: | ||
8029 | + | ||
8030 | + id {String} - id do elemento que será criado. Por default, será 'boxg' | ||
8031 | + */ | ||
8032 | + criaBox: function(id){ | ||
8033 | + if(arguments.length == 0) | ||
8034 | + {var id = "boxg"} | ||
8035 | + if (!$i(id)) | ||
8036 | + { | ||
8037 | + var novoel = document.createElement("div"); | ||
8038 | + novoel.id = id; | ||
8039 | + novoel.style.zIndex=1; | ||
8040 | + novoel.innerHTML = '<font face="Arial" size=0></font>'; | ||
8041 | + document.body.appendChild(novoel); | ||
8042 | + //YAHOO.util.Event.addListener($i(id),"mouseover", "this.style.display='none'"); | ||
8043 | + //novoel.onmouseover = eval("$i('"+id+"').style.display='none';"); | ||
8044 | + novoel.onmouseover = function(){novoel.style.display='none';}; | ||
8045 | + novoel.onmouseout = function(){novoel.style.display='block';}; | ||
8046 | + i3GEO.util.BOXES.push(id); | ||
8047 | + } | ||
8048 | + else | ||
8049 | + $i(id).style.display="block"; | ||
8050 | + }, | ||
8051 | + /* | ||
8052 | + Function: escondeBox | ||
8053 | + | ||
8054 | + Esconde os BOXES com IDs registrados em i3GEO.util.BOXES | ||
8055 | + | ||
8056 | + Os ids são criado pela função criaBox | ||
8057 | + */ | ||
8058 | + escondeBox: function(){ | ||
8059 | + var l = i3GEO.util.BOXES.length; | ||
8060 | + for (i=0; i<l; i++){ | ||
8061 | + if($i(i3GEO.util.BOXES[i])) | ||
8062 | + {$i(i3GEO.util.BOXES[i]).style.display = "none";} | ||
8063 | + } | ||
8064 | + }, | ||
8065 | + /* | ||
8066 | + Function: criaPin | ||
8067 | + | ||
8068 | + Cria um elemento imagem na página atual. | ||
8069 | + | ||
8070 | + Esse elemento pode ser utilizado para desenhar pontos sobre o mapa | ||
8071 | + | ||
8072 | + Parameters: | ||
8073 | + | ||
8074 | + id {String} - (opcional) id do elemento que será criado. Por default, será 'boxpin' | ||
8075 | + | ||
8076 | + imagem {URL} - (opcional) endereço da imagem | ||
8077 | + | ||
8078 | + w {String} - (opcional) largura da imagem | ||
8079 | + | ||
8080 | + h {String} - (opcional) altura da imagem | ||
8081 | + */ | ||
8082 | + criaPin: function(id,imagem,w,h){ | ||
8083 | + if(arguments.length < 1 || id == ""){ | ||
8084 | + var id = "boxpin"; | ||
8085 | + } | ||
8086 | + if(arguments.length < 2 || imagem == ""){ | ||
8087 | + var imagem = i3GEO.configura.locaplic+'/imagens/marker.png'; | ||
8088 | + } | ||
8089 | + if(arguments.length < 3 || w == ""){ | ||
8090 | + var w = "21px"; | ||
8091 | + } | ||
8092 | + if(arguments.length < 4 || h == ""){ | ||
8093 | + var h = "25px"; | ||
8094 | + } | ||
8095 | + if (!$i(id)) | ||
8096 | + { | ||
8097 | + var novoel = document.createElement("img"); | ||
8098 | + novoel.id = id; | ||
8099 | + novoel.style.zIndex=10000; | ||
8100 | + novoel.style.position="absolute"; | ||
8101 | + novoel.style.width=w; | ||
8102 | + novoel.style.height=h; | ||
8103 | + novoel.src = imagem; | ||
8104 | + if(id == "boxpin") | ||
8105 | + {novoel.onmouseover = function(){$i("boxpin").style.display="none";};} | ||
8106 | + document.body.appendChild(novoel); | ||
8107 | + i3GEO.util.PINS.push(id); | ||
8108 | + } | ||
8109 | + }, | ||
8110 | + /* | ||
8111 | + Function: posicionaImagemNoMapa | ||
8112 | + | ||
8113 | + Posiciona uma imagem no mapa no local onde o mouse está posicionado sobre o mapa | ||
8114 | + | ||
8115 | + Parameters: | ||
8116 | + | ||
8117 | + id {string} - id do elemento que será posicionado | ||
8118 | + */ | ||
8119 | + posicionaImagemNoMapa: function(id){ | ||
8120 | + var i = $i(id); | ||
8121 | + var mx = parseInt(i.style.width) / 2; | ||
8122 | + var my = parseInt(i.style.height) / 2; | ||
8123 | + i.style.position = "absolute"; | ||
8124 | + i.style.top = objposicaocursor.telay - my; | ||
8125 | + i.style.left = objposicaocursor.telax - mx; | ||
8126 | + }, | ||
8127 | + /* | ||
8128 | + Function: escondePin | ||
8129 | + | ||
8130 | + Esconde os PINS com IDs registrados em i3GEO.util.PINS | ||
8131 | + | ||
8132 | + Os ids são criado pela função criaPin | ||
8133 | + */ | ||
8134 | + escondePin: function(){ | ||
8135 | + var l = i3GEO.util.PINS.length; | ||
8136 | + for (i=0; i<l; i++){ | ||
8137 | + if($i(i3GEO.util.PINS[i])) | ||
8138 | + {$i(i3GEO.util.PINS[i]).style.display = "none";} | ||
8139 | + } | ||
8140 | + }, | ||
8141 | + /* | ||
8142 | + Function: $im ou nome curto $im | ||
8143 | + | ||
8144 | + Retorna o caminho correto de uma imagem incluindo o endereço da aplicação e do visual em uso. | ||
8145 | + | ||
8146 | + Exemplo: $im("imagem.png") | ||
8147 | + | ||
8148 | + Parâmetros: | ||
8149 | + | ||
8150 | + g {String} - nome da imagem | ||
8151 | + | ||
8152 | + Retorno: | ||
8153 | + | ||
8154 | + string - caminho para a imagem | ||
8155 | + */ | ||
8156 | + $im: function(g){ | ||
8157 | + return i3GEO.configura.locaplic+"/imagens/visual/"+i3GEO.configura.visual+"/"+g; | ||
8158 | + }, | ||
8159 | + /* | ||
8160 | + Function $inputText ou nome curto $inputText | ||
8161 | + | ||
8162 | + Cria um elemento html do tipo input text com formatação especial. | ||
8163 | + | ||
8164 | + Parameters: | ||
8165 | + | ||
8166 | + idPai {String} - id do elemento pai do input | ||
8167 | + | ||
8168 | + larguraIdPai {Integer} - largura em pixel | ||
8169 | + | ||
8170 | + idInput {String} - id do objeto input | ||
8171 | + | ||
8172 | + titulo {String} - texto que vai no title | ||
8173 | + | ||
8174 | + digitos {Integer} - numero de dígitos do input | ||
8175 | + | ||
8176 | + valor {String} - valor do input | ||
8177 | + */ | ||
8178 | + $inputText: function(idPai,larguraIdPai,idInput,titulo,digitos,valor) { | ||
8179 | + if(idPai != "") | ||
8180 | + { | ||
8181 | + if(larguraIdPai != "") | ||
8182 | + {$i(idPai).style.width=larguraIdPai+"px";} | ||
8183 | + $i(idPai).style.padding="3"; | ||
8184 | + $i(idPai).style.textAlign="center"; | ||
8185 | + $i(idPai).onmouseover = function() | ||
8186 | + {this.className = "digitarMouseover";}; | ||
8187 | + $i(idPai).onmouseout = function() | ||
8188 | + {this.className = "";}; | ||
8189 | + } | ||
8190 | + var i = "<input onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' onclick='javascript:this.className=\"digitarMouseclick\";' id="+idInput+" title='"+titulo+"' type=text size="+digitos+" class=digitar value='"+valor+"' />"; | ||
8191 | + return i; | ||
8192 | + }, | ||
8193 | + /* | ||
8194 | + Function: $top ou nome curto $top | ||
8195 | + | ||
8196 | + Muda a posição (superior) de um objeto tanto no IE como no Firefox. | ||
8197 | + | ||
8198 | + Exemplo: $top("imagem",100) | ||
8199 | + | ||
8200 | + Parâmetros: | ||
8201 | + | ||
8202 | + id - identificador do objeto | ||
8203 | + | ||
8204 | + valor - posição em relação ao topo. | ||
8205 | + */ | ||
8206 | + $top: function(id,valor){ | ||
8207 | + if (document.getElementById(id).style){ | ||
8208 | + if (document.getElementById(id).style.pixelTop) | ||
8209 | + {document.getElementById(id).style.pixelTop=valor;} | ||
8210 | + else | ||
8211 | + {document.getElementById(id).style.top=valor+"px";} | ||
8212 | + } | ||
8213 | + }, | ||
8214 | + /* | ||
8215 | + Function: $left ou nome curto $left | ||
8216 | + | ||
8217 | + Muda a posição (esquerda) de um objeto tanto no IE como no Firefox. | ||
8218 | + | ||
8219 | + Exemplo: $left("imagem",100) | ||
8220 | + | ||
8221 | + Parâmetros: | ||
8222 | + | ||
8223 | + id - identificador do objeto | ||
8224 | + | ||
8225 | + valor - posição em relação a esquerda. | ||
8226 | + */ | ||
8227 | + $left: function(id,valor){ | ||
8228 | + if (document.getElementById(id).style){ | ||
8229 | + if (document.getElementById(id).style.pixelLeft) | ||
8230 | + {document.getElementById(id).style.pixelLeft=valor;} | ||
8231 | + else | ||
8232 | + {document.getElementById(id).style.left=valor+"px";} | ||
8233 | + } | ||
8234 | + }, | ||
8235 | + /* | ||
8236 | + Function: insereMarca | ||
8237 | + | ||
8238 | + Insere ou remove pontos no mapa. | ||
8239 | + */ | ||
8240 | + insereMarca:{ | ||
8241 | + /* | ||
8242 | + Variable: CONTAINER | ||
8243 | + | ||
8244 | + Armazena o valor do ID do div criado para inserir pontos | ||
8245 | + | ||
8246 | + Type: | ||
8247 | + {Array} | ||
8248 | + */ | ||
8249 | + CONTAINER: new Array(), | ||
8250 | + /* | ||
8251 | + Function: cria | ||
8252 | + | ||
8253 | + Insere um ponto no mapa | ||
8254 | + | ||
8255 | + Os pontos são inseridos em um contaier de pontos e mostrados temporáriamente | ||
8256 | + | ||
8257 | + Parameters: | ||
8258 | + | ||
8259 | + xi {Numeric} - coordenada x. | ||
8260 | + | ||
8261 | + yi {Numeric} - coordenada y. | ||
8262 | + | ||
8263 | + funcaoOnclick {String} - funcao que sera executada quando a marca | ||
8264 | + for clicada, se for "", o container será esvaziado ao ser clicado na marca | ||
8265 | + | ||
8266 | + container {String} - id do container que receberá os pontos | ||
8267 | + */ | ||
8268 | + cria:function(xi,yi,funcaoOnclick,container){ | ||
8269 | + try{ | ||
8270 | + if(i3GEO.util.insereMarca.CONTAINER.toString().search(container) < 0) | ||
8271 | + i3GEO.util.insereMarca.CONTAINER.push(container); | ||
8272 | + //verifica se existe o container para os pontos | ||
8273 | + if (!$i(container)){ | ||
8274 | + var novoel = document.createElement("div"); | ||
8275 | + novoel.id = container; | ||
8276 | + var i = novoel.style; | ||
8277 | + i.position = "absolute"; | ||
8278 | + i.top = parseInt($i("img").style.top); | ||
8279 | + i.left = parseInt($i("img").style.left); | ||
8280 | + document.body.appendChild(novoel); | ||
8281 | + } | ||
8282 | + var container = $i(container); | ||
8283 | + var novoel = document.createElement("div"); | ||
8284 | + var i = novoel.style; | ||
8285 | + i.position = "absolute"; | ||
8286 | + i.zIndex=2000; | ||
8287 | + i.top=(yi - 4)+"px"; | ||
8288 | + i.left=(xi - 4)+"px"; | ||
8289 | + i.width="4px"; | ||
8290 | + i.height="4px"; | ||
8291 | + var novoimg = document.createElement("img"); | ||
8292 | + if (funcaoOnclick != "") | ||
8293 | + {novoimg.onclick = funcaoOnclick;} | ||
8294 | + else | ||
8295 | + {novoimg.onclick=function(){i3GEO.util.insereMarca.limpa();}} | ||
8296 | + novoimg.src=i3GEO.configura.locaplic+"/imagens/dot1.gif"; | ||
8297 | + with (novoimg.style){width="6px";height="6px";zIndex=2000;} | ||
8298 | + novoel.appendChild(novoimg); | ||
8299 | + container.appendChild(novoel); | ||
8300 | + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()") < 0) | ||
8301 | + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()");} | ||
8302 | + } | ||
8303 | + catch(e){alert("Ocorreu um erro. inseremarca"+e);} | ||
8304 | + }, | ||
8305 | + limpa: function(){ | ||
8306 | + try{ | ||
8307 | + var n = i3GEO.util.insereMarca.CONTAINER.length; | ||
8308 | + for(i=0;i<n;i++){ | ||
8309 | + if($i(i3GEO.util.insereMarca.CONTAINER[i])) | ||
8310 | + $i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML = ""; | ||
8311 | + } | ||
8312 | + i3GEO.util.insereMarca.CONTAINER = new Array(); | ||
8313 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()"); | ||
8314 | + } | ||
8315 | + catch(e){} | ||
8316 | + } | ||
8317 | + }, | ||
8318 | + /* | ||
8319 | + Function: adicionaSHP | ||
8320 | + | ||
8321 | + Inclui um arquivo shapefile no mapa atual como uma nova camada | ||
8322 | + | ||
8323 | + Parameters: | ||
8324 | + | ||
8325 | + path {String} - caminho completo do shapefile | ||
8326 | + */ | ||
8327 | + adicionaSHP: function(path){ | ||
8328 | + i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); | ||
8329 | + var temp = path.split("."); | ||
8330 | + if ((temp[1] == "SHP") || (temp[1] == "shp")) | ||
8331 | + {i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path);} | ||
8332 | + else | ||
8333 | + {i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path);} | ||
8334 | + }, | ||
8335 | + /* | ||
8336 | + Function: abreCor | ||
8337 | + | ||
8338 | + Abre a janela flutuante para escolha de uma cor | ||
8339 | + | ||
8340 | + Parameters: | ||
8341 | + | ||
8342 | + janela {String} - id do conteúdo da janela flutuante que chamou a função | ||
8343 | + | ||
8344 | + elemento {String} - id do elemento que receberá os valores da cor selecionada | ||
8345 | + */ | ||
8346 | + abreCor: function(janela,elemento){ | ||
8347 | + i3GEO.janela.cria("400","240",i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janela+"&elemento="+elemento,"","","Cor","i3geo_janelaCor",true); | ||
8348 | + }, | ||
8349 | + /* | ||
8350 | + Function: ajaxhttp | ||
8351 | + | ||
8352 | + Cria o objeto XMLHttpRequest para uso com funções próprias de chamada em ajax | ||
8353 | + | ||
8354 | + O uso dessa função não é recomendado. Dê preferência para uso da chamada ajax via YUI | ||
8355 | + | ||
8356 | + Return: | ||
8357 | + | ||
8358 | + {XMLHttpRequest} | ||
8359 | + */ | ||
8360 | + ajaxhttp: function(){ | ||
8361 | + try | ||
8362 | + {var objhttp1 = new XMLHttpRequest();} | ||
8363 | + catch(ee){ | ||
8364 | + try{var objhttp1 = new ActiveXObject("Msxml2.XMLHTTP");} | ||
8365 | + catch(e){ | ||
8366 | + try{var objhttp1 = new ActiveXObject("Microsoft.XMLHTTP");} | ||
8367 | + catch(E) | ||
8368 | + {var objhttp1 = false;} | ||
8369 | + } | ||
8370 | + } | ||
8371 | + return(objhttp1); | ||
8372 | + }, | ||
8373 | + /* | ||
8374 | + Function: ajaxexecASXml | ||
8375 | + | ||
8376 | + Executa uma chamada ajax no modo assíncrono retornando o resultado em XML. | ||
8377 | + | ||
8378 | + Parameters: | ||
8379 | + | ||
8380 | + programa {String} - URL do programa que será executado no servidor. | ||
8381 | + funcao {funcao} - função que tratará o resultado. | ||
8382 | + | ||
8383 | + Returns: | ||
8384 | + | ||
8385 | + O resultado em um objeto DOM. Se o retorno contiver a palavra "Erro", é gerado um alert. | ||
8386 | + */ | ||
8387 | + ajaxexecASXml: function(programa,funcao){ | ||
8388 | + if (programa.search("http") == 0){ | ||
8389 | + var h = window.location.host; | ||
8390 | + if (programa.search(h) < 0){ | ||
8391 | + alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php"); | ||
8392 | + return; | ||
8393 | + } | ||
8394 | + } | ||
8395 | + var ohttp = i3GEO.util.ajaxhttp(); | ||
8396 | + ohttp.open("GET",programa,true); | ||
8397 | + var retorno = ""; | ||
8398 | + ohttp.onreadystatechange=function(){ | ||
8399 | + if (ohttp.readyState==4){ | ||
8400 | + var retorno = ohttp.responseText; | ||
8401 | + if (retorno != undefined){ | ||
8402 | + if (document.implementation.createDocument){ | ||
8403 | + var parser = new DOMParser(); | ||
8404 | + var dom = parser.parseFromString(retorno, "text/xml"); | ||
8405 | + } | ||
8406 | + else{ | ||
8407 | + var dom = new ActiveXObject("Microsoft.XMLDOM"); | ||
8408 | + dom.async="false"; | ||
8409 | + dom.load(programa); | ||
8410 | + } | ||
8411 | + } | ||
8412 | + else | ||
8413 | + {var dom = "erro";} | ||
8414 | + if (funcao != "volta") | ||
8415 | + {eval(funcao+'(dom)');} | ||
8416 | + else | ||
8417 | + {return dom;} | ||
8418 | + } | ||
8419 | + }; | ||
8420 | + ohttp.send(null); | ||
8421 | + }, | ||
8422 | + /* | ||
8423 | + Function: aparece | ||
8424 | + | ||
8425 | + Aplica efeito de aparecimento suave de um objetov | ||
8426 | + | ||
8427 | + Parameters: | ||
8428 | + | ||
8429 | + id {String} - id do objeto | ||
8430 | + | ||
8431 | + tempo {Integer} - tempo em milesegundos que levará o efeito | ||
8432 | + | ||
8433 | + intervalo {Integer} - intervalo entre uma imagem e outra | ||
8434 | + */ | ||
8435 | + aparece: function(id,tempo,intervalo){ | ||
8436 | + var n = parseInt(tempo / intervalo); | ||
8437 | + var tempo = n * intervalo; | ||
8438 | + var intervalo = (intervalo * 100) / tempo; | ||
8439 | + var obj = $i(id); | ||
8440 | + var opacidade = 0; | ||
8441 | + if (navm) | ||
8442 | + {obj.style.filter='alpha(opacity=0)';} | ||
8443 | + else | ||
8444 | + {obj.style.opacity= 0;} | ||
8445 | + obj.style.display = "block"; | ||
8446 | + var fadei = function(){ | ||
8447 | + opacidade += intervalo; | ||
8448 | + if (navm) | ||
8449 | + {obj.style.filter='alpha(opacity='+opacidade+')';} | ||
8450 | + else | ||
8451 | + {obj.style.opacity= opacidade/100;} | ||
8452 | + if(opacidade < 100) | ||
8453 | + var tempoFade = setTimeout(fadei, tempo); | ||
8454 | + else{ | ||
8455 | + clearTimeout(tempoFadei); | ||
8456 | + if (navm) | ||
8457 | + {obj.style.filter='alpha(opacity=100)';} | ||
8458 | + else | ||
8459 | + {obj.style.opacity= 1;} | ||
8460 | + } | ||
8461 | + }; | ||
8462 | + var tempoFadei = setTimeout(fadei, tempo); | ||
8463 | + }, | ||
8464 | + /* | ||
8465 | + Function: desaparece | ||
8466 | + | ||
8467 | + Aplica efeito de desaparecimento suave de um objeto | ||
8468 | + | ||
8469 | + Parameters: | ||
8470 | + | ||
8471 | + id {String} - id do objeto | ||
8472 | + | ||
8473 | + tempo {Integer} - tempo em milesegundos que levará o efeito | ||
8474 | + | ||
8475 | + intervalo {Integer} - intervalo entre uma imagem e outra | ||
8476 | + | ||
8477 | + removeobj {Boolean} - remove ou não o objeto no final | ||
8478 | + */ | ||
8479 | + desaparece: function(id,tempo,intervalo,removeobj){ | ||
8480 | + var n = parseInt(tempo / intervalo); | ||
8481 | + var tempo = n * intervalo; | ||
8482 | + var intervalo = (intervalo * 100) / tempo; | ||
8483 | + var obj = $i(id); | ||
8484 | + var opacidade = 100; | ||
8485 | + if (navm) | ||
8486 | + {obj.style.filter='alpha(opacity=100)';} | ||
8487 | + else | ||
8488 | + {obj.style.opacity= 1;} | ||
8489 | + obj.style.display = "block"; | ||
8490 | + var fade = function(){ | ||
8491 | + opacidade -= intervalo; | ||
8492 | + if (navm) | ||
8493 | + {obj.style.filter='alpha(opacity='+opacidade+')';} | ||
8494 | + else | ||
8495 | + {obj.style.opacity= opacidade/100;} | ||
8496 | + if(opacidade > 0){ | ||
8497 | + var tempoFade = setTimeout(fade, tempo); | ||
8498 | + } | ||
8499 | + else{ | ||
8500 | + clearTimeout(tempoFade); | ||
8501 | + obj.style.display = "none"; | ||
8502 | + if (navm) | ||
8503 | + {obj.style.filter='alpha(opacity=100)';} | ||
8504 | + else | ||
8505 | + {obj.style.opacity= 1;} | ||
8506 | + if(removeobj){ | ||
8507 | + var p = obj.parentNode; | ||
8508 | + if(p) | ||
8509 | + p.removeChild(obj); | ||
8510 | + } | ||
8511 | + } | ||
8512 | + }; | ||
8513 | + var tempoFade = setTimeout(fade, tempo); | ||
8514 | + }, | ||
8515 | + /* | ||
8516 | + Function: wkt2ext | ||
8517 | + | ||
8518 | + Calcula a extensão geográfica de uma geometria fornecida no formato WKT | ||
8519 | + | ||
8520 | + Parameters: | ||
8521 | + | ||
8522 | + wkt {String} - geometria no formato wkt | ||
8523 | + | ||
8524 | + tipo {String} - tipo de geometria (polygon,point,line) | ||
8525 | + | ||
8526 | + Return: | ||
8527 | + | ||
8528 | + {String} - extensão geográfica (xmin ymin xmax ymax) | ||
8529 | + */ | ||
8530 | + wkt2ext:function(wkt,tipo){ | ||
8531 | + var tipo = tipo.toLowerCase(); | ||
8532 | + ext = false; | ||
8533 | + if(tipo == "polygon"){ | ||
8534 | + try{ | ||
8535 | + var re = new RegExp("POLYGON", "g"); | ||
8536 | + var wkt = wkt.replace(re,""); | ||
8537 | + var wkt = wkt.split("(")[2].split(")")[0]; | ||
8538 | + var wkt = wkt.split(","); | ||
8539 | + var x = new Array(); | ||
8540 | + var y = new Array(); | ||
8541 | + for (w=0;w<wkt.length; w++){ | ||
8542 | + var temp = wkt[w].split(" "); | ||
8543 | + x.push(temp[0]); | ||
8544 | + y.push(temp[1]); | ||
8545 | + } | ||
8546 | + x.sort(i3GEO.util.sortNumber); | ||
8547 | + var xMin = x[0]; | ||
8548 | + var xMax = x[(x.length)-1]; | ||
8549 | + y.sort(i3GEO.util.sortNumber); | ||
8550 | + var yMin = y[0]; | ||
8551 | + var yMax = y[(y.length)-1]; | ||
8552 | + return xMin+" "+yMin+" "+xMax+" "+yMax; | ||
8553 | + } | ||
8554 | + catch(e){} | ||
8555 | + } | ||
8556 | + return ext; | ||
8557 | + }, | ||
8558 | + /* | ||
8559 | + Function: sortNumber | ||
8560 | + | ||
8561 | + Ordena um array contendo números. Deve ser usado como parâmetro do método "sort", exemplo | ||
8562 | + | ||
8563 | + y.sort(i3GEO.util.sortNumber), onde y é um array de números | ||
8564 | + */ | ||
8565 | + sortNumber: function(a,b){ | ||
8566 | + return a - b; | ||
8567 | + } | ||
8568 | +}; | ||
8569 | +// | ||
8570 | +//alias | ||
8571 | +// | ||
8572 | +$im = function(g){ | ||
8573 | + return i3GEO.util.$im(g); | ||
8574 | +}; | ||
8575 | +$inputText = function(idPai,larguraIdPai,idInput,titulo,digitos,valor){ | ||
8576 | + return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor); | ||
8577 | +}; | ||
8578 | +$top = function(id,valor){ | ||
8579 | + i3GEO.util.$top(id,valor); | ||
8580 | +}; | ||
8581 | +$left = function(id,valor){ | ||
8582 | + i3GEO.util.$left(id,valor); | ||
8583 | +}; | ||
8584 | +//YAHOO.log("carregou classe util", "Classes i3geo"); | ||
7558 | 8585 | ||
7559 | <?php if(extension_loaded('zlib')){ob_end_flush();}?> | 8586 | <?php if(extension_loaded('zlib')){ob_end_flush();}?> |
7560 | \ No newline at end of file | 8587 | \ No newline at end of file |
menutemas/admin.db
No preview for this file type