I am trying to tweak the prevent self-intersecting lines sample for polygons.
I want to avoid the user creating any self-intersecting polygons, making similar use of the client-side GeometryEngine package.
I have tried a variety of combinations, but struggling to massage this sample to work for polygons. Can someone help put me out of my misery?
This is one of my attempts: https://jsfiddle.net/jobvt523/
Still not catching all cases of self-intersecting polygons.