ThinkGeo.com    |     Documentation    |     Premium Support

How to read text column name from map canvas

Dear Sir/Madam,



We want read the text column name from map canvas please give me a solution.



Thanks & Regards 



Harish Upadhyay


Hi Harish, 
  
 Thanks for your post and welcome to MapSuite World, do you mean get the text column from GdiPlusGeoCanvas class, If yes, I am sorry to say that there isn’t a existing API to get it for now. If not would you please give us more information about your scenario,  
  
 Thanks 
  
 Summer

Dear Sir,



 My text  column add process given below 



 ShapeFileFeatureLayer austinStreetsLabelLayer = new ShapeFileFeatureLayer(@"…\SampleData\Data\austinstreets.shp");
            austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.LocalRoad1("FENAME"));
            austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;




LayerOverlay staticOverlay = new LayerOverlay();
          staticOverlay.Layers.Add("AustinStreetsLabelLayer", austinStreetsLabelLayer);
            winformsMap1.Overlays.Add(staticOverlay);


winformsMap1.CurrentExtent = new RectangleShape(-97.749141617693908, 30.300592918607943, -97.741202279009826, 30.29492809316849);



            winformsMap1.Refresh();



After that i want to read text column Name  ("FENAME") please give me a solution .



 public void read_column_name(string namre_of_laye)
        {



            FeatureLayer worldLayer = winformsMap1.FindFeatureLayer(namre_of_laye);
           
            worldLayer.Open();
            Collection<string> selectedFeatures = worldLayer.FeatureSource.GetAllFeatures();
            worldLayer.Close();
        }


Regards



Harish Upadhyay
















Dear Sir, 
  
  My text  column add process given below  
  
  ShapeFileFeatureLayer austinStreetsLabelLayer = new ShapeFileFeatureLayer(@"…\SampleData\Data\austinstreets.shp"); 
             austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.LocalRoad1("FENAME")); 
             austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; 
  
 LayerOverlay staticOverlay = new LayerOverlay(); 
           staticOverlay.Layers.Add("AustinStreetsLabelLayer", austinStreetsLabelLayer); 
             winformsMap1.Overlays.Add(staticOverlay); 
 winformsMap1.CurrentExtent = new RectangleShape(-97.749141617693908, 30.300592918607943, -97.741202279009826, 30.29492809316849); 
  
             winformsMap1.Refresh(); 
  
 After that i want to read text column Name  ("FENAME") please give me a solution . 
  
  public void read_column_name(string namre_of_laye) 
         { 
  
             FeatureLayer worldLayer = winformsMap1.FindFeatureLayer(namre_of_laye); 
             
             worldLayer.Open(); 
             Collection selectedFeatures = worldLayer.FeatureSource.GetAllFeatures(); 
             worldLayer.Close(); 
         } 
  
 Regards 
  
 Harish Upadhyay 
  


Hi Harish, 
  
 Thanks for your further info, we have replied it in thinkgeo.com/forums/tabid/143/aft/11888/Default.aspx , would you please check it there? 
  
 Best Regards 
  
 Summer

Dear Sir,  
  
 This function working  properly. 
  
 Thanks   
  
 Harish Upadhyay

Hi Harish,  
  
  if you have any more question , please feel free to let us know.  
  
  Best Regards  
  
  Summer