 
       widget = this
 
-      this.map.on "draw:created", (e) ->
-        widget.edition.addLayer e.layer
+      this.map.on "draw:created", (e) =>
+        #Attempt to add a geojson feature
+        try
+          feature = e.layer.toGeoJSON()
+          feature.properties['internal_id'] = new Date().getTime()
+          widget.edition.addData feature
+        catch
+          widget.edition.addLayer e.layer
+
         widget._saveUpdates()
         widget.element.trigger "mapchange"
 

    findLayer: (feature_id) ->
      containerLayer = undefined
      this.edition.eachLayer (layer) =>
        if (layer.feature.properties.internal_id == feature_id)
          containerLayer = layer
          return
      return containerLayer



    removeLayer: (layer) ->
      this.edition.removeLayer layer


    popupize: (feature, layer) ->
