Display labels/text symbols without overlap

186
4
02-13-2020 09:36 AM
ClayGinn
New Contributor II

I am trying to label graphics on my map and am having trouble getting exactly the display that I want.

Using a LabelDefinition doesn't work because the labels will disappear if they might overlap (yes, I've turned on AllowOverlap and it doesn't seem to work). 

Using a TextSymbol doesn't work because then they all stack on top of each other making it impossible to see which vehicles are actually at the location. 

Is there any way to label these vehicles in such a way that it shows the label in whatever the best position is? I loaded the same data into ArcGIS Pro and it labeled them correctly until I realized it was using Maplex to do it. Once I turned it off so I could compare them directly then it went back to the issues I had before.

Surely someone else has run across this. The tutorial from four years ago about how to cluster the graphics is OK, but I would rather not cluster them. I would prefer that the labels/text symbols move slightly in order to accommodate the other labels around them. 

Tags (1)
0 Kudos
4 Replies
RichardShepherd
Esri Contributor

Have you tried setting the "deconflictionStrategy":"dynamic" property on the LabelDefinition (JSON label class properties—ArcGIS Runtime SDK for .NET | ArcGIS for Developers )?

That should move the label around a point symbol to try to find space.

(However, this does not work so well currently for labels on polygon or line features).

0 Kudos
ClayGinn
New Contributor II

I tried that, and it didn't work.

Ideally, we would be using TextSymbol anyway since we allow users to interact with the data a bit. 

0 Kudos
RichardShepherd
Esri Contributor

Hmm. That sounds like a bug if the deconfliction isn't kicking in when it should be. You're welcome to submit a bug report through your support, ideally including the LabelDefinition json and an idea of the sort of data you're applying it to. I'd be interested in taking a look.

Unfortunately, there are no current plans for automatic positioning of TextSymbols, other than Labels generated from features. Even Annotation is a stored form of the label and doesn't move to avoid obstacles. Again, you'd be welcome to submit an enhancement idea on the arcgis-ideas page.

0 Kudos
ClayGinn
New Contributor II

I went ahead and submitted a case for this last night. The TextSymbols are more useful for us than the LabelDefinition so we can provide some interactivity, but I'll go ahead and add the JSON for the LabelDefinition as well to the case so that you have both.