Commit 9d69c7969410c10c2a53cd28cf6590225c865209

Authored by Edmar Moretti
1 parent 96c2acf3

Correções em ferramentas para uso do OL3

classesjs/classe_analise.js
@@ -501,7 +501,7 @@ i3GEO.analise = @@ -501,7 +501,7 @@ i3GEO.analise =
501 * layer para receber os graficos 501 * layer para receber os graficos
502 */ 502 */
503 inicia : function() { 503 inicia : function() {
504 - var linha, estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], controle = 504 + var linha, controle =
505 i3geoOL.getControlsBy("id", "i3GeoMedeDistancia"); 505 i3geoOL.getControlsBy("id", "i3GeoMedeDistancia");
506 i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); 506 i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia();
507 i3GEO.analise.medeDistancia.pontos = { 507 i3GEO.analise.medeDistancia.pontos = {
classesphp/classe_temas.php
@@ -757,6 +757,7 @@ $wkt - boolean indicando se $xy e um WKT @@ -757,6 +757,7 @@ $wkt - boolean indicando se $xy e um WKT
757 case "ANNOTATION": 757 case "ANNOTATION":
758 //$c->set("status",MS_DELETE); 758 //$c->set("status",MS_DELETE);
759 $pinlayer->setmetadata("TEMA",$texto); 759 $pinlayer->setmetadata("TEMA",$texto);
  760 + $pinlayer->setmetadata("tiles","nao");
760 $pinlayer->set("type",MS_LAYER_ANNOTATION); 761 $pinlayer->set("type",MS_LAYER_ANNOTATION);
761 $pinlayer->set("opacity","100"); 762 $pinlayer->set("opacity","100");
762 break; 763 break;
classesphp/classe_toponimia.php
@@ -196,6 +196,7 @@ Retorno: @@ -196,6 +196,7 @@ Retorno:
196 $novolayer->set("status",MS_DEFAULT); 196 $novolayer->set("status",MS_DEFAULT);
197 $novolayer->setmetadata("tema","texto de ".$nome); 197 $novolayer->setmetadata("tema","texto de ".$nome);
198 $novolayer->setmetadata("tip",""); 198 $novolayer->setmetadata("tip","");
  199 + $novolayer->setmetadata("tiles","nao");
199 $novolayer->setmetadata("identifica","nao"); 200 $novolayer->setmetadata("identifica","nao");
200 $novolayer->set("labelitem",$item); 201 $novolayer->set("labelitem",$item);
201 } 202 }
classesphp/mapa_controle.php
@@ -980,7 +980,10 @@ switch (strtoupper($funcao)) @@ -980,7 +980,10 @@ switch (strtoupper($funcao))
980 if(!isset($wkt)){ 980 if(!isset($wkt)){
981 $wkt = false; 981 $wkt = false;
982 } 982 }
983 - $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); 983 + if(!isset($nomeTema)){
  984 + $nomeTema = "";
  985 + }
  986 + $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);
984 $m->salva(); 987 $m->salva();
985 $_SESSION["contadorsalva"]++; 988 $_SESSION["contadorsalva"]++;
986 redesenhaMapa(); 989 redesenhaMapa();
ferramentas/inseretxt/index.js
@@ -374,7 +374,7 @@ i3GEOF.inseretxt = { @@ -374,7 +374,7 @@ i3GEOF.inseretxt = {
374 par += "&cor=0 0 0"; 374 par += "&cor=0 0 0";
375 } 375 }
376 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+ 376 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+
377 - "&funcao=inserefeature&"+par+"&pin="+nometema+"&tipo=LINE&texto="+texto+" (conector)&xy="+xy; 377 + "&funcao=inserefeature&"+par+"&pin="+nometema+"&tipo=LINE&nomeTema="+texto+" (conector)&xy="+xy;
378 if(par === false){ 378 if(par === false){
379 i3GEOF.inseretxt.aguarde.visibility = "hidden"; 379 i3GEOF.inseretxt.aguarde.visibility = "hidden";
380 return; 380 return;
ferramentas/mostraexten/index.js
@@ -158,14 +158,18 @@ i3GEOF.mostraExten = { @@ -158,14 +158,18 @@ i3GEOF.mostraExten = {
158 */ 158 */
159 executa: function(){ 159 executa: function(){
160 try{ 160 try{
161 - var x = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxg").value,$i("i3GEOmostraExtenxm").value,$i("i3GEOmostraExtenxs").value);  
162 - var xx = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxxg").value,$i("i3GEOmostraExtenxxm").value,$i("i3GEOmostraExtenxxs").value);  
163 - var y = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyg").value,$i("i3GEOmostraExtenym").value,$i("i3GEOmostraExtenys").value);  
164 - var yy = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyyg").value,$i("i3GEOmostraExtenyym").value,$i("i3GEOmostraExtenyys").value);  
165 - if ((x == xx) || (y == yy))  
166 - {i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario));return;}  
167 - if ((x > xx) || (y > yy))  
168 - {i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario));return;} 161 + var x = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxg").value,$i("i3GEOmostraExtenxm").value,$i("i3GEOmostraExtenxs").value),
  162 + xx = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenxxg").value,$i("i3GEOmostraExtenxxm").value,$i("i3GEOmostraExtenxxs").value),
  163 + y = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyg").value,$i("i3GEOmostraExtenym").value,$i("i3GEOmostraExtenys").value),
  164 + yy = i3GEO.calculo.dms2dd($i("i3GEOmostraExtenyyg").value,$i("i3GEOmostraExtenyym").value,$i("i3GEOmostraExtenyys").value);
  165 + if ((x == xx) || (y == yy)){
  166 + i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario));
  167 + return;
  168 + }
  169 + if ((x > xx) || (y > yy)){
  170 + i3GEO.janela.tempoMsg($trad('msgCoordValida',i3GEOF.mostraExten.dicionario));
  171 + return;
  172 + }
169 i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,window.parent.i3GEO.parametros.tipoimagem,(x+" "+y+" "+xx+" "+yy)); 173 i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,window.parent.i3GEO.parametros.tipoimagem,(x+" "+y+" "+xx+" "+yy));
170 } 174 }
171 catch(e){i3GEO.janela.tempoMsg(e+" Erro.");} 175 catch(e){i3GEO.janela.tempoMsg(e+" Erro.");}
ferramentas/selecao/index.js
@@ -483,9 +483,11 @@ i3GEOF.selecao = @@ -483,9 +483,11 @@ i3GEOF.selecao =
483 i3GEO.Interface.atualizaTema(retorno, tema); 483 i3GEO.Interface.atualizaTema(retorno, tema);
484 nsel = i3GEO.arvoreDeCamadas.pegaTema(tema, retorno.data.temas); 484 nsel = i3GEO.arvoreDeCamadas.pegaTema(tema, retorno.data.temas);
485 $i("i3GEOselecaoNsel").innerHTML = $trad('selecionados', i3GEOF.selecao.dicionario) + ": " + (nsel.nsel); 485 $i("i3GEOselecaoNsel").innerHTML = $trad('selecionados', i3GEOF.selecao.dicionario) + ": " + (nsel.nsel);
486 - i3GEO.eventos.adicionaEventos("SELECAO", [  
487 - "i3GEOF.tabela.atualizaListaDeRegistros()"  
488 - ]); 486 + if(i3GEOF.tabela){
  487 + i3GEO.eventos.adicionaEventos("SELECAO", [
  488 + "i3GEOF.tabela.atualizaListaDeRegistros()"
  489 + ]);
  490 + }
489 i3GEO.eventos.executaEventos(i3GEO.eventos.SELECAO); 491 i3GEO.eventos.executaEventos(i3GEO.eventos.SELECAO);
490 }, 492 },
491 /* 493 /*
@@ -898,18 +900,18 @@ i3GEOF.selecao = @@ -898,18 +900,18 @@ i3GEOF.selecao =
898 draw : "", 900 draw : "",
899 inicia : function() { 901 inicia : function() {
900 var features = i3GEO.desenho.layergrafico.getFeatures(); 902 var features = i3GEO.desenho.layergrafico.getFeatures();
901 - if(features.getLength() === 0){ 903 + if(features.length === 0){
902 return; 904 return;
903 } 905 }
904 i3GEO.eventos.cliquePerm.desativa(); 906 i3GEO.eventos.cliquePerm.desativa();
905 i3GEOF.selecao.figura.ol3.removeControle(); 907 i3GEOF.selecao.figura.ol3.removeControle();
906 i3GEOF.selecao.figura.ol3.draw = new ol.interaction.Select(); 908 i3GEOF.selecao.figura.ol3.draw = new ol.interaction.Select();
907 i3GEOF.selecao.figura.ol3.draw.on("select",function(evt){ 909 i3GEOF.selecao.figura.ol3.draw.on("select",function(evt){
908 - var wkt, geo, i, n, f, format = new ol.format.WKT(); 910 + var wkt, i, n, f, format = new ol.format.WKT();
909 geo = i3GEOF.selecao.figura.ol3.draw.getFeatures(); 911 geo = i3GEOF.selecao.figura.ol3.draw.getFeatures();
910 - n = geo.getLength(); 912 + n = evt.selected.length;
911 for(i=0; i<n; i++){ 913 for(i=0; i<n; i++){
912 - f = geo.item(i); 914 + f =evt.selected[i];
913 f = i3GEO.util.projOSM2Geo(f); 915 f = i3GEO.util.projOSM2Geo(f);
914 wkt = format.writeFeature(f); 916 wkt = format.writeFeature(f);
915 i3GEOF.selecao.figura.termina(i3GEO.temaAtivo, $i("i3GEOselecaotipoOperacao").value, wkt); 917 i3GEOF.selecao.figura.termina(i3GEO.temaAtivo, $i("i3GEOselecaotipoOperacao").value, wkt);
ferramentas/toponimia/exec.php
@@ -17,10 +17,12 @@ Cria um novo tema com a topon&amp;iacute;mia do tema atual. @@ -17,10 +17,12 @@ Cria um novo tema com a topon&amp;iacute;mia do tema atual.
17 include_once(dirname(__FILE__)."/../../classesphp/classe_toponimia.php"); 17 include_once(dirname(__FILE__)."/../../classesphp/classe_toponimia.php");
18 copiaSeguranca($map_file); 18 copiaSeguranca($map_file);
19 $m = new Toponimia($map_file,$tema); 19 $m = new Toponimia($map_file,$tema);
20 - if(!isset($tipo))  
21 - {$tipo="";}  
22 - if(!isset($novotema))  
23 - {$novotema = "sim";} 20 + if(!isset($tipo)){
  21 + $tipo="";
  22 + }
  23 + if(!isset($novotema)){
  24 + $novotema = "sim";
  25 + }
24 $retorno = $m->criaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo,$wrap,$novotema); 26 $retorno = $m->criaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo,$wrap,$novotema);
25 if(empty($maxscale)){ 27 if(empty($maxscale)){
26 $maxscale = -1; 28 $maxscale = -1;
@@ -428,6 +428,9 @@ i3GEO.desenho = @@ -428,6 +428,9 @@ i3GEO.desenho =
428 }) 428 })
429 }); 429 });
430 i3GEO.desenho.layergrafico.setMap(i3geoOL); 430 i3GEO.desenho.layergrafico.setMap(i3geoOL);
  431 + i3GEO.desenho.layergrafico.getFeatures = function(){
  432 + return i3GEO.desenho.layergrafico.getSource().getFeatures();
  433 + };
431 } 434 }
432 return; 435 return;
433 if (!i3GEO.desenho.layergrafico) { 436 if (!i3GEO.desenho.layergrafico) {