-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGMapMarkerRect.cs
44 lines (39 loc) · 1.38 KB
/
GMapMarkerRect.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GMap.NET;
using GMap.NET.WindowsForms;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace JCFLIGHTGCS
{
class GMapMarkerRect : GMapMarker
{
public Pen Pen = new Pen(Brushes.White, 3);
public Color Color { get { return Pen.Color; } set { Pen.Color = value; } }
public GMapMarker InnerMarker;
public int WPRadius = 0;
public GMapControl MainMap;
public GMapMarkerRect(PointLatLng p)
: base(p)
{
Pen.DashStyle = DashStyle.Dot;
Size = new Size(50, 50);
Offset = new Point(-Size.Width / 2, -Size.Height / 2 - 20);
}
public override void OnRender(Graphics g)
{
base.OnRender(g);
if (WPRadius == 0 || MainMap == null)
return;
GPoint loc = new GPoint((int)(LocalPosition.X - (WPRadius * 2)), LocalPosition.Y);
try
{
g.DrawArc(Pen, new Rectangle((int)(LocalPosition.X - Offset.X - (Math.Abs(loc.X - LocalPosition.X) / 2)), (int)(LocalPosition.Y - Offset.Y - Math.Abs(loc.X - LocalPosition.X) / 2), (int)(Math.Abs(loc.X - LocalPosition.X)), (int)(Math.Abs(loc.X - LocalPosition.X))), 0, 360);
}
catch { }
}
}
}