ThinkGeo.com    |     Documentation    |     Premium Support

Change Label placement for Polygon and Line features

Hi,


I am changing the placement of label of the feature layer at run-time. I am able to change the placement of features of the Point layer by setting the PointPlacement property of the feature layer to one of the value from the PointPlacement enum. But when I try to change the Placement of the Polygon and Line layer through same method, the new placement is not getting reflected on the map control. I am assuming that methodology to change the placement of Polygon and Line features is different as compared to point feature as PointPlacement must work on the centroid part of the geometry only. Is there any other way to set the placement at run-time for Polygon and Line features. if you can provide the sample code that will be very helpful. Below is my code changing the placement.



_featureLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.BestPlacement =



true;



_featureLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.PointPlacement = ;



Thanks,


 


 



Nitish, 
  
 You can not change the placement of features of the polygon or line layer, we only support point layer which you can see the document of PointPlacement property, this property allows you to choose where the labels are created relative to the point. 
  
 Please let me know if you have more questions. 
  
 Thanks. 
 James 


James,  
  
   I think it can be changed by setting the xoffset and yoffset in the text style property.  You can also always adjust them yourself by overrideing some of our methods in the text style and adding your own code.  What kind of effect are you looking for exactly? 
  
 David