My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 3964: Bug: drawignManager: double clicks triggers the overlaycomplete event no matter if there is an overlay drawn
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  [email protected]
Closed:  Sep 2012


Sign in to add a comment
 
Reported by [email protected], Feb 23, 2012
does not matter it is circle mode or any drawing mode, whenever there is a double-click, the overlaycomplete event is fired even there is no geometry drawn.
Feb 23, 2012
Project Member #1 [email protected]
A geometry should be drawn in such cases, although it's not visible: a circle with zero radius, or a polyline with just one vertex. Is that what you are seeing? If so, is there any difficulty with manually ignoring these degenerate cases?
Status: NeedsMoreInfo
Owner: [email protected]
Feb 24, 2012
#2 [email protected]
"A geometry should be drawn in such cases, although it's not visible: a circle with zero radius, or a polyline with just one vertex."
This is not completely true. The behavior for drawing a circle using the drawingManager is, 1) press the button (mouse left), 2)drag, and 3) release the button, then 4) overlaycomplete event fires. Doubl-click does not have the 'drag' inbetween, which should not be regarded as a 'draw' process, thus should not fire the overlaycomplete event. The same is with the rectangle drawing. For drawing polyline and polygon, the process is click-click...-doubleclick, withough the first at least two clicks makes no sense of drawing a polyline or polygon. 
I certainly can verify the situation and ignor the cases, but since there is no meaning for having one-point polyline, polygon, circle, or rectangle, would it be better handle the case within the drawManger?
Feb 24, 2012
Project Member #3 [email protected]
You can also draw circles and rectangles using two clicks, which is why a double click would give you a shape with no area. This being an API, I would be hesitant to say that there is absolutely no value to anyone of these degenerate shapes; wouldn't it be better to give developers the choice of what they want? Perhaps some people would also say a polygon with only two vertices is degenerate; is that always true?
Feb 28, 2012
#4 [email protected]
1.As I mentioned, double-click to draw something is not consistent with how the drawingManager draws other geometries, which indicates a bug or bad design. As a programmer myself, I would rather improve it than try to find excuse for it (I am not accusing anybody here).

2.I really don't think there is any need for doing so (create no area shape), if it is not 'absolutely no value'. Also, if you want to do something with double-click, you can listen to the double-click event, which is the way supposed to do.

3. On ther other side, in my case, it caused me a lot of trouble to isolate the situation, as I have many listeners to the overlayComplete event and each of them has to deal with the situation.
Feb 28, 2012
Project Member #5 [email protected]
Thanks for clarifying. We'll continue to allow users to explicitly draw shapes with zero area (say, by making two intentional clicks that define a circle with zero radius) but we'll make sure that double-clicking doesn't cause an empty shape to be drawn.
Status: Confirmed
Labels: Internal-6087609
Feb 29, 2012
#6 [email protected]
That sounds great and I hope the change could be done soon. 

Many thanks!
Sep 2, 2012
#7 [email protected]
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting