fix bugs with UI for gps denied

This commit is contained in:
Alex Bezdieniezhnykh
2025-05-30 02:09:15 +03:00
parent d87ddb5f6a
commit b345137f16
10 changed files with 143 additions and 85 deletions
@@ -1,28 +0,0 @@
using Azaion.Common.Services;
using GMap.NET;
using GMap.NET.WindowsPresentation;
using MediatR;
namespace Azaion.Annotator.Controls;
public class MapMatcherEventHandler(MapMatcher mapMatcher) : INotificationHandler<GPSMatcherResultEvent>
{
public Task Handle(GPSMatcherResultEvent result, CancellationToken cancellationToken)
{
mapMatcher.Dispatcher.Invoke(() =>
{
var marker = new GMapMarker(new PointLatLng(result.Latitude, result.Longitude));
var ann = mapMatcher.Annotations[result.Index];
marker.Shape = new CircleVisual(marker, System.Windows.Media.Brushes.Blue)
{
Text = result.Image
};
mapMatcher.SatelliteMap.Markers.Add(marker);
ann.Lat = result.Latitude;
ann.Lon = result.Longitude;
mapMatcher.SatelliteMap.Position = new PointLatLng(result.Latitude, result.Longitude);
mapMatcher.SatelliteMap.ZoomAndCenterMarkers(null);
});
return Task.CompletedTask;
}
}