Thanks for looking into the issue.
A couple of updates from my side
I have managed to enable WebSockets, which unfortunately hasn't made a noticeable difference.
I have also tried to increase performance by loading all the JSON map data on startup of the application and also setting the data in parallel inside OnInitializedAsync.
Locally hosted on my machine: no difference (the performance was already great)
Locally hosted on a slow machine: 50% increase (loading from 7 seconds to 3.5)
Hosted in IIS on AWS server: no difference to before enabling WebSockets and changing the data loading
EDIT:
I have done some further testing, where I realised the spinner to indicate the data loading was not displaying. Sometimes you could see it for a split second, then the delay was after that. It means that the data is loading into the component quickly, but rendering that data to the layers I think is what is taking time. (However, the reason for this taking much longer on deployment is a mystery)
The JSON map data file sizes are:
Layer 1: 373 KB
Layer 2: 475 KB
Layer 3: 875 KB
I removed map layer 2 and 3 from the map component, and there was no loading time, it was almost instant.
I removed layer 3 and saw a short delay of about 0.5 seconds
I added all layers back, and I saw a delay of approximately 2 seconds (which I still think is fast)
Unfortunately all 3 layers is about 5 seconds delay in deployment, and because it's not the data that's null, I think it must be the map layer rendering the data that's taking the time, I don't think I can display a spinner to indicate that it is loading?
I'm not sure why the time to load the layers with this data would take so much longer when deployed, rather than on my local system.
Is there a recommended way to handle or load in multiple layers?
Thanks again,
Lee