geoman - 在 removeMode

问题描述

我有一个 FeatureCollection,从中删除了单个功能。我可以通过添加事件侦听器pm:remove获取删除功能,如下所示:

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

我还想访问生成的 FeatureCollection(该功能已从中删除)。我怎么能“console.log()”?

解决方法

您是否将图层添加到图层组 / 要素组?然后你可以调用 @Scheduled(cron = "0 0 16 * * *") public void sendMsg() { }

或者,如果您使用默认值并将图层添加到地图,则可以调用 layergroup.toGeoJSON()map.pm.getGeomanLayers(true).toGeoJSON() 表示它返回一个 true 而不是带有层的数组。