From ee7de46d787e991e39c2bf72dbf65ce4aa216e8d Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 26 Nov 2012 02:20:17 +0000 Subject: [PATCH] Inclusão de variável para permitir a definição de parâmetros da API do OpenLayers não previsto na inicialização do mapa --- classesjs/classe_interface.js | 36 +++++++++++++++++++++++++++--------- interface/openlayers.htm | 3 +++ interface/openlayersdebug.htm | 5 ++++- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/classesjs/classe_interface.js b/classesjs/classe_interface.js index 6f21264..a3e2b66 100644 --- a/classesjs/classe_interface.js +++ b/classesjs/classe_interface.js @@ -447,6 +447,15 @@ i3GEO.Interface = { */ openlayers:{ /* + Propriedade: parametrosMap + + Permite incluir parametros da API do OpenLayers não previstos no i3Geo. Veja em http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Map-js.html + + Exemplo i3GEO.Interface.openlayers.parametrosMap.scales = [50000000, 30000000, 10000000, 5000000]; + */ + parametrosMap: { + }, + /* Propriedade: FUNDOTEMA Estilo "background" do nome do tema na árvore de camadas enquanto o mesmo está sendo carregado. @@ -590,15 +599,24 @@ i3GEO.Interface = { bb.INCLUIBOTAO.zoomli = true; bb.INCLUIBOTAO.pan = true; bb.INCLUIBOTAO.zoomtot = true; - i3geoOL = new OpenLayers.Map('openlayers', { - controls: [], - fractionalZoom: false, - minResolution: "auto", - minExtent: new OpenLayers.Bounds(mi[0],mi[1],mi[2],mi[3]), - maxResolution: "auto", - maxExtent: new OpenLayers.Bounds(ma[0],ma[1],ma[2],ma[3]), - allOverlays: false - }); + i3GEO.Interface.openlayers.parametrosMap.controls = []; + i3GEO.Interface.openlayers.parametrosMap.fractionalZoom = false; + if(!i3GEO.Interface.openlayers.parametrosMap.minResolution){ + i3GEO.Interface.openlayers.parametrosMap.minResolution = "auto"; + } + if(!i3GEO.Interface.openlayers.parametrosMap.minExtent){ + i3GEO.Interface.openlayers.parametrosMap.minExtent = new OpenLayers.Bounds(mi[0],mi[1],mi[2],mi[3]); + } + if(!i3GEO.Interface.openlayers.parametrosMap.maxResolution){ + i3GEO.Interface.openlayers.parametrosMap.maxResolution = "auto"; + } + if(!i3GEO.Interface.openlayers.parametrosMap.maxExtent){ + i3GEO.Interface.openlayers.parametrosMap.maxExtent = new OpenLayers.Bounds(ma[0],ma[1],ma[2],ma[3]); + } + if(!i3GEO.Interface.openlayers.parametrosMap.allOverlays){ + i3GEO.Interface.openlayers.parametrosMap.allOverlays = false; + } + i3geoOL = new OpenLayers.Map('openlayers', i3GEO.Interface.openlayers.parametrosMap); } }, inicia: function(){ diff --git a/interface/openlayers.htm b/interface/openlayers.htm index fd04f5d..c252cc6 100644 --- a/interface/openlayers.htm +++ b/interface/openlayers.htm @@ -168,6 +168,9 @@ i3GEO.Interface.openlayers.GADGETS = { OverviewMap:false }; i3GEO.Interface.openlayers.TILES = true; +i3GEO.Interface.openlayers.parametrosMap.scales = [ + 105000000,50000000,21000000,10000000,5000000,1000000,500000,250000,100000,50000,25000,10000,5000,1000,100 +]; // //controla o tamanho da barra de zoom // diff --git a/interface/openlayersdebug.htm b/interface/openlayersdebug.htm index cd441bc..ce8b2bd 100644 --- a/interface/openlayersdebug.htm +++ b/interface/openlayersdebug.htm @@ -163,6 +163,9 @@ i3GEO.Interface.openlayers.GADGETS = { OverviewMap:false }; i3GEO.Interface.openlayers.TILES = true; +i3GEO.Interface.openlayers.parametrosMap.scales = [ + 105000000,50000000,21000000,10000000,5000000,1000000,500000,250000,100000,50000,25000,10000,5000,1000,100 +]; // //controla o tamanho da barra de zoom // @@ -171,7 +174,7 @@ i3GEO.Interface.openlayers.TILES = true; // //desabilita o item que abre a interface "default" do menu suspenso // -i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}' +i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}'; /* Após a criação, é criado o objeto i3geoOL que corresponde ao objeto map da API do OpenLayers. -- libgit2 0.21.2