ThinkGeo.com    |     Documentation    |     Premium Support

Custom Data missing within Map1_Click

Hello,



I have a layer that I'm loading with custom data from a database using the following:




            _countryLayer.FeatureSource.CustomColumnFetch += new EventHandler<CustomColumnFetchEventArgs>(FeatureSource_CustomColumnFetch);
            _countryLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.RequiredColumnNames.Add("CustomColumn");


I know my custom data is being loaded because I can see the "CustomColumn" data on my map when I add a TextStyle:



            TextStyle myTextStyle = TextStyles.City1("CustomColumn");
_countryLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(myTextStyle); 
            _countryLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(myTextStyle);


All this works great and my "CustomColumn" data shows up as labels on my country layer.  My problem comes when I try to get that "CustomColumn" data out of the selected feature during the Map_Click event:



            _countryLayer.Open();
            Collection<Feature> selectedFeatures = _countryLayer.QueryTools.GetFeaturesContaining(e.Position, new string[2] { "CNTRY_NAME", "CustomColumn" });
            _countryLayer.Close();


The GetFeaturesContaining method throws an InvalidOperationException "The Field namd you want is not exist".   Thanks for your help!

 




 


Joe

 



Joe, 
  
 This is a bug and thanks for pointing it out. I’ve added to our tracking system and I think we will fix it in the next version. 
  
 Thanks, 
  
 Ben

Thanks for the quick reply!  I'll look for it in a future release.  



Thanks again for pointing this bug out, Joe.