Commit 4713212466689c690e57d6da2d416913bdcb7589
1 parent
66bfabcb
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
48 additions
and
7 deletions
Show diff stats
ferramentas/selecao/index.js
... | ... | @@ -534,7 +534,7 @@ i3GEOF.selecao = |
534 | 534 | if (i3GEOF.selecao.aguarde.visibility === "visible") { |
535 | 535 | return; |
536 | 536 | } |
537 | - //try { | |
537 | + // try { | |
538 | 538 | if ($i("i3GEOselecaotemasLigados").value === "") { |
539 | 539 | i3GEO.janela.tempoMsg("Escolha um tema"); |
540 | 540 | return; |
... | ... | @@ -584,10 +584,10 @@ i3GEOF.selecao = |
584 | 584 | i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); |
585 | 585 | i3GEOF.selecao.figura[api].inicia(); |
586 | 586 | } |
587 | - //} catch (e) { | |
588 | - //i3GEO.janela.tempoMsg("Erro: " + e); | |
589 | - //i3GEOF.selecao.aguarde.visibility = "hidden"; | |
590 | - //} | |
587 | + // } catch (e) { | |
588 | + // i3GEO.janela.tempoMsg("Erro: " + e); | |
589 | + // i3GEOF.selecao.aguarde.visibility = "hidden"; | |
590 | + // } | |
591 | 591 | }, |
592 | 592 | /* |
593 | 593 | * Function: removeFiguras Remove as figuras marcadas como origem igual a i3GEOFselecao |
... | ... | @@ -631,6 +631,45 @@ i3GEOF.selecao = |
631 | 631 | * Controla o desenho do box para a seleção e executa a operação de seleção |
632 | 632 | */ |
633 | 633 | box : { |
634 | + ol3 : { | |
635 | + draw : "", | |
636 | + inicia : function() { | |
637 | + i3GEO.eventos.cliquePerm.desativa(); | |
638 | + i3GEOF.selecao.box.ol3.removeControle(); | |
639 | + i3GEOF.selecao.box.ol3.draw = new ol.interaction.DragBox({ | |
640 | + //condition: ol.events.condition.shiftKeyOnly, | |
641 | + style: new ol.style.Style({ | |
642 | + stroke: new ol.style.Stroke({ | |
643 | + color: [0, 0, 255, 1] | |
644 | + }) | |
645 | + }) | |
646 | + }); | |
647 | + i3GEOF.selecao.box.ol3.draw.on("boxend",function(evt){ | |
648 | + var feature, geo, pol = i3GEOF.selecao.box.ol3.draw.getGeometry(); | |
649 | + if ($i("i3GEOFselecaoMantemFigura").checked === true) { | |
650 | + feature = new ol.Feature({ | |
651 | + geometry: pol, | |
652 | + origem: 'i3GEOFselecao' | |
653 | + }); | |
654 | + //i3GEOF.selecao.box.ol3.draw.feature.setProperties({origem : "i3GEOFselecao"}); | |
655 | + i3GEO.desenho.layergrafico.addFeature(feature); | |
656 | + } | |
657 | + i3GEOF.selecao.box.ol3.removeControle(); | |
658 | + i3GEO.eventos.cliquePerm.ativa(); | |
659 | + pol = i3GEO.util.projOSM2Geo(pol); | |
660 | + geo = pol.getExtent(); | |
661 | + i3GEOF.selecao.box.termina( | |
662 | + i3GEO.temaAtivo, | |
663 | + $i("i3GEOselecaotipoOperacao").value, | |
664 | + geo.join(" ")); | |
665 | + }); | |
666 | + i3geoOL.addInteraction(i3GEOF.selecao.box.ol3.draw); | |
667 | + }, | |
668 | + removeControle : function() { | |
669 | + i3geoOL.removeInteraction(i3GEOF.selecao.box.ol3.draw); | |
670 | + i3GEOF.selecao.box.ol3.draw = ""; | |
671 | + } | |
672 | + }, | |
634 | 673 | openlayers : { |
635 | 674 | inicia : function() { |
636 | 675 | i3GEO.eventos.cliquePerm.desativa(); |
... | ... | @@ -695,6 +734,7 @@ i3GEOF.selecao = |
695 | 734 | i3GEO.janela.abreAguarde("i3GEO.atualiza", $trad("o1")); |
696 | 735 | i3GEO.eventos.cliquePerm.ativa(); |
697 | 736 | i3GEO.php.selecaobox(retorna, tema, tipo, box); |
737 | + i3GEOF.selecao.mudaicone(); | |
698 | 738 | } |
699 | 739 | }, |
700 | 740 | /* |
... | ... | @@ -709,7 +749,7 @@ i3GEOF.selecao = |
709 | 749 | i3GEO.eventos.cliquePerm.desativa(); |
710 | 750 | i3GEOF.selecao.clique.ol3.removeControle(); |
711 | 751 | i3GEOF.selecao.clique.ol3.draw = new ol.interaction.Draw({ |
712 | - //features : i3GEO.desenho.layergrafico.getFeatures(), | |
752 | + // features : i3GEO.desenho.layergrafico.getFeatures(), | |
713 | 753 | type : "Point", |
714 | 754 | maxPoints : 1 |
715 | 755 | }); |
... | ... | @@ -737,7 +777,7 @@ i3GEOF.selecao = |
737 | 777 | i3GEOF.selecao.clique.ol3.draw = ""; |
738 | 778 | } |
739 | 779 | }, |
740 | - //versao 2 do openlayers | |
780 | + // versao 2 do openlayers | |
741 | 781 | openlayers : { |
742 | 782 | inicia : function() { |
743 | 783 | i3GEO.eventos.cliquePerm.desativa(); |
... | ... | @@ -833,6 +873,7 @@ i3GEOF.selecao = |
833 | 873 | }; |
834 | 874 | i3GEO.eventos.cliquePerm.ativa(); |
835 | 875 | i3GEO.php.selecaopt(retorna, tema, x + " " + y, tipo, tolerancia); |
876 | + i3GEOF.selecao.mudaicone(); | |
836 | 877 | } |
837 | 878 | }, |
838 | 879 | /* | ... | ... |