From 88c17943e6171f0ef702a119f3a601a0661893fe Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Fri, 17 Jun 2011 14:29:01 +0000 Subject: [PATCH] Incluido botão trazer para frente no editor vetorial --- classesjs/classe_barradebotoes.js | 3 ++- mashups/openlayers.css | 6 ++++++ mashups/openlayers.js.php | 24 +++++++++++++++++++++++- mashups/openlayers.php | 5 ++++- mashups/openlayers.png | Bin 22431 -> 0 bytes mashups/openlayers_ajuda.php | 6 +++++- 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/classesjs/classe_barradebotoes.js b/classesjs/classe_barradebotoes.js index 346f749..98b9c5b 100644 --- a/classesjs/classe_barradebotoes.js +++ b/classesjs/classe_barradebotoes.js @@ -1093,7 +1093,8 @@ i3GEO.barraDeBotoes = { 'ajuda':true, 'fecha':true, 'tools':true, - 'undo':true + 'undo':true, + 'frente':true }; i3GEO.editorOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); i3GEO.editorOL.mapa.addLayers([i3GEO.editorOL.layergrafico]); diff --git a/mashups/openlayers.css b/mashups/openlayers.css index 29d36cf..7b9cce6 100644 --- a/mashups/openlayers.css +++ b/mashups/openlayers.css @@ -130,6 +130,12 @@ background-position:-522px -28px; .olControlEditingToolbar1 .editorOLundoItemActive { background-position:-609px -28px; } +.olControlEditingToolbar1 .editorOLfrenteItemInactive { + background-position:-638px 0; +} +.olControlEditingToolbar1 .editorOLfrenteItemActive { + background-position:-638px -28px; +} .olControlEditingToolbar1 { width:600px; float:right; diff --git a/mashups/openlayers.js.php b/mashups/openlayers.js.php index e0b5de5..15c5401 100644 --- a/mashups/openlayers.js.php +++ b/mashups/openlayers.js.php @@ -62,7 +62,8 @@ i3GEO.editorOL = { 'propriedades':true, 'fecha':false, 'tools':false, - 'undo':false + 'undo':false, + 'frente':true }, pontos: [], marca: "../pacotes/openlayers/img/marker-gold.png", @@ -651,6 +652,15 @@ i3GEO.editorOL = { controles.push(i3GEO.editorOL.ModifyFeature); adiciona = true; } + if(botoes.frente===true){ + button = new OpenLayers.Control.Button({ + displayClass: "editorOLfrente", + trigger: function(){i3GEO.editorOL.trazParaFrente();}, + title: "traz para frente" + }); + controles.push(button); + adiciona = true; + } //só funciona dentro do i3geo if(botoes.tools===true && i3GEO.php){ button = new OpenLayers.Control.Button({ @@ -1096,5 +1106,17 @@ i3GEO.editorOL = { }, carregajts: function(funcao){ i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/jstsi3geo.js",funcao,"i3GEOjts",true); + }, + trazParaFrente: function(){ + var features = i3GEO.editorOL.layergrafico.selectedFeatures; + if(features.length > 0){ + i3GEO.editorOL.backup = new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}) + i3GEO.editorOL.backup.addFeatures(features); + i3GEO.editorOL.unselTodos(); + i3GEO.editorOL.layergrafico.removeFeatures(features); + i3GEO.editorOL.layergrafico.addFeatures(i3GEO.editorOL.backup.features); + } + else + {alert("Selecione pelo menos um elemento");} } }; \ No newline at end of file diff --git a/mashups/openlayers.php b/mashups/openlayers.php index 36a2a64..7199c44 100644 --- a/mashups/openlayers.php +++ b/mashups/openlayers.php @@ -80,7 +80,9 @@ if(isset($botoes)){ if(in_array("undo",$botoes)) {$objBotoes[] = "'undo':true";} if(in_array("propriedades",$botoes)) - {$objBotoes[] = "'propriedades':true";} + {$objBotoes[] = "'propriedades':true";} + if(in_array("frente",$botoes)) + {$objBotoes[] = "'frente':true";} $botoes = "{".implode(",",$objBotoes)."}"; } @@ -180,6 +182,7 @@ Parâmetros: apaga captura procura + frente propriedades tools undo diff --git a/mashups/openlayers.png b/mashups/openlayers.png index 2974d56..1855024 100644 Binary files a/mashups/openlayers.png and b/mashups/openlayers.png differ diff --git a/mashups/openlayers_ajuda.php b/mashups/openlayers_ajuda.php index 30d6870..583125b 100644 --- a/mashups/openlayers_ajuda.php +++ b/mashups/openlayers_ajuda.php @@ -100,9 +100,13 @@ p,td
- Salve ou obtenha as coordenadas das geometrias selecionadas. + Converta para shapefile, salve ou obtenha as coordenadas das geometrias selecionadas. +
+ Traz a figura selecionada para a frente das demais. + +
Defina as propriedades de edição, como a distância de aproximação e outros comportamentos das operações. Defina também o comportamento da ferramenta de edição, permitindo alterar uma figura ou rotacioná-la, movê-la ou redimensionar. -- libgit2 0.21.2