I am trying to prioritize my labelclasses by a custom variable. The documentation says "Defines label priorities", which should meen that you are able to prioritize the labels somehow. I cant find any property that will help me do that?
Any suggestion on how to solve my problem?
I am using ArcGis 4.11.
Thank you in advance!
Currently, label priorities can be established using a where expression:
This allows you to only label features that evaluate to `true`. You can also create multiple label classes with different where expressions:
Down the road we are considering different methods to establish label priorities. Also, please consider upgrading to the latest version of the JS API, which is 4.15.
Hope this helps!
Thank you for your response!
Unfortunatly I think you have missunderstood the question, or maybe I was not asking it clearly enough.
What i meen is that i want to prioritize the drawing order of the labels, which means if 2 features are placed close to eachother in the map, I want to specify which of them that will be visible for the user.
Is there any way to make such prioriting for labelclasses?
Hi Eric Rydgren,
Yes I don't think we yet have a great way of doing what you are asking for, however I have heard a request for something similar from other users in the past. Can you give us a few more details?
- Would supporting a LabelClass.priority property be enough to fit your use case?
- Do you only want to pin a specific feature's label?
- Do you want the priority to differ between features of a given labelClass? (make it attribute-driven)
Thank you for a quick respond about this. For us this is quite essential, and we are looking forward for this to work in the future.
Can you please tell me what is making the priority for labels at this point? Is it placement in the map, or maybe it is which feature that has been loaded first?
I would really appriciate if you could look into this, and maybe we can use that information to tweek our app in the meenwhile.
There is no per-labelClass priority at the moment. Likely whatever comes first would drive the priority, and that depends loosely on how the data is loaded, spatially indexed, and patched to the individual tiles. There is per-layer priority, with labels from top labels take precedence over those in the lower lays.