Level level;
level.LoadFromFile("Maps/spawn.tmx");
sf::FloatRect rect2(0, 0, 2048, 1536);
level.SetDrawingBounds(rect2); // THIS
Create an instance of Level.
Level level;
To load a map file,
level.LoadFromFile("example.tmx");
You MUST set drawing bounds before attempting to display the level.
level.SetDrawingBounds(somesfview.GetRect());
I recommend using an sf::View to "scroll" the map, rather than moving the map itself. This way you don't have to worry about objects (NPCs etc) on your map moving (or not) correctly.
You will find you need to implement some system to only move the view by whole numbers, otherwise you will see gaps between tiles.
Then to draw you simply pass your renderwindow to the Draw function.
level.Draw(window);
the GetRect() function in sf::view has been changed to getviewport(). this will return a floatrect same as GetRect().Wrooooooooooooooooong.