 
   drawFeatureId: (feature, id) =>
     if @drawnFeatures[id]
-      @constructor.drawnItems.removeLayer @drawnFeatures[id]
+      @drawnItems.removeLayer @drawnFeatures[id]
       @drawnLayerChanged()
     if feature
       feature = L.geoJson(feature).getLayers()[0]


    @map.on 'draw:edited draw:editvertex draw:drawvertex draw:editmove draw:deleted', (e) =>
      return unless @_editing
      @drawFeature(layer) for layer in drawnItems.getLayers()

    if feature
      @drawFeature(layer) for layer in L.geoJson(feature).getLayers()

    @drawFeatureId(circle, "circle")

  drawFeature: (layer) =>
    @drawnItems.addLayer layer
    if @deletePopup
      domelem = document.createElement('a')
      domelem.innerHTML = "#{CONSTANTS.i18n.delete}?</a>"
      domelem.onclick = =>
        @drawnItems.removeLayer layer
        @drawnLayerChanged()
      @drawnItems.bindPopup(domelem)
    @drawnLayerChanged()

  drawnLayerChanged: =>
    @geoInput.changeVal JSON.stringify(@drawnItems.toGeoJSON())
    $("a[title='Save changes.']")[0].click() if @_editing
    $('.leaflet-draw-edit-edit')[0].click()

  addDraw: (feature) =>
    @drawnItems = new L.FeatureGroup()
    $('.icon-save').toggle()

    @map.addLayer @drawnItems
    drawControl = new L.Control.Draw {
      position: 'topright'
      edit: {
        featureGroup: @drawnItems
        edit: { selectedPathOptions: { fillColor: '#00008B', maintainColor: true } }
      }
      draw: {
