mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 19:26:31 +00:00
fix bugs with UI for gps denied
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Azaion.Annotator.Controls;
|
||||
using Azaion.Annotator.DTO;
|
||||
using Azaion.Common;
|
||||
using Azaion.Common.Database;
|
||||
@@ -11,6 +14,8 @@ using Azaion.Common.Extensions;
|
||||
using Azaion.Common.Services;
|
||||
using Azaion.CommonSecurity.DTO;
|
||||
using Azaion.CommonSecurity.Services;
|
||||
using GMap.NET;
|
||||
using GMap.NET.WindowsPresentation;
|
||||
using LibVLCSharp.Shared;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -38,7 +43,9 @@ public class AnnotatorEventHandler(
|
||||
INotificationHandler<AnnotatorControlEvent>,
|
||||
INotificationHandler<VolumeChangedEvent>,
|
||||
INotificationHandler<AnnotationsDeletedEvent>,
|
||||
INotificationHandler<AnnotationAddedEvent>
|
||||
INotificationHandler<AnnotationAddedEvent>,
|
||||
INotificationHandler<SetStatusTextEvent>,
|
||||
INotificationHandler<GPSMatcherResultEvent>
|
||||
{
|
||||
private const int STEP = 20;
|
||||
private const int LARGE_STEP = 5000;
|
||||
@@ -363,4 +370,35 @@ public class AnnotatorEventHandler(
|
||||
});
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(SetStatusTextEvent e, CancellationToken cancellationToken)
|
||||
{
|
||||
mainWindow.Dispatcher.Invoke(() =>
|
||||
{
|
||||
mainWindow.StatusHelp.Text = e.Text;
|
||||
if (e.Color.HasValue)
|
||||
mainWindow.StatusHelp.Foreground = new SolidColorBrush(e.Color.Value);
|
||||
});
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(GPSMatcherResultEvent e, CancellationToken cancellationToken)
|
||||
{
|
||||
mainWindow.Dispatcher.Invoke(() =>
|
||||
{
|
||||
var mapMatcher = mainWindow.MapMatcherComponent;
|
||||
var marker = new GMapMarker(new PointLatLng(e.Latitude, e.Longitude));
|
||||
var ann = mapMatcher.Annotations[e.Index];
|
||||
marker.Shape = new CircleVisual(marker, Brushes.Blue)
|
||||
{
|
||||
Text = e.Image
|
||||
};
|
||||
mapMatcher.SatelliteMap.Markers.Add(marker);
|
||||
ann.Lat = e.Latitude;
|
||||
ann.Lon = e.Longitude;
|
||||
mapMatcher.SatelliteMap.Position = new PointLatLng(e.Latitude, e.Longitude);
|
||||
mapMatcher.SatelliteMap.ZoomAndCenterMarkers(null);
|
||||
});
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user