Select to view content in your preferred language

How to place a label in the center of a polygon in Feature layer?

07-11-2023 06:37 AM
New Contributor III

I have a feature layer with polygons and I want to place a label in the center of the polygon. I tried with polylines and polygons both but with the current label placement options available I am not able to place it in the center. 

Is there any way to do this? 

0 Kudos
2 Replies
New Contributor

Hi @PrashantR,

You can try:

1. to find the centroid of each polygon and set the label

2. if you are using LabelClass, then you can set the labelPlacement property

0 Kudos
Esri Regular Contributor

Hi there, 

The always-horizontal label placement for polygons always places the labels at the center of polygons. Is this what you are not seeing?  Here is a simple codepen that shows labels for polygon features:


0 Kudos