Despite the code being far from minimal, it is also incomplete. In BackgroundTileMap::WriteToFile you forgot the return statement and tileset_castle.png is missing.
However I took a quick look and could find the problem for your blinking:
Line 133 in main.cpp -> wheelPos = window.mapPixelToCoords(sf::Mouse::getPosition(window));
That should be removed, because you should only set the reference position once you press the middle mouse button, otherwise the program uses the destination position as the new reference position, going back and forth everytime you move, which results in your blinking.
You also have a ton of C type casts, even on things that are already the desired type (like in line 131, main.cpp). Use static_cast instead where needed. I am not here to judge the code, but that was an eye catcher.