mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 18:06:39 +00:00
add gps matcher service
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Azaion.Annotator.Controls
|
||||
|
||||
public CircleVisual(GMapMarker m, Brush background)
|
||||
{
|
||||
ShadowEffect = new DropShadowEffect();
|
||||
Marker = m;
|
||||
Marker.ZIndex = 100;
|
||||
|
||||
@@ -161,14 +162,11 @@ namespace Azaion.Annotator.Controls
|
||||
|
||||
public double? Angle
|
||||
{
|
||||
get
|
||||
{
|
||||
return _angle;
|
||||
}
|
||||
get => _angle;
|
||||
set
|
||||
{
|
||||
if (!Angle.HasValue || !value.HasValue ||
|
||||
Angle.HasValue && value.HasValue && Math.Abs(_angle.Value - value.Value) > 11)
|
||||
if (!_angle.HasValue || !value.HasValue ||
|
||||
Angle.HasValue && Math.Abs(_angle.Value - value.Value) > 11)
|
||||
{
|
||||
_angle = value;
|
||||
IsChanged = true;
|
||||
@@ -211,31 +209,28 @@ namespace Azaion.Annotator.Controls
|
||||
|
||||
public virtual Visual Child
|
||||
{
|
||||
get
|
||||
{
|
||||
return _child;
|
||||
}
|
||||
get => _child;
|
||||
set
|
||||
{
|
||||
if (_child != value)
|
||||
if (_child == value)
|
||||
return;
|
||||
|
||||
if (_child != null)
|
||||
{
|
||||
if (_child != null)
|
||||
{
|
||||
RemoveLogicalChild(_child);
|
||||
RemoveVisualChild(_child);
|
||||
}
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
AddVisualChild(value);
|
||||
AddLogicalChild(value);
|
||||
}
|
||||
|
||||
// cache the new child
|
||||
_child = value;
|
||||
|
||||
InvalidateVisual();
|
||||
RemoveLogicalChild(_child);
|
||||
RemoveVisualChild(_child);
|
||||
}
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
AddVisualChild(value);
|
||||
AddLogicalChild(value);
|
||||
}
|
||||
|
||||
// cache the new child
|
||||
_child = value;
|
||||
|
||||
InvalidateVisual();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,36 +254,34 @@ namespace Azaion.Annotator.Controls
|
||||
|
||||
var square = new DrawingVisualFx();
|
||||
|
||||
using (var dc = square.RenderOpen())
|
||||
using var dc = square.RenderOpen();
|
||||
dc.DrawEllipse(null,
|
||||
Stroke,
|
||||
new Point(Width / 2, Height / 2),
|
||||
Width / 2 + Stroke.Thickness / 2,
|
||||
Height / 2 + Stroke.Thickness / 2);
|
||||
|
||||
if (Angle.HasValue)
|
||||
{
|
||||
dc.DrawEllipse(null,
|
||||
Stroke,
|
||||
new Point(Width / 2, Height / 2),
|
||||
Width / 2 + Stroke.Thickness / 2,
|
||||
Height / 2 + Stroke.Thickness / 2);
|
||||
|
||||
if (Angle.HasValue)
|
||||
dc.PushTransform(new RotateTransform(Angle.Value, Width / 2, Height / 2));
|
||||
{
|
||||
dc.PushTransform(new RotateTransform(Angle.Value, Width / 2, Height / 2));
|
||||
{
|
||||
var polySeg = new PolyLineSegment(new[]
|
||||
{
|
||||
new Point(Width * 0.2, Height * 0.3), new Point(Width * 0.8, Height * 0.3)
|
||||
},
|
||||
true);
|
||||
var pathFig = new PathFigure(new Point(Width * 0.5, -Height * 0.22),
|
||||
new PathSegment[] {polySeg},
|
||||
true);
|
||||
var pathGeo = new PathGeometry(new[] {pathFig});
|
||||
dc.DrawGeometry(Brushes.AliceBlue, StrokeArrow, pathGeo);
|
||||
}
|
||||
dc.Pop();
|
||||
var polySeg = new PolyLineSegment(new[]
|
||||
{
|
||||
new Point(Width * 0.2, Height * 0.3), new Point(Width * 0.8, Height * 0.3)
|
||||
},
|
||||
true);
|
||||
var pathFig = new PathFigure(new Point(Width * 0.5, -Height * 0.22),
|
||||
new PathSegment[] {polySeg},
|
||||
true);
|
||||
var pathGeo = new PathGeometry(new[] {pathFig});
|
||||
dc.DrawGeometry(Brushes.AliceBlue, StrokeArrow, pathGeo);
|
||||
}
|
||||
|
||||
dc.DrawEllipse(Background, null, new Point(Width / 2, Height / 2), Width / 2, Height / 2);
|
||||
dc.DrawText(_fText, new Point(Width / 2 - _fText.Width / 2, Height / 2 - _fText.Height / 2));
|
||||
dc.Pop();
|
||||
}
|
||||
|
||||
dc.DrawEllipse(Background, null, new Point(Width / 2, Height / 2), Width / 2, Height / 2);
|
||||
dc.DrawText(_fText, new Point(Width / 2 - _fText.Width / 2, Height / 2 - _fText.Height / 2));
|
||||
|
||||
return square;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user