MarkerEvents.click and GoogleMap.click conflicts

Nov 26, 2009 at 12:36 AM

Hi. I am adding markers dynamically in th code behind. Therefore I handle the GoogleMap.click event. I get the Location and put a new marker to that location. And I handle the MarkerEvents.click too, I show the info when somebod clicks the marker. But when somebody clicks the marker, th GoogleMap.click is alo trigered. How can I solve this?

Coordinator
Nov 26, 2009 at 5:36 AM
Edited Nov 26, 2009 at 5:36 AM

Hi,

Can you provide a sample of your code here or send it to me by email.

Regards

Dec 1, 2009 at 1:00 PM

protected void Page_Load(object sender, EventArgs e)
        {          
            Artem.Web.UI.Controls.GoogleMap gmap = new Artem.Web.UI.Controls.GoogleMap();
            gmap.ID = "googleMap1";
            gmap.Key = "ABQIAAAABS1tlWh5VVNOB3FwCnypHxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTz3f1plVr-H0YVUtuJsjxK1DnH7Q";
            gmap.Latitude = 21.1231231231;
            gmap.Longitude = 40.1231231231;
            gmap.Zoom = 10;
            gmap.Height = 600;
            gmap.Width = 800;
            gmap.MarkerEvents.Click += new EventHandler<Artem.Web.UI.Controls.GoogleLocationEventArgs>(MarkerEvents_Click);
            gmap.DoubleClick += new EventHandler<Artem.Web.UI.Controls.GoogleLocationEventArgs>(GoogleMap1_Click);
          
            phMap.Controls.Add(gmap);
            

        
            
        }

        void MarkerEvents_Click(object sender, Artem.Web.UI.Controls.GoogleLocationEventArgs e)
        {
            isMarkerClicked = true;
            Artem.Web.UI.Controls.GoogleMarker marker = sender as Artem.Web.UI.Controls.GoogleMarker;
            marker.Text = "You clicked here";
            marker.Title = "ıerwerwehruhwe";
            marker.Show();
            isMarkerClicked = false;
        }

        void GoogleMap1_Click(object sender, Artem.Web.UI.Controls.GoogleLocationEventArgs e)
        {
          
         
                Artem.Web.UI.Controls.GoogleMap gmap = sender as Artem.Web.UI.Controls.GoogleMap;
                Artem.Web.UI.Controls.GoogleMarker marker = new Artem.Web.UI.Controls.GoogleMarker(e.Location.Latitude, e.Location.Longitude);        
                    gmap.Markers.Add(marker);
                    gmap.Latitude = e.Location.Latitude;
                    gmap.Longitude = e.Location.Longitude;
              
                   
          
            
        }