OnItemSelect event has no ShapeData

While building a Blazor component using SfMaps to display a 'Normal' geometry layer, I made a start by using Syncfusion's "Bus seat booking" sample data, but when ItemSelect events are triggered ShapeData is null. Is this a bug, or am I missing something?

@using Syncfusion.Blazor.Maps
 
<SfMaps @ref="MapInstance" ProjectionType="ProjectionType.Equirectangular">
    <MapsEvents OnMarkerClick="OnMarkerClick" OnItemSelect="OnItemSelect" />
    <MapsLayers>
        <MapsLayer LayerType="ShapeLayerType.Geometry" GeometryType="GeometryType.Normal" ShapeData="@ShapeDataSource">
            <MapsShapeSettings Fill="gray" ColorValuePath="fill">
                <MapsShapeBorder Color="#FFFFFF" Width="1"></MapsShapeBorder>
            </MapsShapeSettings>
            <MapsLayerSelectionSettings Enable="true" Opacity="1"></MapsLayerSelectionSettings>
        </MapsLayer>
    </MapsLayers>
    <MapsZoomSettings Enable="true" />
</SfMaps>
 
@code{
    protected SfMaps MapInstance { get; set; }
 
    protected MapDataSettings ShapeDataSource => new MapDataSettings
    {
        dataOptions = "assets/seat.json"
    };
    protected void OnItemSelect(ISelectionEventArgs args)
    {
        var dump = args.ShapeData?.ToString() ?? string.Empty; // should output something like -> {"seatno":12,"fill":"gray"}
        Console.WriteLine("OnItemSelect: {0}", dump);
    }
 
    protected class MapDataSettings
    {
        public string dataOptions { get; set; }
 
        public bool async => true;
 
        public string type => "GET";
    };
}

3 Replies 1 reply marked as answer

SA Sabari Anand Senthamarai Kannan Syncfusion Team November 26, 2020 04:56 PM UTC

Hi Miguel,

Thank you for contacting Syncfusion support.

We are able to reproduce the reported issue. We are currently checking the reported issue. We will update you with further details on November 30, 2020.

Regards,
Sabari Anand
 



SB Swetha Babu Syncfusion Team December 1, 2020 01:43 PM UTC

Hi Miguel,

Thank you for your patience.

We have confirmed that the reported issue as a defect and logged a defect report for the same. We will include the fix for the reported issue in our Volume 4 Main Release which is expected to be available by the end of December 2020. Please find the below feedback link to keep track of the reported issue.

https://www.syncfusion.com/feedback/20221

Please let us know if you need any further assistance.

Regards,
Swetha Babu


SB Swetha Babu Syncfusion Team December 17, 2020 04:13 PM UTC

Hi Miguel, 
  
Thank you for your patience. 
  
We have included the fix for the reported issue of "shape Data argument not available in the itemSelect event" in our Essential Studio 2020 Volume 4 Main Release which is rolled out and is available for download under the following link. 
  
  
Please find the code snippet for the getting ShapeData below in the event. 
<SfMaps> 
    <MapsEvents OnItemSelect="OnItemSelect"/> 
    <MapsLayers> 
        <MapsLayer TValue="MapDataSettings" ShapeData='new {dataOptions= "https://cdn.syncfusion.com/maps/map-data/world-map.json"}'> 
            <MapsShapeSettings Fill="gray" ColorValuePath="fill"> 
                <MapsShapeBorder Color="#FFFFFF" Width="1"></MapsShapeBorder> 
            </MapsShapeSettings> 
            <MapsLayerSelectionSettings Enable="true" Opacity="1"></MapsLayerSelectionSettings> 
        </MapsLayer> 
    </MapsLayers> 
</SfMaps> 
  
We have created the sample application to demonstrate the same and it can be downloaded from the below link. 
  
  
In the above sample, we have rendered a world map. When we select the shape in the map, the OnItemSelect event gets triggered. 
  
We thank you for your support and appreciate your patience in waiting for our release. Please get in touch with us if you would require any further assistance. 
  
Regards, 
Swetha Babu 


Marked as answer
Loader.
Up arrow icon