Graphics being covered by labels

07-28-2021 03:36 PM
New Contributor III

Graphics in a graphics overlay are covered by labels from the map's operational layers (WPF Runtime SDK 100.10).  Is it possible to have labels respect graphics and not cover the graphic?

0 Kudos
2 Replies
New Contributor II

I finally got the labels to not cover graphics by adding a LabelDefinition to the graphics overlay; then I defined a label centered on the point, made the label fully transparent, and set the label priority to 0 (highest priority).  It seems that labels only respect other labels, and with the transparent label over the graphic that I wanted to remain unobscured, the label stayed away from the graphic as well.

0 Kudos
Esri Contributor

Hello DJurgella, 

Setting a label definition on the graphics overlay will allow you to set the featureBoundaryOverlapStrategy /or featureInteriorOverlapStrategy property to `exclude`, which in its turn will stop other feature labels from overlapping the graphic feature. 

This way other labels will know not to overlap those graphic features. 

Also keep in mind that the deconfliction strategy always comes first, i.e. if you set the deconfliction to none, all labels will be placed disregarding overlap settings.

I hope this helps. 

Kind Regards,
Peter Dimitrov


0 Kudos