This project is read-only.

A question About show labels

Apr 23, 2011 at 3:30 AM
Edited Apr 23, 2011 at 3:30 AM

I want to show the NAME of the province .

my shp file :

my code:

 FeatureSet fsProvince = new FeatureSet(); 

fsProvince.Open(mapPath + "china\\res2_4m.shp");

 fsProvince.Projection = mapMain.Projection;

  IMapFeatureLayer chinaProvince;

  lock (mapOperateLock)


               chinaProvince = mapMain.Layers.Add(fsProvince); 


   chinaProvince.LegendText = "City";  

   PointSymbolizer chinaProvincePointSymbolizer = new PointSymbolizer(Color.Red,DotSpatial.Symbology.PointShape.Ellipse,8);  

   chinaProvince.Symbolizer = chinaProvincePointSymbolizer;

   System.Drawing.Font lblfont=new System.Drawing.Font("Tahoma", 8.0f);

   mapMain.AddLabels((DotSpatial.Symbology.FeatureLayer)chinaProvince, "[NAME]", lblfont, Color.Black);            

But the name doesn't show well ,it includes other column of the attribute table.I don't konw why,can any one try it and tell me why and how to solve it?