           widget.element.trigger 'mapeditor:feature_delete', layer.feature
 
         widget.update()
+
+      this.map.on "draw:drawvertex", (e) =>
+        console.log 'draw', e.layers.getLayers()
+        poly = @geod.Polygon(false)
+        e.layers.eachLayer (layer) =>
+          latlng = layer.getLatLng()
+          poly.AddPoint latlng['lat'], latlng['lng']
+
+        poly = poly.Compute(false, true)
+        console.log 'Perimeter/area of polygon are ' + poly.perimeter.toFixed(3) + ' m / ' + poly.area.toFixed(1) + ' m^2.'
+
+      this.map.on "draw:editvertex", (e) ->
+        console.log 'edit', e.layers
 
       this._resize()
       # console.log "resized"

#    $(this._getInnerContentContainer()).find('.modal-body > :first-child').replaceWith($content)
    $(this._getInnerContentContainer()).find('.modal-body').append($(content))
    this.update()


  $.widget "ui.mapeditor",

        this.controls.fullscreen = new L.Control.FullScreen(this.options.controls.fullscreen)
        this.map.addControl this.controls.fullscreen
      if this.edition?
        console.log this.options.controls.draw
        this.controls.draw = new L.Control.Draw($.extend(true, {}, this.options.controls.draw, {edit: {featureGroup: this.edition}}))
        this.map.addControl this.controls.draw
      unless this.options.controls.scale is false
