if (layer instanceof ObjectGroup) {
ObjectGroup group = (ObjectGroup) layer;
Point pos = mapView.screenToPixelCoords(event.getX(), event.getY());
MapObject obj = group.getObjectNear(pos.x, pos.y, mapView.getZoom());
if (obj != null) {
undoSupport.postEdit(new RemoveObjectEdit(group, obj));
group.removeObject(obj);
// TODO: repaint only affected area
mapView.repaint();
}
}