ThinkGeo.com    |     Documentation    |     Premium Support

InMemoryMarkerOverlay - FeatureColumns - Popup not working

I have an InMemoryMarkerOverlay to which programmatically add features. The points (markers) display just fine, but it seems that they receive no column values.


Here's the code:



For Each dbRow In dbPermits(nType, nIndex).Rows
dbRows = dbFeatures.Select("LINC = '" & dbRow("sLinc") & "'")
If dbRows IsNot Nothing AndAlso dbRows.Length > 0 Then
shpOverlay(nIndex).FeatureSource.BeginTransaction()
sID = dbRows(0)(0)
ftr = shpMuni.FeatureSource.GetFeatureById(sID, New String() {"LINC"})
shpOverlay(nIndex).FeatureSource.AddFeature(New Feature(ftr.GetBoundingBox.GetCenterPoint(), ftr.ColumnValues))
shpOverlay(nIndex).FeatureSource.CommitTransaction()
End If
Next

This seems to work, but when I put a watch on it, ftr.ColumnValues has the data, but the added feature in the overlay does not.


So when I try to do a popup.contentHtml = "[#LINC#]" - all I get is the string literal not the value it represents.


Thoughts?


Kirk



Kirk, 



Your code seems right, just wonder does your marker overlay have the column of “LINC”? If not, please add the following code. 

 
' shpOverlay(nIndex) is an InMemoryMarkerOverlay  
shpOverlay(nIndex).Columns.Add(new FeatureSourceColumn("LINC"))

If you still have the problem, please provide more codes for your app. 



Thanks, 



Ben



That worked!


I made the incorrect assumption that the columns were associated with the feature, not the overlay.


My mistake!


Thank you for your kind assistance.



That’s my pleasure, Kirk. Let me know if you have more issues. 
  
 Ben

Now my popups are working TOO well. 
 I’ve tried setting the delay, but that hasn’t helped. 
 What happens is when a person moves their mouse across the map, if they happen to go over any markers ALL of them show their popup. 
 It’s like it doesn’t wait for the hover event or something.  
 THEN they don’t want to go away. You have move over them one at a time and hope they go away before another one shows up in it’s place. 
 I’ve restricted their visibility to a higher zoom level, but that only helps so much. 
  
 Any ideas to get the popups to behave themselves and only show up after a 1-2 second hover?




 


Kirk,


This is a bug and thanks for pointing it out! We couldn't find a good way to work it around with the current version(3.1.16), sorry for the inconvenience and we will fix it in the next version.


I think the PopupDelay works find though. If you want to set 1 second delay, you need to set it to 1000 as its unit is ms. Code should be like this:



inMemoryMarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.PopupDelay = 1000

With the current version, even you set the delay time to 1 second, when you quickly move over a marker, the Popup will still be displayed in one second. As I mentioned above, we will fix it in the next version.


Here attached is my test demo, please have a look if you are interested.


Thanks,


Ben



469-TestInMemoryMarkerOverlayDelay.zip (18.8 KB)