diff --git a/ferramentas/imprimir/a4lpaisagempdf.php b/ferramentas/imprimir/a4lpaisagempdf.php index e322104..c5e4113 100755 --- a/ferramentas/imprimir/a4lpaisagempdf.php +++ b/ferramentas/imprimir/a4lpaisagempdf.php @@ -123,7 +123,7 @@ $imgo->saveImage($nomer); $pathlegenda = $dir_tmp."/".basename($imgo->imageurl)."/".basename($nomer); $titulo = $_GET['titulo']; -substituiCon($map_file,$postgis_mapa); +substituiConObj($map_file,$postgis_mapa); require(dirname(__FILE__).'/../../pacotes/fpdf/fpdf.php'); $pdf = new FPDF("L","mm","A4"); diff --git a/ferramentas/imprimir/aggpng.php b/ferramentas/imprimir/aggpng.php index d941366..2f7df50 100755 --- a/ferramentas/imprimir/aggpng.php +++ b/ferramentas/imprimir/aggpng.php @@ -66,7 +66,7 @@ $nomes = nomeRandomico(); $map = ms_newMapObj($map_file); $temp = str_replace(".map","xxx.map",$map_file); $map->save($temp); -substituiCon($temp,$postgis_mapa); +substituiConObj($temp,$postgis_mapa); $of = $map->outputformat; $of->set("driver","AGG/PNG"); $of->set("imagemode","RGB"); @@ -108,10 +108,11 @@ foreach ($temas as $tema) } } } +restauraConObj($map, $postgis_mapa); $map->save($temp); removeLinha("classeNula",$temp); $map = ms_newMapObj($temp); -substituiCon($temp,$postgis_mapa); +substituiConObj($temp,$postgis_mapa); $o = $map->outputformat; if($mapexten != ""){ @@ -133,7 +134,7 @@ $imgo = $map->drawscalebar(); $nomer = ($imgo->imagepath)."escala".$nomes.".png"; $imgo->saveImage($nomer); $nomeescala = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); -//referência +//referencia $o = $map->reference->outlinecolor; $o->setrgb(255,0,0); $map->preparequery(); diff --git a/ferramentas/imprimir/dicionario.js b/ferramentas/imprimir/dicionario.js index 2540b18..5429349 100755 --- a/ferramentas/imprimir/dicionario.js +++ b/ferramentas/imprimir/dicionario.js @@ -29,5 +29,10 @@ i3GEOF.imprimir.dicionario = { pt : $trad("p7"), en : $trad("p7"), es : $trad("p7"), - } ] + } ], + "ref" : [ { + pt : $trad("d9t"), + en : $trad("d9t"), + es : $trad("d9t"), + } ] }; \ No newline at end of file diff --git a/ferramentas/imprimir/template_mst.html b/ferramentas/imprimir/template_mst.html index 919ca69..0d3d888 100755 --- a/ferramentas/imprimir/template_mst.html +++ b/ferramentas/imprimir/template_mst.html @@ -9,4 +9,5 @@ {{{legenda}}} {{{escala}}} {{{tamanho}}} + {{{ref}}} \ No newline at end of file diff --git a/ferramentas/opcoes_maparef/dependencias.php b/ferramentas/opcoes_maparef/dependencias.php new file mode 100644 index 0000000..341222f --- /dev/null +++ b/ferramentas/opcoes_maparef/dependencias.php @@ -0,0 +1,24 @@ + ou com a funcao scripttag do i3Geo + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel + * javascript i3GEOF.opcoesTamanho.MUSTACHE + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta + */ +if(extension_loaded('zlib')){ + ob_start('ob_gzhandler'); +} +header("Content-type: text/javascript"); +include("index.js"); +include("dicionario.js"); +echo "\n"; + +if(extension_loaded('zlib')){ + ob_end_flush(); +} +?> \ No newline at end of file diff --git a/ferramentas/opcoes_maparef/dicionario.js b/ferramentas/opcoes_maparef/dicionario.js new file mode 100644 index 0000000..5525286 --- /dev/null +++ b/ferramentas/opcoes_maparef/dicionario.js @@ -0,0 +1,33 @@ +//+$trad(1,i3GEOF.opcoesTamanho.dicionario)+ +i3GEOF.opcoesMaparef.dicionario = { + 'largura' : [ { + pt : "Largura", + en : "Width", + es : "Ancho" + } ], + 'altura' : [ { + pt : "Altura", + en : "Height", + es : "Altura" + } ], + 'valor' : [ { + pt : "Valores em pixels", + en : "Values in pixels", + es : "Valores en píxeles" + } ], + 'testa' : [ { + pt : "Testar", + en : "Test", + es : "Probar" + } ], + 'aplica' : [ { + pt : "Aplicar", + en : "Apply", + es : "Aplicar" + } ], + 'msg' : [ { + pt : "Essa operação afeta apenas a legenda utilizada na ferramenta de impressão do mapa", + en : "This operation only affects the legend used for the map printing tool", + es : "Esta operación solo afecta a la leyenda utilizada en la herramienta de impresión del mapa" + } ] +}; \ No newline at end of file diff --git a/ferramentas/opcoes_maparef/exec.php b/ferramentas/opcoes_maparef/exec.php new file mode 100644 index 0000000..8c4c657 --- /dev/null +++ b/ferramentas/opcoes_maparef/exec.php @@ -0,0 +1,34 @@ +reference; + $r->updateFromString("REFERENCE SIZE " . $_POST["width"] . " " . $_POST["height"] . " END"); + $salvo = $map->save($map_file); + $retorno = "ok"; + $_SESSION["contadorsalva"]++; + break; + case "GETREF": + $map = ms_newMapObj($map_file); + $r = $map->reference; + $retorno = array( + "width" => 150, + "height" => 150 + ); + break; +} +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); +} +ob_clean(); +header("Content-type: application/json"); +echo json_encode($retorno); +?> \ No newline at end of file diff --git a/ferramentas/opcoes_maparef/index.js b/ferramentas/opcoes_maparef/index.js new file mode 100644 index 0000000..6f9c58b --- /dev/null +++ b/ferramentas/opcoes_maparef/index.js @@ -0,0 +1,134 @@ + +if(typeof(i3GEOF) === 'undefined'){ + var i3GEOF = {}; +} +/* +Classe: i3GEOF.opcoesMaparef + + */ +i3GEOF.opcoesMaparef = { + /* + Variavel: aguarde + + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. + */ + aguarde: "", + /** + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php + */ + MUSTACHE : "", + CONFIG : {}, + /** + * Susbtitutos para o template + */ + mustacheHash : function() { + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.opcoesMaparef.dicionario); + dicionario["Tamanhol"] = i3GEOF.opcoesMaparef.CONFIG.width; + dicionario["Tamanhoa"] = i3GEOF.opcoesMaparef.CONFIG.height; + return dicionario; + }, + /* + Function: inicia + + Inicia a ferramenta. É chamado por criaJanelaFlutuante + + Parametro: + + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta + */ + inicia: function(iddiv){ + if(i3GEOF.opcoesMaparef.MUSTACHE == ""){ + var t1 = i3GEO.configura.locaplic + "/ferramentas/opcoes_maparef/template_mst.html", + t2 = i3GEO.configura.locaplic + "/ferramentas/opcoes_maparef/exec.php?funcao=getref"; + $.when( $.get(t1),$.get(t2) ).done(function(r1,r2) { + i3GEOF.opcoesMaparef.MUSTACHE = r1[0]; + i3GEOF.opcoesMaparef.CONFIG = r2[0]; + i3GEOF.opcoesMaparef.inicia(iddiv); + }); + return; + } + var b,box; + try{ + $i(iddiv).innerHTML = i3GEOF.opcoesMaparef.html(); + i3GEO.janela.tempoMsg($trad('msg',i3GEOF.opcoesMaparef.dicionario)); + } + catch(erro){i3GEO.janela.tempoMsg(erro);} + }, + /* + Function: html + + Gera o código html para apresentação das opções da ferramenta + + Retorno: + + String com o código html + */ + html:function() { + var ins = Mustache.render(i3GEOF.opcoesMaparef.MUSTACHE, i3GEOF.opcoesMaparef.mustacheHash()); + return ins; + }, + /* + Function: iniciaJanelaFlutuante + + Cria a janela flutuante para controle da ferramenta. + */ + iniciaJanelaFlutuante: function(){ + var janela,divid,temp,titulo,cabecalho,minimiza; + if ($i("i3GEOF.opcoesMaparef")) { + return; + } + cabecalho = function(){}; + minimiza = function(){ + i3GEO.janela.minimiza("i3GEOF.opcoesMaparef",200); + }; + //cria a janela flutuante + titulo = "" + $trad("d9t") + ""; + janela = i3GEO.janela.cria( + "250px", + "270px", + "", + "", + "", + titulo, + "i3GEOF.opcoesMaparef", + false, + "hd", + cabecalho, + minimiza, + "", + true, + "", + "", + "", + "" + ); + divid = janela[2].id; + $i("i3GEOF.opcoesMaparef_corpo").style.backgroundColor = "white"; + $i("i3GEOF.opcoesMaparef_corpo").style.textAlign = "left"; + i3GEOF.opcoesMaparef.aguarde = $i("i3GEOF.opcoesMaparef_imagemCabecalho").style; + i3GEOF.opcoesMaparef.inicia(divid); + }, + /* + Function: executa + */ + executa: function(){ + if(i3GEOF.opcoesMaparef.aguarde.visibility === "visible"){ + return; + } + i3GEOF.opcoesMaparef.aguarde.visibility = "visible"; + $.post( + i3GEO.configura.locaplic+"/ferramentas/opcoes_maparef/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=altera&", + $("#form-opcoesMaparef").serialize() + ) + .done( + function(data, status){ + i3GEOF.opcoesMaparef.aguarde.visibility = "hidden"; + } + ) + .fail( + function(data){ + i3GEOF.opcoesMaparef.aguarde.visibility = "hidden"; + } + ); + } +}; \ No newline at end of file diff --git a/ferramentas/opcoes_maparef/template_mst.html b/ferramentas/opcoes_maparef/template_mst.html new file mode 100644 index 0000000..0bb0c35 --- /dev/null +++ b/ferramentas/opcoes_maparef/template_mst.html @@ -0,0 +1,14 @@ +
+
+
+ + +
+
+ + +
+
{{{valor}}}
+ +
+
\ No newline at end of file diff --git a/interface/config.php b/interface/config.php index 58ad323..bcc9d54 100755 --- a/interface/config.php +++ b/interface/config.php @@ -114,7 +114,7 @@ i3GEO.janela.ativaAlerta(); var osm = new ol.layer.Tile({ title : "OSM", - visible : true, + visible : false, isBaseLayer : true, name : "osm", source: new ol.source.OSM({ diff --git a/js/dicionario.js b/js/dicionario.js index 3bfefa9..2a3178e 100755 --- a/js/dicionario.js +++ b/js/dicionario.js @@ -1205,7 +1205,7 @@ g_traducao = ], "d9t" : [ { - pt : "mapa de referência", + pt : "Mapa de referência", en : "Overview map", es : "Mapa de referencia" } diff --git a/js/mapa.js b/js/mapa.js index 64d848b..ac348b0 100755 --- a/js/mapa.js +++ b/js/mapa.js @@ -875,6 +875,19 @@ i3GEO.mapa = "dependencias.php", "i3GEOF.opcoesLegenda.iniciaJanelaFlutuante()"); }, + /** + * Function: opcoesMapaRef + * + * Abre a janela de dialogo da ferramenta opcoes_maparef + */ + opcoesMapaRef : function() { + i3GEO.util.dialogoFerramenta( + "i3GEO.mapa.dialogo.opcoesMapaRef()", + "opcoes_maparef", + "opcoesMaparef", + "dependencias.php", + "i3GEOF.opcoesMaparef.iniciaJanelaFlutuante()"); + }, /** * Function: gradeCoord * diff --git a/ms_criamapa.php b/ms_criamapa.php index 6feb303..75ce29c 100755 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -545,6 +545,10 @@ if (! isset($mapext)) { // arquivo com a imagem de referência if (! isset($map_reference_image)) { $map_reference_image = $map->reference->image; + //verifica o caminho + if(!file_exists($map_reference_image)){ + $map_reference_image = $locaplic . "/imagens/" . basename($map_reference_image); + } } // extensão geográfica da imagem do mapa de referência if (! isset($map_reference_extent)) { -- libgit2 0.21.2