I am adding multiple polygons on a map and trying to identify which one is clicked on. C# can already pick up whether a polygon was clicked, but I need to identify which one was clicked. I have tried many variations to this, but Currently I have with the error at the bottom:
{
gMapControl1.MapProvider = GMapProviders.GoogleMap;
gMapControl1.Position = new PointLatLng(52.2659416, 10.5267296);
GMapOverlay polygons = new GMapOverlay("polygons");
List<PointLatLng> points = new List<PointLatLng>();
points.Add(new PointLatLng(52.2659416, 10.5267296));
points.Add(new PointLatLng(62.2659416, 10.5267296));
points.Add(new PointLatLng(62.2659416, 20.5267296));
points.Add(new PointLatLng(52.2659416, 20.5267296));
GMapPolygon polygon = new GMapPolygon(points, "test");
polygons.Polygons.Add(polygon);
gMapControl1.Overlays.Add(polygons);
}
private void gmap_OnPolygonClick(GMapPolygon item, MouseEventArgs e)
{
Console.WriteLine(String.Format("Polygon {0} with tag {1} was clicked",
item.Name, item.Tag));
}
Error CS0104 'MouseEventArgs' is an ambiguous reference between 'System.Windows.Forms.MouseEventArgs' and 'System.Windows.Input.MouseEventArgs'