Random map crash

I have a screen with an SfMap with some markers on it. 99% of the time when this screen loads it works perfectly. Sometimes randomly though the map crashes with the console log errors below

Image_9881_1722353506295

Since the error occurs within the map control I can't even trap it. Could you provide some direction on why this might be occurring but only randomly using the same browser and same data?


4 Replies

IR Indumathi Ravi Syncfusion Team July 31, 2024 01:17 PM UTC

Hi Brad,


Based on the provided information, we attempted to replicate the scenario by adding markers to the Maps component, refreshing and resizing the browser multiple times. However, we were unable to reproduce the reported issue. You can find the sample where we attempted to replicate the issue at the link below.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/MapsSample-565487063

Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/maps_marker-474488994


Since the reported issue is inconsistently reproduced on your end, could you please provide the following details?

  • How many markers are used in your application?
  • Do you use any database to retrieve the marker data source for the Maps component?
  • Have you utilized any additional data sources, such as layer data sources or bubble data sources?
  • What Maps features are enabled in your application?
  • From the stack trace, it appears you are using a Blazor Server-side application. Could you please confirm this?
  • What web browser are you using to run the application?
  • Can you provide a video demonstrating the steps to replicate the issue?
  • If possible, could you please share a code snippet that replicates the exact scenario?


These details will be helpful for us to understand the exact issue and assist you further.



BK Brad Knowles August 1, 2024 03:49 PM UTC

The amount of markers is minimal, usually less than 10.

The marker data source is a MySQL table and the data is retrieved via an api

There are no other data sources

The map allows zooming and panning

It is a server side application as you surmised

This happens in Edge and Chrome. I haven't tried other browsers but I don't think it is browser related.

I am trying to replicate it in a smaller app but haven't had luck yet.


I have a theory that what might be happening is certain events in my code might be interrupting the map as it is trying to load the markers. Is there a reasonable way to allow the map to load the markers completely before processing any interrupts? ie is there something I can check that will tell me the map is completely finished doing everything it needs to do so I can wait?


Thanks




IR Indumathi Ravi Syncfusion Team August 2, 2024 05:41 PM UTC

Hi Brad,


We are currently working on replicating the reported scenario with the Maps component and database. However, we will analyze and update you with further details on August 5, 2024.



IR Indumathi Ravi Syncfusion Team August 5, 2024 01:29 PM UTC

Hi Brad,


When we attempted to reproduce the reported issue by creating the data source using the SQL database, we were unable to replicate the issue. We suspect that the inconsistency may be due to the unavailability of data from the database in certain instances. If this is the case, you can resolve the issue by adding a null reference check before rendering the Maps component. Please find the code snippet for the same below.


Code Snippet:

@if (MarkerDataSource != null && MarkerDataSource.Count > 0)

{

    <SfMaps>

        <MapsLayers>

            <MapsLayer ShapeData='new {dataOptions= https://cdn.syncfusion.com/maps/map-data/world-map.json}' TValue="string">

                <MapsMarkerSettings>

                    <MapsMarker Visible="true" DataSource="MarkerDataSource" Height="25" Width="25" TValue="MarkerData" AnimationDuration="0"></MapsMarker>

                </MapsMarkerSettings>

                <MapsShapeSettings Fill="lightgray"></MapsShapeSettings>

            </MapsLayer>

        </MapsLayers>

    </SfMaps>

}

 

@code {

    private ObservableCollection<MarkerData> MarkerDataSource;

   

    protected override async Task OnInitializedAsync()

    {

        MarkerDataSource = await MarkerService.GetMarkersAsync();

    }

   

}


You can find the sample in which we tried to replicate the reported issue below.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Maps2098259519

Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/maps2060238830


NOTE: Add your database connection in the above sample and run it.


If you are still facing the reported issue, could you please replicate the scenario using the provided sample and share the modified sample with us? This will help us analyze the issue more effectively and provide better assistance. If replicating the scenario in the sample is not feasible, we can arrange a meeting to discuss the issue in more detail.


Loader.
Up arrow icon