Chris,
Yes, please have a look at the code below:
void markerOverlay_Click(object sender, MarkerOverlayClickEventArgs e)
{
SimpleMarkerOverlay markerOverlay = (SimpleMarkerOverlay)sender;
Marker selectedMarker = null;
foreach (Marker marker in markerOverlay.Markers)
{
marker.Popup.ContentHtml = GetPopupContent(marker.Id);
if (marker.Id == e.FeatureId)
{
selectedMarker = marker;
break;
}
}
selectedMarker.Popup.ContentHtml = GetPopupContent(selectedMarker.Id);
//clickPointShape = (PointShape)feature.GetShape();
Map1.Popups.Clear();
CloudPopup popup = new CloudPopup(selectedMarker.Id, selectedMarker.Position, string.Empty, 150, 60);
popup.AutoSize = true;
popup.AutoPan = true;
popup.HasCloseButton = true;
Map1.Popups.Add(popup);
popup.ContentHtml = selectedMarker.Popup.ContentHtml;
}
private string GetPopupContent(string name)
{
string content;
if (!string.IsNullOrEmpty(name))
{
StringBuilder message = new StringBuilder();
message.AppendFormat("{0}", name);
message.AppendFormat("{0}", string.Empty);
message.AppendFormat("");
message.AppendFormat("");
message.AppendFormat("<a href=javascript:__doPostBack('saveMaker','') id='btnSaveMaker'>Save</a> ", "");
message.AppendFormat("<a href=javascript:" + ClientScript.GetPostBackEventReference(this.deleteMarker, name) + " id='btnHotel'>DeleteMarker</a> ", "");
message.AppendFormat("");
message.AppendFormat("FindNearest");
message.AppendFormat("");
message.AppendFormat("<a href=javascript:setQueryType('HOTEL');__doPostBack('spatialQuery','') id='btnHotel'>Hotel</a> ", "");
message.AppendFormat("<a href=javascript:setQueryType('HOSPITAL');__doPostBack('spatialQuery','') id='btnHospital'>Hospital</a> ", "");
message.AppendFormat("");
string messageInPopup = String.Format("{0}", message.ToString());
content = messageInPopup;
}
else
{
content = string.Empty;
}
return content;
}
Regards,
Gary