From 61ae6b6c7a028d8535e32792c58010eefc61e3b4 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Fri, 24 Sep 2010 00:48:23 +0000 Subject: [PATCH] Revisão dos códigos da interface Google Maps --- aplicmap/geral.htm | 3 +++ classesjs/classe_arvoredecamadas.js | 14 +++++++++----- classesjs/classe_configura.js | 7 ++++--- classesjs/classe_gadgets.js | 16 +++++++++++++--- classesjs/classe_interface.js | 12 +++++++++--- classesjs/classe_tema.js | 22 +++++++++++++--------- classesjs/classe_util.js | 47 +++++++++++++++++++++++++++++------------------ classesjs/dicionario.js | 2 +- classesphp/classe_alteraclasse.php | 2 +- classesphp/classe_atributos.php | 12 +++++++----- classesphp/mapa_controle.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- ferramentas/cortina/index.js.php | 2 +- ferramentas/identifica/index.js.php | 4 ++++ ferramentas/linhadotempo/index.php | 2 ++ ferramentas/opcoes_fundo/index.js.php | 2 +- imagens/logo_inicio.png | Bin 33629 -> 0 bytes menutemas/admin.db | Bin 66560 -> 0 bytes ms_configura.php | 2 +- 18 files changed, 145 insertions(+), 58 deletions(-) diff --git a/aplicmap/geral.htm b/aplicmap/geral.htm index 9e1ec90..02fc50c 100644 --- a/aplicmap/geral.htm +++ b/aplicmap/geral.htm @@ -215,6 +215,9 @@ i3GEO.barraDeBotoes.AUTO = true //as barras de botões serão construídas automati i3GEO.idioma.IDSELETOR = "seletorIdiomas" i3GEO.interface.ATIVAMENUCONTEXTO = true; + +//i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml = ""; + i3GEO.inicia(); // //inclui um tema via javascript diff --git a/classesjs/classe_arvoredecamadas.js b/classesjs/classe_arvoredecamadas.js index 558a7e5..bb113eb 100644 --- a/classesjs/classe_arvoredecamadas.js +++ b/classesjs/classe_arvoredecamadas.js @@ -596,11 +596,15 @@ i3GEO.arvoreDeCamadas = { //exclui tema if(DDM.getDDById(id).id === "i3geo_lixeira"){ if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true){ - i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1")); + tema = (this.getEl()).id.split("arrastar_")[1]; + i3GEO.tema.exclui(tema); + /* + i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1")); tema = (this.getEl()).id.split("arrastar_")[1]; i3GEO.contadorAtualiza++; i3GEO.php.excluitema(i3GEO.atualiza,tema); i3GEO.mapa.ativaTema(""); + */ } } //muda ordem de desenho do tema @@ -748,9 +752,7 @@ i3GEO.arvoreDeCamadas = { if(i3GEO.Interface.ATUAL !== "flamingo") {i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t22"),$trad("t23"),'i3GEO.tema.dialogo.procuraratrib(\"'+ltema.name+'\")',node);} i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t24"),$trad("t25"),'i3GEO.tema.dialogo.toponimia(\"'+ltema.name+'\")',node); - if(i3GEO.Interface.ATUAL === "padrao"){ - i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t26"),$trad("t27"),'i3GEO.tema.dialogo.etiquetas(\"'+ltema.name+'\")',node); - } + i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t26"),$trad("t27"),'i3GEO.tema.dialogo.etiquetas(\"'+ltema.name+'\")',node); i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t28"),$trad("t29"),'i3GEO.tema.dialogo.filtro(\"'+ltema.name+'\")',node); i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t30"),$trad("t31"),'i3GEO.tema.dialogo.tabela(\"'+ltema.name+'\")',node); if(i3GEO.parametros.versaoms > 4){ @@ -760,7 +762,9 @@ i3GEO.arvoreDeCamadas = { if (ltema.type < 4){ i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t32"),$trad("t33"),'i3GEO.tema.dialogo.editaLegenda(\"'+ltema.name+'\")',node); } - i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t34"),$trad("t35"),'i3GEO.navega.destacaTema.inicia(\"'+ltema.name+'\")',node); + if(i3GEO.Interface.ATUAL !== "googlemaps"){ + i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t34"),$trad("t35"),'i3GEO.navega.destacaTema.inicia(\"'+ltema.name+'\")',node); + } if(i3GEO.Interface.ATUAL !== "padrao"){ i3GEO.arvoreDeCamadas.adicionaOpcaoTema($trad("t42"),$trad("t42"),'i3GEO.tema.dialogo.cortina(\"'+ltema.name+'\")',node); } diff --git a/classesjs/classe_configura.js b/classesjs/classe_configura.js index 4770d66..28a2df7 100644 --- a/classesjs/classe_configura.js +++ b/classesjs/classe_configura.js @@ -434,9 +434,9 @@ i3GEO.configura = { "pan": {ff:"/imagens/cursores/pan.png",ie:"/imagens/cursores/pan.cur"}, "area": - {ff:"/imagens/cursores/area.png",ie:"crosshair"}, + {ff:"crosshair",ie:"crosshair"}, "distancia": - {ff:"/imagens/cursores/distancia.png",ie:"crosshair"}, + {ff:"crosshair",ie:"crosshair"}, "zoom": {ff:"/imagens/cursores/zoom.png",ie:"/imagens/cursores/zoom.cur"}, "contexto": @@ -647,6 +647,7 @@ i3GEO.configura = { i3GEO.barraDeBotoes.BOTAOPADRAO = "pan"; if(i3GEO.Interface.ATUAL === "googlemaps"){ i3GeoMap.setOptions({draggable:true}); + i3GEO.util.mudaCursor(i3GEO.configura.cursores,"pan",i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); return; } if($i(i3GEO.Interface.IDMAPA)){ @@ -791,7 +792,7 @@ i3GEO.configura = { if($i(i3GEO.Interface.IDMAPA)){ $i(i3GEO.Interface.IDMAPA).title = ""; temp = "identifica"; - if(i3GEO.Interface.ATIVAMENUCONTEXTO) + if(i3GEO.Interface.ATIVAMENUCONTEXTO && i3GEO.Interface.ATUAL !== "googlemaps") {temp = "identifica_contexto";} i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); } diff --git a/classesjs/classe_gadgets.js b/classesjs/classe_gadgets.js index 67a9164..243ec55 100644 --- a/classesjs/classe_gadgets.js +++ b/classesjs/classe_gadgets.js @@ -49,7 +49,11 @@ i3GEO.gadgets = { Você pode acessar os parâmetros da seguinte forma: - i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda = 400 + i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda = 400; + + Para evitar o funcionamento de um gadget experimente utilizar o seguinte exemplo: + + i3GEO.gadgets.PARAMETROS.mostraCoordenadasUTM.idhtml = ""; Default: @@ -355,8 +359,14 @@ i3GEO.gadgets = { } if(arguments.length === 1) {e.value = escala;} - else - {e.value = parseInt(i3GEO.parametros.mapscale,10);} + else{ + if(i3GEO.parametros.mapscale != ""){ + e.value = parseInt(i3GEO.parametros.mapscale,10); + } + else{ + e.value = 0; + } + } }; if(!$i("i3geo_escalanum")){ i = $inputText(id,"155","i3geo_escalanum",$trad("d10"),"15",parseInt(i3GEO.parametros.mapscale,10)); diff --git a/classesjs/classe_interface.js b/classesjs/classe_interface.js index 225a692..71d50cf 100644 --- a/classesjs/classe_interface.js +++ b/classesjs/classe_interface.js @@ -1376,19 +1376,25 @@ i3GEO.Interface = { }, recalcPar: function(){ try{ - var bounds,sw,ne; + var bounds, + sw, + ne, + escalaAtual = i3GEO.parametros.mapscale; g_operacao = ""; g_tipoacao = ""; sw = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,i3GEO.parametros.h)); ne = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(i3GEO.parametros.w,0)); i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat(); i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala(); + //alert(i3GEO.parametros.mapscale) sw = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,1)); ne = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(1,0)); - i3GEO.parametros.pixelsize = sw.lng() - ne.lng(); if(i3GEO.parametros.pixelsize < 0) {i3GEO.parametros.pixelsize = i3GEO.parametros.pixelsize * -1;} + + if (i3GEO.parametros.mapscale !== escalaAtual && escalaAtual !== 0) + {i3GEO.arvoreDeCamadas.atualizaFarol(i3GEO.parametros.mapscale);} } catch(e){ i3GEO.parametros.mapexten = "0 0 0 0"; @@ -1422,7 +1428,7 @@ i3GEO.Interface = { i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne)); }, pan2ponto: function(x,y){ - i3GeoMap.panTo(new google.maps.LatLng(x,y)); + i3GeoMap.panTo(new google.maps.LatLng(y,x)); }, /* Function: adicionaKml diff --git a/classesjs/classe_tema.js b/classesjs/classe_tema.js index 6f1ba1a..749c134 100644 --- a/classesjs/classe_tema.js +++ b/classesjs/classe_tema.js @@ -50,24 +50,28 @@ i3GEO.tema = { //remove o tema do DOM e seus filhos var layer, indice, + p; + try{ p = document.getElementById("idx"+tema).parentNode.parentNode.parentNode; - do - {p.removeChild(p.childNodes[0]);} - while - (p.childNodes.length > 0); - p.parentNode.removeChild(p); + do + {p.removeChild(p.childNodes[0]);} + while + (p.childNodes.length > 0); + p.parentNode.removeChild(p); + } + catch(e){} i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); i3GEO.contadorAtualiza++; + if(i3GEO.Interface.ATUAL === "googlemaps"){ + indice = i3GEO.Interface.googlemaps.retornaIndiceLayer(tema); + i3GeoMap.overlayMapTypes.removeAt(indice); + } i3GEO.php.excluitema(i3GEO.atualiza,tema); i3GEO.mapa.ativaTema(""); if(i3GEO.Interface.ATUAL === "openlayers"){ layer = i3geoOL.getLayersByName(tema)[0]; i3geoOL.removeLayer(layer); } - if(i3GEO.Interface.ATUAL === "googlemaps"){ - indice = i3GEO.Interface.googlemaps.retornaIndiceLayer(tema); - i3GeoMap.overlayMapTypes.removeAt(indice); - } }, /* Function: fonte diff --git a/classesjs/classe_util.js b/classesjs/classe_util.js index d2bad8e..4421850 100644 --- a/classesjs/classe_util.js +++ b/classesjs/classe_util.js @@ -488,34 +488,45 @@ i3GEO.util = { i, c, n, - layers; + layers, + cursor; // //no caso da interface openlayers, o cursor deve ser definido no estilo //do elemento img de cada TILE de cada LAYER //para achar os img faz-se a busca pela classe css utilizada pelo OpenLayers nos img desse tipo // - if(i3GEO.Interface.ATUAL === "openlayers"){ - os = YAHOO.util.Dom.getElementsByClassName('olTileImage', 'img'); - } - else - {os.push(document.getElementById(idobjeto));} - n = os.length; - for(i=0;imapa = ms_newMapObj($map_file); $this->arquivo = $map_file; if($tema != "" && @$this->mapa->getlayerbyname($tema)) - $this->layer = $this->mapa->getlayerbyname($tema); - if($this->layer->getProjection() == "" ) - {$this->layer->setProjection("init=epsg:4291");} - $this->nome = $tema; + { + $this->layer = $this->mapa->getlayerbyname($tema); + if($this->layer->getProjection() == "" ) + {$this->layer->setProjection("init=epsg:4291");} + $this->nome = $tema; + } if($ext && $ext != ""){ $e = explode(" ",$ext); $extatual = $this->mapa->extent; diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index 435a3f4..094b9dc 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -1192,7 +1192,14 @@ Muda a extensão geográfica do mapa de acordo com a abrangência de um tema. include_once("classe_temas.php"); copiaSeguranca($map_file); $m = new Temas($map_file,$tema); + if($interface == "googlemaps") + { + $projMapa = $m->mapa->getProjection(); + $m->mapa->setProjection("init=epsg:4291"); + } $m->zoomTema(); + if($interface == "googlemaps") + {$m->mapa->setProjection($projMapa);} $m->salva(); redesenhaMapa(); break; @@ -1207,7 +1214,14 @@ Muda a extensão geográfica do mapa de acordo com a abrangência dos elementos sel include_once("classe_temas.php"); copiaSeguranca($map_file); $m = new Temas($map_file,$tema); + if($interface == "googlemaps") + { + $projMapa = $m->mapa->getProjection(); + $m->mapa->setProjection("init=epsg:4291"); + } $m->zoomSel(); + if($interface == "googlemaps") + {$m->mapa->setProjection($projMapa);} $m->salva(); redesenhaMapa(); break; @@ -1340,6 +1354,11 @@ Altera uma classe de um tema, aplicando uma nova classificação ou modificando pa include_once("classe_alteraclasse.php"); copiaSeguranca($map_file); $m = new Alteraclasse($map_file,$tema,"",$ext); + if($interface == "googlemaps") + { + $projMapa = $m->mapa->getProjection(); + $m->mapa->setProjection("init=epsg:4291"); + } if ($opcao == "adicionaclasse") {$retorno = $m->adicionaclasse();} if ($opcao == "valorunico") @@ -1358,6 +1377,8 @@ Altera uma classe de um tema, aplicando uma nova classificação ou modificando pa } if ($opcao == "simbolounico") {$retorno = $m->simbolounico();} + if($interface == "googlemaps") + {$m->mapa->setProjection($projMapa);} $salvo = $m->salva(); break; /* @@ -1968,6 +1989,8 @@ Procura valores em uma tabela que aderem a uma palavra de busca. include_once("classe_atributos.php"); if(!isset($tema)){$tema = "";} $m = new Atributos($map_file,$tema,"",$ext); + if($interface == "googlemaps") + {$m->mapa->setProjection("init=epsg:4291");} $retorno = $m->buscaRegistros($palavra,$lista,$tipo,$onde); break; /* @@ -1983,8 +2006,19 @@ Identifica elementos no mapa. if (!isset($tema)){$tema = "";} if (!isset($resolucao)){$resolucao = 5;} include_once("classe_atributos.php"); - $m = new Atributos($map_file,$tema); + $m = new Atributos($map_file,$tema); + if($interface == "googlemaps") + { + $projMapa = $m->mapa->getProjection(); + $m->mapa->setProjection("init=epsg:4291"); + $m->salva(); + } $retorno = $m->identifica($opcao,$xy,$resolucao); + if($interface == "googlemaps") + { + $m->mapa->setProjection($projMapa); + $m->salva(); + } break; /* Valor: IDENTIFICA2 @@ -1999,15 +2033,21 @@ Identifica elementos no mapa. include_once("classe_atributos.php"); if(!isset($ext)) {$ext = "";} - if(isset($ext) && $ext != "" && $interface == "googlemaps") - { - $ext = projetaExt($map_file,$ext); - $xy = projetaExt($map_file,$xy,","); - } $m = new Atributos($map_file,$tema,"",$ext); + if($interface == "googlemaps") + { + $projMapa = $m->mapa->getProjection(); + $m->mapa->setProjection("init=epsg:4291"); + $m->salva(); + } $retorno = $m->identifica2($opcao,$xy,$resolucao,$ext,$listaDeTemas); + if($interface == "googlemaps") + { + $m->mapa->setProjection($projMapa); + $m->salva(); + } + break; - /* Valor: IDENTIFICAUNICO diff --git a/ferramentas/cortina/index.js.php b/ferramentas/cortina/index.js.php index 72215db..0858353 100644 --- a/ferramentas/cortina/index.js.php +++ b/ferramentas/cortina/index.js.php @@ -135,7 +135,7 @@ i3GEOF.cortina = { catch(e){} } if(i3GEO.Interface.ATUAL === "googlemaps"){ - var divlayer = i3GEO.Interface.googlemaps.retornaDivLayer(i3GEO.temaAtivo); + var estilo = (i3GEO.Interface.googlemaps.retornaDivLayer(i3GEO.temaAtivo)).style; if(navm) {estilo.clip = "rect(0px,"+i3GEO.parametros.w+"px,"+i3GEO.parametros.h+"px,0px)";} else diff --git a/ferramentas/identifica/index.js.php b/ferramentas/identifica/index.js.php index f536d5a..0585783 100644 --- a/ferramentas/identifica/index.js.php +++ b/ferramentas/identifica/index.js.php @@ -209,6 +209,10 @@ i3GEOF.identifica = { var i = $i("i3GEOF.identifica_c").style; i3GEO.janela.ULTIMOZINDEX++; i.zIndex = 10000 + i3GEO.janela.ULTIMOZINDEX; + temp = "identifica"; + if(i3GEO.Interface.ATIVAMENUCONTEXTO && i3GEO.Interface.ATUAL !== "googlemaps") + {temp = "identifica_contexto";} + i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); }, /* Function: html diff --git a/ferramentas/linhadotempo/index.php b/ferramentas/linhadotempo/index.php index 2bf8dee..5e79471 100644 --- a/ferramentas/linhadotempo/index.php +++ b/ferramentas/linhadotempo/index.php @@ -17,6 +17,7 @@ Timeline_parameters='bundle=true';

Escolha o tema para gerar a linha do tempo:

+