Behavior in MapsMarkerSettings weird with @if

Dear Syncfusion Team,

please check the attached sample.
The problem is in detail written in the project, essentially the following snippet is working only, if the Destinations had been set to null before and after Destinations.Count == 1.

 @if (Destinations != null)
                {
                    <MapsMarkerSettings>
                        @if (Destinations.Count == 1)
                        {
                            <MapsMarker Visible="true" DataSource="@Destinations" Height="14" Width="14"
                            TValue="Destination" Shape="@Syncfusion.Blazor.Maps.MarkerType.Circle" Fill="Green" AnimationDuration="0">
                                <MapsMarkerBorder Width="2" Color="#333"></MapsMarkerBorder>
                                <MapsMarkerTooltipSettings Visible="true" ValuePath="@nameof(Destination.Name)"></MapsMarkerTooltipSettings>
                            </MapsMarker>
                        }
                        else
                        {
                            <MapsMarker Visible="true" DataSource="@Destinations" Height="8" Width="8"
                            TValue="Destination" Shape="@Syncfusion.Blazor.Maps.MarkerType.Circle" Fill="Grey" AnimationDuration="0">
                                <MapsMarkerBorder Width="2" Color="#333"></MapsMarkerBorder>
                                <MapsMarkerTooltipSettings Visible="true" ValuePath="@nameof(Destination.Name)"></MapsMarkerTooltipSettings>
                            </MapsMarker>
                        }
                    </MapsMarkerSettings>
                }

Please advise how to make the behavior as expected.

Best regards

Michael


Attachment: Syncfusion.BubbleChart_4d349e28.zip

3 Replies

IR Indumathi Ravi Syncfusion Team January 17, 2022 04:58 PM UTC

Hi Michael, 
Thank you for the contacting Syncfusion support. 
We are able to reproduce the reported scenario with the provided sample. We are currently analyzing the reported scenario. We will update you with further details on January 19, 2021. 
Regards, 
Indumathi R 



IR Indumathi Ravi Syncfusion Team January 19, 2022 04:58 PM UTC

Hi Michael, 
We are able to reproduce the reported issue with the provided code snippet in the Maps component. We have considered this as a defect and logged a defect report for the same. However, we will include the fix for the reported issue in our weekly patch release which is expected to be available by the start of February 2022. Meanwhile, please find the below feedback link to keep track of the reported issue. 
 
Regards, 
Indumathi R. 



IR Indumathi Ravi Syncfusion Team February 1, 2022 11:51 AM UTC

Hi Michael, 
We have fixed the reported issue and it is included in our Essential Studio 2021 Volume 4 SP release v19.4.0.48 that is rolled out and is available for download under the following link. 
NOTE: 
In the provided sample, buttons that contains data source list with multiple items, single item and empty list will work fine with the provided fix. But when we click the "DataSource is null" button, markers will not be removed as the Maps component does not refresh with the System.Collections.Generic.List. The component can be refreshed automatically when ObservableCollection (which implements INotifyPropertyChanged) is used instead of List data type. However, this can be resolved in your sample project (your sample application itself) by clearing the data source list using “Clear” method and calling the “Refresh” method of the Maps component. Please find the code snippet for the same below. 
  
Code Snippet
<SfButton id="datasourcenull"        OnClick="@(()=>{Destinations.Clear(); maps.Refresh();})">              DataSource is null</SfButton> 
We have modified the provided sample to demonstrate the same and it can be download from the below link. 
Please get in touch with us if you would require any further assistance. 
Regards, 
Indumathi R. 


Loader.
Up arrow icon