Commit 0ac2e32cebf675913a8cf875e83398ed81fcd129
1 parent
85ccb84c
Exists in
master
and in
7 other branches
--no commit message
Showing
5 changed files
with
45 additions
and
17 deletions
Show diff stats
classesjs/classe_barradebotoes.js
... | ... | @@ -1054,7 +1054,8 @@ i3GEO.barraDeBotoes = { |
1054 | 1054 | 'edita':true, |
1055 | 1055 | 'apaga':true, |
1056 | 1056 | 'procura':false, |
1057 | - 'salva':true | |
1057 | + 'salva':true, | |
1058 | + 'fecha':true | |
1058 | 1059 | } |
1059 | 1060 | i3GEOOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); |
1060 | 1061 | i3GEOOL.mapa.addLayers([i3GEOOL.layergrafico]); | ... | ... |
mashups/openlayers.css
... | ... | @@ -94,6 +94,12 @@ background-position:-435px 0; |
94 | 94 | .olControlEditingToolbar1 .salvaItemActive { |
95 | 95 | background-position:-435px -28px; |
96 | 96 | } |
97 | +.olControlEditingToolbar1 .fechaItemInactive { | |
98 | +background-position:-464px 0; | |
99 | +} | |
100 | +.olControlEditingToolbar1 .fechaItemActive { | |
101 | +background-position:-464px -28px; | |
102 | +} | |
97 | 103 | .olControlEditingToolbar1 { |
98 | 104 | width:500px; |
99 | 105 | float:right; | ... | ... |
mashups/openlayers.js.php
... | ... | @@ -53,7 +53,8 @@ i3GEOOL = { |
53 | 53 | 'edita':true, |
54 | 54 | 'apaga':true, |
55 | 55 | 'procura':true, |
56 | - 'salva':true | |
56 | + 'salva':true, | |
57 | + 'fecha':false | |
57 | 58 | }, |
58 | 59 | pontos: [], |
59 | 60 | marca: "../pacotes/openlayers/img/marker-gold.png", |
... | ... | @@ -112,7 +113,6 @@ i3GEOOL = { |
112 | 113 | i3GEOOL.criaJanelaBusca(); |
113 | 114 | i3GEOOL.criaJanelaAtivaTema(); |
114 | 115 | i3GEOOL.criaBotoes(i3GEOOL.botoes); |
115 | - | |
116 | 116 | }, |
117 | 117 | layersLigados: function(){ |
118 | 118 | var layers = i3GEOOL.mapa.layers; |
... | ... | @@ -195,21 +195,28 @@ i3GEOOL = { |
195 | 195 | combo += "<option value='"+i+"' >"+layers[i].name+"</option>"; |
196 | 196 | } |
197 | 197 | combo += "</select>"; |
198 | - try{ | |
198 | + if(!document.getElementById("paneltemaativo")){ | |
199 | 199 | YAHOO.namespace("temaativo.container"); |
200 | - YAHOO.temaativo.container.panel = new YAHOO.widget.Panel("paneltemaativo", {zIndex:2000, iframe:false, width:"250px", visible:false, draggable:true, close:true } ); | |
201 | - YAHOO.temaativo.container.panel.setHeader("Tema ativo"); | |
200 | + YAHOO.temaativo.container.panel = new YAHOO.widget.Panel("paneltemaativo", {zIndex:20000, iframe:true, width:"250px", visible:false, draggable:true, close:true } ); | |
202 | 201 | YAHOO.temaativo.container.panel.setBody(combo); |
202 | + YAHOO.temaativo.container.panel.setHeader("Tema ativo"); | |
203 | 203 | YAHOO.temaativo.container.panel.setFooter(""); |
204 | 204 | YAHOO.temaativo.container.panel.render(document.body); |
205 | 205 | YAHOO.temaativo.container.panel.center(); |
206 | - document.getElementById("i3GEOOLlistaTemasAtivos").onchange = function(){ | |
207 | - if(botaoIdentifica){ | |
208 | - botaoIdentifica.layers = [i3GEOOL.layersLigados()[this.value]]; | |
209 | - } | |
210 | - }; | |
206 | + YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close, "click", function(){ | |
207 | + i3GEOpanelEditor.deactivate(); | |
208 | + i3GEOpanelEditor.activate(); | |
209 | + }); | |
211 | 210 | } |
212 | - catch(e){} | |
211 | + else{ | |
212 | + YAHOO.temaativo.container.panel.render(document.body); | |
213 | + YAHOO.temaativo.container.panel.show(); | |
214 | + } | |
215 | + document.getElementById("i3GEOOLlistaTemasAtivos").onchange = function(){ | |
216 | + if(botaoIdentifica){ | |
217 | + botaoIdentifica.layers = [i3GEOOL.layersLigados()[this.value]]; | |
218 | + } | |
219 | + }; | |
213 | 220 | }, |
214 | 221 | ativaTema: function(id){ |
215 | 222 | document.getElementById("i3GEOOLlistaTemasAtivos").value = id; |
... | ... | @@ -428,7 +435,7 @@ i3GEOOL = { |
428 | 435 | var styleMap = new OpenLayers.StyleMap({"default": style}); |
429 | 436 | var adiciona = false; |
430 | 437 | var controles = new Array(); |
431 | - var panel = new OpenLayers.Control.Panel({ | |
438 | + i3GEOpanelEditor = new OpenLayers.Control.Panel({ | |
432 | 439 | displayClass: "olControlEditingToolbar1 noprint" |
433 | 440 | }); |
434 | 441 | if(botoes.procura==true){ |
... | ... | @@ -528,8 +535,7 @@ i3GEOOL = { |
528 | 535 | )); |
529 | 536 | }, |
530 | 537 | activate: function(){ |
531 | - try{YAHOO.temaativo.container.panel.show();} | |
532 | - catch(e){} | |
538 | + i3GEOOL.criaJanelaAtivaTema(); | |
533 | 539 | } |
534 | 540 | } |
535 | 541 | }); |
... | ... | @@ -629,12 +635,24 @@ i3GEOOL = { |
629 | 635 | controles.push(button); |
630 | 636 | var adiciona = true; |
631 | 637 | } |
638 | + if(botoes.fecha==true){ | |
639 | + var button = new OpenLayers.Control.Button({ | |
640 | + displayClass: "fecha", | |
641 | + trigger: function(){ | |
642 | + i3GEOpanelEditor.destroy(); | |
643 | + YAHOO.temaativo.container.panel.destroy(); | |
644 | + }, | |
645 | + title: "Fechar editor" | |
646 | + }); | |
647 | + controles.push(button); | |
648 | + var adiciona = true; | |
649 | + } | |
632 | 650 | // |
633 | 651 | //adiciona o painel ao mapa se alguma op��o foi inserida |
634 | 652 | // |
635 | 653 | if(adiciona == true){ |
636 | - panel.addControls(controles); | |
637 | - i3GEOOL.mapa.addControl(panel); | |
654 | + i3GEOpanelEditor.addControls(controles); | |
655 | + i3GEOOL.mapa.addControl(i3GEOpanelEditor); | |
638 | 656 | } |
639 | 657 | }, |
640 | 658 | adicionaMarcas: function(){ | ... | ... |
mashups/openlayers.php
... | ... | @@ -71,6 +71,8 @@ if(isset($botoes)){ |
71 | 71 | {$objBotoes[] = "'procura':false";} |
72 | 72 | if(in_array("salva",$botoes)) |
73 | 73 | {$objBotoes[] = "'salva':false";} |
74 | + if(in_array("fecha",$botoes)) | |
75 | + {$objBotoes[] = "'fecha':false";} | |
74 | 76 | $botoes = "{".implode(",",$objBotoes)."}"; |
75 | 77 | } |
76 | 78 | |
... | ... | @@ -170,6 +172,7 @@ Parâmetros: |
170 | 172 | captura |
171 | 173 | procura |
172 | 174 | salva |
175 | + fecha | |
173 | 176 | |
174 | 177 | Para ver a lista de códigos de temas, que podem ser utilizados no parâmetro 'temas', acesse: |
175 | 178 | <a href='../ogc.php?lista=temas' >lista de temas</a>. Os códigos são mostrados em vermelho. | ... | ... |
mashups/openlayers.png