BlazorMaps is a Blazor library that provides a C# interface for maps provided by Leaflet.js library. It includes several Leaflet.js features which are easily accessible from C# level within a project and it does not require any use of JavaScript.
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender)
return;
this.MapReference = await this.MapJsInterop.Initialize(this.MapOptions);
this.MapEvented = new MapEvented(this.MapReference, this.EventedJsInterop);
}
So, property MapEvented declared in OnAfterRenderAsync, but in parent component I don't know when it happened.
Parent's OnAfterRenderAsync not promise that children had rendered. https://github.com/dotnet/aspnetcore/issues/13781
When I subscribe on click event I get exception NRE, because method OnClick uses property MapEvented, that is null on time when my page rendered.
I think, that Map component must rise event "load" to know when it rendered.
In my page I can't subscribe Map events, because
So, property MapEvented declared in OnAfterRenderAsync, but in parent component I don't know when it happened. Parent's OnAfterRenderAsync not promise that children had rendered. https://github.com/dotnet/aspnetcore/issues/13781
When I subscribe on click event I get exception NRE, because method OnClick uses property MapEvented, that is null on time when my page rendered.
I think, that Map component must rise event "load" to know when it rendered.