AnsweredAssumed Answered

GraphicsOverlay - Label priority problems

Question asked by mangoyoga on Sep 20, 2018
Latest reply on Sep 21, 2018 by MBranscomb-esristaff

Hi,

Currently I am having some issues with labeling of Graphics in version 100.3.0. It appears that the priority is not respected based on the LabelDefinitions i have defined. I have used the classes provided by Label features the easy way (in case someone else have missed this blog post).

 

I have the following json definition (boiled down to the essentials for an easier read):

"priority":0,where":"[Priority] = 'Alarm'

"priority":1,where":"[Priority] = 'Pri1'

"priority":2,where":"[Priority] = 'Pri2'

"priority":3,where":"[Priority] = 'Pri3'

"priority":4,where":"[Priority] = 'None'

 

Based on this definition I expected labels for Alarm to have priority over the rest. From Label map features—ArcGIS Runtime SDK for .NET | ArcGIS for Developers

Priority (priority)—A label definition can be given a priority relative to other definitions in the layer. If labels from different definitions conflict in their placement, the label from the highest-priority definition will be displayed.

From labelingInfo | ArcGIS for Developers, priority is documented as 

The priority of the label class relative to other label classes. Numbers are positive with 0 being the most important and higher numbers being less important.

 

At both of the locations indicated by the symbols in the image below, there are 5 graphics with the same position. I have been able to fix the drawing order of the symbols within a layer with ZIndex (ref How to define the drawing order of unique value symbols?), however I have yet to master labeling the symbol with the highest priority. 

 

The labeling still seems rather random in my experience. Is there anyone who can guide me on the path to label Mastery?

 

My next question is; is there a way I can control label priority across layers? 

 

In the real application, I have split the objects of different states into separate layers to allow the user to hide graphics that are in a specific state to hide irrelevant graphics for the current work.

 

I have the following layers (top-most layer in list is drawn on top):

- Active

- Planned

- Completed

 

Is it possible to control that the labels from Active (priority:0) will have priority ahead of priority:0 from layer Planned or Completed? Or is this the default behavior?

Outcomes