Commit dc4184be1909938fabbafe8ae834238d6dd53055
1 parent
fa5b1152
Exists in
master
and in
7 other branches
Inclusão do temporizador por camada
Showing
5 changed files
with
41 additions
and
32 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesjs/classe_arvoredecamadas.js
| ... | ... | @@ -875,7 +875,7 @@ i3GEO.arvoreDeCamadas = { |
| 875 | 875 | {tnome = "<span onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t19")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+$trad("t20")+"</span> <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=42' > </a>"+$inputText("","","tr"+ltema.name,"","3",ltema.transparency)+"<img class='tic' style='position:relative;top:3px;' onclick='i3GEO.tema.mudatransp(\""+ltema.name+"\")' src='"+i3GEO.util.$im("branco.gif")+"' />";} |
| 876 | 876 | n = new YAHOO.widget.HTMLNode({expanded:false,enableHighlight:false,isLeaf:true,html:tnome}, node); |
| 877 | 877 | } |
| 878 | - if(funcoes.temporizador === true){ | |
| 878 | + if(funcoes.temporizador === true && i3GEO.Interface.ATUAL != "padrao" && i3GEO.Interface.ATUAL != "flamingo"){ | |
| 879 | 879 | if(navm) |
| 880 | 880 | {tnome = "<span onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t47")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+$trad("t48")+"</span> <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=101' > </a>"+$inputText("","","temporizador"+ltema.name,"","3",ltema.temporizador)+" <a class='tic' onclick='i3GEO.tema.temporizador(\""+ltema.name+"\")' href='#' /a>";} |
| 881 | 881 | else |
| ... | ... | @@ -1180,6 +1180,11 @@ i3GEO.arvoreDeCamadas = { |
| 1180 | 1180 | else |
| 1181 | 1181 | {html += " <span id='ArvoreTituloTema"+tema.name+"' style='"+estilo+"' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t7")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+tema.tema+"</span>";} |
| 1182 | 1182 | html += "</p>"; |
| 1183 | + | |
| 1184 | + if(i3GEO.tema.TEMPORIZADORESID[tema.name] == undefined && tema.temporizador != "") | |
| 1185 | + {i3GEO.tema.temporizador(tema.name,tema.temporizador);} | |
| 1186 | + | |
| 1187 | + | |
| 1183 | 1188 | return(html); |
| 1184 | 1189 | }, |
| 1185 | 1190 | /* | ... | ... |
classesjs/classe_interface.js
| ... | ... | @@ -249,7 +249,7 @@ i3GEO.Interface = { |
| 249 | 249 | |
| 250 | 250 | Parametros: |
| 251 | 251 | |
| 252 | - retorno {JSON} - objeto JSON com os parâmetros obtidos da função PHP de redesenho do mapa | |
| 252 | + 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. | |
| 253 | 253 | |
| 254 | 254 | tema {string} - código do tema |
| 255 | 255 | */ |
| ... | ... | @@ -1081,6 +1081,8 @@ i3GEO.Interface = { |
| 1081 | 1081 | layer.url = layer.url+"&&"; |
| 1082 | 1082 | layer.redraw(); |
| 1083 | 1083 | } |
| 1084 | + if(retorno === "") | |
| 1085 | + {return;} | |
| 1084 | 1086 | i3GEO.Interface.openlayers.recalcPar(); |
| 1085 | 1087 | try |
| 1086 | 1088 | {i3GEO.arvoreDeCamadas.atualiza(retorno.data.temas);} |
| ... | ... | @@ -1237,6 +1239,8 @@ i3GEO.Interface = { |
| 1237 | 1239 | i3GeoMap.overlayMapTypes.removeAt(indice); |
| 1238 | 1240 | i3GEO.Interface.googlemaps.posfixo += 1; |
| 1239 | 1241 | i3GEO.Interface.googlemaps.insereLayer(tema,indice); |
| 1242 | + if(retorno === "") | |
| 1243 | + {return;} | |
| 1240 | 1244 | i3GEO.Interface.googlemaps.recalcPar(); |
| 1241 | 1245 | try |
| 1242 | 1246 | {i3GEO.arvoreDeCamadas.atualiza(retorno.data.temas);} |
| ... | ... | @@ -1827,6 +1831,8 @@ i3GEO.Interface = { |
| 1827 | 1831 | hr = layer.getLink().getHref(); |
| 1828 | 1832 | hr = hr.replace("&&&&&",""); |
| 1829 | 1833 | layer.getLink().setHref(hr+"&"); |
| 1834 | + if(retorno === "") | |
| 1835 | + {return;} | |
| 1830 | 1836 | i3GEO.Interface.googleearth.recalcPar(); |
| 1831 | 1837 | try |
| 1832 | 1838 | {i3GEO.arvoreDeCamadas.atualiza(retorno.data.temas);} | ... | ... |
classesjs/classe_tema.js
| ... | ... | @@ -374,6 +374,31 @@ i3GEO.tema = { |
| 374 | 374 | } |
| 375 | 375 | }, |
| 376 | 376 | /* |
| 377 | + Function: temporizador | |
| 378 | + | |
| 379 | + Aplica um temporizador para que a camada seja redesenhada em determinado intervalo de tempo. | |
| 380 | + | |
| 381 | + O campo com o valor de tempo (em segundos) é composto por "temporizador"+idtema | |
| 382 | + | |
| 383 | + Parametros: | |
| 384 | + | |
| 385 | + idtema - id que identifica o tema no map file. | |
| 386 | + */ | |
| 387 | + temporizador: function(idtema,tempo){ | |
| 388 | + if(!tempo) | |
| 389 | + {tempo = $i("temporizador"+idtema).value;} | |
| 390 | + if(tempo != "" && parseInt(tempo,10) > 0){ | |
| 391 | + 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)};'); | |
| 392 | + } | |
| 393 | + else{ | |
| 394 | + try{ | |
| 395 | + window.clearInterval(i3GEO.tema.TEMPORIZADORESID[idtema].idtemporizador); | |
| 396 | + delete(i3GEO.tema.TEMPORIZADORESID[idtema]); | |
| 397 | + } | |
| 398 | + catch(e){} | |
| 399 | + } | |
| 400 | + }, | |
| 401 | + /* | |
| 377 | 402 | Classe: i3GEO.tema.dialogo |
| 378 | 403 | |
| 379 | 404 | Abre as telas de diálogo das opções de manipulação de um tema |
| ... | ... | @@ -588,35 +613,7 @@ i3GEO.tema = { |
| 588 | 613 | editorsql: function(idtema){ |
| 589 | 614 | i3GEO.mapa.ativaTema(idtema); |
| 590 | 615 | i3GEO.util.dialogoFerramenta("i3GEO.tema.dialogo.editorsql()","editorsql","editorsql"); |
| 591 | - }, | |
| 592 | - /* | |
| 593 | - Function: temporizador | |
| 594 | - | |
| 595 | - Aplica um temporizador para que a camada seja redesenhada em determinado intervalo de tempo. | |
| 596 | - | |
| 597 | - O campo com o valor de tempo (em segundos) é composto por "temporizador"+idtema | |
| 598 | - | |
| 599 | - Parametros: | |
| 600 | - | |
| 601 | - idtema - id que identifica o tema no map file. | |
| 602 | - */ | |
| 603 | - temporizador: function(idtema){ | |
| 604 | - i3GEO.mapa.ativaTema(idtema); | |
| 605 | - var tempo = $i("temporizador"+idtema).value, | |
| 606 | - tpz = i3GEO.tema.TEMPORIZADORESID.idtema; | |
| 607 | - if(tempo != "" && parseInt(tempo,10) > 0){ | |
| 608 | - i3GEO.tema.TEMPORIZADORESID.idtema = { | |
| 609 | - tempo: tempo, | |
| 610 | - idtemporizador: setInterval() | |
| 611 | - } | |
| 612 | - } | |
| 613 | - else{ | |
| 614 | - if(tpz != undefined){ | |
| 615 | - clearInterval(tpz.idtemporizador); | |
| 616 | - delete(i3GEO.tema.TEMPORIZADORESID.idtema); | |
| 617 | - } | |
| 618 | - } | |
| 619 | - } | |
| 616 | + } | |
| 620 | 617 | } |
| 621 | 618 | }; |
| 622 | 619 | //YAHOO.log("carregou classe tema", "Classes i3geo"); |
| 623 | 620 | \ No newline at end of file | ... | ... |
temas/povoado.map