Open EMREOYUN opened 3 months ago
Note: This issue happens with hardware acceleration
I've heard of this issue before, but it's the same usage as on map.simrail.app. It shouldn't impact your game, usually on my system SMO starts lagging before the game.
I've looked into this and simply moving the map is the most performance hungry thing that happens. (CPU usage sits around 20 for me when not moving the map) I tried using different moving function like setView
instead of panTo
but that didn't help. I'm open for suggestions if you have any.
There is also some odd behavior I noticed. When the train is moving, if you move the map, the train movement animation is delayed. With the following function enabled movement animation makes the train go outside of its track and go back after the following animation is done.
That's probably because leaflet-drift-marker uses the container's coords instead of the lat-lon coordinates so if you move the map while it moves it doesn't line up anymore. The solution for that is to use the react-leaflet-drift-marker's built in keepAtCenter
prop which moves the map with the marker, the only problem with that is that it's not as smooth as when using the map.panTo
function.
When you follow a train, follow action uses too much CPU, affecting other apps, including SimRail.