title: permanently deleting markers from an array
body: <p>I need to delete my markers with a right click because I have two buttons to show the markers and hide them but when I right click each marker its meant to delete it but it doesn't can anyone view my code and see what I missed because I can't see it and I have been looking for about 2 hours now:</p>
  
  <pre><code>function rightclickableMarker(marker, h) {
      google.maps.event.addListener(marker, 'rightclick', function(evt) {
          if(lastCoordinates[h] &amp;&amp; lastCoordinates[h].setMap){
           lastCoordinates[h].setMap(null);
            delete (lastCoordinates);
            var idx = path.indexOf(lastCoordinates[h].getPosition())
            if (idx &gt; -1) {
               path.splice(idx, 1);
              // removeLine();
               drawPath();
            }
  
          } 
      });
  }
  </code></pre>