This project is read-only.

Dynamic add Circle not work onClientClick

Jun 23, 2012 at 4:30 AM

hi

code:

 

foreach (var tbBecario in result.GroupBy(q=>q.PaisHomologado))
        {
            var circle = new GoogleCircle();
            circle.OnClientClick = "CirculoClick";
            //circle.Click += new EventHandler<MouseEventArgs>(circle_Click);
            
            
            var strUrl = string.Format("http://maps.googleapis.com/maps/api/geocode/xml?address={0}&sensor=true", tbBecario.Key);
            var xmldoc= ResponseXml.PostXmlTransaction(strUrl,new XmlDocument());
            
            try
            {
                var lat = xmldoc.SelectSingleNode("GeocodeResponse/result/geometry/location/lat").InnerText;
                var lng = xmldoc.SelectSingleNode("GeocodeResponse/result/geometry/location/lng").InnerText;
                //circle.ID = string.Format("cir{0}", i);
                circle.ClientIDMode= ClientIDMode.AutoID;
                
                circle.Clickable = true;
                circle.FillColor =  _tipo=="MAGISTER"?  Color.Red: Color.DarkGray;
                circle.FillOpacity = .5F;
                circle.StrokeColor = Color.MidnightBlue;
                circle.StrokeWeight = 5;
                circle.Radius = 200000;
                circle.TargetControlID = "GoogleMap1";
                circle.Center = new LatLng(Convert.ToDouble(lat.Replace('.',',')), Convert.ToDouble(lng.Replace('.',',')));
                GoogleMap1.Overlays.Add(circle);

                //i++;
            }
            catch (Exception)
            {
                
                continue;
            }
           
        }


the last circle drawn on the map, triggers the OnClientClick event, the rest is not triggered.
any ideas?
thanks guys