From dc4184be1909938fabbafe8ae834238d6dd53055 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 9 Jun 2011 03:14:32 +0000 Subject: [PATCH] Inclusão do temporizador por camada --- admin/admin.db | Bin 71680 -> 0 bytes classesjs/classe_arvoredecamadas.js | 7 ++++++- classesjs/classe_interface.js | 8 +++++++- classesjs/classe_tema.js | 55 ++++++++++++++++++++++++++----------------------------- temas/povoado.map | 3 ++- 5 files changed, 41 insertions(+), 32 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index db6b252..0195cf0 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesjs/classe_arvoredecamadas.js b/classesjs/classe_arvoredecamadas.js index cf76f00..938070e 100644 --- a/classesjs/classe_arvoredecamadas.js +++ b/classesjs/classe_arvoredecamadas.js @@ -875,7 +875,7 @@ i3GEO.arvoreDeCamadas = { {tnome = ""+$trad("t20")+"    "+$inputText("","","tr"+ltema.name,"","3",ltema.transparency)+"";} n = new YAHOO.widget.HTMLNode({expanded:false,enableHighlight:false,isLeaf:true,html:tnome}, node); } - if(funcoes.temporizador === true){ + if(funcoes.temporizador === true && i3GEO.Interface.ATUAL != "padrao" && i3GEO.Interface.ATUAL != "flamingo"){ if(navm) {tnome = ""+$trad("t48")+"    "+$inputText("","","temporizador"+ltema.name,"","3",ltema.temporizador)+" ";} else @@ -1180,6 +1180,11 @@ i3GEO.arvoreDeCamadas = { else {html += " "+tema.tema+"";} html += "

"; + + if(i3GEO.tema.TEMPORIZADORESID[tema.name] == undefined && tema.temporizador != "") + {i3GEO.tema.temporizador(tema.name,tema.temporizador);} + + return(html); }, /* diff --git a/classesjs/classe_interface.js b/classesjs/classe_interface.js index 1661027..c843aa4 100644 --- a/classesjs/classe_interface.js +++ b/classesjs/classe_interface.js @@ -249,7 +249,7 @@ i3GEO.Interface = { Parametros: - retorno {JSON} - objeto JSON com os parâmetros obtidos da função PHP de redesenho do mapa + retorno {JSON} - objeto JSON com os parâmetros obtidos da função PHP de redesenho do mapa. Quando igual a "", é feita apenas a atualização da camada, sem que a árvore de camadas seja atualizada. tema {string} - código do tema */ @@ -1081,6 +1081,8 @@ i3GEO.Interface = { layer.url = layer.url+"&&"; layer.redraw(); } + if(retorno === "") + {return;} i3GEO.Interface.openlayers.recalcPar(); try {i3GEO.arvoreDeCamadas.atualiza(retorno.data.temas);} @@ -1237,6 +1239,8 @@ i3GEO.Interface = { i3GeoMap.overlayMapTypes.removeAt(indice); i3GEO.Interface.googlemaps.posfixo += 1; i3GEO.Interface.googlemaps.insereLayer(tema,indice); + if(retorno === "") + {return;} i3GEO.Interface.googlemaps.recalcPar(); try {i3GEO.arvoreDeCamadas.atualiza(retorno.data.temas);} @@ -1827,6 +1831,8 @@ i3GEO.Interface = { hr = layer.getLink().getHref(); hr = hr.replace("&&&&&",""); layer.getLink().setHref(hr+"&"); + if(retorno === "") + {return;} i3GEO.Interface.googleearth.recalcPar(); try {i3GEO.arvoreDeCamadas.atualiza(retorno.data.temas);} diff --git a/classesjs/classe_tema.js b/classesjs/classe_tema.js index 02b0234..d4afd96 100644 --- a/classesjs/classe_tema.js +++ b/classesjs/classe_tema.js @@ -374,6 +374,31 @@ i3GEO.tema = { } }, /* + Function: temporizador + + Aplica um temporizador para que a camada seja redesenhada em determinado intervalo de tempo. + + O campo com o valor de tempo (em segundos) é composto por "temporizador"+idtema + + Parametros: + + idtema - id que identifica o tema no map file. + */ + temporizador: function(idtema,tempo){ + if(!tempo) + {tempo = $i("temporizador"+idtema).value;} + if(tempo != "" && parseInt(tempo,10) > 0){ + eval('i3GEO.tema.TEMPORIZADORESID.'+idtema+' = {tempo: '+tempo+',idtemporizador: setInterval(function('+idtema+'){if(!$i("arrastar_'+idtema+'")){delete(i3GEO.tema.TEMPORIZADORESID.'+idtema+');return;}i3GEO.Interface.atualizaTema("",idtema);},parseInt('+tempo+',10)*1000)};'); + } + else{ + try{ + window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador); + delete(i3GEO.tema.TEMPORIZADORESID[idtema]); + } + catch(e){} + } + }, + /* Classe: i3GEO.tema.dialogo Abre as telas de diálogo das opções de manipulação de um tema @@ -588,35 +613,7 @@ i3GEO.tema = { editorsql: function(idtema){ i3GEO.mapa.ativaTema(idtema); i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql"); - }, - /* - Function: temporizador - - Aplica um temporizador para que a camada seja redesenhada em determinado intervalo de tempo. - - O campo com o valor de tempo (em segundos) é composto por "temporizador"+idtema - - Parametros: - - idtema - id que identifica o tema no map file. - */ - temporizador: function(idtema){ - i3GEO.mapa.ativaTema(idtema); - var tempo = $i("temporizador"+idtema).value, - tpz = i3GEO.tema.TEMPORIZADORESID.idtema; - if(tempo != "" && parseInt(tempo,10) > 0){ - i3GEO.tema.TEMPORIZADORESID.idtema = { - tempo: tempo, - idtemporizador: setInterval() - } - } - else{ - if(tpz != undefined){ - clearInterval(tpz.idtemporizador); - delete(i3GEO.tema.TEMPORIZADORESID.idtema); - } - } - } + } } }; //YAHOO.log("carregou classe tema", "Classes i3geo"); \ No newline at end of file diff --git a/temas/povoado.map b/temas/povoado.map index dca2f1e..fe25875 100644 --- a/temas/povoado.map +++ b/temas/povoado.map @@ -5,7 +5,8 @@ MAP CONNECTION "" DATA "c:\ms4w\apache\htdocs\i3geo\aplicmap\dados\sc22\povoado.shp" METADATA - "cache" "" + "temporizador" "5" + "cache" "" "ltempoitemimagem" "" "CLASSE" "SIM" "ltempoitemdescricao" "" -- libgit2 0.21.2