Select to view content in your preferred language

Right-click messes with draw

855
2
08-23-2012 12:11 PM
danbonab
Emerging Contributor
When you activate a draw tool and start drawing on the map, if you suddenly right-click, the drawn graphic will remain on the map and it's like it is not even part of the map and there is no way to remove it. If you look at map.graphics after you do the right click, it's empty!
You may say well nobody is gonna right-click in the middle of a draw, but I have seen it happen many times especially on touch-screen devices where people touch the screen with their other finger in the middle of their drawing.
0 Kudos
2 Replies
JohnGravois
Deactivated User
thanks for taking the time to share your input.  what do you think would be more appropriate behavior in the case that a user right clicks in the middle of drawing?

in the case that a user accidently right clicks while drawing, it seems fairly intuitive to me that clicking "esc" or clicking again outside the context menu allows you to continue drawing verticies.

if you suddenly right-click, the drawn graphic will remain on the map and it's like it is not even part of the map and there is no way to remove it.

clicking "esc" is also helpful to clear a graphic in the middle of drawing (whether you have right-clicked or not)

http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/toolbar/toolbar_draw.html
0 Kudos
danbonab
Emerging Contributor
Well the best behavior in my opinion would be to raise an event at the time like DrawInterrupted and the payload would include the event (right-click in this case) and the drawn graphic (so the user of API could decide if they want to remove it or do something else with it).
On top of that drawn graphics should not be orphaned in the middle of nowhere. It still should be part of the map.graphics or any GraphicsLayer it belongs to.
0 Kudos