Commit ee7de46d787e991e39c2bf72dbf65ce4aa216e8d

Authored by Edmar Moretti
1 parent 2ae150a3

Inclusão de variável para permitir a definição de parâmetros da API do OpenLayer…

…s não previsto na inicialização do mapa
classesjs/classe_interface.js
... ... @@ -447,6 +447,15 @@ i3GEO.Interface = {
447 447 */
448 448 openlayers:{
449 449 /*
  450 + Propriedade: parametrosMap
  451 +
  452 + 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
  453 +
  454 + Exemplo i3GEO.Interface.openlayers.parametrosMap.scales = [50000000, 30000000, 10000000, 5000000];
  455 + */
  456 + parametrosMap: {
  457 + },
  458 + /*
450 459 Propriedade: FUNDOTEMA
451 460  
452 461 Estilo "background" do nome do tema na árvore de camadas enquanto o mesmo está sendo carregado.
... ... @@ -590,15 +599,24 @@ i3GEO.Interface = {
590 599 bb.INCLUIBOTAO.zoomli = true;
591 600 bb.INCLUIBOTAO.pan = true;
592 601 bb.INCLUIBOTAO.zoomtot = true;
593   - i3geoOL = new OpenLayers.Map('openlayers', {
594   - controls: [],
595   - fractionalZoom: false,
596   - minResolution: "auto",
597   - minExtent: new OpenLayers.Bounds(mi[0],mi[1],mi[2],mi[3]),
598   - maxResolution: "auto",
599   - maxExtent: new OpenLayers.Bounds(ma[0],ma[1],ma[2],ma[3]),
600   - allOverlays: false
601   - });
  602 + i3GEO.Interface.openlayers.parametrosMap.controls = [];
  603 + i3GEO.Interface.openlayers.parametrosMap.fractionalZoom = false;
  604 + if(!i3GEO.Interface.openlayers.parametrosMap.minResolution){
  605 + i3GEO.Interface.openlayers.parametrosMap.minResolution = "auto";
  606 + }
  607 + if(!i3GEO.Interface.openlayers.parametrosMap.minExtent){
  608 + i3GEO.Interface.openlayers.parametrosMap.minExtent = new OpenLayers.Bounds(mi[0],mi[1],mi[2],mi[3]);
  609 + }
  610 + if(!i3GEO.Interface.openlayers.parametrosMap.maxResolution){
  611 + i3GEO.Interface.openlayers.parametrosMap.maxResolution = "auto";
  612 + }
  613 + if(!i3GEO.Interface.openlayers.parametrosMap.maxExtent){
  614 + i3GEO.Interface.openlayers.parametrosMap.maxExtent = new OpenLayers.Bounds(ma[0],ma[1],ma[2],ma[3]);
  615 + }
  616 + if(!i3GEO.Interface.openlayers.parametrosMap.allOverlays){
  617 + i3GEO.Interface.openlayers.parametrosMap.allOverlays = false;
  618 + }
  619 + i3geoOL = new OpenLayers.Map('openlayers', i3GEO.Interface.openlayers.parametrosMap);
602 620 }
603 621 },
604 622 inicia: function(){
... ...
interface/openlayers.htm
... ... @@ -168,6 +168,9 @@ i3GEO.Interface.openlayers.GADGETS = {
168 168 OverviewMap:false
169 169 };
170 170 i3GEO.Interface.openlayers.TILES = true;
  171 +i3GEO.Interface.openlayers.parametrosMap.scales = [
  172 + 105000000,50000000,21000000,10000000,5000000,1000000,500000,250000,100000,50000,25000,10000,5000,1000,100
  173 +];
171 174 //
172 175 //controla o tamanho da barra de zoom
173 176 //
... ...
interface/openlayersdebug.htm
... ... @@ -163,6 +163,9 @@ i3GEO.Interface.openlayers.GADGETS = {
163 163 OverviewMap:false
164 164 };
165 165 i3GEO.Interface.openlayers.TILES = true;
  166 +i3GEO.Interface.openlayers.parametrosMap.scales = [
  167 + 105000000,50000000,21000000,10000000,5000000,1000000,500000,250000,100000,50000,25000,10000,5000,1000,100
  168 +];
166 169 //
167 170 //controla o tamanho da barra de zoom
168 171 //
... ... @@ -171,7 +174,7 @@ i3GEO.Interface.openlayers.TILES = true;
171 174 //
172 175 //desabilita o item que abre a interface "default" do menu suspenso
173 176 //
174   -i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}'
  177 +i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}';
175 178  
176 179 /*
177 180 Após a criação, é criado o objeto i3geoOL que corresponde ao objeto map da API do OpenLayers.
... ...