GraphicsOverlay - Label priority problems

354
4
09-20-2018 07:40 AM
Highlighted
Occasional Contributor II

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 https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-net/blo... (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?

4 Replies
Highlighted
Esri Frequent Contributor

Hi,

Please can you add the repro code?

Cheers

Mike

Reply
0 Kudos
Highlighted
Occasional Contributor II

I do not have repro code at the moment, but will make one as soon as I can.

Reply
0 Kudos
Highlighted
Occasional Contributor II

For some reason I was unable to attach the sample to the thread. I sent you an email, assuming the address I have is correct.

Cheers

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi,

Email received - thanks for the repro. We'll investigate and update you.

Cheers

Mike