Select to view content in your preferred language

How to set a round corner for text symbol style?

680
4
01-19-2023 10:13 PM
LeoDeng
Occasional Contributor II

Hi All,

   The SDK version is 100.15.0

   Here is my java code for create a text symbol with background color. And the requirement is setting a round corner for the style. Is there any way to implement it by the SDK now?

 

 

TextSymbol textSymbol = new TextSymbol();
textSymbol.setHorizontalAlignment(TextSymbol.HorizontalAlignment.LEFT);
textSymbol.setFontWeight(TextSymbol.FontWeight.BOLD);
textSymbol.setSize(14);
textSymbol.setColor(0xFFFFFFFF);
textSymbol.setBackgroundColor(backgroundColor);

textSymbol.setText(information);
textSymbol.setOffsetX(offsetX);
textSymbol.setOffsetY(offsetY);

 

 

This is the style now.

LeoDeng_0-1674195105479.png


Bests,
Leo

Tags (1)
0 Kudos
4 Replies
PriyankaRupani
Esri Contributor

Hi Leo,
You mention, you need a round corner added to the text symbol. Or the text symbol background?
Do you have an image if how you want your text to look like?

As far as I see from the API documentation, we have no property to add corners to the text symbol background.
https://developers.arcgis.com/java/api-reference/reference/com.esri.arcgisruntime/com/esri/arcgisrun...

0 Kudos
LeoDeng
Occasional Contributor II

Hi Priyanka,

    Sorry for the confusion. As you see in the image, there is a rectangle background for the text symbol. My target is to create a text symbol with round corner background. I didn't find any clues in the API document or demos either.

Thanks,
Leo

0 Kudos
PriyankaRupani
Esri Contributor

Currently, we don't support adding rounded corners to text symbol background. Is it important for your workflow to have rounded corners to the text symbol background?
You could alternatively use a `Callout` which does have rounded corners.

0 Kudos
LeoDeng
Occasional Contributor II

Yes. The target style is similar to the defalut callout demo. Howerver, in the callout style I met another trouble.

The callout‘s behavior is worse than the text symbol when user pan the map. Is there any symbolization solution for the callout style?

I appreciate your comments.

0 Kudos