I am trying to make a map where a user can outline any shape they would like. But I am running into an issue where users can select points that will make the lines of the polygon cross and exclude area's that I would like to include.
To see what i'm talking about go to this page and take the following steps:
- click 4 points to make the 4 corners of a box
- click in between each of the 4 points you just made to further define the perimter of the box
- click done
You should see something like this:
Is there an easy way to solve this problem, or am I basically dealing with a "Traveling Salesman" type situation here? All the logic is done in javascript so feel free to "view source" if you would like to see how i'm doing this.