Using the draw polygon (PolygonDrawAction), the isSelfIntersecting bool is only true after vertex-add but not draw-complete. So if I draw a polygon and create a self intersecting polygon, if I just double click ie draw-complete event the isSelfIntersecting bool stays false. I need to add a vertex ie vertex-add after I draw a self intersecting polygon and then double click to draw complete and then the isSelfIntersecting bool is set to true. so my question is there a way to force a vertex-add at the draw-complete location or do I need to evaluate the vertices and find the self intersecting geometry manually by evaluating the vertices?
Solved! Go to Solution.
OK so I just check to see if the polygon isSimple on draw complete and it is not .isSelfIntersecting.
From your description, this appears to be a bug, but you shouldn't necessarily have to go through the effort of manually checking the vertices yourself. One possible workaround may be to clone the polygon, and check the property of the cloned object. Another workaround may be to call one or both of the following on the original geometry:
geometry.notifyChange("rings");
geometry.notifyChange("isSelfIntersecting");
the clone is still identified as isSelfIntersecting: false
I will keep looking into your suggestions. Thank you!
OK so I just check to see if the polygon isSimple on draw complete and it is not .isSelfIntersecting.