Edit.MOVE. How to trigger Edit.MOVE action without clicking on graphic???

920
2
04-27-2012 11:04 AM
D_R_
by
New Contributor II
Hi, suppose I have a point on the map and I want it to be moving along with mouse pointer when mouse pointer hovers it!! Is it possible? And it should stop moving when we click on it. I guess I should call some toolbar's method or manually trigger some graphic's event. Any suggestions, please?!
0 Kudos
2 Replies
MarkLewin2
New Contributor
Hi,

I think this would work:


  1. Create a Graphic object for the point and display it on the Graphics layer

  2. Capture the GraphicsLayer's onMouseOver event to access the point

  3. Call the Edit Toolbar's activate() method, passing in the Graphic you created above:


var myEditor = esri.toolbars.Edit(map);
myEditor.activate(Edit.MOVE, graphic);


Then capture the GraphicsLayer's onClick event, call myEditor.deactivate() and persist the change.

HTH,

Mark Lewin
0 Kudos
D_R_
by
New Contributor II
Thanks for reply, but it doesn't work, because activate() method just makes graphic movable, but it doesn't trigger moving action. You have to click on the graphic in order to move it. And I want it to make movable on graphic hover!
0 Kudos