Commit 99a4d32ed048e8234b6c764c862bb401e6f03d5a
1 parent
3b87983a
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
49 additions
and
15 deletions
Show diff stats
ferramentas/wmstime/index.htm
| ... | ... | @@ -21,7 +21,7 @@ textarea |
| 21 | 21 | <div id=controle style="text-align:center;display:none;position:absolute;cursor:pointer" > |
| 22 | 22 | <img title='inicia' src="../../imagens/player_inicia.png" onclick="iniciarFilme()" /> |
| 23 | 23 | <img title='pausa' src="../../imagens/player_pausa.png" onclick="pausarFilme()" /> |
| 24 | - <img title='rebobina' src="../../imagens/player_para.png" onclick="pararFilme()" /> | |
| 24 | + <img title='rebobina' src="../../imagens/player_para.png" onclick="rebobina()" /> | |
| 25 | 25 | <img title='mais rapido' src="../../imagens/player_avanca.png" onclick="maisrapido()" /> |
| 26 | 26 | <img title='mais lento' src="../../imagens/player_volta.png" onclick="maislento()" /> |
| 27 | 27 | <input style='position:relative;top:-2px;' onclick="javascript:$i('quadroAnima').style.display='none';$i('parametros').style.display='block';" size=18 type='button' value='Voltar' /> |
| ... | ... | @@ -30,4 +30,4 @@ textarea |
| 30 | 30 | <script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script> |
| 31 | 31 | <script type="text/javascript" src="index.js"></script> |
| 32 | 32 | </body> |
| 33 | -</html> | |
| 34 | 33 | \ No newline at end of file |
| 34 | +</html> | ... | ... |
ferramentas/wmstime/index.js
| ... | ... | @@ -82,7 +82,8 @@ ins += "<div id='divumaImagemPor' style=width:200px; ></div>"; |
| 82 | 82 | ins += "<div onclick='iniciaImagens()' style='text-align:left;left:0px;top:20px;'><input id='botao1' size=18 type='button' value='Continuar' /></div>"; |
| 83 | 83 | ins += "</div>"; |
| 84 | 84 | $i("parametros").innerHTML = ins; |
| 85 | - | |
| 85 | +idServicoEscolhido = ""; | |
| 86 | +emPausa = true; | |
| 86 | 87 | //new YAHOO.widget.Button("botao1"); |
| 87 | 88 | /* |
| 88 | 89 | Function: escolheuServico |
| ... | ... | @@ -94,6 +95,7 @@ Parametro: |
| 94 | 95 | idWMS {String} - id do serviço escolhido |
| 95 | 96 | */ |
| 96 | 97 | function escolheuServico(idWMS){ |
| 98 | + idServicoEscolhido = idWMS; | |
| 97 | 99 | tipoServico = wms_configura[idWMS].tipo; |
| 98 | 100 | servico = wms_configura[idWMS].servico+"&VERSION=1.1.1&REQUEST=GetMap&layers="+wms_configura[idWMS].layers+"&styles="+wms_configura[idWMS].styles+"&srs="+wms_configura[idWMS].srs+"&format="+wms_configura[idWMS].format; |
| 99 | 101 | $i("iServico").value = servico; |
| ... | ... | @@ -241,7 +243,12 @@ function criaImg(tempo,id){ |
| 241 | 243 | novoel.style.left = "0px"; |
| 242 | 244 | novoel.style.width = dw+"px"; |
| 243 | 245 | novoel.style.height = dh+"px"; |
| 246 | + novoel.style.cursor = "pointer"; | |
| 244 | 247 | novoel.src = $i("iServico").value+"&width="+dw+"&height="+dh+"&bbox="+bbox+"&time="+tempo; //"../../imagens/atlas1.jpg"; |
| 248 | + novoel.title = 'clique para adicionar ao mapa'; | |
| 249 | + novoel.onclick = function(){ | |
| 250 | + adicionaMapa(idServicoEscolhido); | |
| 251 | + }; | |
| 245 | 252 | novoel.onload = function(){ |
| 246 | 253 | $i("status"+this.id).innerHTML = " <span style=color:red >OK</span>"; |
| 247 | 254 | idsValidos.push(this.id); |
| ... | ... | @@ -325,7 +332,7 @@ function criaMarcadorTempo(){ |
| 325 | 332 | for(var i=1;i<=nmarcas;i++){ |
| 326 | 333 | ins += "<img title='clique para adicionar ao mapa' onclick='adicionaMapa(\""+i+"\")' onmouseover='mostraI(\""+i+"\")' onmouseout='escondeI(\""+i+"\")' style='position:absolute;top:"+(dh + 10)+"px;left:"+parseInt((distanciaMarcas*i - (distanciaMarcas/2)))+"px;' src='../../imagens/dot1.gif' id='marcaTempo"+i+"' />"; |
| 327 | 334 | } |
| 328 | - ins += "<img style='position:absolute;top:"+(dh + 5)+"px;left:"+parseInt((distanciaMarcas - (distanciaMarcas/2)))+"px;' src='../../imagens/dot1red.gif' id='marcaDeTempo' />"; | |
| 335 | + ins += "<img style='position:absolute;top:"+(dh - 5)+"px;left:"+parseInt((distanciaMarcas - (distanciaMarcas/2)))+"px;' src='../../imagens/dot1red.gif' id='marcaDeTempo' />"; | |
| 329 | 336 | ins += "<img style='position:absolute;top:"+(dh + 10)+"px;left:"+parseInt((distanciaMarcas - (distanciaMarcas/2)))+"px;' src='../../imagens/dot1cinza.gif' id='marcaGranulo' />"; |
| 330 | 337 | ngranulo = nmarcas; |
| 331 | 338 | tgranulo = (parseInt((distanciaMarcas*i - (distanciaMarcas/2))) - ini) / 10; |
| ... | ... | @@ -376,9 +383,10 @@ Function: adicionaMapa |
| 376 | 383 | Adiciona uma camada ao mapa baseado na imagem vista na tela |
| 377 | 384 | |
| 378 | 385 | */ |
| 379 | -function adicionaMapa(obj){ | |
| 386 | +function adicionaMapa(idMarca){ | |
| 380 | 387 | aguarde("block"); |
| 381 | - var serv = wms_configura[obj-1]; | |
| 388 | + idMarca = parseInt(idMarca,10); | |
| 389 | + var serv = wms_configura[idServicoEscolhido]; | |
| 382 | 390 | var fim = function(retorno){ |
| 383 | 391 | aguarde("none"); |
| 384 | 392 | if (retorno.data.erro) |
| ... | ... | @@ -397,10 +405,10 @@ function adicionaMapa(obj){ |
| 397 | 405 | p += "&formato="+serv.format; |
| 398 | 406 | p += "&tipo=estilo"; |
| 399 | 407 | p += "&versao=1.1.1"; |
| 400 | - p += "&nomecamada="+serv.titulo+" "+idsTempo[obj-1]; | |
| 408 | + p += "&nomecamada="+serv.titulo+" "+idsTempo[idMarca-1]; | |
| 401 | 409 | p += "&tiporep=&suportasld=nao"; |
| 402 | 410 | p += "&formatosinfo=text/plain,application/vnd.ogc.gml"; |
| 403 | - p += "&time="+idsTempo[obj-1]; | |
| 411 | + p += "&time="+idsTempo[idMarca-1]; | |
| 404 | 412 | var cp = new cpaint(); |
| 405 | 413 | cp.set_response_type("JSON"); |
| 406 | 414 | cp.call(p,"wmstime",fim); |
| ... | ... | @@ -418,15 +426,36 @@ function ativaQuadro(i){ |
| 418 | 426 | q.style.position = "relative"; |
| 419 | 427 | q.style.display = "block"; |
| 420 | 428 | } |
| 421 | - marcaVermelha.style.left = $i("marcaTempo"+(i)).style.left; | |
| 429 | + if($i("marcaTempo"+i)){ | |
| 430 | + $i("marcaTempo"+i).style.display = "block"; | |
| 431 | + } | |
| 432 | + if($i("marcaTempo"+(i))){ | |
| 433 | + marcaVermelha.style.left = $i("marcaTempo"+(i)).style.left; | |
| 434 | + } | |
| 422 | 435 | } |
| 423 | 436 | function pausarFilme(){ |
| 424 | - pulaGranulo = 11; | |
| 425 | - try{ | |
| 426 | - clearTimeout(ganima); | |
| 427 | - }catch(e){} | |
| 437 | + emPausa = !emPausa; | |
| 438 | + if(emPausa == false){ | |
| 439 | + anima(); | |
| 440 | + } | |
| 441 | + else{ | |
| 442 | + imgGranulo.style.display="none"; | |
| 443 | + pulaGranulo = 11; | |
| 444 | + try{ | |
| 445 | + clearTimeout(ganima); | |
| 446 | + }catch(e){} | |
| 447 | + } | |
| 448 | +} | |
| 449 | +function esconderMarcasTempo(){ | |
| 450 | + var n = idsValidos.length; | |
| 451 | + for(var i=0;i<n;i++){ | |
| 452 | + if($i("marcaTempo"+i)){ | |
| 453 | + $i("marcaTempo"+i).style.display = "none"; | |
| 454 | + } | |
| 455 | + } | |
| 428 | 456 | } |
| 429 | 457 | function pararFilme(){ |
| 458 | + emPausa = false; | |
| 430 | 459 | imgGranulo.style.left = parseInt((distanciaMarcas - (distanciaMarcas/2)))+"px"; |
| 431 | 460 | quadroAtual = 0; |
| 432 | 461 | desativaQuadros(); |
| ... | ... | @@ -439,11 +468,17 @@ function pararFilme(){ |
| 439 | 468 | }catch(e){} |
| 440 | 469 | } |
| 441 | 470 | function iniciarFilme(){ |
| 471 | + emPausa = false; | |
| 472 | + esconderMarcasTempo(); | |
| 442 | 473 | imgGranulo.style.display="block"; |
| 443 | 474 | //tanima = setTimeout("anima()",tempoAnima) |
| 444 | 475 | //ganima = setTimeout("animacaoGranulo()",tempoGranulo) |
| 445 | 476 | anima(); |
| 446 | 477 | } |
| 478 | +function rebobina(){ | |
| 479 | + esconderMarcasTempo(); | |
| 480 | + pararFilme(); | |
| 481 | +} | |
| 447 | 482 | function anima(){ |
| 448 | 483 | desativaQuadros(); |
| 449 | 484 | ativaQuadro(ids[quadroAtual]); |
| ... | ... | @@ -457,7 +492,6 @@ function anima(){ |
| 457 | 492 | } |
| 458 | 493 | else{ |
| 459 | 494 | imgGranulo.style.display="none"; |
| 460 | - pararFilme(); | |
| 461 | 495 | } |
| 462 | 496 | } |
| 463 | 497 | function animacaoGranulo(){ |
| ... | ... | @@ -474,4 +508,4 @@ function maisrapido(){ |
| 474 | 508 | } |
| 475 | 509 | function maislento(){ |
| 476 | 510 | tempoGranulo = tempoGranulo + 10; |
| 477 | -} | |
| 478 | 511 | \ No newline at end of file |
| 512 | +} | ... | ... |