ThinkGeo.com    |     Documentation    |     Premium Support

InMemoryMarkerOverlay display last popup with database records

hi i am trying to add mouseover popup i did done with mouseover marker mouseover marker display fine but issue is with data because data is only display last record in popup i am using foreach loop my code is.

 foreach (var ans in allAnswers)

        {

            if (ans.strAnswer != “0.0,0.0”)

            {

                

                string Lat = ans.strAnswer.Split(’,’)[0].ToString();

                string Long = ans.strAnswer.Split(’,’)[1].ToString();

                var basicInfo = from q in db.tblAnswers

                    where q.nQuestionnnaireId == ans.nQuestionnnaireId

                    select q;

                if (query.strAnswer == “19302”)

                {

                    StringBuilder contentHtml = new StringBuilder();

                    myFeature =

                 new Feature(Convert.ToDouble(Long),

                     Convert.ToDouble(Lat));

                    myData.EditTools.Add(myFeature);

                 

                    string ImageUrl = string.Empty;



                    ImageUrl = “/ftp/pictures/” + picture.strAnswer;

                    

                  //  contentHtml.Append(“Picture”)





                        contentHtml.Append("")

                        .Append("
")

          .Append(“Date:  “)



                   .Append(”” + Date.strAnswer + “”);



                    markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage =

                        new WebImage("/a.png", 30, 30);

                    markerOverlay.FeatureSource.InternalFeatures.Add(myFeature);

                         //markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup=new CustomPopup(contentHtml.ToString());

                         

                    markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = contentHtml.ToString();

                    markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Width = 250;

                    markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Height = 290;

                    markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.IsVisible = false;

                    markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.AutoPan = true;

                    markerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

             

                

                }

problem is with  contentHtml its only show last record of my loop. what can i do to achieve all  contentHtml record according to myfeature.

Hi Raja, 
  
 It looks you create duplication post, I will reply you in another post. 
  
 thinkgeo.com/forums/MapSuite/tabid/143/aft/12828/Default.aspx 
  
 Regards, 
  
 Don