Polygon labeling in the new Map Viewer is causing me issues. It appears that my polygon labels are being placed on the polygon centroid, which in some cases is OUTSIDE the polygon. This does not happen in Map Viewer Classic.
Is there a setting somewhere or some workaround for this?
In the old map viewer, your labels get created as a LabelLayer:
Within that object, each label is separately defined with their own x/y coordinates.
In the JS 4.x API, there does not appear to be a LabelLayer object, but there are instead LabelClass objects. Oddly, they both seem to have the same placement properties.
I'm a little out of my depth on some of this JS stuff. It's not totally clear to me what the JS 3.x viewer was doing under the hood to calculate the particular placement of the individual labels. I'd guess that the way the new viewer sort of loads features as "tiles" has something to do with it. Line labeling in the new viewer is kind of goofy for that reason, with line labels being repeated across the "tiles".
I am also having this issue. Highlighted is polygon number 7, green is number 4, however the 4 is clearly placed within the purple seven boundaries. This is not helpful and doesn't actually change when I zoom in.
I am experiencing a similar issue. The polygon label appears to be locked on to the centroid. The only way for someone to see the polygon label is if they zoom in on the polygon centroid. If the centroid is outside of their current map view, they will not see it.
I'm currently dealing with this exact problem. It makes the New Map Viewer unreliable & unsuitable for any map that needs to have a labeled polygon. Is there still no solution for this aside from switching my maps to the Classic Map Viewer?
Yes. I am having a similar problem with polygon labels. When I create labels for two different fields in a polygon feature class and then go to create an export PDF file, it will not show the second label. It appears in the Map Viewer map display but when the export PDF file is created it only shows one label. Even if I offset the X and Y locations for the two different labels, they still don't appear.
The labels being placed for the centroid places them outside of the actual polygon and users will not understand this. They will assume labels are incorrect, or that a feature is something that it is not. For example, the below CF label needs to be in the shape that has red fill but no hash marks. I can't use the labels because there are a few of these that are making the map appear incorrect. This is a real bummer.
Having same issue. It is a real show-stopper for moving to the new Map Viewer for some applications that rely on polygon labelling. Just submitted an idea. "Label Polygons Beyond the Centroid in New Map Viewer". Maybe this can get some attention if we get a few thumbs up. Thanks