The individual sections of a switch statement are actually all one block. They're not isolated from each other. As the compiler tells you flat-out, if you were to jump to Desert, you would jump over the initialization of the map in the Forest section. That's a problem.
Not only that, but none of those would be visible outside of the switch statement. You'll probably want to declare map outside of your switch statement.
I see @Albatross, thank you. Do you mind dropping an example of how would one define the ifstream outside the switch block, and later give the ability to the switchblock to change the map?
As Albatross said, you need to declare the ifstream before the switch and use the .open() method to open the files. Also, you can't make the ifstream const or it won't be usable since it needs to be able to modify itself (file position pointers, buffers, etc) to operate.
1 2 3 4 5 6
std::ifstream map;
switch (level) {
case Forest: map.open("assets/forest.map"); break;
case Desert: map.open("assets/desert.map"); break;
default: /* presumably an error */ break;
}