Removed the check if a mapobj exist, because its not needed anymore. The export function is only available if a mapobj exist. Added an extra function to remove all layers.