Select to view content in your preferred language

Disable move of the Polygon

587
2
07-17-2012 07:01 AM
PriyaRam
Deactivated User
I have attached a MouuseEvent.click to each of my FeatueLayer and I want to disable the move of the polygon

(oplList.layer as FeatureLayer).addEventListener(MouseEvent.CLICK,polygonSelectHandler);

In the polygonSelectHandler , activate method I just pass the Edit Vertcies alone , but I'm unable to disable the move. I also tried changing in the editor.editTool.activate method.Please direct , how can we handle this situation.

private function polygonSelectHandler(event:MouseEvent):void
   {
    try
    {
    
     if (event.target is Graphic)
     {
     
      editGraphic = Graphic(event.target);
      lastActiveEditType = "none";      }
     if (editGraphic.geometry is Polyline || editGraphic.geometry is Polygon)
     {
      if (lastActiveEditType == "none")
      {
       isEditing = true;
       lastActiveEditType = "moveEditVertices";
      
       myeditTool.activate(EditTool.EDIT_VERTICES, [ editGraphic ]);
      }
      else if (lastActiveEditType == "moveEditVertices")
      {
       isEditing = false;
       editGraphic = null;
       lastActiveEditType = "none";
       myeditTool.deactivate();
      }
     }
                                                                 else
     {
      if (lastActiveEditType == "none")
      {
       isEditing = true;
       lastActiveEditType = "moveEditVertices";
       myeditTool.activate(EditTool.EDIT_VERTICES, [ editGraphic ]);
      }
      else
      {
       isEditing = false;
       editGraphic = null;
       lastActiveEditType = "none";
       myeditTool.deactivate();
      }
     }
    
    
    }
Tags (2)
0 Kudos
2 Replies
PriyaRam
Deactivated User
Is it possible to disable move of the polygons in the EditWidget.mxml and what would be the right event to trap. should I atatch map click event to the Feature layer or the map or the Graphic.I would appreciate, if someone could give some leads in the right direction.
0 Kudos
PriyaRam
Deactivated User
When using the FlexAPI and using the edit tool as a standalone(see attached txt file, rename to mxml), the editTool.activate passing only the edit_vertices disables the move, but not with the editor that comes with the editWidget. Also I get a warning message unable to bind Graphics to GraphicsLayer when selecting the polygon, not sure if this a bug that is preventing this behaviour from happening. is there a work around to disable the move of the polygons
0 Kudos