From a66ac9ba810d497b202ed3429debfcd394f06f95 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 24 Jun 2008 13:06:17 +0000 Subject: [PATCH] Incluido um box no mapa de referência para refletir a alteração da extensão geográfica do mapa na opção de alteração da extensão --- classesjs/funcoes.js | 4 +++- classesjs/iniciamma.js | 1 + ferramentas/mostraexten/index.htm | 26 ++++++++++++-------------- ferramentas/mostraexten/index.js | 37 ++++++++++++++++++++++++++++++++++++- 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/classesjs/funcoes.js b/classesjs/funcoes.js index c7d273b..48ba680 100644 --- a/classesjs/funcoes.js +++ b/classesjs/funcoes.js @@ -1701,7 +1701,9 @@ function initJanelaRef() ins += " "; ins += ' '+$trad("o6")+''; ins += '
'; - ins += ''; + ins += ''; + ins += '
'; + ins += '
'; novoel.innerHTML = ins; document.body.appendChild(novoel); diff --git a/classesjs/iniciamma.js b/classesjs/iniciamma.js index 0c4488f..8001b1b 100644 --- a/classesjs/iniciamma.js +++ b/classesjs/iniciamma.js @@ -834,6 +834,7 @@ function Mapa(e,m) this.atualizaReferencia = function(mapexten) { //objaguarde.abre("ajaxreferencia1",$trad("o3")); + if($i("boxRef")){$i("boxRef").style.display="none";} //div utilizado na ferramenta mostraexten var dinamico = false; if ($i("refDinamico")) {var dinamico = $i("refDinamico").checked;} diff --git a/ferramentas/mostraexten/index.htm b/ferramentas/mostraexten/index.htm index 9474dde..fe07eb5 100644 --- a/ferramentas/mostraexten/index.htm +++ b/ferramentas/mostraexten/index.htm @@ -7,7 +7,6 @@ -
Extensão geográfica atual, em décimos de grau. As coordenadas correspondem a menor longitude, menor latitude, maior longitude e maior latitude: @@ -19,33 +18,33 @@ Menor longitude (oeste): - - - + + + Menor latitude (sul): - - - + + + Maior longitude (leste): - - - + + + Maior latitude (norte): - - - + + + @@ -55,7 +54,6 @@
- diff --git a/ferramentas/mostraexten/index.js b/ferramentas/mostraexten/index.js index 9aa648a..9541ef5 100644 --- a/ferramentas/mostraexten/index.js +++ b/ferramentas/mostraexten/index.js @@ -19,7 +19,19 @@ GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. */ -//inicializa +//pega o elemento boxref para desenhar um retângulo no mapa de referência +boxref = false +if (window.parent.document.getElementById("boxRef")) +{boxref = window.parent.document.getElementById("boxRef")} +if((boxref) && !window.parent.document.getElementById("refDinamico").checked) +{ + boxref.style.display="block"; + boxref.style.top=0; + boxref.style.left=0; + boxref.style.width=0; + boxref.style.height=0; +} +//inicializa alguns parâmetros. parametrosURL() YAHOO.example.init = function () { @@ -46,6 +58,8 @@ function aplicar() var yy = window.parent.convdmsddf($i("yyg").value,$i("yym").value,$i("yys").value); if ((x == xx) || (y == yy)) {alert("Digite coordenadas válidas");return;} + if ((x > xx) || (y > yy)) + {alert("Digite coordenadas válidas");return;} var cp = new cpaint(); cp.set_response_type("JSON"); //cp.set_debug(2) @@ -54,3 +68,24 @@ function aplicar() } catch(e){alert("Digite coordenadas válidas");} } +//muda o box no mapa de referência +function mudabox() +{ + if((boxref) && !window.parent.document.getElementById("refDinamico").checked) + { + var x = window.parent.convdmsddf($i("xg").value,$i("xm").value,$i("xs").value); + var xx = window.parent.convdmsddf($i("xxg").value,$i("xxm").value,$i("xxs").value); + var y = window.parent.convdmsddf($i("yg").value,$i("ym").value,$i("ys").value); + var yy = window.parent.convdmsddf($i("yyg").value,$i("yym").value,$i("yys").value); + if ((x == xx) || (y == yy)) + {return;} + if ((x > xx) || (y > yy)) + {return;} + //calculo da nova posição do box + var extr = window.parent.objmapa.extentref.split(" "); + boxref.style.left = ((extr[0] - x) / window.parent.g_celularef) * -1 + boxref.style.width = ((xx - x) / window.parent.g_celularef) + boxref.style.top = ((extr[3] - yy) / window.parent.g_celularef) + boxref.style.height = ((yy - y) / window.parent.g_celularef) + } +} \ No newline at end of file -- libgit2 0.21.2