title: Remove last point from Draw Interaction in Ol3
body: <p>I am trying to remove the last point in a polygon draw feature on esc key. </p>
  
  <p>The following code do not work. It seems to remove it when it draw the area part, but the vertex is stil there.</p>
  
  <pre><code>var geom :ol.geom.Polygon = null;
  draw.on("drawstart",(event) =&gt; {
      console.log(event);
      var feature :ol.Feature= event.feature;
      console.log(feature);
      geom = feature.getGeometry&lt;ol.geom.Polygon&gt;();
  });
  
  $(document).keyup((e)=&gt; {
      if (e.keyCode === 27) {
          var coords = geom.getCoordinates()[0];
          if(coords.length&gt;1)
              geom.setCoordinates([coords.slice(0, coords.length - 2)]);
      }
  });
  </code></pre>