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 | 1088 | 'salva':true, |
| 1089 | 1089 | 'ajuda':true, |
| 1090 | 1090 | 'fecha':true, |
| 1091 | - 'uniao':true | |
| 1091 | + 'tools':true, | |
| 1092 | + 'undo':true | |
| 1092 | 1093 | }; |
| 1093 | 1094 | i3GEO.editorOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); |
| 1094 | 1095 | i3GEO.editorOL.mapa.addLayers([i3GEO.editorOL.layergrafico]); | ... | ... |
classesphp/classe_mapa.php
| ... | ... | @@ -1205,7 +1205,8 @@ Include: |
| 1205 | 1205 | $epsg = "EPSG:4291"; |
| 1206 | 1206 | $e4291 = "nao"; |
| 1207 | 1207 | $ecrs = "nao"; |
| 1208 | - $pos = explode(",",$proj); | |
| 1208 | + $pos = str_replace(" ",",",$proj); | |
| 1209 | + $pos = explode(",",$pos); | |
| 1209 | 1210 | if (count($pos) > 1) |
| 1210 | 1211 | { |
| 1211 | 1212 | foreach ($pos as $p) |
| ... | ... | @@ -1216,12 +1217,12 @@ Include: |
| 1216 | 1217 | if ($p[1] == "4291") |
| 1217 | 1218 | {$epsg = "EPSG:4291";$e4291="sim";} |
| 1218 | 1219 | if ($p[1] == "84") |
| 1219 | - {$ecrs = "CRS:84";} | |
| 1220 | + {$ecrs = "CRS:84";$ecrs = "sim";} | |
| 1220 | 1221 | } |
| 1221 | 1222 | } |
| 1222 | 1223 | else {$epsg = $proj;} |
| 1223 | 1224 | if ($e4291 == "sim"){$epsg = "EPSG:4291";} |
| 1224 | - if ($ecrs !== "sim"){$epsg = $ecrs;} | |
| 1225 | + if ($ecrs == "sim"){$epsg = $ecrs;} | |
| 1225 | 1226 | $epsg = trim($epsg); |
| 1226 | 1227 | $layer->setmetadata("wms_srs",$epsg); |
| 1227 | 1228 | $layer->setmetadata("wms_crs",$epsg); | ... | ... |
mashups/openlayers.css
| ... | ... | @@ -118,6 +118,18 @@ background-position:-522px -28px; |
| 118 | 118 | .olControlEditingToolbar1 .editorOLuniaoItemActive { |
| 119 | 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 | 133 | .olControlEditingToolbar1 { |
| 122 | 134 | width:600px; |
| 123 | 135 | float:right; | ... | ... |
mashups/openlayers.js.php
| ... | ... | @@ -10,6 +10,7 @@ if (app==='N'){navn=true;}else{navm=true;} |
| 10 | 10 | OpenLayers.ImgPath = "../pacotes/openlayers/img/"; |
| 11 | 11 | OpenLayers.Lang.setCode("pt-BR"); |
| 12 | 12 | i3GEO.editorOL = { |
| 13 | + backup: new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}), | |
| 13 | 14 | nomeFuncaoSalvar: "i3GEO.editorOL.testeSalvar()", |
| 14 | 15 | ol_mma: new OpenLayers.Layer.WMS( |
| 15 | 16 | "Base cartográfica", |
| ... | ... | @@ -59,7 +60,9 @@ i3GEO.editorOL = { |
| 59 | 60 | 'salva':true, |
| 60 | 61 | 'ajuda':true, |
| 61 | 62 | 'propriedades':true, |
| 62 | - 'fecha':false | |
| 63 | + 'fecha':false, | |
| 64 | + 'tools':false, | |
| 65 | + 'undo':false | |
| 63 | 66 | }, |
| 64 | 67 | pontos: [], |
| 65 | 68 | marca: "../pacotes/openlayers/img/marker-gold.png", |
| ... | ... | @@ -465,19 +468,32 @@ i3GEO.editorOL = { |
| 465 | 468 | new OpenLayers.Rule({symbolizer: sketchSymbolizers}) |
| 466 | 469 | ]); |
| 467 | 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 | 486 | if(botoes.procura===true){ |
| 471 | 487 | button = new OpenLayers.Control.Button({ |
| 472 | 488 | displayClass: "editorOLprocura", |
| 473 | 489 | trigger: function(){YAHOO.procura.container.panel.show();}, |
| 474 | - title: "Procurar" | |
| 490 | + title: "procura" | |
| 475 | 491 | }); |
| 476 | 492 | controles.push(button); |
| 477 | 493 | adiciona = true; |
| 478 | 494 | } |
| 479 | 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 | 497 | adiciona = true; |
| 482 | 498 | } |
| 483 | 499 | if(botoes.zoombox===true){ |
| ... | ... | @@ -488,7 +504,7 @@ i3GEO.editorOL = { |
| 488 | 504 | button = new OpenLayers.Control.Button({ |
| 489 | 505 | displayClass: "editorOLzoomtot", |
| 490 | 506 | trigger: function(){i3GEO.editorOL.mapa.zoomToMaxExtent();}, |
| 491 | - title: "Ajusta extensão" | |
| 507 | + title: "ajusta extensão" | |
| 492 | 508 | }); |
| 493 | 509 | controles.push(button); |
| 494 | 510 | adiciona = true; |
| ... | ... | @@ -497,7 +513,7 @@ i3GEO.editorOL = { |
| 497 | 513 | button = new OpenLayers.Control.Button({ |
| 498 | 514 | displayClass: "editorOLlegenda", |
| 499 | 515 | trigger: function(){i3GEO.editorOL.mostraLegenda();}, |
| 500 | - title: "Legenda" | |
| 516 | + title: "legenda" | |
| 501 | 517 | }); |
| 502 | 518 | controles.push(button); |
| 503 | 519 | adiciona = true; |
| ... | ... | @@ -509,7 +525,7 @@ i3GEO.editorOL = { |
| 509 | 525 | handlerOptions: {layerOptions: {styleMap: styleMap}}, |
| 510 | 526 | persist: true, |
| 511 | 527 | displayClass: "editorOLdistancia", |
| 512 | - title: "Distância" | |
| 528 | + title: "distância" | |
| 513 | 529 | } |
| 514 | 530 | ); |
| 515 | 531 | button.events.on({ |
| ... | ... | @@ -529,7 +545,7 @@ i3GEO.editorOL = { |
| 529 | 545 | handlerOptions: {layerOptions: {styleMap: styleMap}}, |
| 530 | 546 | persist: true, |
| 531 | 547 | displayClass: "editorOLarea", |
| 532 | - title: "Área" | |
| 548 | + title: "área" | |
| 533 | 549 | } |
| 534 | 550 | ); |
| 535 | 551 | button.events.on({ |
| ... | ... | @@ -548,7 +564,7 @@ i3GEO.editorOL = { |
| 548 | 564 | infoFormat:'text/plain', //'application/vnd.ogc.gml', |
| 549 | 565 | layers: [i3GEO.editorOL.layerAtivo()], |
| 550 | 566 | queryVisible: true, |
| 551 | - title: "Identificar", | |
| 567 | + title: "identifica", | |
| 552 | 568 | displayClass: "editorOLidentifica", |
| 553 | 569 | eventListeners: { |
| 554 | 570 | getfeatureinfo: function(event) { |
| ... | ... | @@ -609,25 +625,28 @@ i3GEO.editorOL = { |
| 609 | 625 | adiciona = true; |
| 610 | 626 | } |
| 611 | 627 | if(botoes.edita===true){ |
| 612 | - button = new OpenLayers.Control.ModifyFeature( | |
| 628 | + i3GEO.editorOL.ModifyFeature = new OpenLayers.Control.ModifyFeature( | |
| 613 | 629 | i3GEO.editorOL.layergrafico, |
| 614 | 630 | { |
| 615 | 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 | 640 | adiciona = true; |
| 621 | 641 | } |
| 622 | 642 | //só funciona dentro do i3geo |
| 623 | - if(botoes.uniao===true && i3GEO.php){ | |
| 643 | + if(botoes.tools===true && i3GEO.php){ | |
| 624 | 644 | button = new OpenLayers.Control.Button({ |
| 625 | - displayClass: "editorOLuniao", | |
| 645 | + displayClass: "editorOLtools", | |
| 626 | 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 | 651 | controles.push(button); |
| 633 | 652 | adiciona = true; |
| ... | ... | @@ -657,13 +676,24 @@ i3GEO.editorOL = { |
| 657 | 676 | trigger: function(){ |
| 658 | 677 | if(i3GEO.editorOL.layergrafico.selectedFeatures.length > 0){ |
| 659 | 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 | 684 | else |
| 664 | 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 | 698 | controles.push(button); |
| 669 | 699 | adiciona = true; |
| ... | ... | @@ -672,7 +702,7 @@ i3GEO.editorOL = { |
| 672 | 702 | button = new OpenLayers.Control.Button({ |
| 673 | 703 | displayClass: "editorOLpropriedades", |
| 674 | 704 | trigger: function(){i3GEO.editorOL.propriedades();}, |
| 675 | - title: "Propriedades" | |
| 705 | + title: "propriedades" | |
| 676 | 706 | }); |
| 677 | 707 | controles.push(button); |
| 678 | 708 | adiciona = true; |
| ... | ... | @@ -681,7 +711,7 @@ i3GEO.editorOL = { |
| 681 | 711 | button = new OpenLayers.Control.Button({ |
| 682 | 712 | displayClass: "editorOLsalva", |
| 683 | 713 | trigger: function(){i3GEO.editorOL.salvaGeometrias();}, |
| 684 | - title: "Salvar" | |
| 714 | + title: "salva" | |
| 685 | 715 | }); |
| 686 | 716 | controles.push(button); |
| 687 | 717 | adiciona = true; |
| ... | ... | @@ -695,7 +725,7 @@ i3GEO.editorOL = { |
| 695 | 725 | catch(e) |
| 696 | 726 | {window.open("openlayers_ajuda.php");} |
| 697 | 727 | }, |
| 698 | - title: "Ajuda" | |
| 728 | + title: "ajuda" | |
| 699 | 729 | }); |
| 700 | 730 | controles.push(button); |
| 701 | 731 | adiciona = true; |
| ... | ... | @@ -710,7 +740,7 @@ i3GEO.editorOL = { |
| 710 | 740 | i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.layergrafico); |
| 711 | 741 | } |
| 712 | 742 | }, |
| 713 | - title: "Fechar editor" | |
| 743 | + title: "fecha editor" | |
| 714 | 744 | }); |
| 715 | 745 | controles.push(button); |
| 716 | 746 | adiciona = true; |
| ... | ... | @@ -718,12 +748,15 @@ i3GEO.editorOL = { |
| 718 | 748 | // |
| 719 | 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 | 754 | i3GEOOLsplit = new OpenLayers.Control.Split({ |
| 723 | 755 | layer: i3GEO.editorOL.layergrafico, |
| 724 | 756 | source: i3GEO.editorOL.layergrafico, |
| 725 | 757 | tolerance: 0.0001, |
| 726 | 758 | eventListeners: { |
| 759 | + beforesplit: function(event){i3GEO.editorOL.guardaBackup();}, | |
| 727 | 760 | aftersplit: function(event) { |
| 728 | 761 | i3GEO.editorOL.flashFeatures(event.features); |
| 729 | 762 | } |
| ... | ... | @@ -787,7 +820,7 @@ i3GEO.editorOL = { |
| 787 | 820 | YAHOO.namespace("editorOL.container"); |
| 788 | 821 | YAHOO.editorOL.container.panel = new YAHOO.widget.Panel("panelpropriedadesEditor", {zIndex:20000, iframe:true, width:"350px", visible:false, draggable:true, close:true } ); |
| 789 | 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 | 824 | '<table class=lista7 >' + |
| 792 | 825 | ' <tr>' + |
| 793 | 826 | ' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>' + |
| ... | ... | @@ -799,12 +832,25 @@ i3GEO.editorOL = { |
| 799 | 832 | ' </tr>' + |
| 800 | 833 | '</table>' + |
| 801 | 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 | 836 | '<table class=lista7 >' + |
| 804 | 837 | ' <tr>' + |
| 805 | 838 | ' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>' + |
| 806 | 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 | 854 | YAHOO.editorOL.container.panel.setBody(ins); |
| 809 | 855 | if(typeof i3GEO != undefined && i3GEO != "") |
| 810 | 856 | {YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>");} |
| ... | ... | @@ -829,6 +875,46 @@ i3GEO.editorOL = { |
| 829 | 875 | } |
| 830 | 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 | 918 | snap: function(){ |
| 833 | 919 | var target = i3GEOOLsnap.targets[0], |
| 834 | 920 | tipos = ["node","vertex","edge"], |
| ... | ... | @@ -854,7 +940,8 @@ i3GEO.editorOL = { |
| 854 | 940 | if(temp.checked === true) |
| 855 | 941 | {i3GEOOLsplit.activate();} |
| 856 | 942 | }, |
| 857 | - uniao: function(){ | |
| 943 | + processageo: function(operacao){ | |
| 944 | + if(operacao === ""){return;} | |
| 858 | 945 | var geosel = i3GEO.editorOL.layergrafico.selectedFeatures, |
| 859 | 946 | fwkt = new OpenLayers.Format.WKT(), |
| 860 | 947 | polis,linhas,pontos,uniaopolis,uniaolinhas,uniaopontos,n,i,temp; |
| ... | ... | @@ -866,20 +953,20 @@ i3GEO.editorOL = { |
| 866 | 953 | i3GEO.janela.fechaAguarde("i3GEO.editorPoli"); |
| 867 | 954 | i3GEO.janela.fechaAguarde("i3GEO.editorLinhas"); |
| 868 | 955 | i3GEO.janela.fechaAguarde("i3GEO.editorPontos"); |
| 869 | - if(retorno.data) | |
| 956 | + if(retorno != "" && retorno.data && retorno.data != "") | |
| 870 | 957 | {i3GEO.editorOL.substituiFeaturesSel(retorno.data);} |
| 871 | 958 | } |
| 872 | - if(polis){ | |
| 959 | + if(polis.length > 0){ | |
| 873 | 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 | 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 | 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 | 971 | return; |
| 885 | 972 | /* |
| ... | ... | @@ -932,10 +1019,35 @@ i3GEO.editorOL = { |
| 932 | 1019 | } |
| 933 | 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 | 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 | 1052 | flashFeatures: function(features, index) { |
| 941 | 1053 | if(!index) { | ... | ... |
mashups/openlayers.php
| ... | ... | @@ -65,8 +65,6 @@ if(isset($botoes)){ |
| 65 | 65 | {$objBotoes[] = "'poligono':true";} |
| 66 | 66 | if(in_array("edita",$botoes)) |
| 67 | 67 | {$objBotoes[] = "'edita':true";} |
| 68 | - if(in_array("uniao",$botoes)) | |
| 69 | - {$objBotoes[] = "'uniao':true";} | |
| 70 | 68 | if(in_array("apaga",$botoes)) |
| 71 | 69 | {$objBotoes[] = "'apaga':true";} |
| 72 | 70 | if(in_array("procura",$botoes)) |
| ... | ... | @@ -77,6 +75,10 @@ if(isset($botoes)){ |
| 77 | 75 | {$objBotoes[] = "'ajuda':true";} |
| 78 | 76 | if(in_array("fecha",$botoes)) |
| 79 | 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 | 82 | if(in_array("propriedades",$botoes)) |
| 81 | 83 | {$objBotoes[] = "'propriedades':true";} |
| 82 | 84 | $botoes = "{".implode(",",$objBotoes)."}"; |
| ... | ... | @@ -179,6 +181,8 @@ Parâmetros: |
| 179 | 181 | captura |
| 180 | 182 | procura |
| 181 | 183 | propriedades |
| 184 | + tools | |
| 185 | + undo | |
| 182 | 186 | salva |
| 183 | 187 | ajuda |
| 184 | 188 | fecha | ... | ... |
mashups/openlayers.png
versao.php