0

I am drawing different polygons on google map. I need when user draws polygon, if polygon overlap with any other polygon then user get warning alert, ( You can't draw overlapped polygon).

Please check Example https://developers.google.com/maps/documentation/javascript/examples/drawing-tools

I have done drawing different polygons. but I could not find prevent overlapping. Please help me, how I show alert when polygon is overlapped with other polygon

awd
  • 2,302
  • 1
  • 22
  • 29
Ition
  • 607
  • 5
  • 6

1 Answers1

0

1) You need to keep track of all existing polygon coordinates.

2) You will need a polygon overlapping algorithm, example for convex polygons.

2b) If your polygons are non-convex, you either need to find appropriate algorithm or split them into convex elements (triangles?) to be able to use 2).

3) Javascript alerts

user5226582
  • 1,946
  • 1
  • 22
  • 37