arnaudleclerc / AzureMapsControl.Components

Razor Components for azure-maps-control
MIT License
34 stars 12 forks source link

Can AzureMapsControl.Components use RenderMode InteractiveWebAssembly #103

Open blackboxlogic opened 3 days ago

blackboxlogic commented 3 days ago

Forgive me, I'm new. All the samples have @rendermode InteractiveServer, which I understand renders the DOM on the server then sends it to the browser. I'm trying to make a client-side web app with lower user-interaction-latency using @rendermode InteractiveWebAssembly but I'm getting errors which makes me wonder:

The error I get while loading the webpage: InvalidOperationException: Cannot provide a value for property 'JSRuntime' on type 'AzureMapsControl.Components.Map.AzureMap'. There is no registered service of type 'AzureMapsControl.Components.Runtime.IMapJsRuntime'. I've got @inject IJSRuntime JSRuntime on the page and app.MapRazorComponents<App>().AddInteractiveWebAssemblyRenderMode() in program.cs.

blackboxlogic commented 2 days ago

I found an answer to my primary question: here's an example of someone doing client-side rendering of the map component. Secondary question stands: is there some reason not to (other than longer initial load time)?