Hi Sebastien,
Web Edition doesn’t have the default action to delete a selected feature.
Here is a JavaScript method for you to satisfy your requirement; please call “deleteSelectedFeature()” to delete the selected feature. We’ll consider to add this feature in the future version.
If you have any questions please let me know.
Thanks,
Howard
var tgMap;
var OnMapCreated = function(map) {
tgMap = map;
var keyboard = new OpenLayers.Control.KeyboardDefaults();
tgMap.addControl(keyboard);
keyboard.activate();
};
var getEditOverlay = function() {
var layers = tgMap.getLayersByName('EditOverlay');
if (layers.length > 0) {
return layers[0];
} else {
return null;
}
};
var getModifyControl = function() {
return tgMap.getControl('Modify');
};
// Delete feature which is selected.
var deleteSelectedFeature = function() {
var editOverlay = getEditOverlay();
var modifyControl = getModifyControl();
if (editOverlay != null && modifyControl != null) {
var selectedFeatures = editOverlay.selectedFeatures;
if (selectedFeatures.length > 0) {
modifyControl.unselectFeature({ feature: selectedFeatures[0] });
editOverlay.removeFeatures(selectedFeatures);
}
}
}