Commit a2f277607207b3f95ad966f71ab653c3eb43931d

Authored by Edmar Moretti
1 parent d325917f

MOdificação no comportamento da ferramenta de seleção para que ao acionar o botã…

…o de seleção por figura é feita a verificação se já existe seleção
Showing 1 changed file with 19 additions and 9 deletions   Show diff stats
ferramentas/selecao/index.js
... ... @@ -689,10 +689,27 @@ i3GEOF.selecao = {
689 689 */
690 690 figura: {
691 691 openlayers: {
  692 + executa: function(feature){
  693 + i3GEOF.selecao.figura.openlayers.removeControle();
  694 + var wkt = i3GEO.util.projOSM2Geo(feature.geometry);
  695 + //var wkt = feature.geometry;
  696 + i3GEOF.selecao.figura.termina(
  697 + i3GEO.temaAtivo,
  698 + $i("i3GEOselecaotipoOperacao").value,
  699 + wkt
  700 + );
  701 + },
692 702 inicia: function(){
  703 + var ponto,f;
693 704 i3GEO.eventos.cliquePerm.desativa();
694 705 i3GEOF.selecao.figura.openlayers.removeControle();
695   - var ponto = new OpenLayers.Control.SelectFeature(
  706 + //verifica se ja tem uma figura selecionada
  707 + f = i3GEO.desenho.layergrafico.selectedFeatures;
  708 + if(f && f.length > 0){
  709 + i3GEOF.selecao.figura.openlayers.executa(f[0]);
  710 + return;
  711 + }
  712 + ponto = new OpenLayers.Control.SelectFeature(
696 713 i3GEO.desenho.layergrafico,
697 714 {
698 715 clickout: true,
... ... @@ -705,14 +722,7 @@ i3GEOF.selecao = {
705 722 id: "i3GEOFselecaoFigura",
706 723 type: OpenLayers.Control.TYPE_TOOL,
707 724 onSelect: function(feature){
708   - i3GEOF.selecao.figura.openlayers.removeControle();
709   - var wkt = i3GEO.util.projOSM2Geo(feature.geometry);
710   - //var wkt = feature.geometry;
711   - i3GEOF.selecao.figura.termina(
712   - i3GEO.temaAtivo,
713   - $i("i3GEOselecaotipoOperacao").value,
714   - wkt
715   - );
  725 + i3GEOF.selecao.figura.openlayers.executa(feature);
716 726 }
717 727 });
718 728 i3geoOL.addControl(ponto);
... ...