Skip to content

Commit

Permalink
GMap.NET.WindowsForms: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
radioman committed May 11, 2015
1 parent 7bf2faa commit d0b12f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
44 changes: 7 additions & 37 deletions GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,7 @@ public void UpdateMarkerLocalPosition(GMapMarker marker)
p.OffsetNegative(Core.renderOffset);
}
#endif

var f = new System.Drawing.Point((int)(p.X + marker.Offset.X), (int)(p.Y + marker.Offset.Y));
marker.LocalPosition = f;
marker.LocalPosition = new System.Drawing.Point((int)(p.X + marker.Offset.X), (int)(p.Y + marker.Offset.Y));
}
}

Expand All @@ -646,32 +644,18 @@ public void UpdateMarkerLocalPosition(GMapMarker marker)
/// <param name="route"></param>
public void UpdateRouteLocalPosition(GMapRoute route)
{
route.LocalPoints.Clear();
route.LocalPoints.Clear();

for (int i = 0; i < route.Points.Count; i++)
{
PointLatLng pg= route.Points[i];
GPoint p = FromLatLngToLocal(pg);
GPoint p = FromLatLngToLocal(route.Points[i]);

#if !PocketPC
if (!MobileMode)
{
p.OffsetNegative(Core.renderOffset);
}
#endif

// if(IsRotated)
// {
//#if !PocketPC
// System.Drawing.Point[] tt = new System.Drawing.Point[] { new System.Drawing.Point(p.X, p.Y) };
// rotationMatrix.TransformPoints(tt);
// var f = tt[0];

// p.X = f.X;
// p.Y = f.Y;
//#endif
// }

route.LocalPoints.Add(p);
}
#if !PocketPC
Expand All @@ -685,31 +669,17 @@ public void UpdateRouteLocalPosition(GMapRoute route)
/// <param name="polygon"></param>
public void UpdatePolygonLocalPosition(GMapPolygon polygon)
{
polygon.LocalPoints.Clear();

foreach (GMap.NET.PointLatLng pg in polygon.Points)
{
GPoint p = FromLatLngToLocal(pg);
polygon.LocalPoints.Clear();

for (int i = 0; i < polygon.Points.Count; i++)
{
GPoint p = FromLatLngToLocal(polygon.Points[i]);
#if !PocketPC
if (!MobileMode)
{
p.OffsetNegative(Core.renderOffset);
}
#endif

// if(IsRotated)
// {
//#if !PocketPC
// System.Drawing.Point[] tt = new System.Drawing.Point[] { new System.Drawing.Point(p.X, p.Y) };
// rotationMatrix.TransformPoints(tt);
// var f = tt[0];

// p.X = f.X;
// p.Y = f.Y;
//#endif
// }

polygon.LocalPoints.Add(p);
}
#if !PocketPC
Expand Down
2 changes: 1 addition & 1 deletion GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public bool IsVisible
{
if(!Overlay.Control.HoldInvalidation)
{
Overlay.Control.Core.Refresh.Set();
Overlay.Control.Invalidate();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapPolygon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public bool IsVisible
{
if(!Overlay.Control.HoldInvalidation)
{
Overlay.Control.Core.Refresh.Set();
Overlay.Control.Invalidate();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public bool IsVisible
{
if (!Overlay.Control.HoldInvalidation)
{
Overlay.Control.Core.Refresh.Set();
Overlay.Control.Invalidate();
}
}
}
Expand Down

0 comments on commit d0b12f3

Please sign in to comment.