Skip to content

Commit

Permalink
Fix warning in MyLocationSample
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldendulk committed Mar 23, 2024
1 parent da10dd0 commit 5f6ce04
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Samples/Mapsui.Samples.MapView/MyLocationSample.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using Mapsui.Samples.Common.Maps.Demo;
using Mapsui.UI;
using Mapsui.UI.Maui;

namespace Mapsui.Samples.Maui;

Expand All @@ -15,15 +14,11 @@ public class MyLocationSample : IMapViewSample

public bool OnTap(object? sender, EventArgs args)
{
var mapView = sender as UI.Maui.MapView;
var e = args as MapClickedEventArgs;

if (mapView == null)
return false;

mapView.MyLocationLayer.IsMoving = mapView.MyLocationEnabled;
mapView.MyLocationEnabled = true;

if (sender is UI.Maui.MapView mapView)
{
mapView.MyLocationLayer.IsMoving = mapView.MyLocationEnabled;
mapView.MyLocationEnabled = true;
}
return false;
}

Expand Down

0 comments on commit 5f6ce04

Please sign in to comment.