mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 18:36:32 +00:00
fix bugs with UI for gps denied
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user