Hello,
I have some hover popups that show data relating to a point on the map. The problem is that each popup shows the same data, which is not what I want. It should display that particular data for the individual point. The data is coming from a DataRowView instance from a DataTable. Code follows;
private void DrawMarkerOverlays(DataTable dt, ValueMarkerStyle myValueStyle)DataView dv = dt.DefaultView;//Assertion does not fail so they are the same.
System.
{
drv = (
lon = drv.Row[
lat = drv.Row[
{
dlon =
dlat =
desc = drv.Row[
AppendFeatures(Map1.MarkerOverlay,state.ToString(),dlon,dlat);
}
}
Debug.Assert(dv.Count == dt.Rows.Count);IEnumerator iterator = dv.GetEnumerator();DataRowView drv;Int32 i = 0;string lon = string.Empty;string lat = string.Empty;Double dlon = 0.0;Double dlat = 0.0;string desc = string.Empty;int state = 0;while (iterator.MoveNext())DataRowView)iterator.Current;"lLongitude"].ToString();"lLatitude"].ToString();if (VerifyLatLon(lat, lon))Convert.ToDouble(drv.Row["lLongitude"]);Convert.ToDouble(drv.Row["lLatitude"]);"szSiteDesc"].ToString();CreateValueMarker(state,myValueStyle,dlon,dlat,desc);i++;
{
{
vmStyle.ValueItems.Add(
CreatePopup(CreateKey(lat), lon, lat, hoverText),
CreateContext(CreateKey(lat), lon, lat))));
vmStyle.ValueItems.Add(
CreatePopup(CreateKey(lat), lon, lat, hoverText),
CreateContext(CreateKey(lat), lon, lat))));
vmStyle.ValueItems.Add(
CreatePopup(CreateKey(lat), lon, lat, hoverText),
CreateContext(CreateKey(lat), lon, lat))));
}
}
private void CreateValueMarker(Int32 state, ValueMarkerStyle vmStyle, double lon, double lat, string hoverText)switch (state)case 0:new MarkerValueItem(state.ToString(),new PointMarkerStyle(new WebImage("/CrossingsMap/theme/default/img/marker_green.gif", 25, 25, -11.5F, -25F),break;case 1:new MarkerValueItem(state.ToString(),new PointMarkerStyle(new WebImage("/CrossingsMap/theme/default/img/marker.gif", 25, 25, -11.5F, -25F),break;case 2:new MarkerValueItem(state.ToString(),new PointMarkerStyle(new WebImage("/CrossingsMap/theme/default/img/marker_grey.gif", 25, 25, -11.5F, -25F),break;default:break;
{
private CustomPopup CreatePopup(string key, double lon, double lat, string hoverText)try
{
CustomPopup popup = new CustomPopup();StringBuilder contentHtml = new StringBuilder();//contentHtml.Append("")
contentHtml.Append(
.Append(hoverText)
.Append(
popup.ContentHtml = contentHtml.ToString();
popup.AutoSize =
popup.BorderWidth = 1;
popup.IsVisible =
popup.AutoPan =
Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =
}
"")"");true;false;true;ApplyUntilZoomLevel.Level20;return popup;catch
{
}
}
return null;
{