Thank you very much, I used RobbeEDE example of overloading the marker.
I also managed to change the cross to an elipse, and add the text inside the elipse, so now it looks really great.
I only have one problem left, which I can't solve on my own, since I'm pretty new to overloading, delegates etc.
Normally I use an eventHandler for handling the marker click event like below:
private void gmap_OnMarkerClick(GMapMarker item, MouseEventArgs e)
{
....
}
But on my overloaded class called GMapMarker_Text I have added a property called MyTag, and I would like to get that back when clicking on a marker.
So therefore I changed my OnMarkerClick eventHandler to the following:
private void gmap_OnMarkerClick(GMapMarker_Text item, MouseEventArgs e)
Then I get the following error message:
"No overload for 'gmap_OnMarkerClick' matches delegate 'GMap.NET.WindowsForms.MarkerClick'"
How do I overload this eventhandler or delegate or whatever it is?
Here is my overloaded GMapMarker class:
public class GMapMarker_Text : GMapMarker
{
private Pen Pen = new Pen(Brushes.Blue, 3);
private Brush FillBrush = new SolidBrush(Color.Blue);
private int circleHeight;
private int circleWidth;
private string _MyTag;
private string _markerTitle;
private PointLatLng _p;
public string MyTag
{
get { return _MyTag; }
}
public GMapMarker_Text(PointLatLng p, string MyTag, string markerTitle) : base(p) //Constructor
{
_p = p;
_MyTag = MyTag;
_markerTitle = markerTitle;
Size = new System.Drawing.Size(5, 5);
Offset = new System.Drawing.Point(0, 0);
}
public override void OnRender(Graphics g)
{
circleHeight = 24;
circleWidth = 24;
g.FillEllipse(FillBrush, LocalPosition.X - circleWidth / 2, LocalPosition.Y - circleHeight / 2, circleWidth, circleHeight);
Font drawFont = new Font("Arial", 11);
Pen OutlinePen = new Pen(Color.FromArgb(255, Color.White), 5);
g.DrawString(_markerTitle, drawFont, OutlinePen.Brush, LocalPosition.X - 6, LocalPosition.Y - 8);
}
}