Skip to content

Commit

Permalink
GMap.NET.WindowsPresentation: WPF couldn't draw GMapRoute and GMapPol…
Browse files Browse the repository at this point in the history
…ygon, thx WintelZhao
  • Loading branch information
radioman committed May 19, 2015
1 parent 8fd03e2 commit bad7fc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
5 changes: 1 addition & 4 deletions GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ public Point LocalPosition
{
if(!Overlay.Control.HoldInvalidation)
{
if (Overlay.Control.Core.Refresh!=null)
{
Overlay.Control.Core.Refresh.Set();
}
Overlay.Control.Invalidate();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ public class GMapPolygon : GMapMarker, IShapable
public GMapPolygon(IEnumerable<PointLatLng> points)
{
Points.AddRange(points);
if (Points.Count > 0)
{
Position = Points[0];
RegenerateShape(null);
}
RegenerateShape(null);
}

public override void Clear()
Expand All @@ -35,6 +31,8 @@ public virtual void RegenerateShape(GMapControl map)

if(Points.Count > 1)
{
Position = Points[0];

var localPath = new List<System.Windows.Point>(Points.Count);
var offset = Map.FromLatLngToLocal(Points[0]);
foreach(var i in Points)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ public class GMapRoute : GMapMarker, IShapable
public GMapRoute(IEnumerable<PointLatLng> points)
{
Points.AddRange(points);
if (Points.Count > 0)
{
Position = Points[0];
RegenerateShape(null);
}
RegenerateShape(null);
}

public override void Clear()
Expand All @@ -40,6 +36,8 @@ public virtual void RegenerateShape(GMapControl map)

if(Points.Count > 1)
{
Position = Points[0];

var localPath = new List<System.Windows.Point>(Points.Count);
var offset = Map.FromLatLngToLocal(Points[0]);
foreach(var i in Points)
Expand Down

0 comments on commit bad7fc1

Please sign in to comment.