This project is read-only.

Assigning multiple client handlers on marker

Apr 23, 2008 at 3:13 PM
Edited Apr 23, 2008 at 3:14 PM
Hi there,

I am having an issue when I assign client side event handlers server side to a GoogleMarker. If I handle 1 event, everything is fine, its when i try to handle two events I get the javascript error "Expected ']'"... I think the JSON is getting malformed. Here is the code i am using to create the GoogleMarker, and add it to the map:

GoogleMarker mark = new GoogleMarker((double)c.Latitude, (double)c.Longitude);

mark.Clickable = true;
mark.Bouncy = true;
mark.AutoPan = true;
mark.Title = string.Format("marker_{0}", GoogleMap1.Markers.Count);

mark.Draggable = true;
mark.AutoPan = true;
mark.OnClientDragEnd = "handleDragEnd(this)";
mark.OnClientMouseUp = "handleMouseUp(this)"; //if I comment this out or the one above, I will not get the error.

mark.OpenInfoWindowHtml(Resources.LocalizedText.yourLocation); //auto open the window : - Added by Sharbel
mark.Text = Resources.LocalizedText.yourLocation;
GoogleMap1.Address = c.Address;
GoogleMap1.Latitude = (double)c.Latitude;
GoogleMap1.Longitude = (double)c.Longitude;
GoogleMap1.Zoom = 13;
GoogleMap1.PanTo(new GoogleLocation((double)c.Latitude, (double)c.Longitude));
hfLatitude.Value = c.Latitude.ToString();
hfLongitude.Value = c.Longitude.ToString();
Apr 24, 2008 at 6:43 AM
Will be fixed and release coming in next couple of days.

Apr 24, 2008 at 6:44 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.