title: How to remove a single edge of a polygon from Google Map JavaScript
body: <pre><code>window.google.maps.event.addListener(
    this.poly, //currently selected polygon
    &quot;mouseup&quot;,
    (event) =&gt; {
      if (this.insidePolygon(event.latLng)) {
        const path = this.poly.getPaths().getAt(event.path);
          if (event?.vertex &gt;= 0) { //returns true if vertex is being dragged
            path.removeAt(event.vertex); // removes the current vertex
          } else if (event?.edge &gt;= 0) { //returns true if edge is being dragged
            path.removeAt(event.edge); // does not remove the current edge
          }
      } else {
        this.calcAreaAndLatlng();
      }
    }
  );
  </code></pre>
  <p>I have multiple polygons inside google map. I am trying to use <strong>mouseup</strong> event to drag and edit a polygon. I do not want my polygons to overlap. That's why I am using <code>insidePolygon</code> function which returns true if current polygon overlaps any other polygons. So when the function returns true, I use <code>path.removeAt(event.vertex)</code> to remove the <em><strong>vertex</strong></em> that was trying to overlap. But the problem begins when I try to drag <em><strong>edge</strong></em> instead of <em><strong>vertex</strong></em>.  Then the <code>path.removeAt(event.edge)</code> does not work even though both <code>event.vertex</code> and <code>event.edge</code> return the index of vertex and edge respectively.  Is there any way to remove the edge like I removed the vertex?</p>