Mapsui
Mapsui copied to clipboard
Blazor Server Rendering
I'm trying here to enable Server rendering for Blazor. This solves the Problem that on certain Platforms only Server Rendering is possible. The idea is that when the control is rendered on the server I add an Image that is filled on the server and only updated when the image content is changed. I render it with webp because this as less data than png, I'll investigate if png is faster later.
When this works I'll test it how it works in the Hybrid mode.
- [ ] Renders the same as the Blazor Control (Widgets ...)
- [ ] Mouse Interaction works
Hmm, so actually rendering the image on the server and sending it over blazors signalr to the client? I worked on a project where we used leaflet.js like that (by accident) and it was super slow. But then if you optimize for this scenario it may be an good enough solution where there is no other option.
What I am personally interested in is to use it in the InteractiveWebAssembly render mode https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-9.0. But perhaps that is already possible with our current component.
It is still a work in Progress. I have to provide the imageinfo in the snapshot function or adjust the Viewport area. I know that it is Slow it is mainly for static Maps or an initial render in the hybrid Mode. Or for Maps that don't work because of CORS wms Services that are using http:// called from an https:// Website
I have not looked into the changes in this PR but I created an issue to describe how I think Blazor server rendering should work, the SkiaSharp rendering should still be on the clients, and server side rendering should be a way to compose the Map and Viewport state.