From 9d69c7969410c10c2a53cd28cf6590225c865209 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 9 Sep 2015 15:06:32 +0000 Subject: [PATCH] Correções em ferramentas para uso do OL3 --- classesjs/classe_analise.js | 2 +- classesphp/classe_temas.php | 1 + classesphp/classe_toponimia.php | 1 + classesphp/mapa_controle.php | 5 ++++- ferramentas/inseretxt/index.js | 2 +- ferramentas/mostraexten/index.js | 20 ++++++++++++-------- ferramentas/selecao/index.js | 16 +++++++++------- ferramentas/toponimia/exec.php | 10 ++++++---- js/desenho.js | 3 +++ 9 files changed, 38 insertions(+), 22 deletions(-) diff --git a/classesjs/classe_analise.js b/classesjs/classe_analise.js index f6a310f..368a3d7 100644 --- a/classesjs/classe_analise.js +++ b/classesjs/classe_analise.js @@ -501,7 +501,7 @@ i3GEO.analise = * layer para receber os graficos */ inicia : function() { - var linha, estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], controle = + var linha, controle = i3geoOL.getControlsBy("id", "i3GeoMedeDistancia"); i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); i3GEO.analise.medeDistancia.pontos = { diff --git a/classesphp/classe_temas.php b/classesphp/classe_temas.php index 1ba3324..b2d32dd 100644 --- a/classesphp/classe_temas.php +++ b/classesphp/classe_temas.php @@ -757,6 +757,7 @@ $wkt - boolean indicando se $xy e um WKT case "ANNOTATION": //$c->set("status",MS_DELETE); $pinlayer->setmetadata("TEMA",$texto); + $pinlayer->setmetadata("tiles","nao"); $pinlayer->set("type",MS_LAYER_ANNOTATION); $pinlayer->set("opacity","100"); break; diff --git a/classesphp/classe_toponimia.php b/classesphp/classe_toponimia.php index 242ca12..91f894b 100644 --- a/classesphp/classe_toponimia.php +++ b/classesphp/classe_toponimia.php @@ -196,6 +196,7 @@ Retorno: $novolayer->set("status",MS_DEFAULT); $novolayer->setmetadata("tema","texto de ".$nome); $novolayer->setmetadata("tip",""); + $novolayer->setmetadata("tiles","nao"); $novolayer->setmetadata("identifica","nao"); $novolayer->set("labelitem",$item); } diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index d2fb353..1865f15 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -980,7 +980,10 @@ switch (strtoupper($funcao)) if(!isset($wkt)){ $wkt = false; } - $m->insereFeature($marca,$tipo,$xy,$texto,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$wrap,$wkt); + if(!isset($nomeTema)){ + $nomeTema = ""; + } + $m->insereFeature($marca,$tipo,$xy,$texto,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$wrap,$wkt,$nomeTema); $m->salva(); $_SESSION["contadorsalva"]++; redesenhaMapa(); diff --git a/ferramentas/inseretxt/index.js b/ferramentas/inseretxt/index.js index ba9cc06..3a79126 100644 --- a/ferramentas/inseretxt/index.js +++ b/ferramentas/inseretxt/index.js @@ -374,7 +374,7 @@ i3GEOF.inseretxt = { par += "&cor=0 0 0"; } p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+ - "&funcao=inserefeature&"+par+"&pin="+nometema+"&tipo=LINE&texto="+texto+" (conector)&xy="+xy; + "&funcao=inserefeature&"+par+"&pin="+nometema+"&tipo=LINE&nomeTema="+texto+" (conector)&xy="+xy; if(par === false){ i3GEOF.inseretxt.aguarde.visibility = "hidden"; return; diff --git a/ferramentas/mostraexten/index.js b/ferramentas/mostraexten/index.js index 28d9edf..a27ecd0 100644 --- a/ferramentas/mostraexten/index.js +++ b/ferramentas/mostraexten/index.js @@ -158,14 +158,18 @@ i3GEOF.mostraExten = { */ executa: function(){ try{ - var x = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxg").value,$i("i3GEOmostraExtenxm").value,$i("i3GEOmostraExtenxs").value); - var xx = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxxg").value,$i("i3GEOmostraExtenxxm").value,$i("i3GEOmostraExtenxxs").value); - var y = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyg").value,$i("i3GEOmostraExtenym").value,$i("i3GEOmostraExtenys").value); - var yy = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyyg").value,$i("i3GEOmostraExtenyym").value,$i("i3GEOmostraExtenyys").value); - if ((x == xx) || (y == yy)) - {i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario));return;} - if ((x > xx) || (y > yy)) - {i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario));return;} + var x = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxg").value,$i("i3GEOmostraExtenxm").value,$i("i3GEOmostraExtenxs").value), + xx = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxxg").value,$i("i3GEOmostraExtenxxm").value,$i("i3GEOmostraExtenxxs").value), + y = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyg").value,$i("i3GEOmostraExtenym").value,$i("i3GEOmostraExtenys").value), + yy = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyyg").value,$i("i3GEOmostraExtenyym").value,$i("i3GEOmostraExtenyys").value); + if ((x == xx) || (y == yy)){ + i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario)); + return; + } + if ((x > xx) || (y > yy)){ + i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario)); + return; + } i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,window.parent.i3GEO.parametros.tipoimagem,(x+" "+y+" "+xx+" "+yy)); } catch(e){i3GEO.janela.tempoMsg(e+" Erro.");} diff --git a/ferramentas/selecao/index.js b/ferramentas/selecao/index.js index 9435c13..a56869d 100644 --- a/ferramentas/selecao/index.js +++ b/ferramentas/selecao/index.js @@ -483,9 +483,11 @@ i3GEOF.selecao = i3GEO.Interface.atualizaTema(retorno, tema); nsel = i3GEO.arvoreDeCamadas.pegaTema(tema, retorno.data.temas); $i("i3GEOselecaoNsel").innerHTML = $trad('selecionados', i3GEOF.selecao.dicionario) + ": " + (nsel.nsel); - i3GEO.eventos.adicionaEventos("SELECAO", [ - "i3GEOF.tabela.atualizaListaDeRegistros()" - ]); + if(i3GEOF.tabela){ + i3GEO.eventos.adicionaEventos("SELECAO", [ + "i3GEOF.tabela.atualizaListaDeRegistros()" + ]); + } i3GEO.eventos.executaEventos(i3GEO.eventos.SELECAO); }, /* @@ -898,18 +900,18 @@ i3GEOF.selecao = draw : "", inicia : function() { var features = i3GEO.desenho.layergrafico.getFeatures(); - if(features.getLength() === 0){ + if(features.length === 0){ return; } i3GEO.eventos.cliquePerm.desativa(); i3GEOF.selecao.figura.ol3.removeControle(); i3GEOF.selecao.figura.ol3.draw = new ol.interaction.Select(); i3GEOF.selecao.figura.ol3.draw.on("select",function(evt){ - var wkt, geo, i, n, f, format = new ol.format.WKT(); + var wkt, i, n, f, format = new ol.format.WKT(); geo = i3GEOF.selecao.figura.ol3.draw.getFeatures(); - n = geo.getLength(); + n = evt.selected.length; for(i=0; icriaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo,$wrap,$novotema); if(empty($maxscale)){ $maxscale = -1; diff --git a/js/desenho.js b/js/desenho.js index 97e68e2..ec19b6b 100755 --- a/js/desenho.js +++ b/js/desenho.js @@ -428,6 +428,9 @@ i3GEO.desenho = }) }); i3GEO.desenho.layergrafico.setMap(i3geoOL); + i3GEO.desenho.layergrafico.getFeatures = function(){ + return i3GEO.desenho.layergrafico.getSource().getFeatures(); + }; } return; if (!i3GEO.desenho.layergrafico) { -- libgit2 0.21.2