From 59f3254d2fb774641814541a5917ce3ce11b8acd Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 7 Jul 2015 21:24:34 +0000 Subject: [PATCH] Inclusão de opção de login no testamapfile --- admin/admin.db | Bin 286720 -> 0 bytes admin/js/core.js | 2 +- js/interface.js | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------- testamapfile.php | 50 +++++++++++++++++++++++++++++++++++++------------- 4 files changed, 106 insertions(+), 69 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 884008e..0e8c910 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/js/core.js b/admin/js/core.js index de5c6da..29f5c80 100644 --- a/admin/js/core.js +++ b/admin/js/core.js @@ -1745,7 +1745,7 @@ function core_listaDeLetras(onde,nomeFuncao,semLetras){ */ var jsfiles = []; var cssfiles = []; - if(typeof(i3GEO) !== 'undefined' && i3GEO.locaplic){ + if(typeof(i3GEO) !== 'undefined' && i3GEO.configura.locaplic){ scriptLocation = ""; jsfiles = []; // diff --git a/js/interface.js b/js/interface.js index 1f5e623..23deb36 100755 --- a/js/interface.js +++ b/js/interface.js @@ -725,18 +725,18 @@ i3GEO.Interface = removeAoAdicionar : true, classeCadeado : "i3GEOiconeAberto", autoPan : true, - autoPanAnimation: { - duration: 250 + autoPanAnimation : { + duration : 250 }, - width: '200px', - baloes: [] + width : '200px', + baloes : [] }, balao : function(texto, completo, x, y) { var icone, painel, b, cabecalho, conteudo, p = i3GEO.Interface.openlayers.BALAOPROP, removeBaloes; - removeBaloes = function(){ + removeBaloes = function() { var t, n = i3GEO.Interface.openlayers.BALAOPROP.baloes.length, i; - for(i=0; i 0) { - reg = new RegExp(parametro + "([=])+([a-zA-Z0-9_]*)"); - layers[i].url = url.replace(reg, ""); - layers[i].url = layers[i].url + "&" + parametro + "=" + valor; - layers[i].redraw(); + layer = i3geoOL.getLayersByName(layers[i].name)[0]; + if (layer && layer != undefined && layer.get("isBaseLayer") === false) { + url = ""; + source = layer.getSource(); + param = source.getProperties().parametrosUrl; + param[parametro] = valor; + chaves = i3GEO.util.listaTodasChaves(param); + n = chaves.length; + for(j = 0; j < n; j++){ + k = chaves[j]; + if(param[k] != "" && k != "par"){ + url += "&" + k + "=" + param[k]; + } } + param.par = url; + console.info(url); + source.set("parametrosUrl",param); } } }, @@ -1698,7 +1702,7 @@ i3GEO.Interface = * Atualiza o mapa atual, forcando o redesenho dos layers */ atualizaMapa : function() { - var camadas = i3GEO.arvoreDeCamadas.CAMADAS, n = camadas.lenght, i; + var camadas = i3GEO.arvoreDeCamadas.CAMADAS, n = camadas.length, i; for (i = 0; i < n; i++) { i3GEO.Interface.openlayers.atualizaTema("", camadas[i].name); } @@ -1707,28 +1711,37 @@ i3GEO.Interface = * Forca o redesenho de um layer especifico */ atualizaTema : function(retorno, tema) { - var layer = i3geoOL.getLayersByName(tema)[0], objtemas, funcaoLoad, servico, source; + var layer = i3geoOL.getLayersByName(tema), objtemas, funcaoLoad, servico, source; + if(layer.length == 0){ + return ""; + } + else{ + layer = layer[0]; + } if (layer && layer != undefined) { source = layer.getSource(); servico = source.getProperties().tipoServico; - if(servico === "WMTS"){ - funcaoLoad = layer.getSource().getTileUrlFunction(); - if(funcaoLoad){ + if (servico === "WMTS") { + funcaoLoad = source.getTileUrlFunction(); + if (funcaoLoad) { + // console.info("atualiza") layer.getSource().setTileUrlFunction(function() { + // camada = i3GEO.arvoreDeCamadas.pegaTema(tema) + // if(camada && camada.cache && camada.cache === "nao"){ var url = funcaoLoad.apply(this, arguments); url = url.replace("&cache=sim", "&cache=nao"); - //console.info(layer.getSource().getProperties().tipoServico) - return url.split('&r=')[0] + '&r=' + Math.random(); + return url.split('&r=')[0] + '&r=' + Math.random() + source.getProperties().parametrosUrl.par; }); + } } - if(servico === "ImageWMS"){ - funcaoLoad = layer.getSource().getImageLoadFunction(); - if(funcaoLoad){ - layer.getSource().setImageLoadFunction(function(image,src) { + if (servico === "ImageWMS") { + funcaoLoad = source.getImageLoadFunction(); + if (funcaoLoad) { + layer.getSource().setImageLoadFunction(function(image, src) { src = src.replace("&cache=sim", "&cache=nao"); src = src.split('&r=')[0] + '&r=' + Math.random(); - image.getImage().src = src; + image.getImage().src = src + source.getProperties().parametrosUrl.par; }); } } @@ -1881,7 +1894,7 @@ i3GEO.Interface = y = metrica.lat; } } - i3geoOL.panTo(x,y); + i3geoOL.panTo(x, y); } }, /** diff --git a/testamapfile.php b/testamapfile.php index 59b6076..c8e4354 100644 --- a/testamapfile.php +++ b/testamapfile.php @@ -81,18 +81,21 @@ if ($tipo == "") { echo ''; echo ''; - echo ''; - echo ''; - - echo ''; + echo ''; echo ''; - echo '
 
'; - echo '
'; - echo 'Nome do arquivo map existente no diretório i3geo/temas. Exemplo para uso manual da URL: testamapfile.php?map=biomashp (utilize "testamapfile.php?map=todos" na URL para testar todos de uma só vez)

'; - //echo '
Mostra apenas a legenda? sim não
'; + echo ''; + echo ''; + echo '
'; + echo '
 
'; + echo ''; -echo ''; -echo ''; +?> + +
+
+ + + + +save($destino); - //echo $destino;exit; + validaAcessoTemas($destino,true); //testa a tabela de atributos if(isset($tabela)){ -- libgit2 0.21.2