How to configure the border line of the background of a text symbol ?

718
1
05-29-2020 04:21 AM
xavierlhomme
Occasional Contributor

Hello 

 

    In our aplication, we need to draw some label connected to a SymbolPicturemarker. 

    The operator could move the SymbolPictureMarker and the label. In order to do this we needed to draw for the label : 

         a TextSymbol 

         a Polygone for the background

         a Polyligne for the contour of the backgroung

For doing this, we have an Initialize fonction 

The ActivateLabelBorder flag is enable with thue for displaying the border of the label

private void Initialize()         {             Origin = new MapPoint(0, 0, SpatialReference.Create(2154));             OffsetX = 0;             OffsetY = -50;             TextContent = "";             TextSize = 20;             TextFont = "Arial";             TextColor = 0;             BackgroundColor = 1;             BorderColor = 0;               _TextSymbol = new TextSymbol()             {                 Text = "",                 Size = 10,                 FontFamily = "Arial",                 Color = ColorService.Colors[0],                 HorizontalAlignment = Esri.ArcGISRuntime.Symbology.HorizontalAlignment.Center,                 VerticalAlignment = VerticalAlignment.Middle             };             _LineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Black, 1);             TextGraphic = new Graphic(Origin, _TextSymbol);             LineGraphic = new Graphic(new Polyline(new MapPoint[] { Origin, Origin }), _LineSymbol);               var z = Counter.GetAndIncrement();             if (ActivateLabelBorder)             {                 var colorColorBorderLabel = ColorService.Colors[int.Parse(FeatureLabel.ColorLineBorderLabel.ToString())];                 colorColorBorderLabel = Color.FromArgb(255, colorColorBorderLabel.R, colorColorBorderLabel.G, colorColorBorderLabel.B);                   var BorderPolygon = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, colorColorBorderLabel, ThicknessLineBorderLabel);                 _PolygonSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.FromArgb(230, 0, 0, 0), BorderPolygon);                 BackgroundGraphic = new Graphic(new Polygon(new MapPoint[] { Origin, Origin }), _PolygonSymbol);                 BackgroundGraphic.ZIndex = z;             }             TextGraphic.ZIndex = z + 1;             LineGraphic.ZIndex = 0;         }

I tried with the 100.8 sample (GetElevation from a point)

It's possible to initialize a BackgroungColor , an OutlineColor, a Halo

But none of the combinaison I tried can display de border of the background with n other color.

Could you add in your roadmap a BorderBackgroundColor option ? 

Best regards 

xavier lhomme

Xavier Lhomme
GIS Architect / ESIRI Expert
Tags (1)
0 Kudos
1 Reply
PreetiMaske
Esri Contributor

Hi Xavier ,

Thanks for reporting and explaining your use case. This feature is already in our backlog and under consideration. But it is not targeted for any release yet.

I have added your request and workflow to our backlog issue which will certainly add more some weight to this feature and help us prioritize it.

Thanks,

Preeti

0 Kudos