Open NovaKs68 opened 3 months ago
When I added double click my intention was to keep the MapInfo event like it was. However, I added the TapType to all tap events and now this has become confusing. I guess this needs to be fixed.
An alternative is to remove MapInfo and add a GetMapInfo() method to the eventArgs of all the other events. so they can be used for MapInfo instead.
And thanks for testing beta1!
Thank you for your quick reply. In the meantime we have implemented the same code defined in the library on our side :
private bool _waitingForDoubleTap = false;
private readonly int _millisecondsToWaitForDoubleTap = 300;
private void ZoomOnDoubleClick(MapInfo mapInfo, TapType tapType)
{
if (_waitingForDoubleTap)
MapCtl.Map.Navigator.CenterOnAndZoomTo(mapInfo.WorldPosition, mapInfo.Resolution * 0.5, 500, Mapsui.Animations.Easing.CubicOut);
else
_ = StartWaitingForSecondTapAsync();
}
private async Task StartWaitingForSecondTapAsync()
{
_waitingForDoubleTap = true;
await Task.Delay(_millisecondsToWaitForDoubleTap);
_waitingForDoubleTap = false;
}
Mapsui Version 5.0.0-beta.1
Mapsui Platform MAUI
Device Windows 11, Android Emulator pixel 5 api 34
Describe the bug When I double-click on the map. The Map.Info event is triggered twice with Single click as TapType. It must return a Double TapType.
To Reproduce Steps to reproduce the behavior:
Expected behavior Tested on the demo website (Blazor) https://mapsui.com/v5/samples see bellow : It's works on widgets.
I want to have the same behavior as in the demo plateform when double clicking on the "tap me" button.
Additional context Here is my implementation :
The log is never triggered.
On the source code of the project the double click seems to be detected in the
TapIfNeeded()
function fromTapGestureTracker.cs
. But the TapType seems also be overrided just after that with a single click value at theOnMapTapped()
function fromMapControl.cs
.