Select to view content in your preferred language

CIM Symbol - Label Positioning / Offset

547
2
Jump to solution
04-06-2023 05:07 PM
LukaB
by
New Contributor

Hi I am trying to use CIM Symbols for a point feature, but am having issues with labeling.

When using primitiveOverrides to adjust the symbol size property based on view.scale the labels are really close to the center point of the symbol. Is there any way to specify a larger offset for the label? This is not an issue when I disable the primitiveOverrides.

For reference, this is what "above-center" looks like.

API v4.24

LukaB_0-1680825840568.png

Any feedback or advice would be appreciated.

 

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi @LukaB - unfortunately, this is a known issue and something we are working on improving! As a workaround, you could add the label to your CIMSymbol as a CIMTextSymbol in the markerGraphics of the CIMVectorMarker symbol layer, and use primitive overrides to (1) update the textString based on your feature attribute, and (2) adjust the offsetY of your symbol based on the $view.scale. Here's a quick example I just put together to demonstrate this: https://codepen.io/annefitz/pen/ZEqQzgZ?editors=100

View solution in original post

0 Kudos
2 Replies
AnneFitz
Esri Regular Contributor

Hi @LukaB - unfortunately, this is a known issue and something we are working on improving! As a workaround, you could add the label to your CIMSymbol as a CIMTextSymbol in the markerGraphics of the CIMVectorMarker symbol layer, and use primitive overrides to (1) update the textString based on your feature attribute, and (2) adjust the offsetY of your symbol based on the $view.scale. Here's a quick example I just put together to demonstrate this: https://codepen.io/annefitz/pen/ZEqQzgZ?editors=100

0 Kudos
LukaB
by
New Contributor

Thank you Anne. Very much appreciate your response, and the provided workaround which may be just what I am looking for. 

0 Kudos