mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
switcher dataset explorer
lat lon -> geopoint correct location for gps if small keypoints number
This commit is contained in:
@@ -42,7 +42,7 @@ public class AnnotatorEventHandler(
|
||||
INotificationHandler<AnnotationsDeletedEvent>,
|
||||
INotificationHandler<AnnotationAddedEvent>,
|
||||
INotificationHandler<SetStatusTextEvent>,
|
||||
INotificationHandler<GPSMatcherResultEvent>
|
||||
INotificationHandler<GPSMatcherResultProcessedEvent>
|
||||
{
|
||||
private const int STEP = 20;
|
||||
private const int LARGE_STEP = 5000;
|
||||
@@ -378,20 +378,29 @@ public class AnnotatorEventHandler(
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(GPSMatcherResultEvent e, CancellationToken cancellationToken)
|
||||
public Task Handle(GPSMatcherResultProcessedEvent 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, size: 14, text: e.Image, background: Brushes.Blue);
|
||||
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);
|
||||
var ann = mainWindow.MapMatcherComponent.Annotations[e.Index];
|
||||
AddMarker(e.GeoPoint, e.Image, Brushes.Blue);
|
||||
if (e.ProcessedGeoPoint != e.GeoPoint)
|
||||
AddMarker(e.ProcessedGeoPoint, $"{e.Image}: corrected", Brushes.DarkViolet);
|
||||
ann.Lat = e.GeoPoint.Lat;
|
||||
ann.Lon = e.GeoPoint.Lon;
|
||||
|
||||
});
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void AddMarker(GeoPoint point, string text, SolidColorBrush color)
|
||||
{
|
||||
var map = mainWindow.MapMatcherComponent;
|
||||
var pointLatLon = new PointLatLng(point.Lat, point.Lon);
|
||||
var marker = new GMapMarker(pointLatLon);
|
||||
marker.Shape = new CircleVisual(marker, size: 14, text: text, background: color);
|
||||
map.SatelliteMap.Markers.Add(marker);
|
||||
map.SatelliteMap.Position = pointLatLon;
|
||||
map.SatelliteMap.ZoomAndCenterMarkers(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user