Commit c7193a1da28d5e581bedf60efd044b89f78b167d
1 parent
c7e4a4f9
Exists in
master
and in
7 other branches
Alterado o modo de inclusão de camadas do tipo WMS. As camadas agora acessam dir…
…etamente o web service na interface OpenLayers quando o cache da camada não estiver ativado.
Showing
6 changed files
with
40 additions
and
20 deletions
Show diff stats
admin/js/editormapfile.js
... | ... | @@ -1118,7 +1118,7 @@ function montaEditorMetadados(dados) |
1118 | 1118 | {ajuda:"Extensão geográfica máxima do tema, no formato xmin ymin xmax ymax. É utilizado na opção de 'zoom para o tema'. Quando o tema é baseado em shapefile, esse metadata não é necessário, pois o mapserver consegue calcular a extensão. Já em outros tipos de dados, como Postgis, o parâmetro é necessário. Nesse caso, se não for indicado, o botão de zoom para o tema não será visível para o usuário", |
1119 | 1119 | titulo:"Extensao (EXTENSAO)",id:"extensao",value:dados.extensao,tipo:"text"}, |
1120 | 1120 | {ajuda:"Ativa ou não a manutenção de um cache para armazenar as imagens geradas para montar o mapa. Essa opção afeta apenas as interfaces do i3Geo que utilizam o modo TILE (como a interface OpenLayers). O cache é mantido no diretório temporário utilizado pelo i3Geo, na pasta chamada cache. Para cada camada é criada uma sub-pasta. Para limpar o cache, utilize a opção existente junto ao nó principal desse mapfile", |
1121 | - titulo:"Cache de mapas (CACHE)",id:"",value:dados.cache,tipo:"text",div:"<div id=cCache ></div>"}, | |
1121 | + titulo:"Cache de mapas. Camadas WMS são acessadas diretamente do servidor de origem quando o cache estiver inativo. (CACHE)",id:"",value:dados.cache,tipo:"text",div:"<div id=cCache ></div>"}, | |
1122 | 1122 | {ajuda:"Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa", |
1123 | 1123 | titulo:"Aplica extensao (APLICAEXTENSAO)",id:"",value:dados.aplicaextensao,tipo:"text",div:"<div id=cAplicaextensao ></div>"}, |
1124 | 1124 | {ajuda:"Indica se o usuário pode abrir o editor de SQL para poder alterar o elemento DATA do Mapfile.", | ... | ... |
classesjs/classe_arvoredecamadas.js
... | ... | @@ -553,10 +553,9 @@ i3GEO.arvoreDeCamadas = { |
553 | 553 | */ |
554 | 554 | ativaDragDrop: function(){ |
555 | 555 | if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.ativaDragDrop()");} |
556 | - var Dom,Event,DDM; | |
557 | - Dom = YAHOO.util.Dom; | |
558 | - Event = YAHOO.util.Event; | |
559 | - DDM = YAHOO.util.DragDropMgr; | |
556 | + var Dom = YAHOO.util.Dom, | |
557 | + Event = YAHOO.util.Event, | |
558 | + DDM = YAHOO.util.DragDropMgr; | |
560 | 559 | YAHOO.example.DDList = ""; |
561 | 560 | YAHOO.example.DDApp = { |
562 | 561 | init: function() |
... | ... | @@ -578,14 +577,15 @@ i3GEO.arvoreDeCamadas = { |
578 | 577 | YAHOO.example.DDList = function(id, sGroup, config) { |
579 | 578 | YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config); |
580 | 579 | this.logger = this.logger || YAHOO; |
581 | - Dom.setStyle(this.getDragEl(), "opacity", 0.67); // The proxy is slightly transparent | |
580 | + YAHOO.util.Dom.setStyle(this.getDragEl(), "opacity", 0.67); // The proxy is slightly transparent | |
582 | 581 | this.goingUp = false; |
583 | 582 | this.lastY = 0; |
584 | 583 | }; |
585 | 584 | YAHOO.extend( |
586 | 585 | YAHOO.example.DDList, YAHOO.util.DDProxy, { |
587 | 586 | startDrag: function(x, y){ |
588 | - var dragEl,clickEl; | |
587 | + var dragEl,clickEl, | |
588 | + Dom = YAHOO.util.Dom; | |
589 | 589 | this.logger.log(this.id + " startDrag"); |
590 | 590 | // make the proxy look like the source element |
591 | 591 | dragEl = this.getDragEl(); |
... | ... | @@ -616,6 +616,7 @@ i3GEO.arvoreDeCamadas = { |
616 | 616 | // Hide the proxy and show the source element when finished with the animation |
617 | 617 | a.onComplete.subscribe( |
618 | 618 | function(){ |
619 | + var Dom = YAHOO.util.Dom; | |
619 | 620 | Dom.setStyle(proxyid, "visibility", "hidden"); |
620 | 621 | Dom.setStyle(thisid, "visibility", ""); |
621 | 622 | } |
... | ... | @@ -624,7 +625,9 @@ i3GEO.arvoreDeCamadas = { |
624 | 625 | YAHOO.util.Dom.setStyle('i3geo_lixeira', 'border', '0px solid blue'); |
625 | 626 | }, |
626 | 627 | onDragDrop: function(e, id){ |
627 | - var pt,region,tema,destEl,els,lista,noid,temp; | |
628 | + var pt,region,tema,destEl,els,lista,noid,temp, | |
629 | + DDM = YAHOO.util.DragDropMgr, | |
630 | + Dom = YAHOO.util.Dom; | |
628 | 631 | if (DDM.interactionInfo.drop.length === 1){ |
629 | 632 | pt = DDM.interactionInfo.point; |
630 | 633 | region = DDM.interactionInfo.sourceRegion; |
... | ... | @@ -679,7 +682,7 @@ i3GEO.arvoreDeCamadas = { |
679 | 682 | onDragOver: function(e, id){ |
680 | 683 | var srcEl,destEl; |
681 | 684 | srcEl = this.getEl(); |
682 | - destEl = Dom.get(id); | |
685 | + destEl = YAHOO.util.Dom.get(id); | |
683 | 686 | // We are only concerned with list items, we ignore the dragover |
684 | 687 | // notifications for the list. |
685 | 688 | if ($i("i3geo_lixeira") && id === "i3geo_lixeira") |
... | ... | @@ -1275,7 +1278,8 @@ i3GEO.arvoreDeCamadas = { |
1275 | 1278 | */ |
1276 | 1279 | pegaTema: function(idtema){ |
1277 | 1280 | if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.pegaTema()");} |
1278 | - var i,v = "", | |
1281 | + var i, | |
1282 | + v = "", | |
1279 | 1283 | c = i3GEO.arvoreDeCamadas.CAMADAS.length; |
1280 | 1284 | for (i=0; i<c; i += 1){ |
1281 | 1285 | if(i3GEO.arvoreDeCamadas.CAMADAS[i].name === idtema){ | ... | ... |
classesjs/classe_interface.js
... | ... | @@ -770,7 +770,7 @@ i3GEO.Interface = { |
770 | 770 | i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens); |
771 | 771 | i3GEO.idioma.mostraSeletor(); |
772 | 772 | i3GEO.gadgets.mostraEscalaNumerica(); |
773 | - i3GEO.arvoreDeCamadas.ATIVATEMA = "i3GEO.Interface.openlayers.ligaDesliga(i3GEO.Interface)"; | |
773 | + i3GEO.arvoreDeCamadas.ATIVATEMA = "i3GEO.Interface.openlayers.ligaDesliga(this)"; | |
774 | 774 | // |
775 | 775 | //i3GEO.arvoreDeCamadas.CAMADAS é definido na inicialização (classe_i3geo) |
776 | 776 | // |
... | ... | @@ -825,16 +825,23 @@ i3GEO.Interface = { |
825 | 825 | if(i3geoOL.getLayersByName(camada.name).length === 0){ |
826 | 826 | urllayer = url+"&layer="+camada.name; |
827 | 827 | try{ |
828 | - if(camada.escondido === "sim" || camada.connectiontype === 10 || camada.type === 0 || camada.type === 4 || camada.type === 8 ) | |
829 | - {opcoes.singleTile = true;} | |
830 | - else{ | |
831 | - temp = camada.type === 3 ? opcoes.singleTile = false : opcoes.singleTile = !(i3GEO.Interface.openlayers.TILES); | |
832 | - } | |
833 | 828 | temp = camada.type === 0 ? opcoes.gutter = 20 : opcoes.gutter = 0; |
834 | 829 | temp = camada.transitioneffect === "nao" ? opcoes.transitionEffect = "null" : opcoes.transitionEffect = "resize"; |
830 | + if(camada.connectiontype === 7 && camada.wmsurl !== ""){ | |
831 | + urllayer = camada.wmsurl; | |
832 | + layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{format:camada.wmsformat,transparent:true},opcoes); | |
833 | + } | |
834 | + else{ | |
835 | + if(camada.escondido === "sim" || camada.connectiontype === 10 || camada.type === 0 || camada.type === 4 || camada.type === 8 ) | |
836 | + {opcoes.singleTile = true;} | |
837 | + else{ | |
838 | + temp = camada.type === 3 ? opcoes.singleTile = false : opcoes.singleTile = !(i3GEO.Interface.openlayers.TILES); | |
839 | + } | |
840 | + layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},opcoes); | |
841 | + } | |
835 | 842 | } |
836 | 843 | catch(e){} |
837 | - layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},opcoes); | |
844 | + | |
838 | 845 | if(camada.escondido === "sim") |
839 | 846 | {layer.transitionEffect = "null";} |
840 | 847 | i3geoOL.addLayer(layer); | ... | ... |
classesjs/classe_mapa.js
... | ... | @@ -99,7 +99,8 @@ i3GEO.mapa = { |
99 | 99 | codigo {string} - código da camada |
100 | 100 | */ |
101 | 101 | ativaTema: function(codigo){ |
102 | - i3GEO.util.defineValor("arrastar_"+i3GEO.temaAtivo,"style.color",""); | |
102 | + if(i3GEO.temaAtivo !== "") | |
103 | + {i3GEO.util.defineValor("arrastar_"+i3GEO.temaAtivo,"style.color","");} | |
103 | 104 | i3GEO.temaAtivo = codigo; |
104 | 105 | i3GEO.util.defineValor("arrastar_"+codigo,"style.color","brown"); |
105 | 106 | }, | ... | ... |
classesphp/classe_mapa.php
... | ... | @@ -241,6 +241,12 @@ string - javascript com os parametros |
241 | 241 | $aplicaextensao = "nao"; |
242 | 242 | if(strtoupper($oLayer->getmetadata("aplicaextensao")) == "SIM") |
243 | 243 | {$aplicaextensao = "sim";} |
244 | + $wmsurl = ""; | |
245 | + $wmsformat = ""; | |
246 | + if($ct == 7 && strtoupper($oLayer->getmetadata("cache")) != "SIM"){ | |
247 | + $wmsurl = ($oLayer->connection)."&layers=".($oLayer->getmetadata("wms_name"))."&style=".($oLayer->getmetadata("wms_style")); | |
248 | + $wmsformat = $oLayer->getmetadata("wms_format"); | |
249 | + } | |
244 | 250 | $temas[] = array( |
245 | 251 | "name"=>($oLayer->name), |
246 | 252 | "status"=>($oLayer->status), |
... | ... | @@ -264,7 +270,9 @@ string - javascript com os parametros |
264 | 270 | "permitecomentario"=>$permitecomentario, |
265 | 271 | "exttema"=>$exttema, |
266 | 272 | "aplicaextensao"=>$aplicaextensao, |
267 | - "transitioneffect"=>$transitioneffect | |
273 | + "transitioneffect"=>$transitioneffect, | |
274 | + "wmsurl"=>$wmsurl, | |
275 | + "wmsformat"=>$wmsformat | |
268 | 276 | ); |
269 | 277 | } |
270 | 278 | } | ... | ... |
interface/openlayers.htm
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <meta http-equiv="Category" content="I3Geo Mapa interativo MMA geoprocessamento sig mobile"> |
5 | 5 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
6 | 6 | <title>i3GEO - OpenLayers</title> |
7 | -<script type="text/javascript" src="../classesjs/i3geo.js"></script> | |
7 | +<script type="text/javascript" src="../classesjs/i3geonaocompacto.js"></script> | |
8 | 8 | <script type="text/javascript" src="../pacotes/openlayers/OpenLayers29.js.php"></script> |
9 | 9 | </head> |
10 | 10 | <body id="i3geo"> | ... | ... |