0

I have a FeatureCollection from which I remove single Features. I can get the removed feature by adding an event listener pm:remove like following:

layer.on('pm:remove', e => {
    // do stuff regarding the removed feature
    console.log(e.layer.feature)
});

I would like to also have access to the resulting FeatureCollection (from which the feature has been removed). how can I "console.log()" that?

Falke Design
  • 10,635
  • 3
  • 15
  • 30
udo
  • 4,832
  • 4
  • 54
  • 82

1 Answers1

1

Are you added the layer to a LayerGroup / FeatureGroup? Then you can call layergroup.toGeoJSON()

Or if you use the default and adding the layers to the map, you can call map.pm.getGeomanLayers(true).toGeoJSON(). true means that it returns a L.FeatureGroup instead of an array with the layers.

Falke Design
  • 10,635
  • 3
  • 15
  • 30