Populate IMarkerClickEventArgs Data Property on Event OnMarkerClick

Hey there,

I'm trying to populate the "Data" property of an IMarkerClickEventArgs instance after clicking a marker.
Unfortunately "Data" is always null.

Thanks in advance

@using Syncfusion.EJ2.Blazor.Maps
<EjsMaps>
    <MapsEvents OnMarkerClick="@HandleMarkerClick" />
    <MapsLayers>
        <MapsLayer ShapeData='new {dataOptions= "https://cdn.syncfusion.com/maps/map-data/world-map.json"}'>
            <MapsMarkerSettings>
                <MapsMarker Visible='true' DataSource='@MarkerDataSource' Height='40' Width='40' />
            </MapsMarkerSettings>
        </MapsLayer>
    </MapsLayers>
</EjsMaps>
@code
{
    public class MapMarkerDataSource
    {
        public double latitude;
        public double longitude;
        public string name;
        public object data;
    };

    public List<MapMarkerDataSource> MarkerDataSource = new List<MapMarkerDataSource>
    {
        new MapMarkerDataSource
        {
            latitude= 49.95121990866204,
            longitude= 18.468749999999998,
            name= "Europe",
            data ="test"
        }
    };

    void HandleMarkerClick(IMarkerClickEventArgs args)
    {
        // Cancel: false
        // Data: null
        // Latitude: 49.95121990866204
        // Longitude: 18.468749999999998
        // Marker: null
        // Name: "markerClick"
        // Target: "..."
        // Value: "Europe"
        // X: ...
        // Y: ...
    }
}

1 Reply

SM Srihari Muthukaruppan Syncfusion Team March 10, 2020 07:19 AM UTC

Hi Jan, 

We have analyzed your query. From that we would like to let you know that we have passed the values in Data directly to the IMarkerClickEventArgs. Hence we suggest you to use the latitude and longitude values in the arguments to update the marker data. We will remove the Data property from the args in our volume 1 main release which is expected to be rolled at the end of march. 

Let us know if you have any concerns. 

Regards, 
Srihari M  


Loader.
Up arrow icon