GMapMarkerPolygon

Feb 8, 2010 at 2:21 AM
Edited Feb 8, 2010 at 1:16 PM

You can include this class in your own assembly:

namespace GMap.NET.WindowsForms.Markers
{
   using System.Drawing;
   using System.Collections.Generic;

   public class GMapMarkerPolygon : GMapMarker
   {
      public Pen Pen;

      public List<PointLatLng> GeoPoints;
      private List<Point> _localPoints;

      public GMapMarkerPolygon(PointLatLng p,List<PointLatLng> points)
          : base(p)
      {
         Pen = new Pen(Brushes.Blue, 3);
         
          GeoPoints = points;
          
      }

      public override void OnRender(Graphics g)
      {
          _localPoints = new List<Point>();
          foreach (var item in GeoPoints)
          {
              Position = item;
              _localPoints.Add(LocalPosition);
          }

          g.DrawPolygon(Pen, _localPoints.ToArray());
      }
   }
}

 

Coordinator
Feb 8, 2010 at 8:10 AM

great! thanks for sharing ;}