Select to view content in your preferred language

Two labelling classes display labels at the same zoom level despite being configured with discrete visible ranges

107
6
Jump to solution
Thursday
Labels (1)
MappyIan
Frequent Contributor

I have a polygon dataset of buildings that I have configured to display labels showing the building name.  This works fine when I have a single label class configured in Map Viewer, but if I add a second label class and configure the two label classes to have discrete (non-overlapping) 'visible ranges', at certain zoom levels they both display.  The setup I have is as follows:

First label class

  • Visible range: 1:5000 - 1:2000
  • Font size: 13
  • Colour: black text with white halo
  • Position: Offset Y:10 (so they draw above the centre point of the polygon)

Second label class

  • Visible range: 1:1999 - 1:0
  • Font size: 10
  • Colour: blue text with white halo
  • Position: Offset Y:-10 (so they draw below the centre point of the polygon)

Here's how they display at three different zoom levels:

1:4,514

MappyIan_0-1746110881162.png

This is correct, only the first label class is displayed.

1:2,257

MappyIan_1-1746110954220.png

This is incorrect as both the first and second label classes are displayed despite the current map view scale being outwith the specified visible range of the second label class.

1:1,128

MappyIan_2-1746111033058.png

This is correct as only the the second label class is displayed.

What am I missing/doing wrong here?  Given that the two scale ranges for the two label classes do not overlap I don't see how there could be any situation where both sets of labels display at the same time.

The map that shows this is available to everyone here: https://maps.arcgis.com/apps/mapviewer/index.html?webmap=cf2af081f4c24a7a9db3a869fdf49244 

This feels like a bug as I can't understand why it's behaving like this but any help would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
RussRoberts
Esri Notable Contributor

We have a known issue(BUG-000167329) in the Maps SDK for JavaScript and have been working on some updates to it for this upcoming release. This issue looks like its non reproducible with the sample map provided. Here is a screenshot comparing the current release (left) to the upcomming one(right)

RussRoberts_0-1746117215272.png

 

View solution in original post

0 Kudos
6 Replies
DanielFox1
Esri Contributor

Hi @MappyIan 

Thank you for sharing that link to the map I hope you don't mind I started to play around with it. I think in the visibility range there will be slight overlap but I took both labels to the full visible extent and then narrowed down 

DanielFox1_0-1746112649815.pngDanielFox1_1-1746112665335.png

I think at your scales 1:2000 and then 1,999 are to close together and the scaling zooming in and out cannot tell the difference, you need to end one of the labels with a certain scale like in my screenshots and start the other with the same. 

0 Kudos
MappyIan
Frequent Contributor

Hi @DanielFox1, thanks for taking a look and for the prompt response.

I'm not sure I follow what you're saying.  I have the map configured to show the larger (black) labels between 1:5000-1:2000, and the smaller (purple) labels between 1:1999-1:0.  So the scale range of one ends where the scale range of the other starts.  So in this situation I would expect only one of the labels to ever be displayed.  But at 1:2,257, both the labels are displayed.  For some reason the smaller (purple) labels are displaying when the map is viewed at 1:2,257 despite being beyond their upper scale threshold of 1:1,999.

I appreciate I can fiddle with the scale boundaries of the smaller (purple) labels so that they don't display at 1:2,257, but this doesn't seem logical or sensible, because if I reduce the upper scale threshold of the smaller (purple) labels there will no labels configured to display at certain scales.  To explain what I mean, if I lower the upper scale threshold of the smaller (purple) labels to 1:1,692 they no longer display when the map is viewed at 1:2,257.  But this means that no labels are now configured to display between 1:1,692 and 1:2,000.

Now I've no idea if this is a problem but it doesn't seem right.  I don't know how you can control the zoom levels of users looking at your map e.g. on a mobile device using pinch-zoom.  Maybe the map will never be viewed at a scale where no labels are configured.

Would love to know your thoughts on this @DanielFox1 

0 Kudos
DanielFox1
Esri Contributor

I have used the slider to just slide the bottom small labels past the current view line this means that both do not display at the same time and will transition across the scales 

DanielFox1_0-1746114945388.png

 

So buildings at the top is 1:2000 and the small labels is building at 1:1250 with current view at 1:2257

0 Kudos
MappyIan
Frequent Contributor

Thanks @DanielFox1, I understand the workaround.  My concern is that with your solution if the map is viewed at 1:1250 - 1:2000 no labels will be displayed.  Looks like it's a bug that's resolved in the next release which is good news.

0 Kudos
RussRoberts
Esri Notable Contributor

We have a known issue(BUG-000167329) in the Maps SDK for JavaScript and have been working on some updates to it for this upcoming release. This issue looks like its non reproducible with the sample map provided. Here is a screenshot comparing the current release (left) to the upcomming one(right)

RussRoberts_0-1746117215272.png

 

0 Kudos
MappyIan
Frequent Contributor

Thanks for the info @RussRoberts, glad to hear it's in the product plan and hopefully resolved in the next release. For anyone else who stumbles across this, the bug report is here: https://support.esri.com/en-us/bug/when-multiple-label-classes-are-applied-through-a-featu-bug-00016... 

0 Kudos