Hi
Tyrone,
When
we analyzed the provided code snippet, we noticed that the selection support
was not enabled in the Maps. The “OnItemSelect” event will be triggered
only when the selection support is enabled, and the layer shape is selected in
this instance. So, the event is not working properly. However, after enabling
the selection support, the event is working as expected. Please find the code
snippet for the same below.
Code
Snippet:
|
<SfMaps>
<MapsEvents OnClick="@OnClickEvent" OnItemSelect="@OnItemSelectEvent"></MapsEvents>
//..
//..
<MapsLayers>
<MapsLayer ShapeData='@data'
ShapePropertyPath='new string[] {"Name"}'
DataSource="MapDataDetails"
ShapeDataPath="Name" TValue="MapData">
//..
<MapsLayerSelectionSettings
Enable="true" Fill="green">
<MapsLayerSelectionBorder Color="White"
Width="2"></MapsLayerSelectionBorder>
</MapsLayerSelectionSettings>
</MapsLayer>
</MapsLayers>
</SfMaps>
@code
{
public void OnItemSelectEvent(Syncfusion.Blazor.Maps.SelectionEventArgs args)
{
var DataArgs = args;
}
}
|
Please
find the modified sample that demonstrates the same at the below link.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Maps1357222559
Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/maps-event-1283302932
Please
let us know if you need any further assistance.