ThinkGeo.com    |     Documentation    |     Premium Support

Feature's tag disappears

Hi,


I'm attaching a tag to a feature when creating the feature in an InMemoryFeatureLayer.


Later,when a custom style's DrawCore() is called , the tag of the feature in the features collection is null;


This can be reproduced easily in the "VehicleDirection" sample downloaded from the code Community:


In Form1_Load() make the following change:


Feature newFeature1 = new Feature(pointShapes1[count1]);


newFeature1.Tag = "aaa";   //this is an added line


 


Now, put a breakpoint at  RotatedImageStyle:DrawCore, and look at the feature.tag


 Thanks,


Ofer


 



Ofer, 
  
 Welcome you to ThinkGeo Desktop Edition forum! 
  
 Thanks for your reporting and it is bug, we can recreate it very easily as you said. 
  
 We will fix this problem as soon as possible, let me know if it is very urgent for you. 
  
 Thanks. 
  
 Yale 


Yale, are you sure this is a bug? Isn't the feature regenerated from the data source every time the DataSource.GetFeatures (or whatever) is called? If regnerated, then any tag is lost.


Or, maybe the InMemoryFeatureLayer operates on a collection of features, and the collection is never regenerated during a draw?



Ted, 
  
 Thanks for your post and questions! 
  
 I think this should be treated as a bug. 
  
 The problem happens when we call the GetFeaturesForDrawing API (and this API will be called automatically during drawing), in this API, we should select out those features within the current extent from the feature source.  
  
 Yes, the feature is a structure , so every time it returned it will regenerated, but it should keep the properties of the original feature such as ColumValues, Tag etc, because it is just a subset of the features inside the feature source. 
  
 In last public version, we just keep the ColumnValues unchanged but ignored the Tag, now we have fixed this problem. 
  
 Let me know if I am not clear. 
  
 Thanks. 
  
 Yale