toRemove.add(mapLayers.get(i));
}
}
if (toRemove.size() > 0)
activeMap.sendCommandSync(new DeleteLayersCommand((ILayer[]) toRemove
.toArray(new ILayer[toRemove.size()])));
} catch (Exception e) {
MessageDialog.openInformation(shell, "Information",
"Problems occurred while removing the map.");