OnMarkerClick event produce more than one event!?!

Topics: Windows Forms
Feb 12, 2011 at 7:44 AM

Hi,

  nice control this GMap.net. I really enjoy code with it. Now I have little problem about OnMarkerClick event, because when I click on of the markers, it causes more that one event.

 

private void gMapControl1_OnMarkerClick(GMapMarker item, MouseEventArgs e)
{
            if (e.Button == MouseButtons.Left)
                MessageBox.Show("HELLO");

}

 

With this code I get three MessageBox and I expect only one. What I do wrong or is there bug?

I am using WindowsForm.

Coordinator
Feb 12, 2011 at 2:15 PM

i guess you click on few overlapped markers?

Feb 13, 2011 at 1:16 PM

Yes problem was that I accidently add same overlay many time to mapcontrol. Now it seems to work.

 

T

Coordinator
Feb 13, 2011 at 4:42 PM

i see ;}

Apr 4, 2012 at 5:44 PM

Hi Radioman;

I created some markers to show some pictures or video, I want when I click just on these markers show the video and not all markers.

How could I treat this

PointLatLng point1 = new PointLatLng(54.6961334816182, 25.2985095977783);
                GMapMarker m = new GMarkerGoogle(point1, GMarkerGoogleType.red);
                m.ToolTipText = "video or pictures";
                m.ToolTipMode = MarkerTooltipMode.Always;                
                objects.Markers.Add(m);

Coordinator
Apr 4, 2012 at 6:21 PM

?

Apr 5, 2012 at 7:19 AM

I'd like when I click on JUST ONE marker it shows me the picture, not ALL markers (private void gMapControl1_OnMarkerClick(GMapMarker item, MouseEventArgs e)).

Coordinator
Apr 5, 2012 at 7:22 AM

so whats the problem? ;]

Apr 5, 2012 at 7:31 AM

How could I make that?

Apr 5, 2012 at 7:36 AM

I added this 

if (e.Button == MouseButtons.Left && m.ToolTipText == "video or pictures")

but it don't work, I have pictures or message on all markers!

Apr 5, 2012 at 7:59 AM

Ok, ok that's ok ;)