Select to view content in your preferred language

EditTool not activating

935
3
Jump to solution
06-29-2012 07:25 AM
SachaTousignant
Regular Contributor
Hello,

I've been working on my problem for hours now and I'm still not able to get my edit tool to activate itself.

I have looked at the sample http://resources.arcgis.com/en/help/flex-api/samples/index.html#//01nq00000043000000 and it really helped me for my project.
I'm currently doing my own editor and I'm at the part where I want to activate the edit tool when I click on a graphic to be able to move it. I use only point.

Here's some code :

protected function layer_clickHandler(event:MouseEvent):void    {     customDraw.deactivate();          //if (!drawingComplete) //just selection     //{      if (event.target is Graphic || event.target.parent is Graphic)      {       if (selectedGraphic != null)       {        (selectedGraphic.parent as FeatureLayer).applyEdits(null, [ selectedGraphic ], null);       }       if (event.target is Graphic)       {        selectedGraphic = Graphic(event.target);       }       else if (event.target.parent is Graphic)       {        selectedGraphic = Graphic(event.target.parent);       }       editTool.activate(EditTool.MOVE, [ selectedGraphic ]);       map.addEventListener(MapMouseEvent.MAP_CLICK, map_mapClickHandler);                  }


I know that normally, when the edit tool activates itself, the cursor changes from the pan (white glove) to a the one by default (white arrow) and when you mouseOver the selected graphic, the cursor changes to a cross, but it's not my case, nothing happens, the pan stays and I can't move the graphic.

My edit tool :

  <esri:EditTool id="editTool"         graphicsMoveStop="editTool_graphicsMoveHandler(event)"          map="{map}"/>


Let me know if you guys need more code or info!

Thx alot!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SachaTousignant
Regular Contributor
Sacha,

Could you provide the code, would be easier to debug.


I found out what was wrong, I think it might be a bug...



Works :
customEdit.map = map;

Does not :
<esri:EditTool id="customEdit"
map="{map}"/>

View solution in original post

0 Kudos
3 Replies
SachaTousignant
Regular Contributor
Quick update, the drawtool isn't activating either. I tried to make a new flex application with this sample : http://help.arcgis.com/en/webapi/flex/samples/index.html#//01nq0000002z000000

Everything worked fine, I grabbed it and put it in my widget and when I press the buttons, the drawtool isn't activating even tho, the code pass by.

Can someone from Esri help me with this?
0 Kudos
SarthakDatt
Frequent Contributor
Sacha,

Could you provide the code, would be easier to debug.
0 Kudos
SachaTousignant
Regular Contributor
Sacha,

Could you provide the code, would be easier to debug.


I found out what was wrong, I think it might be a bug...



Works :
customEdit.map = map;

Does not :
<esri:EditTool id="customEdit"
map="{map}"/>
0 Kudos