From c2cc08f291abd2ab0a4b2ce8fc3275f1cd539cbd Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 26 Sep 2007 12:16:06 +0000 Subject: [PATCH] Nova opção de iniciallização da interface que possibilita a inicialização do i3geo diretamente do html, sem passar primeiro pelo ms_criamapa.php. Veja no diretório exemplos a interface mashup.htm. Os parâmetros de inicialização podem ser passados como uma variável de inicialização javascript. Os htmls das interfaces existentes foram revistos acrescentando-se o id=i3geo no elemento DOM onde o mapa será inserido. --- aplicmap/admin.htm | 2 +- aplicmap/geral.htm | 15 ++++++++++++++- aplicmap/geral3.htm | 466 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- aplicmap/minima.htm | 2 +- aplicmap/openlayers.htm | 4 ++-- aplicmap/simples.php | 2 +- aplicmap/simples1.htm | 2 +- aplicmap/simples2.htm | 2 +- classesjs/funcoes.js | 38 +++++++++++++++++++++++++++----------- classesjs/funcoes_compacto.js | 25 ++++++++++++++----------- classesjs/i3geo_tudo_compacto.js | 42 +++++++++++++++++++++++++++--------------- classesjs/iniciamma.js | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- classesjs/iniciamma_compacto.js | 17 +++++++++++++---- classesphp/mapa_controle.php | 35 ++++++++++++++++++++++++----------- exemplos/atlas/mapa.htm | 2 +- exemplos/mashup.htm | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ms_configura.php | 2 +- ms_criamapa.php | 33 ++++++++++++++++++--------------- 18 files changed, 402 insertions(+), 546 deletions(-) delete mode 100644 aplicmap/geral3.htm create mode 100644 exemplos/mashup.htm diff --git a/aplicmap/admin.htm b/aplicmap/admin.htm index b60b7ba..01207c5 100644 --- a/aplicmap/admin.htm +++ b/aplicmap/admin.htm @@ -11,7 +11,7 @@ --> - +
diff --git a/aplicmap/geral.htm b/aplicmap/geral.htm index e40a33d..3ac9d1e 100644 --- a/aplicmap/geral.htm +++ b/aplicmap/geral.htm @@ -13,7 +13,7 @@ arquivos não compactados, bastando substituir por i3geonaocompacto --> --> - +
@@ -400,6 +400,19 @@ g_3dmap = "3dmap.map"; g_embedLegenda = "nao"; */ + +/* +Variable: g_mashuppar + +Parâmetros de inicialização que podem ser utilizados na interface mashup. + +Os parâmetros são os mesmos que podem ser utilizados quando o i3geo é inicializado pelo ms_criamapa.php. + +Exemplo: g_mashuppar = "&pontos=-54 -12&temasa=biomas&layers=biomas" + +g_mashuppar = "&mapext=-53 -26 -42 -18"; +*/ + /* Variable: g_mensagempadrao diff --git a/aplicmap/geral3.htm b/aplicmap/geral3.htm deleted file mode 100644 index 127ea93..0000000 --- a/aplicmap/geral3.htm +++ /dev/null @@ -1,466 +0,0 @@ - - - - - -MMA - Mapa interativo - - - - - - - - -
-
- - - - - - - - - - - - - - - -Críticas e sugestões -
- - - - - - - - \ No newline at end of file diff --git a/aplicmap/minima.htm b/aplicmap/minima.htm index 6ecfb72..17e624e 100644 --- a/aplicmap/minima.htm +++ b/aplicmap/minima.htm @@ -14,7 +14,7 @@ arquivos não compactados, bastando substituir por i3geonaocompacto --> --> - +
diff --git a/aplicmap/openlayers.htm b/aplicmap/openlayers.htm index 364f2b5..60829e5 100644 --- a/aplicmap/openlayers.htm +++ b/aplicmap/openlayers.htm @@ -19,7 +19,7 @@ --> - +
@@ -166,7 +166,7 @@ function criaOL(posfixo) objposicaocursor.ddy = lonlat.lat; objposicaocursor.telax = p.x; objposicaocursor.telay = p.y; - var dc = $i("corpo"); + var dc = $i("i3geo"); if ($i("openlayers_OpenLayers_Container")){var dc = $i("openlayers_OpenLayers_Container");} while (dc.offsetParent) { diff --git a/aplicmap/simples.php b/aplicmap/simples.php index b63fbca..4e86656 100644 --- a/aplicmap/simples.php +++ b/aplicmap/simples.php @@ -11,7 +11,7 @@ echo ' - +
diff --git a/aplicmap/simples1.htm b/aplicmap/simples1.htm index d1f19a9..bdf83c5 100644 --- a/aplicmap/simples1.htm +++ b/aplicmap/simples1.htm @@ -14,7 +14,7 @@ arquivos não compactados, bastando substituir por i3geonaocompacto --> --> - +
diff --git a/aplicmap/simples2.htm b/aplicmap/simples2.htm index 7abac2c..ed56953 100644 --- a/aplicmap/simples2.htm +++ b/aplicmap/simples2.htm @@ -14,7 +14,7 @@ arquivos não compactados, bastando substituir por i3geonaocompacto --> --> - +
diff --git a/classesjs/funcoes.js b/classesjs/funcoes.js index 0b67239..9c1feb2 100644 --- a/classesjs/funcoes.js +++ b/classesjs/funcoes.js @@ -917,7 +917,7 @@ function aguarde() eval ('YAHOO.aguarde.'+aguardeId+' = new YAHOO.widget.Panel("wait",{width:"240px",fixedcenter:false,underlay:"matte",close:false,draggable:false,modal:false})'); eval ('YAHOO.aguarde.'+aguardeId+'.setBody(""+texto+" ")'); eval ('YAHOO.aguarde.'+aguardeId+'.render(document.body)'); - eval ('YAHOO.aguarde.'+aguardeId+'.moveTo(0,0)'); + eval ('YAHOO.aguarde.'+aguardeId+'.moveTo('+imagemxi+','+imagemyi+')'); eval('YAHOO.aguarde.'+aguardeId+'.show()'); } this.fecha = function(aguardeId) @@ -970,8 +970,14 @@ function ativaClicks(docMapa) var ny = objposicaocursor.telay - topinicial - clicinicialy; if (g_entorno == "nao") { - $i("img").style.left = nx; - $i("img").style.top = ny; + var l = 0; + if (parseInt($i("i3geo").style.left)) + {var l = parseInt($i("i3geo").style.left);} + $i("img").style.left = nx - l; + var t = 0; + if (parseInt($i("i3geo").style.top)) + {var t = parseInt($i("i3geo").style.top);} + $i("img").style.top = ny - t; } else { @@ -1429,10 +1435,12 @@ function mudaboxnf(tipo) } if (navn) { + var l = objposicaomouse.x; + var t = objposicaomouse.y+document.body.scrollTop; with ($i("aplicari").style) { - left = objposicaomouse.x; - top = objposicaomouse.y+document.body.scrollTop; + left = l; + top = t; } } } @@ -2731,7 +2739,7 @@ function remapaf() Section: eventos */ /* -Function: processevent1 +Function: processevent1 (depreciado) Captura a posição do mouse tendo como referência o navegador. @@ -2746,6 +2754,7 @@ exy1 - objeto evento. function processevent1(exy1) { //detec�o do navegador + /* navm = false; // IE navn = false; // netscape var app = navigator.appName.substring(0,1); @@ -2761,6 +2770,7 @@ function processevent1(exy1) objposicaomouse.x = window.event.clientX; objposicaomouse.y = window.event.clientY; } + */ } /* Function: calcposf @@ -2775,32 +2785,38 @@ function calcposf() imagemyi = 0; imagemxref = 0; //posicao da tag ref imagemyref = 0; - if(!$i("corpo")){return;} - var dc = $i("corpo"); + if(!$i("i3geo")){return;} + if ($i("i3geo").style.left){imagemxi += parseInt($i("i3geo").style.left);} + if ($i("i3geo").style.top){imagemyi += parseInt($i("i3geo").style.top);} + var dc = $i("i3geo"); if ($i("img")) {var dc = $i("contemImg");} if ($i("openlayers_OpenLayers_Container")) {var dc = $i("openlayers_OpenLayers_Container");} - while (dc.offsetParent) + while ((dc.offsetParent) && (dc.offsetParent.id != "i3geo")) { dc = dc.offsetParent; imagemxi = imagemxi + dc.offsetLeft; imagemyi = imagemyi + dc.offsetTop; } + if ($i("img")) { $left("corpoMapa",imagemxi); $top("corpoMapa",imagemyi); + if ($i("i3geo").style.left){$left("corpoMapa",imagemxi - parseInt($i("i3geo").style.left));} + if ($i("i3geo").style.top){$top("corpoMapa",imagemyi - parseInt($i("i3geo").style.top));} } if ($i("mostradistancia")) { $left("mostradistancia",imagemxi); $top("mostradistancia",imagemyi); } + if ($i("ref")) { var dc = $i("ref"); - while (dc.offsetParent.id != "corpo") + while (dc.offsetParent.id != "i3geo") { dc = dc.offsetParent; imagemxref = imagemxref + dc.offsetLeft; @@ -2880,7 +2896,7 @@ function capturaposicao(exy) var xreffig = e.clientX - imagemxref + document.body.scrollLeft; var yreffig = e.clientY - imagemyref + document.body.scrollTop; } - var teladd = calcddf (xfig,yfig,g_celula,objmapa.extent); + var teladd = calcddf(xfig,yfig,g_celula,objmapa.extent); var teladms = convdmsf(teladd[0],teladd[1]); with(objposicaocursor) { diff --git a/classesjs/funcoes_compacto.js b/classesjs/funcoes_compacto.js index ed9bc8f..c1fab6f 100644 --- a/classesjs/funcoes_compacto.js +++ b/classesjs/funcoes_compacto.js @@ -88,7 +88,7 @@ function mostraferramenta(guia){ if($i("ferr"+guia)){ var fs=[1,2,3,4,5,6,7,8,9, $i("ferr"+guia).style.backgroundColor="rgb(255,255,255)"; if($i("ferr"+guia+"obj")){$i("ferr"+guia+"obj").style.display="block";} else{alert("O objeto ferr"+guia+"obj nao existe.");}}} function borra(tipo){ } -function aguarde(){ this.abre=function(aguardeId,texto){ YAHOO.namespace("aguarde"); eval('YAHOO.aguarde.'+aguardeId+'=new YAHOO.widget.Panel("wait",{width:"240px",fixedcenter:false,underlay:"matte",close:false,draggable:false,modal:false})'); eval('YAHOO.aguarde.'+aguardeId+'.setBody(""+texto+" ")'); eval('YAHOO.aguarde.'+aguardeId+'.render(document.body)'); eval('YAHOO.aguarde.'+aguardeId+'.moveTo(0,0)'); eval('YAHOO.aguarde.'+aguardeId+'.show()');} +function aguarde(){ this.abre=function(aguardeId,texto){ YAHOO.namespace("aguarde"); eval('YAHOO.aguarde.'+aguardeId+'=new YAHOO.widget.Panel("wait",{width:"240px",fixedcenter:false,underlay:"matte",close:false,draggable:false,modal:false})'); eval('YAHOO.aguarde.'+aguardeId+'.setBody(""+texto+" ")'); eval('YAHOO.aguarde.'+aguardeId+'.render(document.body)'); eval('YAHOO.aguarde.'+aguardeId+'.moveTo('+imagemxi+','+imagemyi+')'); eval('YAHOO.aguarde.'+aguardeId+'.show()');} this.fecha=function(aguardeId){ if(eval('YAHOO.aguarde.'+aguardeId)){ eval('YAHOO.aguarde.'+aguardeId+'.destroy()');}} } function ativaClicks(docMapa){ docMapa.onmouseover=function(){ if($i("imgh")){$i("imgh").style.display="block";} @@ -98,7 +98,9 @@ function ativaClicks(docMapa){ docMapa.onmouseover=function(){ if($i("imgh")){$i this.onmousemove=function(exy){ if($i("tip")){$i("tip").style.display="none";} capturaposicao(exy); if(g_destaca !=""){$i("imgh").style.display="none";$i("div_d").style.clip='rect('+(objposicaocursor.imgy-destacaTamanho)+" "+(objposicaocursor.imgx-10)+" "+(objposicaocursor.imgy-10)+" "+(objposicaocursor.imgx-destacaTamanho)+')';} if(g_realca=="sim"){ $i("areaRealce").style.left=objposicaocursor.telax-destacaTamanho+10; $i("areaRealce").style.top=objposicaocursor.telay-destacaTamanho+10;} - if($i("img")&&(g_panM=="sim")){ var nx=objposicaocursor.telax-leftinicial-clicinicialx; var ny=objposicaocursor.telay-topinicial-clicinicialy; if(g_entorno=="nao"){ $i("img").style.left=nx; $i("img").style.top=ny;} + if($i("img")&&(g_panM=="sim")){ var nx=objposicaocursor.telax-leftinicial-clicinicialx; var ny=objposicaocursor.telay-topinicial-clicinicialy; if(g_entorno=="nao"){ var l=0; if(parseInt($i("i3geo").style.left)){var l=parseInt($i("i3geo").style.left);} + $i("img").style.left=nx-l; var t=0; if(parseInt($i("i3geo").style.top)){var t=parseInt($i("i3geo").style.top);} + $i("img").style.top=ny-t;} else{ $left("img",objmapa.w*-1+nx); $left("imgS",objmapa.w*-1+nx); $left("imgL",objmapa.w+nx); $left("imgO",objmapa.w*-3+nx); $left("imgN",objmapa.w*-1+nx); $top("img",objmapa.h*-1+ny); $top("imgS",objmapa.h*-1+ny); $top("imgL",objmapa.h*-1+ny); $top("imgN",objmapa.h*-1+ny); $top("imgO",objmapa.h*-1+ny);}} movecursor(); if($i("longlat")){$i("longlat").innerHTML=objposicaocursor.dmsx+" "+objposicaocursor.dmsy;} if(g_tipoacao=="mede"){ $i("mostradistancia").style.display="block"; var n=pontosdistobj.xpt.length; if(n > 0){ var d=calculadistancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); if(objmapa.scale > 500000){ var d=parseInt(d);} @@ -157,7 +159,7 @@ function initJanelaRef(){ if(!$i("winRef")){ var novoel=document.createElement(" var escondeRef=function(){ YAHOO.util.Event.removeListener(YAHOO.janelaRef.xp.panel.close, "click"); YAHOO.janelaRef.xp.panel.destroy(); iCookie("g_mapaRefDisplay","none");} YAHOO.util.Event.addListener(YAHOO.janelaRef.xp.panel.close, "click", escondeRef); iCookie("g_mapaRefDisplay","block"); objmapa.atualizaReferencia();} function mudaboxnf(tipo){ g_operacao=tipo; clearTimeout(objmapa.tempo); objmapa.tempo=setTimeout('remapaf()',(4000)); autoRedesenho("reinicia"); if($i("aplicari")){ $i("aplicari").style.display="block"; if(navm){ mx=objposicaomouse.x-10; my=objposicaomouse.y-15; with($i("aplicari").style){ pixelLeft=mx+document.body.scrollLeft; pixelTop=my+document.body.scrollTop;}} - if(navn){ with($i("aplicari").style){ left=objposicaomouse.x; top=objposicaomouse.y+document.body.scrollTop;}}}} + if(navn){ var l=objposicaomouse.x; var t=objposicaomouse.y+document.body.scrollTop; with($i("aplicari").style){ left=l; top=t;}}}} function movelentef(){ if($i("lente")){ if($i("lente").style.visibility=="visible"){ var esq=(objposicaocursor.telax-imagemxi)*2.25; var topo=(objposicaocursor.telay-imagemyi)*2.25; var clipt="rect("+(topo-40)+" "+(esq+40)+" "+(topo+40)+" "+(esq-40)+")"; with($i("lente").style){ clip=clipt; eval(g_tipotop+"=(imagemyi-(topo-40))+g_postpx"); eval(g_tipoleft+"=(imagemxi-(esq-40))+g_postpx");}}}} function zoomiauto(){ objaguarde.abre("ajaxredesenha","Aguarde..."); g_fatordezoom=0; var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=aproxima&nivel=2&g_sid="+g_sid; var cp=new cpaint(); cp.set_response_type("JSON"); g_operacao="navega"; cp.call(p,"aproxima",ajaxredesenha);} function zoomoauto(){ objaguarde.abre("ajaxredesenha","Aguarde..."); g_fatordezoom=0; var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=afasta&nivel=2&g_sid="+g_sid; var cp=new cpaint(); cp.set_response_type("JSON"); g_operacao="navega"; cp.call(p,"afasta",ajaxredesenha);} @@ -294,16 +296,17 @@ function remapaf(){ clearTimeout(objmapa.tempo); objmapa.tempo=""; objmapa.temaA if((tsd.length > 0)||(tsl.length > 0)){ objaguarde.abre("remapa","Aguarde...refazendo o mapa"); var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=ligatemas&desligar="+(tsd.toString())+"&ligar="+(tsl.toString())+"&g_sid="+g_sid; var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(p,"ligaDesligaTemas",remapaAdicNovos);} else{remapaAdicNovos();}} else{remapaAdicNovos();}} -function processevent1(exy1){ navm=false; navn=false; var app=navigator.appName.substring(0,1); if(app=='N')navn=true;else navm=true; if($i("img")){calcposf();} - if(navn){ objposicaomouse.x=exy1.clientX; objposicaomouse.y=exy1.clientY;} - if(navm){ objposicaomouse.x=window.event.clientX; objposicaomouse.y=window.event.clientY;}} -function calcposf(){ imagemxi=0; imagemyi=0; imagemxref=0; imagemyref=0; if(!$i("corpo")){return;} - var dc=$i("corpo"); if($i("img")){var dc=$i("contemImg");} +function processevent1(exy1){ } +function calcposf(){ imagemxi=0; imagemyi=0; imagemxref=0; imagemyref=0; if(!$i("i3geo")){return;} + if($i("i3geo").style.left){imagemxi+=parseInt($i("i3geo").style.left);} + if($i("i3geo").style.top){imagemyi+=parseInt($i("i3geo").style.top);} + var dc=$i("i3geo"); if($i("img")){var dc=$i("contemImg");} if($i("openlayers_OpenLayers_Container")){var dc=$i("openlayers_OpenLayers_Container");} - while(dc.offsetParent){ dc=dc.offsetParent; imagemxi=imagemxi+dc.offsetLeft; imagemyi=imagemyi+dc.offsetTop;} - if($i("img")){ $left("corpoMapa",imagemxi); $top("corpoMapa",imagemyi);} + while((dc.offsetParent)&&(dc.offsetParent.id !="i3geo")){ dc=dc.offsetParent; imagemxi=imagemxi+dc.offsetLeft; imagemyi=imagemyi+dc.offsetTop;} + if($i("img")){ $left("corpoMapa",imagemxi); $top("corpoMapa",imagemyi); if($i("i3geo").style.left){$left("corpoMapa",imagemxi-parseInt($i("i3geo").style.left));} + if($i("i3geo").style.top){$top("corpoMapa",imagemyi-parseInt($i("i3geo").style.top));}} if($i("mostradistancia")){ $left("mostradistancia",imagemxi); $top("mostradistancia",imagemyi);} - if($i("ref")){ var dc=$i("ref"); while(dc.offsetParent.id !="corpo"){ dc=dc.offsetParent; imagemxref=imagemxref+dc.offsetLeft; imagemyref=imagemyref+dc.offsetTop;}} + if($i("ref")){ var dc=$i("ref"); while(dc.offsetParent.id !="i3geo"){ dc=dc.offsetParent; imagemxref=imagemxref+dc.offsetLeft; imagemyref=imagemyref+dc.offsetTop;}} if($i("aguarde")){ $top("aguarde",imagemyi); $left("aguarde",imagemxi);}} function movecursor(){ var obje=$i("obj").style; if($i("img")){ eval("obje."+g_tipotop+"=objposicaocursor.telay+5+g_postpx"); eval("obje."+g_tipoleft+"=objposicaocursor.telax+5+g_postpx");} else{ eval("obje."+g_tipotop+"=objposicaocursor.telay-15+g_postpx"); eval("obje."+g_tipoleft+"=objposicaocursor.telax+15+g_postpx");} diff --git a/classesjs/i3geo_tudo_compacto.js b/classesjs/i3geo_tudo_compacto.js index 4e56d92..abd22cc 100644 --- a/classesjs/i3geo_tudo_compacto.js +++ b/classesjs/i3geo_tudo_compacto.js @@ -848,7 +848,7 @@ function mostraferramenta(guia){ if($i("ferr"+guia)){ var fs=[1,2,3,4,5,6,7,8,9, $i("ferr"+guia).style.backgroundColor="rgb(255,255,255)"; if($i("ferr"+guia+"obj")){$i("ferr"+guia+"obj").style.display="block";} else{alert("O objeto ferr"+guia+"obj nao existe.");}}} function borra(tipo){ } -function aguarde(){ this.abre=function(aguardeId,texto){ YAHOO.namespace("aguarde"); eval('YAHOO.aguarde.'+aguardeId+'=new YAHOO.widget.Panel("wait",{width:"240px",fixedcenter:false,underlay:"matte",close:false,draggable:false,modal:false})'); eval('YAHOO.aguarde.'+aguardeId+'.setBody(""+texto+" ")'); eval('YAHOO.aguarde.'+aguardeId+'.render(document.body)'); eval('YAHOO.aguarde.'+aguardeId+'.moveTo(0,0)'); eval('YAHOO.aguarde.'+aguardeId+'.show()');} +function aguarde(){ this.abre=function(aguardeId,texto){ YAHOO.namespace("aguarde"); eval('YAHOO.aguarde.'+aguardeId+'=new YAHOO.widget.Panel("wait",{width:"240px",fixedcenter:false,underlay:"matte",close:false,draggable:false,modal:false})'); eval('YAHOO.aguarde.'+aguardeId+'.setBody(""+texto+" ")'); eval('YAHOO.aguarde.'+aguardeId+'.render(document.body)'); eval('YAHOO.aguarde.'+aguardeId+'.moveTo('+imagemxi+','+imagemyi+')'); eval('YAHOO.aguarde.'+aguardeId+'.show()');} this.fecha=function(aguardeId){ if(eval('YAHOO.aguarde.'+aguardeId)){ eval('YAHOO.aguarde.'+aguardeId+'.destroy()');}} } function ativaClicks(docMapa){ docMapa.onmouseover=function(){ if($i("imgh")){$i("imgh").style.display="block";} @@ -858,7 +858,9 @@ function ativaClicks(docMapa){ docMapa.onmouseover=function(){ if($i("imgh")){$i this.onmousemove=function(exy){ if($i("tip")){$i("tip").style.display="none";} capturaposicao(exy); if(g_destaca !=""){$i("imgh").style.display="none";$i("div_d").style.clip='rect('+(objposicaocursor.imgy-destacaTamanho)+" "+(objposicaocursor.imgx-10)+" "+(objposicaocursor.imgy-10)+" "+(objposicaocursor.imgx-destacaTamanho)+')';} if(g_realca=="sim"){ $i("areaRealce").style.left=objposicaocursor.telax-destacaTamanho+10; $i("areaRealce").style.top=objposicaocursor.telay-destacaTamanho+10;} - if($i("img")&&(g_panM=="sim")){ var nx=objposicaocursor.telax-leftinicial-clicinicialx; var ny=objposicaocursor.telay-topinicial-clicinicialy; if(g_entorno=="nao"){ $i("img").style.left=nx; $i("img").style.top=ny;} + if($i("img")&&(g_panM=="sim")){ var nx=objposicaocursor.telax-leftinicial-clicinicialx; var ny=objposicaocursor.telay-topinicial-clicinicialy; if(g_entorno=="nao"){ var l=0; if(parseInt($i("i3geo").style.left)){var l=parseInt($i("i3geo").style.left);} + $i("img").style.left=nx-l; var t=0; if(parseInt($i("i3geo").style.top)){var t=parseInt($i("i3geo").style.top);} + $i("img").style.top=ny-t;} else{ $left("img",objmapa.w*-1+nx); $left("imgS",objmapa.w*-1+nx); $left("imgL",objmapa.w+nx); $left("imgO",objmapa.w*-3+nx); $left("imgN",objmapa.w*-1+nx); $top("img",objmapa.h*-1+ny); $top("imgS",objmapa.h*-1+ny); $top("imgL",objmapa.h*-1+ny); $top("imgN",objmapa.h*-1+ny); $top("imgO",objmapa.h*-1+ny);}} movecursor(); if($i("longlat")){$i("longlat").innerHTML=objposicaocursor.dmsx+" "+objposicaocursor.dmsy;} if(g_tipoacao=="mede"){ $i("mostradistancia").style.display="block"; var n=pontosdistobj.xpt.length; if(n > 0){ var d=calculadistancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); if(objmapa.scale > 500000){ var d=parseInt(d);} @@ -917,7 +919,7 @@ function initJanelaRef(){ if(!$i("winRef")){ var novoel=document.createElement(" var escondeRef=function(){ YAHOO.util.Event.removeListener(YAHOO.janelaRef.xp.panel.close, "click"); YAHOO.janelaRef.xp.panel.destroy(); iCookie("g_mapaRefDisplay","none");} YAHOO.util.Event.addListener(YAHOO.janelaRef.xp.panel.close, "click", escondeRef); iCookie("g_mapaRefDisplay","block"); objmapa.atualizaReferencia();} function mudaboxnf(tipo){ g_operacao=tipo; clearTimeout(objmapa.tempo); objmapa.tempo=setTimeout('remapaf()',(4000)); autoRedesenho("reinicia"); if($i("aplicari")){ $i("aplicari").style.display="block"; if(navm){ mx=objposicaomouse.x-10; my=objposicaomouse.y-15; with($i("aplicari").style){ pixelLeft=mx+document.body.scrollLeft; pixelTop=my+document.body.scrollTop;}} - if(navn){ with($i("aplicari").style){ left=objposicaomouse.x; top=objposicaomouse.y+document.body.scrollTop;}}}} + if(navn){ var l=objposicaomouse.x; var t=objposicaomouse.y+document.body.scrollTop; with($i("aplicari").style){ left=l; top=t;}}}} function movelentef(){ if($i("lente")){ if($i("lente").style.visibility=="visible"){ var esq=(objposicaocursor.telax-imagemxi)*2.25; var topo=(objposicaocursor.telay-imagemyi)*2.25; var clipt="rect("+(topo-40)+" "+(esq+40)+" "+(topo+40)+" "+(esq-40)+")"; with($i("lente").style){ clip=clipt; eval(g_tipotop+"=(imagemyi-(topo-40))+g_postpx"); eval(g_tipoleft+"=(imagemxi-(esq-40))+g_postpx");}}}} function zoomiauto(){ objaguarde.abre("ajaxredesenha","Aguarde..."); g_fatordezoom=0; var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=aproxima&nivel=2&g_sid="+g_sid; var cp=new cpaint(); cp.set_response_type("JSON"); g_operacao="navega"; cp.call(p,"aproxima",ajaxredesenha);} function zoomoauto(){ objaguarde.abre("ajaxredesenha","Aguarde..."); g_fatordezoom=0; var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=afasta&nivel=2&g_sid="+g_sid; var cp=new cpaint(); cp.set_response_type("JSON"); g_operacao="navega"; cp.call(p,"afasta",ajaxredesenha);} @@ -1054,16 +1056,17 @@ function remapaf(){ clearTimeout(objmapa.tempo); objmapa.tempo=""; objmapa.temaA if((tsd.length > 0)||(tsl.length > 0)){ objaguarde.abre("remapa","Aguarde...refazendo o mapa"); var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=ligatemas&desligar="+(tsd.toString())+"&ligar="+(tsl.toString())+"&g_sid="+g_sid; var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(p,"ligaDesligaTemas",remapaAdicNovos);} else{remapaAdicNovos();}} else{remapaAdicNovos();}} -function processevent1(exy1){ navm=false; navn=false; var app=navigator.appName.substring(0,1); if(app=='N')navn=true;else navm=true; if($i("img")){calcposf();} - if(navn){ objposicaomouse.x=exy1.clientX; objposicaomouse.y=exy1.clientY;} - if(navm){ objposicaomouse.x=window.event.clientX; objposicaomouse.y=window.event.clientY;}} -function calcposf(){ imagemxi=0; imagemyi=0; imagemxref=0; imagemyref=0; if(!$i("corpo")){return;} - var dc=$i("corpo"); if($i("img")){var dc=$i("contemImg");} +function processevent1(exy1){ } +function calcposf(){ imagemxi=0; imagemyi=0; imagemxref=0; imagemyref=0; if(!$i("i3geo")){return;} + if($i("i3geo").style.left){imagemxi+=parseInt($i("i3geo").style.left);} + if($i("i3geo").style.top){imagemyi+=parseInt($i("i3geo").style.top);} + var dc=$i("i3geo"); if($i("img")){var dc=$i("contemImg");} if($i("openlayers_OpenLayers_Container")){var dc=$i("openlayers_OpenLayers_Container");} - while(dc.offsetParent){ dc=dc.offsetParent; imagemxi=imagemxi+dc.offsetLeft; imagemyi=imagemyi+dc.offsetTop;} - if($i("img")){ $left("corpoMapa",imagemxi); $top("corpoMapa",imagemyi);} + while((dc.offsetParent)&&(dc.offsetParent.id !="i3geo")){ dc=dc.offsetParent; imagemxi=imagemxi+dc.offsetLeft; imagemyi=imagemyi+dc.offsetTop;} + if($i("img")){ $left("corpoMapa",imagemxi); $top("corpoMapa",imagemyi); if($i("i3geo").style.left){$left("corpoMapa",imagemxi-parseInt($i("i3geo").style.left));} + if($i("i3geo").style.top){$top("corpoMapa",imagemyi-parseInt($i("i3geo").style.top));}} if($i("mostradistancia")){ $left("mostradistancia",imagemxi); $top("mostradistancia",imagemyi);} - if($i("ref")){ var dc=$i("ref"); while(dc.offsetParent.id !="corpo"){ dc=dc.offsetParent; imagemxref=imagemxref+dc.offsetLeft; imagemyref=imagemyref+dc.offsetTop;}} + if($i("ref")){ var dc=$i("ref"); while(dc.offsetParent.id !="i3geo"){ dc=dc.offsetParent; imagemxref=imagemxref+dc.offsetLeft; imagemyref=imagemyref+dc.offsetTop;}} if($i("aguarde")){ $top("aguarde",imagemyi); $left("aguarde",imagemxi);}} function movecursor(){ var obje=$i("obj").style; if($i("img")){ eval("obje."+g_tipotop+"=objposicaocursor.telay+5+g_postpx"); eval("obje."+g_tipoleft+"=objposicaocursor.telax+5+g_postpx");} else{ eval("obje."+g_tipotop+"=objposicaocursor.telay-15+g_postpx"); eval("obje."+g_tipoleft+"=objposicaocursor.telax+15+g_postpx");} @@ -1255,8 +1258,12 @@ function ajaxabrelente(retorno){ try{ var retorno=retorno.data; if(retorno=="err function ajaxdestaca(retorno){ var retorno=retorno.data; var m=new Image(); m.src=retorno; if(!$i("img_d")){ var novoel=document.createElement("div"); novoel.id="div_d"; document.body.appendChild(novoel); $i("div_d").innerHTML=""; $i("div_d").style.left=parseInt($i("corpoMapa").style.left); $i("div_d").style.top=parseInt($i("corpoMapa").style.top); $i("img_d").style.left=0; $i("img_d").style.top=0; $i("img_d").style.width=objmapa.w; $i("img_d").style.height=objmapa.h; $i("div_d").style.clip='rect(0 75 75 0)'; $i("img_d").src=retorno; var novoeli=document.createElement("div"); novoeli.id="div_di"; novoel.appendChild(novoeli); $i("div_di").innerHTML="

+-

";} $i("div_d").innerHTML=""; var novoel=document.createElement("input"); novoel.id="img_d"; novoel.style.position="relative"; novoel.style.top="0px"; novoel.style.left="0px"; novoel.type="image"; novoel.src=m.src; novoel.style.display="block"; $i("div_d").appendChild(novoel); objaguarde.fecha("ajaxdestaca");}function testaajax(){} -g_autoRedesenha=0;g_sid=window.location.href.split("?")[1];atuaLeg="nao";g_operacao="";g_nomepin="";g_arvoreClick="";g_arvoreClicks="";g_movedoca=0;g_movedocac=0;g_movedocar=0;g_tipoacao="zoomli";g_realca="nao";g_destaca="";g_lenteaberta="nao";g_hlpt="";g_panM="nao";quadrosfilme=new Array();g_quadrooriginal="";wd=0;navm=false;navn=false;g_r="nao";g_embedLegenda="nao";oMenuData="";g_3dmap="";g_opcoesTemas="sim";g_mostraRosa="sim";g_visual="default";g_janelaMen="sim";g_downloadbase="sim";g_conectargeorss="sim";g_uploadlocal="sim";g_conectarwms="sim";g_docaguias="nao";g_barraFerramentas1="sim";g_barraFerramentas2="sim";g_fatordezoom=0;g_diminuixM=20;g_diminuixN=25;g_diminuiyM=106;g_diminuiyN=103;g_mapaRefDisplay="block";g_funcaoTip="verificaTipDefault()";g_tempotip=4500;g_tipotip="completo";g_tipoimagem="nenhum";g_sistemas="";destacaTamanho=75;g_mensagempadrao="O I3Geo é software livre! Para download clique aqui";g_entorno="nao";g_guiaativa="guia1";var app=navigator.appName.substring(0,1);if(app=='N')navn=true;else navm=true;if(navm){ g_postpx=""; g_tipotop="pixelTop"; g_tipoleft="pixelLeft";} +g_autoRedesenha=0;if(window.location.href.split("?")[1]){g_sid=window.location.href.split("?")[1];} +else{g_sid="";} +imagemxi=0;imagemyi=0;atuaLeg="nao";g_mashuppar="";g_operacao="";g_nomepin="";g_arvoreClick="";g_arvoreClicks="";g_movedoca=0;g_movedocac=0;g_movedocar=0;g_tipoacao="zoomli";g_realca="nao";g_destaca="";g_lenteaberta="nao";g_hlpt="";g_panM="nao";quadrosfilme=new Array();g_quadrooriginal="";wd=0;navm=false;navn=false;g_r="nao";g_embedLegenda="nao";oMenuData="";g_3dmap="";g_opcoesTemas="sim";g_mostraRosa="sim";g_visual="default";g_janelaMen="sim";g_downloadbase="sim";g_conectargeorss="sim";g_uploadlocal="sim";g_conectarwms="sim";g_docaguias="nao";g_barraFerramentas1="sim";g_barraFerramentas2="sim";g_fatordezoom=0;g_diminuixM=20;g_diminuixN=25;g_diminuiyM=106;g_diminuiyN=103;g_mapaRefDisplay="block";g_funcaoTip="verificaTipDefault()";g_tempotip=4500;g_tipotip="completo";g_tipoimagem="nenhum";g_sistemas="";destacaTamanho=75;g_mensagempadrao="O I3Geo é software livre! Para download clique aqui";g_entorno="nao";g_guiaativa="guia1";var app=navigator.appName.substring(0,1);if(app=='N')navn=true;else navm=true;if(navm){ g_postpx=""; g_tipotop="pixelTop"; g_tipoleft="pixelLeft";} else{ g_postpx="px"; g_tipotop="top"; g_tipoleft="left";}window.onresize=function(){window.status="Após alterar o tamanho da janela, clique no botão de refresh do navegador";} +function cria(){var mashup=function(retorno){ g_sid=retorno.data; objmapa.inicializa();} + var cp=new cpaint(); cp.set_async(true); cp.set_response_type("JSON"); var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa"; cp.call(p,"",mashup);} function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor(); objposicaomouse=new posicaomouse(); imgBranco=new Image(); imgBranco.src=g_locaplic+"/imagens/branco.gif"; var icache=new Array("foldermapa.gif","extent.gif","tic.png","maisvermelho.png","maisverde.png","maisamarelo.png","temas.png","x.gif","sobe.gif","desce.gif","quadro.png","quadro1.png","excluir.png"); for(i=0;icache.lenght;i++){ var temp=new Image(); temp.src=g_locaplic+"/imagens/"+icache[i];} var temp=new Image(); temp.src=g_locaplic+"/classesjs/jsobjects/jsUI-Treeview/plus.gif"; temp.src=g_locaplic+"/classesjs/jsobjects/jsUI-Treeview/minus.gif"; var diminuix=(navm)? g_diminuixM : g_diminuixN; var diminuiy=(navm)? g_diminuiyM : g_diminuiyN; if(e==undefined){ var menos=0; if($i("contemFerramentas")){menos=menos+parseInt($i("contemFerramentas").style.width);} if($i("encolheFerramentas")){menos=menos+parseInt($i("encolheFerramentas").style.width);} @@ -1264,10 +1271,16 @@ function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor var novow=screen.availWidth-diminuix; var novoh=screen.availHeight-diminuiy; if(novow >=1024){ novow=1000;} if(novoh >=700){ novoh=700;} if(document.body.style.width < 400){ var novow=screen.availWidth-diminuix; var novoh=screen.availHeight-diminuiy; window.resizeTo(screen.availWidth,screen.availHeight); window.moveTo(0,0);} - document.body.style.width=novow; document.body.style.height=novoh; this.w=parseInt(document.body.style.width)-menos-diminuix; this.h=parseInt(document.body.style.height)-diminuiy; if(document.getElementById("corpoMapa")){ if(document.getElementById("corpoMapa").style.width){ this.w=parseInt(document.getElementById("corpoMapa").style.width); this.h=parseInt(document.getElementById("corpoMapa").style.height);}}} + document.body.style.width=novow; document.body.style.height=novoh; this.w=parseInt(document.body.style.width)-menos-diminuix; this.h=parseInt(document.body.style.height)-diminuiy; if(document.getElementById("corpoMapa")){ if(document.getElementById("corpoMapa").style.width){ this.w=parseInt(document.getElementById("corpoMapa").style.width); this.h=parseInt(document.getElementById("corpoMapa").style.width);} + if(document.getElementById("corpoMapa").style.height){this.h=parseInt(document.getElementById("corpoMapa").style.height);}}} else{ this.w=document.body.offsetWidth-parseInt($i("contemFerramentas").style.width)-diminuix; this.h=document.body.offsetHeight-diminuiy;} if($i("openlayers")){ $i("openlayers").style.width=this.w; $i("openlayers").style.height=this.h;} - this.navegacaoDir="nao"; this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!window.testafuncoes){alert("funcoes.js com problemas");} + this.navegacaoDir="nao"; this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!$i("i3geo")){document.body.id="i3geo";} + $i("i3geo").onmouseover=function(){ this.onmousemove=function(exy1){ if(navn){ objposicaomouse.x=exy1.clientX; objposicaomouse.y=exy1.clientY;} + if(navm){ objposicaomouse.x=window.event.clientX; objposicaomouse.y=window.event.clientY;}}} + if(g_sid==""){ var mashup=function(retorno){ g_sid=retorno.data; objmapa.inicializa();} + var cp=new cpaint(); cp.set_async("true"); cp.set_response_type("JSON"); var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa"+g_mashuppar; cp.call(p,"",mashup); return;} + if(!window.testafuncoes){alert("funcoes.js com problemas");} if(!window.testamenususpenso){alert("menususpenso.js com problemas");} if(!window.testaferramentas){alert("ferramentas.js com problemas");} if(!window.testaajax){alert("redesenho.js com problemas");} @@ -1430,7 +1443,6 @@ function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor if($i(objmapa.guiaMenu+"obj")){ $i(objmapa.guiaMenu+"obj").style.overflow="auto"; $i(objmapa.guiaMenu+"obj").style.height=objmapa.h-13; $i(objmapa.guiaMenu+"obj").style.width="100%";} if($i(objmapa.guiaLegenda+"obj")){ $i(objmapa.guiaLegenda+"obj").style.overflow="auto"; $i(objmapa.guiaLegenda+"obj").style.height=objmapa.h-13; $i(objmapa.guiaLegenda+"obj").style.width="100%";}} this.verificaClickMapa=function(){ if(this.funcoesClickMapa.length > 0){ for(f=0;f'; ins+=''; $i("menus").innerHTML=ins;}} diff --git a/classesjs/iniciamma.js b/classesjs/iniciamma.js index ad60a2f..bfa3361 100644 --- a/classesjs/iniciamma.js +++ b/classesjs/iniciamma.js @@ -52,7 +52,24 @@ Variable: g_sid Id da seção atual no servidor. */ -g_sid = window.location.href.split("?")[1]; +if (window.location.href.split("?")[1]) +{g_sid = window.location.href.split("?")[1];} +else +{g_sid = "";} +/* +Variable: imagemxi + +Inicialização da variável de cálculo de posicionamento. + +*/ +imagemxi = 0; +/* +Variable: imagemyi + +Inicialização da variável de cálculo de posicionamento. + +*/ +imagemyi = 0; /* Variable: atuaLeg @@ -61,6 +78,16 @@ Variável interna que define se a legenda docável deve ser atualizada. */ atuaLeg="nao"; /* +Variable: g_mashuppar + +Parâmetros de inicialização que podem ser utilizados na interface mashup. + +Os parâmetros são os mesmos que podem ser utilizados quando o i3geo é inicializado pelo ms_criamapa.php. + +Exemplo: g_mashuppar = "&pontos=-54 -12&temasa=biomas&layers=biomas" +*/ +g_mashuppar = ""; +/* Variable: g_operacao Nome da última operação que foi executada. @@ -471,6 +498,21 @@ else } //inclui uma mensagem no rodapé da janela quando a tela do navegador tem seu tamanho modificado pelo usuário window.onresize = function(){window.status = "Após alterar o tamanho da janela, clique no botão de refresh do navegador";} + +function cria() +{ +var mashup = function (retorno) +{ + g_sid = retorno.data; + objmapa.inicializa(); +} + var cp = new cpaint(); + cp.set_async(true); + cp.set_response_type("JSON"); + var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa"; + cp.call(p,"",mashup); +} + /* Class: Mapa @@ -562,8 +604,10 @@ function Mapa(e,m) if (document.getElementById("corpoMapa").style.width) { this.w = parseInt(document.getElementById("corpoMapa").style.width); - this.h = parseInt(document.getElementById("corpoMapa").style.height); + this.h = parseInt(document.getElementById("corpoMapa").style.width); } + if (document.getElementById("corpoMapa").style.height) + {this.h = parseInt(document.getElementById("corpoMapa").style.height);} } } else @@ -722,6 +766,43 @@ function Mapa(e,m) */ this.inicializa= function() { + if (!$i("i3geo")) + {document.body.id = "i3geo";} + $i("i3geo").onmouseover = function() + { + this.onmousemove=function(exy1) + { + //if ($i("img")){calcposf();} + if (navn) + { + objposicaomouse.x = exy1.clientX; + objposicaomouse.y = exy1.clientY; + } + if (navm) + { + objposicaomouse.x = window.event.clientX; + objposicaomouse.y = window.event.clientY; + } + } + } + // + //se g_sid="", o html foi aberto diretamente + //então, é necessário criar o mapa + // + if (g_sid=="") + { + var mashup = function (retorno) + { + g_sid = retorno.data; + objmapa.inicializa(); + } + var cp = new cpaint(); + cp.set_async("true"); + cp.set_response_type("JSON"); + var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa"+g_mashuppar; + cp.call(p,"",mashup); + return; + } //testa se os javascripts foram carregados if (!window.testafuncoes) {alert("funcoes.js com problemas");} @@ -731,6 +812,7 @@ function Mapa(e,m) {alert("ferramentas.js com problemas");} if (!window.testaajax) {alert("redesenho.js com problemas");} + // //objeto que guarda os parametros de posicionamento do cursor objaguarde.abre("montaMapa","Aguarde...iniciando o mapa"); var cp = new cpaint(); @@ -1980,4 +2062,4 @@ function Mapa(e,m) } } } -} +} \ No newline at end of file diff --git a/classesjs/iniciamma_compacto.js b/classesjs/iniciamma_compacto.js index 7843b8d..d9675fd 100644 --- a/classesjs/iniciamma_compacto.js +++ b/classesjs/iniciamma_compacto.js @@ -1,5 +1,9 @@ -g_autoRedesenha=0;g_sid=window.location.href.split("?")[1];atuaLeg="nao";g_operacao="";g_nomepin="";g_arvoreClick="";g_arvoreClicks="";g_movedoca=0;g_movedocac=0;g_movedocar=0;g_tipoacao="zoomli";g_realca="nao";g_destaca="";g_lenteaberta="nao";g_hlpt="";g_panM="nao";quadrosfilme=new Array();g_quadrooriginal="";wd=0;navm=false;navn=false;g_r="nao";g_embedLegenda="nao";oMenuData="";g_3dmap="";g_opcoesTemas="sim";g_mostraRosa="sim";g_visual="default";g_janelaMen="sim";g_downloadbase="sim";g_conectargeorss="sim";g_uploadlocal="sim";g_conectarwms="sim";g_docaguias="nao";g_barraFerramentas1="sim";g_barraFerramentas2="sim";g_fatordezoom=0;g_diminuixM=20;g_diminuixN=25;g_diminuiyM=106;g_diminuiyN=103;g_mapaRefDisplay="block";g_funcaoTip="verificaTipDefault()";g_tempotip=4500;g_tipotip="completo";g_tipoimagem="nenhum";g_sistemas="";destacaTamanho=75;g_mensagempadrao="O I3Geo é software livre! Para download clique aqui";g_entorno="nao";g_guiaativa="guia1";var app=navigator.appName.substring(0,1);if(app=='N')navn=true;else navm=true;if(navm){ g_postpx=""; g_tipotop="pixelTop"; g_tipoleft="pixelLeft";} +g_autoRedesenha=0;if(window.location.href.split("?")[1]){g_sid=window.location.href.split("?")[1];} +else{g_sid="";} +imagemxi=0;imagemyi=0;atuaLeg="nao";g_mashuppar="";g_operacao="";g_nomepin="";g_arvoreClick="";g_arvoreClicks="";g_movedoca=0;g_movedocac=0;g_movedocar=0;g_tipoacao="zoomli";g_realca="nao";g_destaca="";g_lenteaberta="nao";g_hlpt="";g_panM="nao";quadrosfilme=new Array();g_quadrooriginal="";wd=0;navm=false;navn=false;g_r="nao";g_embedLegenda="nao";oMenuData="";g_3dmap="";g_opcoesTemas="sim";g_mostraRosa="sim";g_visual="default";g_janelaMen="sim";g_downloadbase="sim";g_conectargeorss="sim";g_uploadlocal="sim";g_conectarwms="sim";g_docaguias="nao";g_barraFerramentas1="sim";g_barraFerramentas2="sim";g_fatordezoom=0;g_diminuixM=20;g_diminuixN=25;g_diminuiyM=106;g_diminuiyN=103;g_mapaRefDisplay="block";g_funcaoTip="verificaTipDefault()";g_tempotip=4500;g_tipotip="completo";g_tipoimagem="nenhum";g_sistemas="";destacaTamanho=75;g_mensagempadrao="O I3Geo é software livre! Para download clique aqui";g_entorno="nao";g_guiaativa="guia1";var app=navigator.appName.substring(0,1);if(app=='N')navn=true;else navm=true;if(navm){ g_postpx=""; g_tipotop="pixelTop"; g_tipoleft="pixelLeft";} else{ g_postpx="px"; g_tipotop="top"; g_tipoleft="left";}window.onresize=function(){window.status="Após alterar o tamanho da janela, clique no botão de refresh do navegador";} +function cria(){var mashup=function(retorno){ g_sid=retorno.data; objmapa.inicializa();} + var cp=new cpaint(); cp.set_async(true); cp.set_response_type("JSON"); var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa"; cp.call(p,"",mashup);} function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor(); objposicaomouse=new posicaomouse(); imgBranco=new Image(); imgBranco.src=g_locaplic+"/imagens/branco.gif"; var icache=new Array("foldermapa.gif","extent.gif","tic.png","maisvermelho.png","maisverde.png","maisamarelo.png","temas.png","x.gif","sobe.gif","desce.gif","quadro.png","quadro1.png","excluir.png"); for(i=0;icache.lenght;i++){ var temp=new Image(); temp.src=g_locaplic+"/imagens/"+icache[i];} var temp=new Image(); temp.src=g_locaplic+"/classesjs/jsobjects/jsUI-Treeview/plus.gif"; temp.src=g_locaplic+"/classesjs/jsobjects/jsUI-Treeview/minus.gif"; var diminuix=(navm)? g_diminuixM : g_diminuixN; var diminuiy=(navm)? g_diminuiyM : g_diminuiyN; if(e==undefined){ var menos=0; if($i("contemFerramentas")){menos=menos+parseInt($i("contemFerramentas").style.width);} if($i("encolheFerramentas")){menos=menos+parseInt($i("encolheFerramentas").style.width);} @@ -7,10 +11,16 @@ function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor var novow=screen.availWidth-diminuix; var novoh=screen.availHeight-diminuiy; if(novow >=1024){ novow=1000;} if(novoh >=700){ novoh=700;} if(document.body.style.width < 400){ var novow=screen.availWidth-diminuix; var novoh=screen.availHeight-diminuiy; window.resizeTo(screen.availWidth,screen.availHeight); window.moveTo(0,0);} - document.body.style.width=novow; document.body.style.height=novoh; this.w=parseInt(document.body.style.width)-menos-diminuix; this.h=parseInt(document.body.style.height)-diminuiy; if(document.getElementById("corpoMapa")){ if(document.getElementById("corpoMapa").style.width){ this.w=parseInt(document.getElementById("corpoMapa").style.width); this.h=parseInt(document.getElementById("corpoMapa").style.height);}}} + document.body.style.width=novow; document.body.style.height=novoh; this.w=parseInt(document.body.style.width)-menos-diminuix; this.h=parseInt(document.body.style.height)-diminuiy; if(document.getElementById("corpoMapa")){ if(document.getElementById("corpoMapa").style.width){ this.w=parseInt(document.getElementById("corpoMapa").style.width); this.h=parseInt(document.getElementById("corpoMapa").style.width);} + if(document.getElementById("corpoMapa").style.height){this.h=parseInt(document.getElementById("corpoMapa").style.height);}}} else{ this.w=document.body.offsetWidth-parseInt($i("contemFerramentas").style.width)-diminuix; this.h=document.body.offsetHeight-diminuiy;} if($i("openlayers")){ $i("openlayers").style.width=this.w; $i("openlayers").style.height=this.h;} - this.navegacaoDir="nao"; this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!window.testafuncoes){alert("funcoes.js com problemas");} + this.navegacaoDir="nao"; this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!$i("i3geo")){document.body.id="i3geo";} + $i("i3geo").onmouseover=function(){ this.onmousemove=function(exy1){ if(navn){ objposicaomouse.x=exy1.clientX; objposicaomouse.y=exy1.clientY;} + if(navm){ objposicaomouse.x=window.event.clientX; objposicaomouse.y=window.event.clientY;}}} + if(g_sid==""){ var mashup=function(retorno){ g_sid=retorno.data; objmapa.inicializa();} + var cp=new cpaint(); cp.set_async("true"); cp.set_response_type("JSON"); var p=g_locaplic+"/classesphp/mapa_controle.php?funcao=criaMapa"+g_mashuppar; cp.call(p,"",mashup); return;} + if(!window.testafuncoes){alert("funcoes.js com problemas");} if(!window.testamenususpenso){alert("menususpenso.js com problemas");} if(!window.testaferramentas){alert("ferramentas.js com problemas");} if(!window.testaajax){alert("redesenho.js com problemas");} @@ -173,4 +183,3 @@ function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor if($i(objmapa.guiaMenu+"obj")){ $i(objmapa.guiaMenu+"obj").style.overflow="auto"; $i(objmapa.guiaMenu+"obj").style.height=objmapa.h-13; $i(objmapa.guiaMenu+"obj").style.width="100%";} if($i(objmapa.guiaLegenda+"obj")){ $i(objmapa.guiaLegenda+"obj").style.overflow="auto"; $i(objmapa.guiaLegenda+"obj").style.height=objmapa.h-13; $i(objmapa.guiaLegenda+"obj").style.width="100%";}} this.verificaClickMapa=function(){ if(this.funcoesClickMapa.length > 0){ for(f=0;f, , , , , */ -error_reporting(E_ALL); +error_reporting(0); set_time_limit(240); // //pega as variaveis passadas com get ou post @@ -88,17 +88,20 @@ include_once("pega_variaveis.php"); // //inicializa a sessão // -session_name("i3GeoPHP"); -if (isset($g_sid)) -{session_id($g_sid);} -session_start(); -foreach(array_keys($_SESSION) as $k) +if ($funcao != "criaMapa") { - eval("\$".$k."='".$_SESSION[$k]."';"); + session_name("i3GeoPHP"); + if (isset($g_sid)) + {session_id($g_sid);} + session_start(); + foreach(array_keys($_SESSION) as $k) + { + eval("\$".$k."='".$_SESSION[$k]."';"); + } + // + //verifica se deve ativar o debug + // } -// -//verifica se deve ativar o debug -// if (isset($debug) && $debug == "sim") {error_reporting(E_ALL);} // @@ -106,14 +109,24 @@ if (isset($debug) && $debug == "sim") //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido // include_once ("carrega_ext.php"); - require_once("../classesjs/cpaint/cpaint2.inc.php"); // //cria objeto cpaint para uso com ajax // $cp = new cpaint(); +if ($funcao == "criaMapa") +{ + session_destroy(); + include("../ms_configura.php"); + chdir($locaplic); + $interface = "mashup"; + include("ms_criamapa.php"); + $cp->set_data(session_id()); + $cp->return_data(); +} if (!isset($map_file)) { + //nesse caso é necessário criar o diretório temporário e iniciar o mapa $cp->set_data("linkquebrado"); $cp->return_data(); exit; diff --git a/exemplos/atlas/mapa.htm b/exemplos/atlas/mapa.htm index c08c572..3c3a5cb 100644 --- a/exemplos/atlas/mapa.htm +++ b/exemplos/atlas/mapa.htm @@ -10,7 +10,7 @@ - +
diff --git a/exemplos/mashup.htm b/exemplos/mashup.htm new file mode 100644 index 0000000..128b980 --- /dev/null +++ b/exemplos/mashup.htm @@ -0,0 +1,171 @@ + + + + + +MMA - Mapa interativo + + + + + + + +

Este é um exemplo de inclusão do I3Geo dentro de uma página qualquer.

+

+

Você pode chamar o I3Geo de dentro de uma outra página criando o DIV com id=corpo

+

Para chamar a página não é necessário rodar o i3geo/ms_criamapa.php.

+

Nem todos os elementos precisam estar no mapa.

+

Você pode esconder ou mudar as ferramentas de lugar.

+

+
+
+
+ + + + + + + + + + + + + + + + + + + +Críticas e sugestões +
+ + + + + + + + + \ No newline at end of file diff --git a/ms_configura.php b/ms_configura.php index 532640c..67dc660 100644 --- a/ms_configura.php +++ b/ms_configura.php @@ -76,7 +76,7 @@ if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) //caminho completo do diretório temporário utilizado pelo mapserver $dir_tmp = "c:/ms4w/tmp/ms_tmp"; //caminho completo onde fica o I3Geo - $locaplic = getcwd(); //"c:/ms4w/apache/htdocs/i3geo"; + $locaplic = "c:/ms4w/apache/htdocs/i3geo"; //caminho completo do diretório onde ficam os arquivos .map correspondentes aos temas disponíveis $temasdir = $locaplic."/temas"; //"c:/ms4w/apache/htdocs/i3geo/temas"; //caminho completo onde ficam os arquivos .map específicos do I3Geo diff --git a/ms_criamapa.php b/ms_criamapa.php index 74be944..1d6cc3b 100644 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -471,21 +471,24 @@ $mapa->save($tmpfname); // gera a url para abrir o mapa // interface = arquivo html que será aberto // -if (count(explode(".php",$interface)) > 1) +if ($interface != "mashup") { - if (file_exists($caminho."aplicmap/".$interface)) - {include_once($caminho."aplicmap/".$interface);} - else - {include_once($interface);} - exit; -} -else -{ - if (file_exists($caminho."aplicmap/".$interface)) - {$urln = $caminho."aplicmap/".$interface."?".session_id();} - else - {$urln = $interface."?".session_id();} - //header("Location:".$urln); - echo ""; + if (count(explode(".php",$interface)) > 1) + { + if (file_exists($caminho."aplicmap/".$interface)) + {include_once($caminho."aplicmap/".$interface);} + else + {include_once($interface);} + exit; + } + else + { + if (file_exists($caminho."aplicmap/".$interface)) + {$urln = $caminho."aplicmap/".$interface."?".session_id();} + else + {$urln = $interface."?".session_id();} + //header("Location:".$urln); + echo ""; + } } ?> \ No newline at end of file -- libgit2 0.21.2