Commit 117d59c40aefc30679fc31a99c9ad2a26946ac45

Authored by Edmar Moretti
1 parent fb45df0f

Opção para captura das coordenadas por meio de Alt+c na ferramenta "coordenadas"

classesjs/classe_coordenadas.js
... ... @@ -205,6 +205,12 @@ i3GEO.coordenadas = {
205 205 {idhtml:"localizarxy"}
206 206 },
207 207 /*
  208 + Variavel: MODOTEXTO
  209 +
  210 + Representação das coordenadas no modo texto
  211 + */
  212 + MODOTEXTO: "",
  213 + /*
208 214 Function: mostraCoordenadasUTM
209 215  
210 216 Obtém e mostra as coordenadas UTM da posição do mouse sobre o mapa por meio de um cálculo realizado no servidor.
... ... @@ -390,6 +396,7 @@ i3GEO.coordenadas = {
390 396 $i(prefixo+"yg").value = y[0];
391 397 $i(prefixo+"ym").value = y[1];
392 398 $i(prefixo+"ys").value = y[2];
  399 + i3GEO.coordenadas.MODOTEXTO += "DMS - Latitude: "+y[0]+" "+y[1]+" "+y[2]+" Longitude: "+x[0]+" "+x[1]+" "+x[2]+"<br>";
393 400 },
394 401 /*
395 402 Function: criaMascaraMetrica
... ... @@ -466,12 +473,13 @@ i3GEO.coordenadas = {
466 473 //
467 474 //no caso de dd
468 475 //
469   - if(temp.defepsg === "")
  476 + if(temp.defepsg === "" && temp.tipo === "metrica")
470 477 {p = {x:x,y:y};}
471 478 else
472 479 {p = i3GEO.coordenadas.calculaProj4(i3GEO.coordenadas.defOrigem,destino,x,y);}
473 480 i3GEO.util.defineValor(onde+configProj+"X","value",p.x);
474 481 i3GEO.util.defineValor(onde+configProj+"Y","value",p.y);
  482 + i3GEO.coordenadas.MODOTEXTO += temp.titulo+" - X: "+p.x+" Y: "+p.y+"<br>";
475 483 },
476 484 /*
477 485 Function: calculaProj4
... ... @@ -567,6 +575,7 @@ i3GEO.coordenadas = {
567 575 i = 0,
568 576 caixa,
569 577 janela;
  578 + i3GEO.coordenadas.MODOTEXTO = "";
570 579 if(arguments.length === 0){
571 580 ativaMovimento = true;
572 581 onde = "";
... ... @@ -608,7 +617,7 @@ i3GEO.coordenadas = {
608 617 if(this.formato === "janela"){
609 618 janela = i3GEO.janela.cria(
610 619 "450px",
611   - "90px",
  620 + "120px",
612 621 "",
613 622 "",
614 623 "",
... ... @@ -619,6 +628,7 @@ i3GEO.coordenadas = {
619 628 "",
620 629 ""
621 630 );
  631 + YAHOO.util.Event.addListener(janela[0].close, "click", function(){i3GEO.coordenadas.formato = "bloco",i3GEO.coordenadas.mostraCoordenadas();});
622 632 temp = $i("i3GEOJanelaCoordenadas_corpo");
623 633 temp.style.backgroundColor = "white";
624 634 temp.style.textAlign = "left";
... ... @@ -628,6 +638,9 @@ i3GEO.coordenadas = {
628 638 if($i(onde))
629 639 {$i(onde).innerHTML = "";}
630 640 onde = "i3GEOJanelaCoordenadas_corpo";
  641 +
  642 + ins += "<br><a href='#' style='cursor:pointer;color:blue' onclick='new YAHOO.util.KeyListener(document.body,{alt:true,keys:67},{fn: function(type, args, obj){alert(i3GEO.coordenadas.MODOTEXTO);}}).enable();' >" +
  643 + "Clique aqui para ativar Alt+C para poder capturar as coordenadas</a>";
631 644 }
632 645 if(onde !== "" && $i(onde))
633 646 {$i(onde).innerHTML = ins;}
... ... @@ -666,9 +679,16 @@ i3GEO.coordenadas = {
666 679 }
667 680 }
668 681 }
  682 + if(ativaMovimento === true){
  683 + if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.coordenadas.limpaModoTexto()") < 0)
  684 + {i3GEO.eventos.MOUSEMOVE.push("i3GEO.coordenadas.limpaModoTexto()");}
  685 + }
669 686 if(this.formato === "bloco")
670 687 {i3GEO.coordenadas.ativaBloco(onde);}
671 688 }
672 689 catch(men){}
  690 + },
  691 + limpaModoTexto: function(){
  692 + i3GEO.coordenadas.MODOTEXTO = "";
673 693 }
674 694 };
675 695 \ No newline at end of file
... ...
ferramentas/identifica/index.js.php
... ... @@ -159,26 +159,9 @@ i3GEOF.identifica = {
159 159 $i("i3GEOidentificaguia5").onclick = function(){
160 160 i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia5","i3GEOidentificaguia");
161 161 var ins = "",retorna;
162   - i3GEO.coordenadas.formato = "lista";
163   - i3GEO.coordenadas.mostraCoordenadas(false,"i3GEOidentificacoord",i3GEOF.identifica.x,i3GEOF.identifica.y);
164   - /*
165   - $i("i3GEOidentificacoord").innerHTML = "Aguarde...";
166   - retorna = function(utm){
167   - temp = i3GEO.calculo.dd2dms(i3GEOF.identifica.x,i3GEOF.identifica.y);
168   - ins += "<br><p class=paragrafo >Grau, minuto e segundo (DMS)</p>";
169   - ins += "<p class=paragrafo style=left:10px ><i>X (longitude): </i>"+temp[0]+"</p>";
170   - ins += "<p class=paragrafo style=left:10px ><i>Y (latitude): </i>"+temp[1]+"</p>";
171   - ins += "<br><p class=paragrafo >UTM (metros)</p>";
172   - ins += "<p class=paragrafo style=left:10px ><i>X (longitude): </i>"+utm.data.x+"</p>";
173   - ins += "<p class=paragrafo style=left:10px ><i>Y (latitude): </i>"+utm.data.y+"</p>";
174   - ins += "<p class=paragrafo style=left:10px ><i>Zona: </i>"+utm.data.zona+"</p>";
175   - ins += "<br><p class=paragrafo >Décimos de grau</p>";
176   - ins += "<p class=paragrafo style=left:10px ><i>X (longitude): </i>"+i3GEOF.identifica.x+"</p>";
177   - ins += "<p class=paragrafo style=left:10px ><i>Y (latitude): </i>"+i3GEOF.identifica.y+"</p>";
178   - $i("i3GEOidentificacoord").innerHTML = ins;
179   - };
180   - i3GEO.php.geo2utm(retorna,i3GEOF.identifica.x,i3GEOF.identifica.y);
181   - */
  162 + i3GEO.coordenadas.formato = "lista";
  163 + i3GEO.coordenadas.mostraCoordenadas(false,"i3GEOidentificacoord",i3GEOF.identifica.x,i3GEOF.identifica.y);
  164 + $i("i3GEOidentificacoordtexto").innerHTML = i3GEO.coordenadas.MODOTEXTO+"</span>";
182 165 };
183 166  
184 167 i3GEOF.identifica.listaTemas("ligados");
... ... @@ -327,7 +310,9 @@ i3GEOF.identifica = {
327 310 ins += ' </div>';
328 311 ins += ' <div class=guiaobj id="i3GEOidentificaguia5obj" style="left:1px;top:10px;display:none;font-size:12px;overflow:hidden" >';
329 312 ins += ' <b>Valores para o ponto indicado no mapa<br></b>';
330   - ins += ' <div id=i3GEOidentificacoord ></div>';
  313 + ins += ' <div id=i3GEOidentificacoord ></div><br>';
  314 + ins += ' <div id=i3GEOidentificacoordtexto style=text-align:left ></div>';
  315 +
331 316 ins += ' </div>';
332 317 //ins += '</div> ';
333 318 return ins;
... ...