Select to view content in your preferred language

Robert Scheitlin's Enhanced Draw Widget - Repeated Drawing?

753
2
06-16-2011 09:54 AM
by Anonymous User
Not applicable
In an older version I was able to modify Roberts enhanced widget to repeat the last activated drawing tool.  So, a user could - for example: draw many rectangles until selecting another tool or clearing the drawing.  With the edit capabilities in this version - I was thinking of a check box for and EDIT MODE and DRAW MODE for the graphics.  It would really just deactivate repeated graphic drawing and clear the tool when checked is true.  Has anyone done this modification?  Or, better yet - Do you . . . Robert?  know the lines of code I should look at to make repeated graphic drawing work?  Robert - even if you can't respond - I very much appreciate your work.  thanks

BTW - I also had an "undo last graphic" button on the older draw widget.  But, I think I will make it so users can drag a graphic in edit mode to  "garbage can" to delete it (object in edit mode and mouse over icon).
Tags (2)
0 Kudos
2 Replies
by Anonymous User
Not applicable
Well, I made a hack that seems to work.

Declared:  private var lastSelectedDrawingIcon:Image;


I replaced the line after // apply glow with this:
if (event == null && repeatChkBox.selected) {
selectedDrawingIcon = lastSelectedDrawingIcon;
}
else {
selectedDrawingIcon = Image(event.currentTarget);
}            
lastSelectedDrawingIcon = selectedDrawingIcon;


And, I put this at the bottom of the map_drawEndHandler function:
if (repeatChkBox.selected) {
activateDrawTool(null);


You need a checkBox somewhere with a function to null the drawtool.  Any better ideas are welcome.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dan,

   I looked at the code and your solution looks good.
0 Kudos