Select to view content in your preferred language

Label showing in wrong spot - Map Viewer

1091
6
10-11-2022 12:11 PM
Marokapara
Frequent Contributor

Hi AGOLers,

Has anyone had any issues with labels showing over the wrong polygons in Map Viewer. I noticed this the other day. Screenshots below.

I've checked that the polygons are not overlapping and that I haven't accidently put the wrong number in the field the label pulls from.

The 11 showing below should be over the highlighted blue area. It's sitting in the tan area next to 1, which is misleading.

Marokapara_0-1665515171984.png

Same with the 7 at the top right of the yellow. It should show in the brown area, but is instead in the yellow area which is classified as 13.

Marokapara_1-1665515332135.png

It doesn't look like there are labeling controls (like Maplex) in Map Viewer. I'm wondering if it is trying to centralise one label per polygon, putting the label in a central location but which happens to not be on the correct polygon.

Tags (2)
0 Kudos
6 Replies
LearnThenShare
Regular Contributor

@Marokapara It is very likely due to the irregular shapes of the polygons.  The label is trying to find the centroid of the polygon and getting placed there.  The centroid is not necessarily inside a polygon - again depending on the shape of it.  If you draw a box around the extents of the polygon the centroid is in the middle of the box.  See a peace of your image below. You may want to use annotation or force the label to stay inside the polygon boundaries - there should be a setting for that option.  There is in ArcMap and Pro labeling. 

JohnCodd2_0-1665516475378.png

 

0 Kudos
Marokapara
Frequent Contributor

@LearnThenShare thanks for your reply. i see what you're saying. I don't think there's an annotation force option in MapViewer though?

0 Kudos
LearnThenShare
Regular Contributor

@Marokapara  You may be correct that AGOL MapViewer does not have a function to force labels to only label inside polygon boundaries like ArcMap and Pro do - I don't know this for sure.  I also mentioned you can create a point feature of all the polygons, or just the irregular shaped ones. Move the points inside the irregular shaped polygons.  Label only the points layer instead of the polygon layer and the label will stay inside the polygons.  If you only create a points layer of the irregular shaped polygons, then you can have two polygon layers and filter out the irregular shaped ones for the layer that you will continue to label.  Then do not label the other layer that is filtered to only shoe the irregular polygons because you will use the points layer for their labels.

0 Kudos
RyanBohan
Frequent Contributor

Has anyone found a way to adjust labels for the new map viewer or Instant Apps?  In looks better in webapp classic, however with those retiring in 2025, I would rather not use it.

The map below is a coastal zone, and the only label showing in the new map viewer/ Instant Apps is outside of the coastal zone.

RyanBohan_0-1686672418314.png

0 Kudos
Justin_Greco
Frequent Contributor

Its not an issue with the new Map Viewer, Instant Apps or Experience Builder themselves, but a current limitation of the 4.x JavaScript SDK which they are built on.  I've been waiting for this to be resolved too, but looks like it possibly could be addressed in the October release.  I have noticed that in the "next" version of the JavaScript SDK, which is basically the beta version of the next version of the SDK, in this case 4.28, the issue of the labels falling outside of the feature's boundary has been resolved.  I don't see it noted in the change log, so can't guarantee it will be in the final 4.28 release.

Here is the labeling at 4.27, notice the CM label for the highlighted zoning polygon is falling on the OX-3 polygon.

JustinGreco1_3-1695156561067.png

 

Here is it with the next version:

JustinGreco1_2-1695156488898.png

Again, just because its in the next version currently, doesn't mean it will make it to the final release, but is definitely a good sign that its being worked on.  Also doesn't look like it will reposition the label as you pan or zoom yet, it stays at the centroid of the polygon.

 

 

 

Laura
by MVP Regular Contributor
MVP Regular Contributor
0 Kudos