Zum Hauptinhalt gehen

Labels with Graphics Layer Renderer?

Kommentare

7 Kommentare

  • Permanently deleted user

    I've got the text to appear. Now I'm just working on formatting.

    I did this by creating a string variable called 'textLabel' to concatenate my required variables. Next, with my single point added to a feature set, I used 'UpdateGraphicsLayer' tool. I gave it a new Layer ID, added my existing feature set and used the following renderer string:

    New ESRI.ArcGIS.Client.SimpleRenderer() With { .Symbol = New ESRI.ArcGIS.Client.Symbols.TextSymbol() with {.Text = textLabel  } }

    Here's what the output looks like:

    /customer/servlet/servlet.FileDownload?file=00P6000000eltyXEAQ

    If anyone has suggestions on how to offset the label and format the font, I'd appreciate it.

    Thanks!

    0
  • Permanently deleted user

    I've got the offset figured out. But I would like to change the font size and make it bold. Any suggestions?

    Here's the renderer string in 'Update Graphics Layer' tool that I am using where textLabel is my concatenated string for the label text.

    New ESRI.ArcGIS.Client.SimpleRenderer() With { .Symbol = New ESRI.ArcGIS.Client.Symbols.TextSymbol() With {.Text = textLabel, .OffsetX = -20, .OffsetY = 5} }

    Thanks!

    0
  • Richard Diaz

    Mark,

    This will get you your fontsize, plus fontfamily and foreground.  Still working on Fontstyle which is not a member of TextSymbol class.

     

    New ESRI.ArcGIS.Client.SimpleRenderer() With { .Symbol = New ESRI.ArcGIS.Client.Symbols.TextSymbol() With {.Text = textLabel, .FontSize = 35, .OffsetX = -20, .OffsetY = 5, .FontFamily = New System.Windows.Media.FontFamily("Arial"), .Foreground = New System.Windows.Media.SolidColorBrush(Colors.Red)}}

     

    Rick

    0
  • Richard Diaz

    Mark,

    Here is the addition of "FontWeight".

    New ESRI.ArcGIS.Client.SimpleRenderer() With { .Symbol = New ESRI.ArcGIS.Client.Symbols.TextSymbol() With {.Text = textLabel, .FontSize = 35, .OffsetX = -20, .OffsetY = 5, .FontFamily = New System.Windows.Media.FontFamily("Arial"), .Foreground = New System.Windows.Media.SolidColorBrush(Colors.Red), .FontWeight = FontWeights.Bold}}

     

    Thanks for posting this thread.

    Rick

    0
  • Permanently deleted user

    Perfect. Thanks Rick!

    0
  • Ryan Cooney

    We will add Rick's example to the list of expression suggestions that Workflow Designer provides for renderers in an upcoming version.

    --Ryan

    0
  • Richard Diaz

    I found two more renders for FontSyles (Italic) and TextDecorations (UnderLine).

    /customer/servlet/servlet.FileDownload?file=00P6000000elzkyEAA

    New ESRI.ArcGIS.Client.SimpleRenderer() With { .Symbol = New ESRI.ArcGIS.Client.Symbols.TextSymbol() With {.Text = myPoint.X.ToString + " , " + myPoint.Y.ToString, .FontSize = 35, .OffsetX = -20, .OffsetY = 5, .FontFamily = New System.Windows.Media.FontFamily("Arial"), .Foreground = New System.Windows.Media.SolidColorBrush(Colors.Red), .FontWeight = FontWeights.Bold, .FontStyle = FontStyles.Italic, .TextDecorations = TextDecorations.Underline}}

     

    Example renders for FontWeight and FontStyles can be found in the System.Windows Namespace

    .FontWeight = FontWeights.Bold

     

    https://msdn.microsoft.com/en-us/library/system.windows.fontweights(v=vs.110).aspx

    .FontStyle = FontStyles.Italic

     

    https://msdn.microsoft.com/en-us/library/system.windows.fontstyles(v=vs.110).aspx

    Example renders for Textdecorations can be found in the System.Windows.Controls.TextBlock Class, TextBlock Properties

    .TextDecorations = TextDecorations.Underline

     

    https://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.textdecorations(v=vs.110).aspx

     

    Regards,  Rick

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.