ThinkGeo.com    |     Documentation    |     Premium Support

Multiple loading of data : OnInitializedAsync

Hi,

I’m facing slow loading of my map data. After debugging I found that my code is entering OnInitialized method 3 times which restart the loading of my data 3 times.
Can you please help me with that?
Thanks

 protected override System.Threading.Tasks.Task OnInitializedAsync()
 {
     osmLayers = new GeoCollection<LayerBase>();
     editingLayers = new GeoCollection<LayerBase>();
     highlightedFeaturesLayers = new GeoCollection<LayerBase>();

     LoadLayers();

     return base.OnInitializedAsync();
 }

Hi,

I couldn’t recreate the issue, OnInitializedAsync is only hit once on my side. Can you comment out the code in OnInitializedAsync and see if it helps?

protected override Task OnInitializedAsync()
{
    return base.OnInitializedAsync();
}

If it still has the issue, just keep simplifying the code in your project until it works to debug it.

Thanks,
Ben