Commit a4ad749ae47403a37dc512a41d174c21b965eb91
1 parent
73c27242
Exists in
master
and in
7 other branches
--no commit message
Showing
8 changed files
with
176 additions
and
46 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesjs/classe_barradebotoes.js
| @@ -1088,7 +1088,8 @@ i3GEO.barraDeBotoes = { | @@ -1088,7 +1088,8 @@ i3GEO.barraDeBotoes = { | ||
| 1088 | 'salva':true, | 1088 | 'salva':true, |
| 1089 | 'ajuda':true, | 1089 | 'ajuda':true, |
| 1090 | 'fecha':true, | 1090 | 'fecha':true, |
| 1091 | - 'uniao':true | 1091 | + 'tools':true, |
| 1092 | + 'undo':true | ||
| 1092 | }; | 1093 | }; |
| 1093 | i3GEO.editorOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); | 1094 | i3GEO.editorOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); |
| 1094 | i3GEO.editorOL.mapa.addLayers([i3GEO.editorOL.layergrafico]); | 1095 | i3GEO.editorOL.mapa.addLayers([i3GEO.editorOL.layergrafico]); |
classesphp/classe_mapa.php
| @@ -1205,7 +1205,8 @@ Include: | @@ -1205,7 +1205,8 @@ Include: | ||
| 1205 | $epsg = "EPSG:4291"; | 1205 | $epsg = "EPSG:4291"; |
| 1206 | $e4291 = "nao"; | 1206 | $e4291 = "nao"; |
| 1207 | $ecrs = "nao"; | 1207 | $ecrs = "nao"; |
| 1208 | - $pos = explode(",",$proj); | 1208 | + $pos = str_replace(" ",",",$proj); |
| 1209 | + $pos = explode(",",$pos); | ||
| 1209 | if (count($pos) > 1) | 1210 | if (count($pos) > 1) |
| 1210 | { | 1211 | { |
| 1211 | foreach ($pos as $p) | 1212 | foreach ($pos as $p) |
| @@ -1216,12 +1217,12 @@ Include: | @@ -1216,12 +1217,12 @@ Include: | ||
| 1216 | if ($p[1] == "4291") | 1217 | if ($p[1] == "4291") |
| 1217 | {$epsg = "EPSG:4291";$e4291="sim";} | 1218 | {$epsg = "EPSG:4291";$e4291="sim";} |
| 1218 | if ($p[1] == "84") | 1219 | if ($p[1] == "84") |
| 1219 | - {$ecrs = "CRS:84";} | 1220 | + {$ecrs = "CRS:84";$ecrs = "sim";} |
| 1220 | } | 1221 | } |
| 1221 | } | 1222 | } |
| 1222 | else {$epsg = $proj;} | 1223 | else {$epsg = $proj;} |
| 1223 | if ($e4291 == "sim"){$epsg = "EPSG:4291";} | 1224 | if ($e4291 == "sim"){$epsg = "EPSG:4291";} |
| 1224 | - if ($ecrs !== "sim"){$epsg = $ecrs;} | 1225 | + if ($ecrs == "sim"){$epsg = $ecrs;} |
| 1225 | $epsg = trim($epsg); | 1226 | $epsg = trim($epsg); |
| 1226 | $layer->setmetadata("wms_srs",$epsg); | 1227 | $layer->setmetadata("wms_srs",$epsg); |
| 1227 | $layer->setmetadata("wms_crs",$epsg); | 1228 | $layer->setmetadata("wms_crs",$epsg); |
mashups/openlayers.css
| @@ -118,6 +118,18 @@ background-position:-522px -28px; | @@ -118,6 +118,18 @@ background-position:-522px -28px; | ||
| 118 | .olControlEditingToolbar1 .editorOLuniaoItemActive { | 118 | .olControlEditingToolbar1 .editorOLuniaoItemActive { |
| 119 | background-position:-551px -28px; | 119 | background-position:-551px -28px; |
| 120 | } | 120 | } |
| 121 | +.olControlEditingToolbar1 .editorOLtoolsItemInactive { | ||
| 122 | + background-position:-580px 0; | ||
| 123 | +} | ||
| 124 | +.olControlEditingToolbar1 .editorOLtoolsItemActive { | ||
| 125 | + background-position:-580px -28px; | ||
| 126 | +} | ||
| 127 | +.olControlEditingToolbar1 .editorOLundoItemInactive { | ||
| 128 | + background-position:-609px 0; | ||
| 129 | +} | ||
| 130 | +.olControlEditingToolbar1 .editorOLundoItemActive { | ||
| 131 | + background-position:-609px -28px; | ||
| 132 | +} | ||
| 121 | .olControlEditingToolbar1 { | 133 | .olControlEditingToolbar1 { |
| 122 | width:600px; | 134 | width:600px; |
| 123 | float:right; | 135 | float:right; |
mashups/openlayers.js.php
| @@ -10,6 +10,7 @@ if (app==='N'){navn=true;}else{navm=true;} | @@ -10,6 +10,7 @@ if (app==='N'){navn=true;}else{navm=true;} | ||
| 10 | OpenLayers.ImgPath = "../pacotes/openlayers/img/"; | 10 | OpenLayers.ImgPath = "../pacotes/openlayers/img/"; |
| 11 | OpenLayers.Lang.setCode("pt-BR"); | 11 | OpenLayers.Lang.setCode("pt-BR"); |
| 12 | i3GEO.editorOL = { | 12 | i3GEO.editorOL = { |
| 13 | + backup: new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}), | ||
| 13 | nomeFuncaoSalvar: "i3GEO.editorOL.testeSalvar()", | 14 | nomeFuncaoSalvar: "i3GEO.editorOL.testeSalvar()", |
| 14 | ol_mma: new OpenLayers.Layer.WMS( | 15 | ol_mma: new OpenLayers.Layer.WMS( |
| 15 | "Base cartográfica", | 16 | "Base cartográfica", |
| @@ -59,7 +60,9 @@ i3GEO.editorOL = { | @@ -59,7 +60,9 @@ i3GEO.editorOL = { | ||
| 59 | 'salva':true, | 60 | 'salva':true, |
| 60 | 'ajuda':true, | 61 | 'ajuda':true, |
| 61 | 'propriedades':true, | 62 | 'propriedades':true, |
| 62 | - 'fecha':false | 63 | + 'fecha':false, |
| 64 | + 'tools':false, | ||
| 65 | + 'undo':false | ||
| 63 | }, | 66 | }, |
| 64 | pontos: [], | 67 | pontos: [], |
| 65 | marca: "../pacotes/openlayers/img/marker-gold.png", | 68 | marca: "../pacotes/openlayers/img/marker-gold.png", |
| @@ -465,19 +468,32 @@ i3GEO.editorOL = { | @@ -465,19 +468,32 @@ i3GEO.editorOL = { | ||
| 465 | new OpenLayers.Rule({symbolizer: sketchSymbolizers}) | 468 | new OpenLayers.Rule({symbolizer: sketchSymbolizers}) |
| 466 | ]); | 469 | ]); |
| 467 | i3GEOpanelEditor = new OpenLayers.Control.Panel({ | 470 | i3GEOpanelEditor = new OpenLayers.Control.Panel({ |
| 468 | - displayClass: "olControlEditingToolbar1 noprint" | 471 | + displayClass: "olControlEditingToolbar1 noprint", |
| 472 | + saveState: true, | ||
| 473 | + activateControl: function(c){ | ||
| 474 | + this.deactivate(); | ||
| 475 | + this.activate(); | ||
| 476 | + try{ | ||
| 477 | + i3GEO.editorOL.ModifyFeature.deactivate(); | ||
| 478 | + } | ||
| 479 | + catch(e){} | ||
| 480 | + if(!c.type) | ||
| 481 | + {c.activate();} | ||
| 482 | + else | ||
| 483 | + {c.trigger.call();} | ||
| 484 | + } | ||
| 469 | }); | 485 | }); |
| 470 | if(botoes.procura===true){ | 486 | if(botoes.procura===true){ |
| 471 | button = new OpenLayers.Control.Button({ | 487 | button = new OpenLayers.Control.Button({ |
| 472 | displayClass: "editorOLprocura", | 488 | displayClass: "editorOLprocura", |
| 473 | trigger: function(){YAHOO.procura.container.panel.show();}, | 489 | trigger: function(){YAHOO.procura.container.panel.show();}, |
| 474 | - title: "Procurar" | 490 | + title: "procura" |
| 475 | }); | 491 | }); |
| 476 | controles.push(button); | 492 | controles.push(button); |
| 477 | adiciona = true; | 493 | adiciona = true; |
| 478 | } | 494 | } |
| 479 | if(botoes.pan===true){ | 495 | if(botoes.pan===true){ |
| 480 | - controles.push(new OpenLayers.Control.Navigation({title: "Deslocar",displayClass:"editorOLpan"})); | 496 | + controles.push(new OpenLayers.Control.Navigation({title: "deslocar",displayClass:"editorOLpan"})); |
| 481 | adiciona = true; | 497 | adiciona = true; |
| 482 | } | 498 | } |
| 483 | if(botoes.zoombox===true){ | 499 | if(botoes.zoombox===true){ |
| @@ -488,7 +504,7 @@ i3GEO.editorOL = { | @@ -488,7 +504,7 @@ i3GEO.editorOL = { | ||
| 488 | button = new OpenLayers.Control.Button({ | 504 | button = new OpenLayers.Control.Button({ |
| 489 | displayClass: "editorOLzoomtot", | 505 | displayClass: "editorOLzoomtot", |
| 490 | trigger: function(){i3GEO.editorOL.mapa.zoomToMaxExtent();}, | 506 | trigger: function(){i3GEO.editorOL.mapa.zoomToMaxExtent();}, |
| 491 | - title: "Ajusta extensão" | 507 | + title: "ajusta extensão" |
| 492 | }); | 508 | }); |
| 493 | controles.push(button); | 509 | controles.push(button); |
| 494 | adiciona = true; | 510 | adiciona = true; |
| @@ -497,7 +513,7 @@ i3GEO.editorOL = { | @@ -497,7 +513,7 @@ i3GEO.editorOL = { | ||
| 497 | button = new OpenLayers.Control.Button({ | 513 | button = new OpenLayers.Control.Button({ |
| 498 | displayClass: "editorOLlegenda", | 514 | displayClass: "editorOLlegenda", |
| 499 | trigger: function(){i3GEO.editorOL.mostraLegenda();}, | 515 | trigger: function(){i3GEO.editorOL.mostraLegenda();}, |
| 500 | - title: "Legenda" | 516 | + title: "legenda" |
| 501 | }); | 517 | }); |
| 502 | controles.push(button); | 518 | controles.push(button); |
| 503 | adiciona = true; | 519 | adiciona = true; |
| @@ -509,7 +525,7 @@ i3GEO.editorOL = { | @@ -509,7 +525,7 @@ i3GEO.editorOL = { | ||
| 509 | handlerOptions: {layerOptions: {styleMap: styleMap}}, | 525 | handlerOptions: {layerOptions: {styleMap: styleMap}}, |
| 510 | persist: true, | 526 | persist: true, |
| 511 | displayClass: "editorOLdistancia", | 527 | displayClass: "editorOLdistancia", |
| 512 | - title: "Distância" | 528 | + title: "distância" |
| 513 | } | 529 | } |
| 514 | ); | 530 | ); |
| 515 | button.events.on({ | 531 | button.events.on({ |
| @@ -529,7 +545,7 @@ i3GEO.editorOL = { | @@ -529,7 +545,7 @@ i3GEO.editorOL = { | ||
| 529 | handlerOptions: {layerOptions: {styleMap: styleMap}}, | 545 | handlerOptions: {layerOptions: {styleMap: styleMap}}, |
| 530 | persist: true, | 546 | persist: true, |
| 531 | displayClass: "editorOLarea", | 547 | displayClass: "editorOLarea", |
| 532 | - title: "Área" | 548 | + title: "área" |
| 533 | } | 549 | } |
| 534 | ); | 550 | ); |
| 535 | button.events.on({ | 551 | button.events.on({ |
| @@ -548,7 +564,7 @@ i3GEO.editorOL = { | @@ -548,7 +564,7 @@ i3GEO.editorOL = { | ||
| 548 | infoFormat:'text/plain', //'application/vnd.ogc.gml', | 564 | infoFormat:'text/plain', //'application/vnd.ogc.gml', |
| 549 | layers: [i3GEO.editorOL.layerAtivo()], | 565 | layers: [i3GEO.editorOL.layerAtivo()], |
| 550 | queryVisible: true, | 566 | queryVisible: true, |
| 551 | - title: "Identificar", | 567 | + title: "identifica", |
| 552 | displayClass: "editorOLidentifica", | 568 | displayClass: "editorOLidentifica", |
| 553 | eventListeners: { | 569 | eventListeners: { |
| 554 | getfeatureinfo: function(event) { | 570 | getfeatureinfo: function(event) { |
| @@ -609,25 +625,28 @@ i3GEO.editorOL = { | @@ -609,25 +625,28 @@ i3GEO.editorOL = { | ||
| 609 | adiciona = true; | 625 | adiciona = true; |
| 610 | } | 626 | } |
| 611 | if(botoes.edita===true){ | 627 | if(botoes.edita===true){ |
| 612 | - button = new OpenLayers.Control.ModifyFeature( | 628 | + i3GEO.editorOL.ModifyFeature = new OpenLayers.Control.ModifyFeature( |
| 613 | i3GEO.editorOL.layergrafico, | 629 | i3GEO.editorOL.layergrafico, |
| 614 | { | 630 | { |
| 615 | displayClass: "editorOLedita", | 631 | displayClass: "editorOLedita", |
| 616 | - title: "edita elemento" | 632 | + title: "modifica figura", |
| 633 | + //onModification: function(evt){alert("oi");i3GEO.editorOL.guardaBackup();}, | ||
| 634 | + clickout: true, | ||
| 635 | + toggle: true, | ||
| 636 | + mode: OpenLayers.Control.ModifyFeature.RESHAPE | ||
| 617 | } | 637 | } |
| 618 | ); | 638 | ); |
| 619 | - controles.push(button); | 639 | + controles.push(i3GEO.editorOL.ModifyFeature); |
| 620 | adiciona = true; | 640 | adiciona = true; |
| 621 | } | 641 | } |
| 622 | //só funciona dentro do i3geo | 642 | //só funciona dentro do i3geo |
| 623 | - if(botoes.uniao===true && i3GEO.php){ | 643 | + if(botoes.tools===true && i3GEO.php){ |
| 624 | button = new OpenLayers.Control.Button({ | 644 | button = new OpenLayers.Control.Button({ |
| 625 | - displayClass: "editorOLuniao", | 645 | + displayClass: "editorOLtools", |
| 626 | trigger: function(){ | 646 | trigger: function(){ |
| 627 | - //i3GEO.editorOL.carregajts("i3GEO.editorOL.uniao()"); | ||
| 628 | - i3GEO.editorOL.uniao(); | 647 | + i3GEO.editorOL.ferramentas(); |
| 629 | }, | 648 | }, |
| 630 | - title: "Une geometrias" | 649 | + title: "ferramentas" |
| 631 | }); | 650 | }); |
| 632 | controles.push(button); | 651 | controles.push(button); |
| 633 | adiciona = true; | 652 | adiciona = true; |
| @@ -657,13 +676,24 @@ i3GEO.editorOL = { | @@ -657,13 +676,24 @@ i3GEO.editorOL = { | ||
| 657 | trigger: function(){ | 676 | trigger: function(){ |
| 658 | if(i3GEO.editorOL.layergrafico.selectedFeatures.length > 0){ | 677 | if(i3GEO.editorOL.layergrafico.selectedFeatures.length > 0){ |
| 659 | var x = window.confirm("Exclui os elementos selecionados?"); | 678 | var x = window.confirm("Exclui os elementos selecionados?"); |
| 660 | - if(x) | ||
| 661 | - {i3GEO.editorOL.layergrafico.removeFeatures(i3GEO.editorOL.layergrafico.selectedFeatures);} | 679 | + if(x){ |
| 680 | + i3GEO.editorOL.guardaBackup(); | ||
| 681 | + i3GEO.editorOL.layergrafico.removeFeatures(i3GEO.editorOL.layergrafico.selectedFeatures); | ||
| 682 | + } | ||
| 662 | } | 683 | } |
| 663 | else | 684 | else |
| 664 | {alert("Selecione pelo menos um elemento");} | 685 | {alert("Selecione pelo menos um elemento");} |
| 665 | }, | 686 | }, |
| 666 | - title: "Apaga selecionados" | 687 | + title: "apaga selecionados" |
| 688 | + }); | ||
| 689 | + controles.push(button); | ||
| 690 | + adiciona = true; | ||
| 691 | + } | ||
| 692 | + if(botoes.undo===true){ | ||
| 693 | + button = new OpenLayers.Control.Button({ | ||
| 694 | + displayClass: "editorOLundo", | ||
| 695 | + trigger: function(){i3GEO.editorOL.restauraBackup();}, | ||
| 696 | + title: "recupera" | ||
| 667 | }); | 697 | }); |
| 668 | controles.push(button); | 698 | controles.push(button); |
| 669 | adiciona = true; | 699 | adiciona = true; |
| @@ -672,7 +702,7 @@ i3GEO.editorOL = { | @@ -672,7 +702,7 @@ i3GEO.editorOL = { | ||
| 672 | button = new OpenLayers.Control.Button({ | 702 | button = new OpenLayers.Control.Button({ |
| 673 | displayClass: "editorOLpropriedades", | 703 | displayClass: "editorOLpropriedades", |
| 674 | trigger: function(){i3GEO.editorOL.propriedades();}, | 704 | trigger: function(){i3GEO.editorOL.propriedades();}, |
| 675 | - title: "Propriedades" | 705 | + title: "propriedades" |
| 676 | }); | 706 | }); |
| 677 | controles.push(button); | 707 | controles.push(button); |
| 678 | adiciona = true; | 708 | adiciona = true; |
| @@ -681,7 +711,7 @@ i3GEO.editorOL = { | @@ -681,7 +711,7 @@ i3GEO.editorOL = { | ||
| 681 | button = new OpenLayers.Control.Button({ | 711 | button = new OpenLayers.Control.Button({ |
| 682 | displayClass: "editorOLsalva", | 712 | displayClass: "editorOLsalva", |
| 683 | trigger: function(){i3GEO.editorOL.salvaGeometrias();}, | 713 | trigger: function(){i3GEO.editorOL.salvaGeometrias();}, |
| 684 | - title: "Salvar" | 714 | + title: "salva" |
| 685 | }); | 715 | }); |
| 686 | controles.push(button); | 716 | controles.push(button); |
| 687 | adiciona = true; | 717 | adiciona = true; |
| @@ -695,7 +725,7 @@ i3GEO.editorOL = { | @@ -695,7 +725,7 @@ i3GEO.editorOL = { | ||
| 695 | catch(e) | 725 | catch(e) |
| 696 | {window.open("openlayers_ajuda.php");} | 726 | {window.open("openlayers_ajuda.php");} |
| 697 | }, | 727 | }, |
| 698 | - title: "Ajuda" | 728 | + title: "ajuda" |
| 699 | }); | 729 | }); |
| 700 | controles.push(button); | 730 | controles.push(button); |
| 701 | adiciona = true; | 731 | adiciona = true; |
| @@ -710,7 +740,7 @@ i3GEO.editorOL = { | @@ -710,7 +740,7 @@ i3GEO.editorOL = { | ||
| 710 | i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.layergrafico); | 740 | i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.layergrafico); |
| 711 | } | 741 | } |
| 712 | }, | 742 | }, |
| 713 | - title: "Fechar editor" | 743 | + title: "fecha editor" |
| 714 | }); | 744 | }); |
| 715 | controles.push(button); | 745 | controles.push(button); |
| 716 | adiciona = true; | 746 | adiciona = true; |
| @@ -718,12 +748,15 @@ i3GEO.editorOL = { | @@ -718,12 +748,15 @@ i3GEO.editorOL = { | ||
| 718 | // | 748 | // |
| 719 | //controle que permite o snap | 749 | //controle que permite o snap |
| 720 | // | 750 | // |
| 721 | - i3GEOOLsnap = new OpenLayers.Control.Snapping({layer: i3GEO.editorOL.layergrafico}); | 751 | + i3GEOOLsnap = new OpenLayers.Control.Snapping({ |
| 752 | + layer: i3GEO.editorOL.layergrafico | ||
| 753 | + }); | ||
| 722 | i3GEOOLsplit = new OpenLayers.Control.Split({ | 754 | i3GEOOLsplit = new OpenLayers.Control.Split({ |
| 723 | layer: i3GEO.editorOL.layergrafico, | 755 | layer: i3GEO.editorOL.layergrafico, |
| 724 | source: i3GEO.editorOL.layergrafico, | 756 | source: i3GEO.editorOL.layergrafico, |
| 725 | tolerance: 0.0001, | 757 | tolerance: 0.0001, |
| 726 | eventListeners: { | 758 | eventListeners: { |
| 759 | + beforesplit: function(event){i3GEO.editorOL.guardaBackup();}, | ||
| 727 | aftersplit: function(event) { | 760 | aftersplit: function(event) { |
| 728 | i3GEO.editorOL.flashFeatures(event.features); | 761 | i3GEO.editorOL.flashFeatures(event.features); |
| 729 | } | 762 | } |
| @@ -787,7 +820,7 @@ i3GEO.editorOL = { | @@ -787,7 +820,7 @@ i3GEO.editorOL = { | ||
| 787 | YAHOO.namespace("editorOL.container"); | 820 | YAHOO.namespace("editorOL.container"); |
| 788 | YAHOO.editorOL.container.panel = new YAHOO.widget.Panel("panelpropriedadesEditor", {zIndex:20000, iframe:true, width:"350px", visible:false, draggable:true, close:true } ); | 821 | YAHOO.editorOL.container.panel = new YAHOO.widget.Panel("panelpropriedadesEditor", {zIndex:20000, iframe:true, width:"350px", visible:false, draggable:true, close:true } ); |
| 789 | var ins = "" + | 822 | var ins = "" + |
| 790 | - '<p class=paragrafo >Ajusta nó em edição para o(a):</p>' + | 823 | + '<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>' + |
| 791 | '<table class=lista7 >' + | 824 | '<table class=lista7 >' + |
| 792 | ' <tr>' + | 825 | ' <tr>' + |
| 793 | ' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>' + | 826 | ' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>' + |
| @@ -799,12 +832,25 @@ i3GEO.editorOL = { | @@ -799,12 +832,25 @@ i3GEO.editorOL = { | ||
| 799 | ' </tr>' + | 832 | ' </tr>' + |
| 800 | '</table>' + | 833 | '</table>' + |
| 801 | '<br />' + | 834 | '<br />' + |
| 802 | - '<p class=paragrafo >Divide intersecção ao digitalizar</p>' + | 835 | + '<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>' + |
| 803 | '<table class=lista7 >' + | 836 | '<table class=lista7 >' + |
| 804 | ' <tr>' + | 837 | ' <tr>' + |
| 805 | ' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>' + | 838 | ' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>' + |
| 806 | ' </tr>' + | 839 | ' </tr>' + |
| 807 | - '</table>'; | 840 | + '</table>' + |
| 841 | + '<br />' + | ||
| 842 | + '<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>' + | ||
| 843 | + '<table class=lista7 >' + | ||
| 844 | + ' <tr>' + | ||
| 845 | + ' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>' + | ||
| 846 | + ' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>' + | ||
| 847 | + ' </tr>' + | ||
| 848 | + ' <tr>' + | ||
| 849 | + ' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>' + | ||
| 850 | + ' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>' + | ||
| 851 | + ' </tr>' + | ||
| 852 | + | ||
| 853 | + '</table>'; | ||
| 808 | YAHOO.editorOL.container.panel.setBody(ins); | 854 | YAHOO.editorOL.container.panel.setBody(ins); |
| 809 | if(typeof i3GEO != undefined && i3GEO != "") | 855 | if(typeof i3GEO != undefined && i3GEO != "") |
| 810 | {YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>");} | 856 | {YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>");} |
| @@ -829,6 +875,46 @@ i3GEO.editorOL = { | @@ -829,6 +875,46 @@ i3GEO.editorOL = { | ||
| 829 | } | 875 | } |
| 830 | YAHOO.editorOL.container.panel.show(); | 876 | YAHOO.editorOL.container.panel.show(); |
| 831 | }, | 877 | }, |
| 878 | + ferramentas: function(){ | ||
| 879 | + if(!document.getElementById("panelferramentasEditor")){ | ||
| 880 | + YAHOO.namespace("editorOL.ferramentas"); | ||
| 881 | + YAHOO.editorOL.ferramentas.panel = new YAHOO.widget.Panel("panelferramentasEditor", {zIndex:20000, iframe:true, width:"300px", visible:false, draggable:true, close:true } ); | ||
| 882 | + var ins = "" + | ||
| 883 | + '<p class=paragrafo >Operações sobre as figuras selecionadas:</p>' + | ||
| 884 | + '<select onchange="i3GEO.editorOL.processageo(this.value);this.value = \'\'" >' + | ||
| 885 | + ' <option value="">---</option>' + | ||
| 886 | + ' <option value=union >União</option>' + | ||
| 887 | + ' <option value=intersection >Intersecção</option>' + | ||
| 888 | + ' <option value=convexhull >Convex hull</option>' + | ||
| 889 | + ' <option value=boundary >Bordas</option>' + | ||
| 890 | + ' <option value=difference >Diferença</option>' + | ||
| 891 | + ' <option value=symdifference >Diferença simétrica</option>' + | ||
| 892 | + '</select>'+ | ||
| 893 | + '<br><br><a class=paragrafo href=# onclick="i3GEO.editorOL.layergrafico.destroyFeatures()" >Apaga tudo</a>'; | ||
| 894 | + '<br><br><a class=paragrafo href=# onclick="i3GEO.editorOL.layergrafico.removeFeatures(i3GEO.editorOL.layergrafico.features)" >Seleciona tudo</a>'; | ||
| 895 | + | ||
| 896 | + YAHOO.editorOL.ferramentas.panel.setBody(ins); | ||
| 897 | + if(typeof i3GEO != undefined && i3GEO != "") | ||
| 898 | + {YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>");} | ||
| 899 | + else | ||
| 900 | + {YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas");} | ||
| 901 | + | ||
| 902 | + YAHOO.editorOL.ferramentas.panel.setFooter(""); | ||
| 903 | + YAHOO.editorOL.ferramentas.panel.render(document.body); | ||
| 904 | + YAHOO.editorOL.ferramentas.panel.center(); | ||
| 905 | + YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close, "click", function(){ | ||
| 906 | + }); | ||
| 907 | + temp = $i("panelferramentasEditor_minimizaCabecalho"); | ||
| 908 | + if(temp){ | ||
| 909 | + temp.onclick = function(){i3GEO.janela.minimiza("panelferramentasEditor");} | ||
| 910 | + } | ||
| 911 | + | ||
| 912 | + } | ||
| 913 | + else{ | ||
| 914 | + YAHOO.editorOL.ferramentas.panel.render(document.body); | ||
| 915 | + } | ||
| 916 | + YAHOO.editorOL.ferramentas.panel.show(); | ||
| 917 | + }, | ||
| 832 | snap: function(){ | 918 | snap: function(){ |
| 833 | var target = i3GEOOLsnap.targets[0], | 919 | var target = i3GEOOLsnap.targets[0], |
| 834 | tipos = ["node","vertex","edge"], | 920 | tipos = ["node","vertex","edge"], |
| @@ -854,7 +940,8 @@ i3GEO.editorOL = { | @@ -854,7 +940,8 @@ i3GEO.editorOL = { | ||
| 854 | if(temp.checked === true) | 940 | if(temp.checked === true) |
| 855 | {i3GEOOLsplit.activate();} | 941 | {i3GEOOLsplit.activate();} |
| 856 | }, | 942 | }, |
| 857 | - uniao: function(){ | 943 | + processageo: function(operacao){ |
| 944 | + if(operacao === ""){return;} | ||
| 858 | var geosel = i3GEO.editorOL.layergrafico.selectedFeatures, | 945 | var geosel = i3GEO.editorOL.layergrafico.selectedFeatures, |
| 859 | fwkt = new OpenLayers.Format.WKT(), | 946 | fwkt = new OpenLayers.Format.WKT(), |
| 860 | polis,linhas,pontos,uniaopolis,uniaolinhas,uniaopontos,n,i,temp; | 947 | polis,linhas,pontos,uniaopolis,uniaolinhas,uniaopontos,n,i,temp; |
| @@ -866,20 +953,20 @@ i3GEO.editorOL = { | @@ -866,20 +953,20 @@ i3GEO.editorOL = { | ||
| 866 | i3GEO.janela.fechaAguarde("i3GEO.editorPoli"); | 953 | i3GEO.janela.fechaAguarde("i3GEO.editorPoli"); |
| 867 | i3GEO.janela.fechaAguarde("i3GEO.editorLinhas"); | 954 | i3GEO.janela.fechaAguarde("i3GEO.editorLinhas"); |
| 868 | i3GEO.janela.fechaAguarde("i3GEO.editorPontos"); | 955 | i3GEO.janela.fechaAguarde("i3GEO.editorPontos"); |
| 869 | - if(retorno.data) | 956 | + if(retorno != "" && retorno.data && retorno.data != "") |
| 870 | {i3GEO.editorOL.substituiFeaturesSel(retorno.data);} | 957 | {i3GEO.editorOL.substituiFeaturesSel(retorno.data);} |
| 871 | } | 958 | } |
| 872 | - if(polis){ | 959 | + if(polis.length > 0){ |
| 873 | i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos"); | 960 | i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos"); |
| 874 | - i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),"union"); | 961 | + i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao); |
| 875 | } | 962 | } |
| 876 | - if(linhas){ | 963 | + if(linhas.length > 0){ |
| 877 | i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas"); | 964 | i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas"); |
| 878 | - i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),"union"); | 965 | + i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao); |
| 879 | } | 966 | } |
| 880 | - if(pontos){ | 967 | + if(pontos.length > 0){ |
| 881 | i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos"); | 968 | i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos"); |
| 882 | - i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),"union"); | 969 | + i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao); |
| 883 | } | 970 | } |
| 884 | return; | 971 | return; |
| 885 | /* | 972 | /* |
| @@ -932,10 +1019,35 @@ i3GEO.editorOL = { | @@ -932,10 +1019,35 @@ i3GEO.editorOL = { | ||
| 932 | } | 1019 | } |
| 933 | return lista; | 1020 | return lista; |
| 934 | }, | 1021 | }, |
| 1022 | + guardaBackup: function(){ | ||
| 1023 | + i3GEO.editorOL.backup = new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}) | ||
| 1024 | + //i3GEO.editorOL.backup.removeFeatures(i3GEO.editorOL.backup.features); | ||
| 1025 | + i3GEO.editorOL.backup.addFeatures(i3GEO.editorOL.layergrafico.features); | ||
| 1026 | + i3GEO.editorOL.unselTodos(); | ||
| 1027 | + }, | ||
| 1028 | + unselTodos:function(){ | ||
| 1029 | + var n,i,temp; | ||
| 1030 | + n = i3GEO.editorOL.backup.features.length; | ||
| 1031 | + for(i=0;i<n;i++){ | ||
| 1032 | + i3GEO.editorOL.backup.features[i].renderIntent = "default"; | ||
| 1033 | + } | ||
| 1034 | + }, | ||
| 1035 | + restauraBackup: function(){ | ||
| 1036 | + if(i3GEO.editorOL.backup.features.length > 0){ | ||
| 1037 | + i3GEO.editorOL.layergrafico.removeFeatures(i3GEO.editorOL.layergrafico.features); | ||
| 1038 | + i3GEO.editorOL.layergrafico.addFeatures(i3GEO.editorOL.backup.features); | ||
| 1039 | + } | ||
| 1040 | + //i3GEO.editorOL.backup.removeFeatures(i3GEO.editorOL.backup.features); | ||
| 1041 | + }, | ||
| 935 | substituiFeaturesSel: function(wkt){ | 1042 | substituiFeaturesSel: function(wkt){ |
| 936 | - var fwkt = new OpenLayers.Format.WKT(); | ||
| 937 | - i3GEO.editorOL.layergrafico.removeFeatures(i3GEO.editorOL.layergrafico.selectedFeatures); | ||
| 938 | - i3GEO.editorOL.layergrafico.addFeatures([fwkt.read(wkt)]); | 1043 | + i3GEO.editorOL.guardaBackup(); |
| 1044 | + try{ | ||
| 1045 | + var fwkt = new OpenLayers.Format.WKT(); | ||
| 1046 | + i3GEO.editorOL.layergrafico.removeFeatures(i3GEO.editorOL.layergrafico.selectedFeatures); | ||
| 1047 | + i3GEO.editorOL.layergrafico.addFeatures([fwkt.read(wkt)]); | ||
| 1048 | + } | ||
| 1049 | + catch(e) | ||
| 1050 | + {i3GEO.editorOL.restauraBackup();} | ||
| 939 | }, | 1051 | }, |
| 940 | flashFeatures: function(features, index) { | 1052 | flashFeatures: function(features, index) { |
| 941 | if(!index) { | 1053 | if(!index) { |
mashups/openlayers.php
| @@ -65,8 +65,6 @@ if(isset($botoes)){ | @@ -65,8 +65,6 @@ if(isset($botoes)){ | ||
| 65 | {$objBotoes[] = "'poligono':true";} | 65 | {$objBotoes[] = "'poligono':true";} |
| 66 | if(in_array("edita",$botoes)) | 66 | if(in_array("edita",$botoes)) |
| 67 | {$objBotoes[] = "'edita':true";} | 67 | {$objBotoes[] = "'edita':true";} |
| 68 | - if(in_array("uniao",$botoes)) | ||
| 69 | - {$objBotoes[] = "'uniao':true";} | ||
| 70 | if(in_array("apaga",$botoes)) | 68 | if(in_array("apaga",$botoes)) |
| 71 | {$objBotoes[] = "'apaga':true";} | 69 | {$objBotoes[] = "'apaga':true";} |
| 72 | if(in_array("procura",$botoes)) | 70 | if(in_array("procura",$botoes)) |
| @@ -77,6 +75,10 @@ if(isset($botoes)){ | @@ -77,6 +75,10 @@ if(isset($botoes)){ | ||
| 77 | {$objBotoes[] = "'ajuda':true";} | 75 | {$objBotoes[] = "'ajuda':true";} |
| 78 | if(in_array("fecha",$botoes)) | 76 | if(in_array("fecha",$botoes)) |
| 79 | {$objBotoes[] = "'fecha':true";} | 77 | {$objBotoes[] = "'fecha':true";} |
| 78 | + if(in_array("tools",$botoes)) | ||
| 79 | + {$objBotoes[] = "'tools':true";} | ||
| 80 | + if(in_array("undo",$botoes)) | ||
| 81 | + {$objBotoes[] = "'undo':true";} | ||
| 80 | if(in_array("propriedades",$botoes)) | 82 | if(in_array("propriedades",$botoes)) |
| 81 | {$objBotoes[] = "'propriedades':true";} | 83 | {$objBotoes[] = "'propriedades':true";} |
| 82 | $botoes = "{".implode(",",$objBotoes)."}"; | 84 | $botoes = "{".implode(",",$objBotoes)."}"; |
| @@ -179,6 +181,8 @@ Parâmetros: | @@ -179,6 +181,8 @@ Parâmetros: | ||
| 179 | captura | 181 | captura |
| 180 | procura | 182 | procura |
| 181 | propriedades | 183 | propriedades |
| 184 | + tools | ||
| 185 | + undo | ||
| 182 | salva | 186 | salva |
| 183 | ajuda | 187 | ajuda |
| 184 | fecha | 188 | fecha |
mashups/openlayers.png
versao.php
| @@ -2,5 +2,5 @@ | @@ -2,5 +2,5 @@ | ||
| 2 | /* | 2 | /* |
| 3 | Utilizado como um include em ms_configura.php | 3 | Utilizado como um include em ms_configura.php |
| 4 | */ | 4 | */ |
| 5 | -$mensagemInicia = 'Versão 4.5 - Revisão SVN 2014'; | 5 | +$mensagemInicia = 'Versão 4.5 - SP3 - Revisão SVN '; |
| 6 | ?> | 6 | ?> |
| 7 | \ No newline at end of file | 7 | \ No newline at end of file |