Select to view content in your preferred language

LabelingInfo on 4.13 JS API

1153
4
Jump to solution
10-20-2019 11:28 PM
AlexZotos
Emerging Contributor

Hello everyone!

I have a question concerning the ArcGIS JS 4.13 API

Up until now I've been using 4.12 version of the API to show a hosted Feature Layer containing Polygon geometries. To that, I have added a labelingInfo object in order to show a Field from the data of the Polygons. In 4.12 many labels were shown throughout the map even without zooming.

After updating to 4.13, the number of labels has been reduced almost by half without changing anything in the code. I don't see anything relevant in the Changelogs though I think that the change happened for optimisation purposes.

Is there a way to change the density of the shown labels? There isn't anything mentioned in the docs concerning such an option

Thank you everyone in advance!

PS. I can provide screenshots if needed

0 Kudos
1 Solution

Accepted Solutions
mgeorge
Esri Contributor

Hi Alex Zotos‌! Yes this change was made in 4.13 for a few reasons, one is the performance as you already mentioned. The second was that due to some improvements in the label fade logic, we increased the number of instances in which we are able to fade labels in/out (e.g., on rotation). With too many labels, this became quite distracting.The last reason was because we received some feedback that the labeling was too cluttered. Exposing this as a configurable option is a good idea, and we'll look into seeing what we can do.

View solution in original post

4 Replies
Noah-Sager
Esri Regular Contributor

Hi Alex, thanks for the feedback. We did make some optimization changes at 4.13, but if you could provide some screenshots of what you're seeing, that would be very helpful.

0 Kudos
AlexZotos
Emerging Contributor

Hello Noah!

I am attaching two images showing the same area (same layer without any changes), after only applying the update from version 4.12 to version 4.13. The update has the same effect throughout the whole layer

The problem is not that the labels are less after the update since it probably helps with the speed of the rendering. It would be good though if a way to affect it programmatically through the API existed.

Version 4.13:

Version 4.12:

0 Kudos
mgeorge
Esri Contributor

Hi Alex Zotos‌! Yes this change was made in 4.13 for a few reasons, one is the performance as you already mentioned. The second was that due to some improvements in the label fade logic, we increased the number of instances in which we are able to fade labels in/out (e.g., on rotation). With too many labels, this became quite distracting.The last reason was because we received some feedback that the labeling was too cluttered. Exposing this as a configurable option is a good idea, and we'll look into seeing what we can do.

AlexZotos
Emerging Contributor

Hello Matt!

Thanks a lot for the explanation! I guess that for now we will stick to 4.12 which shows everything and then just use a different field for the labeling, populated only by some of the polygons to reduce the shown labels a bit.

Thank you for the help!

0 Kudos