Hello,
I'm using the map component and the focus of my question is the OnMarkerClick event.
Currently, this event is triggered regardless if the input is a "mouse click" or a "touch tap".
My intention is for the map to have different behavior depending on whether the marker is "clicked" or "tapped"
For example, "mouse click" on a point transports the user to another page, while "tapping" the point just shows a preview of other information. This is driven by the fact that intuitive actions on desktop are not always the same on mobile.
One way to achieve this might be to add some kind of JS based browser detection and check for a mobile browser and pair this together with the OnMarkerClick event. Another way might be to use JS to check the browser window size. However both of these potential solutions have big flaws (for example in the case of touchscreen laptops).
Ideally I think it would be best if the map provided the events for "marker touch start", "marker touch end", "marker mouse down", and "marker mouse up".
I would appreciate any ideas if this is possible.
Thank you!
Thank you so much Swetha!
|
<SfMaps>
<MapsEvents OnMarkerMouseMove="MarkerMove" OnMarkerClick="MarkerClick" OnMarkerMouseLeave="MarkerLeave" ></MapsEvents>
//..
//..
</SfMaps>
@code{
public void MarkerLeave(Syncfusion.Blazor.Maps.MarkerMouseLeaveEventArgs args)
{
Console.WriteLine(args.IsTouch);
}
public void MarkerMove(Syncfusion.Blazor.Maps.MarkerMoveEventArgs args)
{
Console.WriteLine(args.IsTouch);
}
public void MarkerClick(Syncfusion.Blazor.Maps.MarkerClickEventArgs args)
{
Console.WriteLine(args.IsTouch);
}
} |